Previous 15994 Revisions Next

r15022 Tuesday 24th April, 2012 at 07:13:35 UTC by Miodrag Milanović
Sync with MAME r16088 (no whatsnew)
[src/emu]memory.c memory.h rendersw.c rendlay.c rendlay.h
[src/emu/video]mc6845.c
[src/mame]mame.lst mame.mak
[src/mame/drivers]amaticmg.c bloodbro.c flower.c meyc8088.c
[src/mame/layout]bfm_sc4.lay suprstar.lay*
[src/mame/video]awpvid.c

src/mame/mame.lst
r15021r15022
1973519735jnero         // (c) 2004 ICE/Play Mechanix
1973619736
1973719737// Amatic Trading GMBH
19738am_uslot      // (c) 1996 Amatic
19738suprstar      // (c) 1996 Amatic
1973919739am_mg24         // (c) 2000 Amatic
1974019740am_mg3         // (c) 2000 Amatic
1974119741
src/mame/mame.mak
r15021r15022
19041904
19051905$(DRIVERS)/acefruit.o:   $(LAYOUT)/sidewndr.lh
19061906
1907$(DRIVERS)/amaticmg.o:   $(LAYOUT)/suprstar.lh
1908
19071909$(DRIVERS)/ampoker2.o:   $(LAYOUT)/ampoker2.lh \
19081910         $(LAYOUT)/sigmapkr.lh \
19091911
src/mame/video/awpvid.c
r15021r15022
11/*************************************************************************************
22
33    AWP Hardware video simulation system
4   originally written for AGEMAME by J.Wallace
45
5    A.G.E Code Copyright J. Wallace and the AGEMAME Development Team.
6    Visit http://www.mameworld.net/agemame/ for more information.
6    M.A.M.E Core Copyright Nicola Salmoria and the MAME Team.
77
8    M.A.M.E Core Copyright Nicola Salmoria and the MAME Team,
9    used under license from http://mamedev.org
10
11**************************************************************************************
12
13   NOTE: Fading lamp system currently only recognises three lamp states:
14
15   0=off, 1, 2= fully on
16
17   Based on evidence, newer techs may need more states, but we can give them their own
18   handlers at some stage in the distant future.
19
20   Instructions:
21   In order to set up displays (dot matrices, etc) we normally set up the unique
22   displays first, and then add the remainder in order.
23
24   The priorities (in descending order) are:
25
26   Full video screens
27   Dot matrix displays
28   Other, as yet unknown devices
29
8   This is a primitive handler for generating reels with multiple symbols visible
9   hanging off steppers.c .
10   
3011**************************************************************************************/
3112
3213#include "emu.h"
r15021r15022
9374   }
9475   else
9576   {
96      reelpos[rno] = stepper_get_position(rno)%(stepper_get_max(rno)-1);
77      reelpos[rno] = stepper_get_position(rno);
78
79      /* legacy symbol support */
9780      for ( m = 0; m < (rsymbols-1); m++ )
9881      {
9982         {
10083            sprintf(rga,"reel%da%d", x, m);
101            output_set_value(rga,(reelpos[rno] + rsteps * m)%stepper_get_max(rno));
84            output_set_value(rga,(reelpos[rno] + (rsteps * m) + stepper_get_max(rno)) % stepper_get_max(rno));
10285         }
10386
10487         {
105            if ((reelpos[rno] - rsteps * m) < 0)
106            {
107               sprintf(rgb,"reel%db%d", x, m);
108               output_set_value(rgb,(reelpos[rno] - (rsteps * m - stepper_get_max(rno))));
109            }
110            else
111            {
112               sprintf(rgb,"reel%db%d", x, m);
113               output_set_value(rgb,(reelpos[rno] - rsteps * m));
114            }
88            sprintf(rgb,"reel%db%d", x, m);
89            output_set_value(rgb,(reelpos[rno] - (rsteps * m) + stepper_get_max(rno)) % stepper_get_max(rno));
11590         }
11691      }
92
11793      output_set_value(rg,(reelpos[rno]));
94
95      sprintf(rg,"sreel%d", x); // out new scrolling reels are called 'sreel'
96      // normalize the value
97      int sreelpos = (reelpos[rno] * 0x10000) / stepper_get_max(rno);
98     
99      output_set_value(rg,sreelpos);
100
101
118102   }
119103}
src/mame/layout/bfm_sc4.lay
r15021r15022
1515      </rect>
1616   </element>
1717  <element name="Steppers" defstate="0">
18    <simplecounter maxstate="999" digits="2">
18    <simplecounter maxstate="999" digits="3">
1919      <color red="1.0" green="1.0" blue="1.0" />
20      <bounds x="0" y="0.1" width="1" height="1" />
20      <bounds x="0" y="0" width="1" height="1" />
2121    </simplecounter>
2222  </element>
2323 
24   <element name="vfd0">
24  <!-- a stateoffset of 682 will shift us by 1 step on a 96 step reel (0x10000/96) which seems a good default alignment for 96 step / 16 symbol reels -->
25  <element name="SteppersReel1" defstate="0">
26    <reel stateoffset="682" symbollist="Fruit1,Fruit2,Fruit3,Fruit4,Fruit5,Fruit6,Fruit7,Fruit8,Fruit9,Fruit10,Fruit11,Fruit12,Fruit13,Fruit14,Fruit15,Fruit16">
27      <color red="1.0" green="1.0" blue="1.0" />
28      <bounds x="0" y="0" width="1" height="1" />
29    </reel>
30  </element>
31 
32  <element name="SteppersReel2" defstate="0">
33    <reel stateoffset="682" symbollist="Fruit1,Fruit2,Fruit3,Fruit4,Fruit5,Fruit6,Fruit7,Fruit8,Fruit9,Fruit10,Fruit11,Fruit12,Fruit13,Fruit14,Fruit15,Fruit16">
34      "<color red="1.0" green="1.0" blue="1.0" />
35      <bounds x="0" y="0" width="1" height="1" />
36    </reel>
37  </element>
38 
39  <element name="SteppersReel3" defstate="0">
40    <reel stateoffset="682" symbollist="Fruit1,Fruit2,Fruit3,Fruit4,Fruit5,Fruit6,Fruit7,Fruit8,Fruit9,Fruit10,Fruit11,Fruit12,Fruit13,Fruit14,Fruit15,Fruit16">
41      <color red="1.0" green="1.0" blue="1.0" />
42      <bounds x="0" y="0" width="1" height="1" />
43    </reel>
44  </element>
45 
46  <element name="SteppersReel4" defstate="0">
47    <reel stateoffset="682" symbollist="Fruit1,Fruit2,Fruit3,Fruit4,Fruit5,Fruit6,Fruit7,Fruit8,Fruit9,Fruit10,Fruit11,Fruit12,Fruit13,Fruit14,Fruit15,Fruit16">
48      <color red="1.0" green="1.0" blue="1.0" />
49      <bounds x="0" y="0" width="1" height="1" />
50    </reel>
51  </element>
52 
53  <element name="SteppersReel5" defstate="0">
54    <reel symbollist="Example1,Example2,Example3,Example4,Example5,Example6,Example7,Example8,Example9,Example10,Example11,Example12">
55      <color red="1.0" green="1.0" blue="1.0" />
56      <bounds x="0" y="0" width="1" height="1" />
57    </reel>
58  </element>
59 
60  <element name="SteppersReel6" defstate="0">
61    <reel symbollist="Example1,Example2,Example3,Example4,Example5,Example6,Example7,Example8,Example9,Example10,Example11,Example12">
62      <color red="1.0" green="1.0" blue="1.0" />
63      <bounds x="0" y="0" width="1" height="1" />
64    </reel>
65  </element>
66 
67 
68 
69  <element name="vfd0">
2570     <led14segsc>
2671           <color red="0" green="0.6" blue="1.0" />
2772     </led14segsc>
r15021r15022
81126      <backdrop name="vfd15" element="vfd0" state="0">
82127         <bounds x="345" y="200" width="9" height="17"/>
83128      </backdrop>
84      <backdrop name="reel1" element="Steppers" state="0">
85         <bounds x="210" y="300" width="50" height="50"/>
129       
130     
131    <backdrop name="reel1" element="Steppers" state="0">
132         <bounds x="250" y="350" width="10" height="5"/>
86133      </backdrop>
87134      <backdrop name="reel2" element="Steppers" state="0">
88         <bounds x="260" y="300" width="50" height="50"/>
135         <bounds x="300" y="350" width="10" height="5"/>
89136      </backdrop>
90137      <backdrop name="reel3" element="Steppers" state="0">
91         <bounds x="310" y="300" width="50" height="50"/>
138         <bounds x="350" y="350" width="10" height="5"/>
92139      </backdrop>
140         
93141      <backdrop name="reel4" element="Steppers" state="0">
94         <bounds x="210" y="360" width="50" height="50"/>
142         <bounds x="250" y="410" width="10" height="5"/>
95143      </backdrop>
96144      <backdrop name="reel5" element="Steppers" state="0">
97         <bounds x="260" y="360" width="50" height="50"/>
145         <bounds x="300" y="410" width="10" height="5"/>
98146      </backdrop>
99147      <backdrop name="reel6" element="Steppers" state="0">
100         <bounds x="310" y="360" width="50" height="50"/>
148         <bounds x="350" y="410" width="10" height="5"/>
101149      </backdrop>
102150 
103151 
152    <backdrop name="sreel1" element="SteppersReel1" state="0">
153      <bounds x="210" y="300" width="50" height="50"/>
154    </backdrop>
155    <backdrop name="sreel2" element="SteppersReel2" state="0">
156      <bounds x="260" y="300" width="50" height="50"/>
157    </backdrop>
158    <backdrop name="sreel3" element="SteppersReel3" state="0">
159      <bounds x="310" y="300" width="50" height="50"/>
160    </backdrop>
104161 
162    <backdrop name="sreel4" element="SteppersReel4" state="0">
163      <bounds x="210" y="360" width="50" height="50"/>
164    </backdrop>
165    <backdrop name="sreel5" element="SteppersReel5" state="0">
166      <bounds x="260" y="360" width="50" height="50"/>
167    </backdrop>
168    <backdrop name="sreel6" element="SteppersReel6" state="0">
169      <bounds x="310" y="360" width="50" height="50"/>
170    </backdrop>
105171 
106      <backdrop name="lamp0" element="matrixlamp" state="0">
172 
173     
174 
175    <backdrop name="lamp0" element="matrixlamp" state="0">
107176         <bounds x="0" y="0" width="7" height="7"/>
108177      </backdrop>
109178      <backdrop name="lamp1" element="matrixlamp" state="0">
src/mame/layout/suprstar.lay
r0r15022
1<?xml version="1.0"?>
2<mamelayout version="2">
3   <element name="bet" defstate="1">
4      <rect state="1">
5         <color red="0.75" green="1.0" blue="0.75" />
6      </rect>
7      <rect state="0">
8         <color red="0.225" green="0.3" blue="0.225" />
9      </rect>
10      <text string="BET">
11         <color red="0.0" green="0.0" blue="0.0" />
12         <bounds x="0" y="0.1" width="1" height="0.4" />
13      </text>
14      <text string="HALF">
15         <color red="0.0" green="0.0" blue="0.0" />
16         <bounds x="0" y="0.5" width="1" height="0.4" />
17      </text>
18   </element>
19
20   <element name="start" defstate="1">
21      <rect state="1">
22         <color red="1.0" green="1.0" blue="1.0" />
23      </rect>
24      <rect state="0">
25         <color red="0.25" green="0.25" blue="0.25" />
26      </rect>
27      <text string="START">
28         <color red="0.0" green="0.0" blue="0.0" />
29         <bounds x="0" y="0.2" width="1" height="0.6" />
30      </text>
31   </element>
32
33   <element name="cancel" defstate="1">
34      <rect state="1">
35         <color red="1.0" green="0.75" blue="0.75" />
36      </rect>
37      <rect state="0">
38         <color red="0.3" green="0.225" blue="0.225" />
39      </rect>
40      <text string="CLEAR">
41         <color red="0.0" green="0.0" blue="0.0" />
42         <bounds x="0" y="0.1" width="1" height="0.4" />
43      </text>
44      <text string="TAKE">
45         <color red="0.0" green="0.0" blue="0.0" />
46         <bounds x="0" y="0.5" width="1" height="0.4" />
47      </text>
48   </element>
49
50   <element name="hold1" defstate="1">
51      <rect state="1">
52         <color red="1.0" green="0.0" blue="0.0" />
53      </rect>
54      <rect state="0">
55         <color red="0.3" green="0.0" blue="0.0" />
56      </rect>
57      <text string="HOLD1">
58         <color red="0.0" green="0.0" blue="0.0" />
59         <bounds x="0" y="0.2" width="1" height="0.6" />
60      </text>
61   </element>
62
63   <element name="hold2" defstate="1">
64      <rect state="1">
65         <color red="1.0" green="0.0" blue="0.0" />
66      </rect>
67      <rect state="0">
68         <color red="0.3" green="0.0" blue="0.0" />
69      </rect>
70      <text string="HOLD2">
71         <color red="0.0" green="0.0" blue="0.0" />
72         <bounds x="0" y="0.2" width="1" height="0.6" />
73      </text>
74   </element>
75
76   <element name="hold3" defstate="1">
77      <rect state="1">
78         <color red="1.0" green="0.0" blue="0.0" />
79      </rect>
80      <rect state="0">
81         <color red="0.3" green="0.0" blue="0.0" />
82      </rect>
83      <text string="HOLD3">
84         <color red="0.0" green="0.0" blue="0.0" />
85         <bounds x="0" y="0.2" width="1" height="0.6" />
86      </text>
87   </element>
88
89   <element name="hold4" defstate="1">
90      <rect state="1">
91         <color red="1.0" green="0.0" blue="0.0" />
92      </rect>
93      <rect state="0">
94         <color red="0.3" green="0.0" blue="0.0" />
95      </rect>
96      <text string="HOLD4">
97         <color red="0.0" green="0.0" blue="0.0" />
98         <bounds x="0" y="0.2" width="1" height="0.6" />
99      </text>
100   </element>
101
102
103   <view name="Button Lamps">
104      <screen index="0">
105         <bounds left="0" top="0" right="3" bottom="4" />
106      </screen>
107      <bezel name="lamp4" element="hold1">
108         <bounds x="0" y="4.05" width="0.35" height="0.24" />
109      </bezel>
110      <bezel name="lamp5" element="hold2">
111         <bounds x="0.4" y="4.05" width="0.35" height="0.24" />
112      </bezel>
113      <bezel name="lamp3" element="hold3">
114         <bounds x="0.8" y="4.05" width="0.35" height="0.24" />
115      </bezel>
116      <bezel name="lamp2" element="hold4">
117         <bounds x="1.2" y="4.05" width="0.35" height="0.24" />
118      </bezel>
119      <bezel name="lamp6" element="cancel">
120         <bounds x="1.6" y="4.05" width="0.35" height="0.24" />
121      </bezel>
122
123      <bezel name="lamp1" element="bet">
124         <bounds x="2.25" y="4.05" width="0.35" height="0.24" />
125      </bezel>
126      <bezel name="lamp0" element="start">
127         <bounds x="2.65" y="4.05" width="0.35" height="0.24" />
128      </bezel>
129   </view>
130</mamelayout>
src/mame/drivers/amaticmg.c
r15021r15022
11/**********************************************************************************
22
3  AMA-8000-1 / AMA-8000-2 Multi Game System.
4  Amatic Trading GmbH.
35
4  AMATIC - MULTI GAME SYSTEM
5  --------------------------
6  Encrypted gambling hardware based on a custom CPU.
67
7  Preliminary driver by Roberto Fresca.
8  Driver by Roberto Fresca & Angelo Salese.
89
910
10  Encrypted gambling hardware based on a custom CPU.
11
12
1311***********************************************************************************
1412
15
1613  Hardware Notes
1714  --------------
1815
1916  ------------------------------------------------
20    Board #1 (unknown slots game)
17    Board #1 (Super Stars) AMA-8000-1
2118  ------------------------------------------------
2219
2320  1x 40-pin custom CPU labeled:
r15021r15022
5855
5956
6057  ------------------------------------------------
61     Multi-Game I v2.4
58     Multi-Game I v2.4 (AMA-8000-2)
6259  ------------------------------------------------
6360
6461  1x 40-pin custom CPU labeled:
r15021r15022
185182
186183
187184  ------------------------------------------------
188     Multi-Game III v3.5
185     Multi-Game III v3.5 (AMA-8000-2)
189186  ------------------------------------------------
190187
191188  1x 40-pin custom CPU labeled:
r15021r15022
229226***********************************************************************************
230227
231228
232    Memory Map
233    ----------
229  Memory Map
230  ----------
234231
235    $00000 - $FFFFF   Still unknown...
232  0000-7FFF   ROM Space.
233  8000-9FFF   NVRAM.
234  A000-AFFF   Video RAM.
235  B000-BFFF   RAM.
236  C000-FFFF   ROM Banking
236237
238  I/O
237239
240  00-03       PPI 8255 0
241  20-23       PPI 8255 1
242  40-41       YM3812 Sound device.
243  60-60       MC6845 CRTC Address.
244  61-61       MC6845 CRTC Register.
245  80-80       unknown (W)
246  C0-C0       ROM Bank selector.
247  E6-E6       NMI Mask.
248
249
238250***********************************************************************************
239251
240252  +------------------------------------------------------------------------------+
r15021r15022
350362***********************************************************************************
351363
352364
365  [2012/04/23]
366
367  - A lot of work on AMA-8000-1 machine and gfx.
368  - Identified the slots game as Super Stars.
369  - Changed am_uslot to suprstar.
370  - Reworked inputs from the scratch.
371  - Added support for outputs: lamps & counters.
372  - Added a button-lamps layout.
373  - Promoted the game to working state.
374  - Added technical notes.
375  - Renamed amaticmg3 to amaticmg2 since is the AMA-8000-2 system.
376  - Found the hopper motor signal. Mapped the hopper pay pulse to
377     key 'Q'. Now is possible to payout manually, avoiding the hang
378     for hopper empty or timeout.
379
353380  [2009/09/11]
354381
355382  - Initial release.
r15021r15022
362389
363390  *** TO DO ***
364391
365  - Decrypt the program ROMs.
366  - Identify the CPU type.
367  - Memory map.
392  - Super Stars: video garbage at first boot (doesn't happen if you soft-reset), btanb?
368393  - Hook the remaining GFX bitplanes.
369  - CRTC
370  - Proper inputs.
371394  - Color decode routines.
372  - Sound support.
395  - Remaining sound devices.
396  - Hopper as device... ;)
373397
374398
375399***********************************************************************************/
r15021r15022
384408#include "emu.h"
385409#include "cpu/z80/z80.h"
386410#include "video/mc6845.h"
387#include "machine/8255ppi.h"
411#include "machine/i8255.h"
388412#include "sound/3812intf.h"
389413#include "sound/dac.h"
390414
415#include "suprstar.lh"
391416
417
392418class amaticmg_state : public driver_device
393419{
394420public:
395421   amaticmg_state(const machine_config &mconfig, device_type type, const char *tag)
396      : driver_device(mconfig, type, tag) { }
422      : driver_device(mconfig, type, tag),
423      m_attr(*this, "attr"),
424      m_vram(*this, "vram")
425      { }
397426
427   required_shared_ptr<UINT8> m_attr;
428   required_shared_ptr<UINT8> m_vram;
429
430   DECLARE_WRITE8_MEMBER(rombank_w);
431   DECLARE_WRITE8_MEMBER(nmi_mask_w);
432   DECLARE_WRITE8_MEMBER(unk80_w);
433
434   UINT8 m_nmi_mask;
398435};
399436
400437
r15021r15022
408445
409446static SCREEN_UPDATE_IND16( amaticmg )
410447{
448   amaticmg_state *state = screen.machine().driver_data<amaticmg_state>();
449   const gfx_element *gfx = screen.machine().gfx[0];
450   int y,x;
451   int count = 0;
452
453   for (y=0;y<32;y++)
454   {
455      for (x=0;x<96;x++)
456      {
457         UINT16 tile = state->m_vram[count];
458         UINT8 color;
459
460         tile += ((state->m_attr[count]&0x0f)<<8);
461         /* TODO: this looks so out of place ... */
462         color = (state->m_attr[count]&0xf0)>>3;
463
464         drawgfx_opaque(bitmap,cliprect,gfx,tile,color,0,0,x*4,y*8);
465         count++;
466      }
467   }
468
411469   return 0;
412470}
413471
472static SCREEN_UPDATE_IND16( amaticmg2 )
473{
474   amaticmg_state *state = screen.machine().driver_data<amaticmg_state>();
475   const gfx_element *gfx = screen.machine().gfx[0];
476   int y,x;
477   int count = 0;
478
479   for (y=0;y<32;y++)
480   {
481      for (x=0;x<96;x++)
482      {
483         UINT16 tile = state->m_vram[count];
484         UINT8 color;
485
486         tile += ((state->m_attr[count]&0xff)<<8);
487         color = 0;
488
489         drawgfx_opaque(bitmap,cliprect,gfx,tile,color,0,0,x*4,y*8);
490         count++;
491      }
492   }
493
494   return 0;
495}
496
414497static PALETTE_INIT( amaticmg )
415498{
416499   const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
r15021r15022
422505      bit0 = 0;
423506      bit1 = (color_prom[0] >> 6) & 0x01;
424507      bit2 = (color_prom[0] >> 7) & 0x01;
425      b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
426      bit0 = (color_prom[0] >> 3) & 0x01;
427      bit1 = (color_prom[0] >> 4) & 0x01;
428      bit2 = (color_prom[0] >> 5) & 0x01;
429508      g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
430509      bit0 = (color_prom[0] >> 0) & 0x01;
431510      bit1 = (color_prom[0] >> 1) & 0x01;
432511      bit2 = (color_prom[0] >> 2) & 0x01;
433512      r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
513      bit0 = (color_prom[0] >> 3) & 0x01;
514      bit1 = (color_prom[0] >> 4) & 0x01;
515      bit2 = (color_prom[0] >> 5) & 0x01;
516      b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
434517
435518      palette_set_color(machine, i, MAKE_RGB(r, g, b));
436519      color_prom++;
r15021r15022
438521}
439522
440523
441static PALETTE_INIT( amaticmg3 )
524static PALETTE_INIT( amaticmg2 )
442525{
443526   const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
444527   int   r, g, b;
r15021r15022
459542*       Read/Write Handlers         *
460543************************************/
461544
545WRITE8_MEMBER( amaticmg_state::rombank_w )
546{
547   membank("bank1")->set_entry(data & 0xf);
548}
462549
550WRITE8_MEMBER( amaticmg_state::nmi_mask_w )
551{
552   m_nmi_mask = (data & 1) ^ 1;
553}
463554
555static WRITE8_DEVICE_HANDLER(out_a_w)
556{
557/*  LAMPS A:
558
559    7654 3210
560    x--- -xxx  (unknown)
561    ---- x---  START
562    ---x ----  BET
563    --x- ----  HOLD3
564    -x-- ----  HOLD4
565*/
566
567   output_set_lamp_value(0, (data >> 3) & 1);   /* START */
568   output_set_lamp_value(1, (data >> 4) & 1);   /* BET */
569   output_set_lamp_value(2, (data >> 5) & 1);   /* HOLD3 */
570   output_set_lamp_value(3, (data >> 6) & 1);   /* HOLD4 */
571
572   logerror("port A: %2X\n", data);
573}
574
575static WRITE8_DEVICE_HANDLER(out_c_w)
576{
577/*  LAMPS B:
578
579    7654 3210
580    ---- ---x  Coin Out counter
581    ---- --x-  HOLD1
582    ---- -x--  Coin In counter
583    ---x ----  HOLD2
584    -x-- ----  CANCEL
585    x--- ----  Hopper motor
586    --x- x---  (unknown)
587*/
588   output_set_lamp_value(4, (data >> 1) & 1);   /* HOLD1 */
589   output_set_lamp_value(5, (data >> 4) & 1);   /* HOLD2 */
590   output_set_lamp_value(6, (data >> 6) & 1);   /* CANCEL */
591
592//   coin_counter_w(machine(), 0, data & 0x04);   /* Coin In */
593//   coin_counter_w(machine(), 1, data & 0x01);   /* Coin Out */
594
595   logerror("port C: %2X\n", data);
596}
597
598WRITE8_MEMBER( amaticmg_state::unk80_w )
599{
600//   dac_data_w(machine().device("dac"), data & 0x01);      /* Sound DAC */
601}
602
603
604
464605/************************************
465606*      Memory Map Information       *
466607************************************/
467608
468609static ADDRESS_MAP_START( amaticmg_map, AS_PROGRAM, 8, amaticmg_state )
469   AM_RANGE(0x00000, 0x3ffff) AM_ROM
470//  AM_RANGE(0x0000, 0x0000) AM_RAM // AM_SHARE("nvram")
471//  AM_RANGE(0x0000, 0x0000) AM_DEVWRITE_LEGACY("crtc", mc6845_address_w)
472//  AM_RANGE(0x0000, 0x0000) AM_DEVREADWRITE_LEGACY("crtc", mc6845_register_r, mc6845_register_w)
473//  AM_RANGE(0x0000, 0x0000) AM_RAM_WRITE_LEGACY(amaticmg_videoram_w) AM_BASE_LEGACY(&amaticmg_videoram)
474//  AM_RANGE(0x0000, 0x0000) AM_RAM_WRITE_LEGACY(amaticmg_colorram_w) AM_BASE_LEGACY(&amaticmg_colorram)
610   AM_RANGE(0x0000, 0x7fff) AM_ROM
611   AM_RANGE(0x8000, 0x9fff) AM_RAM // AM_SHARE("nvram")
612   AM_RANGE(0xa000, 0xafff) AM_RAM AM_SHARE("vram")
613   AM_RANGE(0xb000, 0xbfff) AM_RAM AM_SHARE("attr")
614   AM_RANGE(0xc000, 0xffff) AM_ROMBANK("bank1")
475615ADDRESS_MAP_END
476616
477617static ADDRESS_MAP_START( amaticmg_portmap, AS_IO, 8, amaticmg_state )
478618   ADDRESS_MAP_GLOBAL_MASK(0xff)
479//  AM_RANGE(0x00, 0x00) AM_DEVREADWRITE_LEGACY("ppi8255_0", ppi8255_r, ppi8255_w)
480//  AM_RANGE(0x00, 0x00) AM_DEVREADWRITE_LEGACY("ppi8255_1", ppi8255_r, ppi8255_w)
619   AM_RANGE(0x00, 0x03) AM_DEVREADWRITE("ppi8255_0", i8255_device, read, write)
620   AM_RANGE(0x20, 0x23) AM_DEVREADWRITE("ppi8255_1", i8255_device, read, write)
621   AM_RANGE(0x40, 0x41) AM_DEVWRITE_LEGACY("ymsnd", ym3812_w)
622   AM_RANGE(0x60, 0x60) AM_DEVWRITE("crtc", mc6845_device, address_w)
623   AM_RANGE(0x61, 0x61) AM_DEVREADWRITE("crtc", mc6845_device, register_r, register_w)
624   AM_RANGE(0x80, 0x80) AM_WRITE(unk80_w)
625   AM_RANGE(0xc0, 0xc0) AM_WRITE(rombank_w)
481626//  AM_RANGE(0x00, 0x00) AM_DEVREADWRITE_LEGACY("ppi8255_2", ppi8255_r, ppi8255_w)
482//  AM_RANGE(0x00, 0x00) AM_DEVWRITE_LEGACY("ymsnd", ym3812_w)
483627//  AM_RANGE(0x00, 0x00) AM_DEVWRITE_LEGACY("dac1", dac_signed_w)
484628//  AM_RANGE(0x00, 0x00) AM_DEVWRITE_LEGACY("dac2", dac_signed_w)
485629
486630ADDRESS_MAP_END
487631
632static ADDRESS_MAP_START( amaticmg2_portmap, AS_IO, 8, amaticmg_state )
633   ADDRESS_MAP_GLOBAL_MASK(0xff)
634//   ADDRESS_MAP_UNMAP_HIGH
635   AM_RANGE(0x00, 0x03) AM_DEVREADWRITE("ppi8255_0", i8255_device, read, write)
636   AM_RANGE(0x20, 0x23) AM_DEVREADWRITE("ppi8255_1", i8255_device, read, write)
637   AM_RANGE(0x40, 0x41) AM_DEVWRITE_LEGACY("ymsnd", ym3812_w)
638   AM_RANGE(0x60, 0x60) AM_DEVWRITE("crtc", mc6845_device, address_w)
639   AM_RANGE(0x61, 0x61) AM_DEVREADWRITE("crtc", mc6845_device, register_r, register_w)
640   AM_RANGE(0xc0, 0xc0) AM_WRITE(rombank_w)
641   AM_RANGE(0xe6, 0xe6) AM_WRITE(nmi_mask_w)
642ADDRESS_MAP_END
643
644
488645/*
489646    Unknown R/W
490647    -----------
r15021r15022
499656
500657static INPUT_PORTS_START( amaticmg )
501658   PORT_START("IN0")
502   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("0-1") PORT_CODE(KEYCODE_1)
503   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("0-2") PORT_CODE(KEYCODE_2)
504   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("0-3") PORT_CODE(KEYCODE_3)
505   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("0-4") PORT_CODE(KEYCODE_4)
506   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("0-5") PORT_CODE(KEYCODE_5)
507   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("0-6") PORT_CODE(KEYCODE_6)
508   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("0-7") PORT_CODE(KEYCODE_7)
509   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("0-8") PORT_CODE(KEYCODE_8)
659   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
660   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
661   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
662   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
663   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
664   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
665   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
666   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )          PORT_NAME("Coin 1 (Muenze 1)") PORT_IMPULSE(3)
510667
511668   PORT_START("IN1")
512   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("1-1") PORT_CODE(KEYCODE_Q)
513   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("1-2") PORT_CODE(KEYCODE_W)
514   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("1-3") PORT_CODE(KEYCODE_E)
515   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("1-4") PORT_CODE(KEYCODE_R)
516   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("1-5") PORT_CODE(KEYCODE_T)
517   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("1-6") PORT_CODE(KEYCODE_Y)
518   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("1-7") PORT_CODE(KEYCODE_U)
519   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("1-8") PORT_CODE(KEYCODE_I)
669   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
670   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE2 )       PORT_NAME("Service B (Dienst B") PORT_CODE(KEYCODE_8) PORT_TOGGLE
671   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 )          PORT_NAME("Coin 2 (Muenze 2)")   PORT_IMPULSE(3)
672   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER )          PORT_NAME("Hopper Payout pulse") PORT_IMPULSE(3)      PORT_CODE(KEYCODE_Q)   // Hopper paying pulse
673   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
674   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT )  PORT_CODE(KEYCODE_W)           // 'Ausgegeben 0 - Hopper Leer' (spent 0 - hopper empty)
675   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_POKER_HOLD3 )   PORT_NAME("Hold 3 (Halten 3)")
676   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_POKER_HOLD2 )   PORT_NAME("Hold 2 (Halten 2)")
520677
521678   PORT_START("IN2")
522   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("2-1") PORT_CODE(KEYCODE_A)
523   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("2-2") PORT_CODE(KEYCODE_S)
524   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("2-3") PORT_CODE(KEYCODE_D)
525   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("2-4") PORT_CODE(KEYCODE_F)
526   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("2-5") PORT_CODE(KEYCODE_G)
527   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("2-6") PORT_CODE(KEYCODE_H)
528   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("2-7") PORT_CODE(KEYCODE_J)
529   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("2-8") PORT_CODE(KEYCODE_K)
679   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )         PORT_NAME("Start")
680   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_POKER_CANCEL )   PORT_NAME("Clear / Take (Loeschen)")
681   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_POKER_HOLD1 )   PORT_NAME("Hold 1 (Halten 1)")
682   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 )       PORT_NAME("Service A (Dienst A") PORT_CODE(KEYCODE_7) PORT_TOGGLE
683   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_BET )     PORT_NAME("Bet (Setzen) / Half Take")
684   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE3 )       PORT_NAME("Service C (Dienst C") PORT_CODE(KEYCODE_9) PORT_TOGGLE
685   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE )        PORT_NAME("Service (Master)")    PORT_CODE(KEYCODE_0)
686   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_POKER_HOLD4 )   PORT_NAME("Hold 4 (Halten 4)")
530687
531688   PORT_START("IN3")
532   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("3-1") PORT_CODE(KEYCODE_Z)
533   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("3-2") PORT_CODE(KEYCODE_X)
534   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("3-3") PORT_CODE(KEYCODE_C)
535   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("3-4") PORT_CODE(KEYCODE_V)
536   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("3-5") PORT_CODE(KEYCODE_B)
537   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("3-6") PORT_CODE(KEYCODE_N)
538   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("3-7") PORT_CODE(KEYCODE_M)
539   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("3-8") PORT_CODE(KEYCODE_L)
689   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
690   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
691   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
692   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
693   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
694   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
695   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
696   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
540697
541698   PORT_START("SW1")
542   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
543   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
544   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
545   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
546   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
547   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
548   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
549   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
550   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
551   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
552   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
553   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
554   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
555   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
556   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
557   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
558   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
559   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
560   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
561   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
562   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
563   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
564   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
565   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
699   PORT_DIPNAME( 0x01, 0x01, "DIP1")               PORT_DIPLOCATION("DIP:1")
700   PORT_DIPSETTING(    0x01, "Off (Aus)" )
701   PORT_DIPSETTING(    0x00, "On (Ein)" )
702   PORT_DIPNAME( 0x02, 0x02, "DIP2")               PORT_DIPLOCATION("DIP:2")
703   PORT_DIPSETTING(    0x02, "Off (Aus)" )
704   PORT_DIPSETTING(    0x00, "On (Ein)" )
705   PORT_DIPNAME( 0x04, 0x04, "Coin 1 (Muenzen 1)" )   PORT_DIPLOCATION("DIP:3")
706   PORT_DIPSETTING(    0x04, "10" )
707   PORT_DIPSETTING(    0x00, "5" )
708   PORT_DIPNAME( 0x08, 0x08, "Coin 2 (Muenzen 2)" )   PORT_DIPLOCATION("DIP:4")
709   PORT_DIPSETTING(    0x08, "100" )
710   PORT_DIPSETTING(    0x00, "5" )
711   PORT_DIPNAME( 0x10, 0x10, "Jackpot")            PORT_DIPLOCATION("DIP:5")
712   PORT_DIPSETTING(    0x10, "Jackpot KZB")
713   PORT_DIPSETTING(    0x00, "Jackpot LZB")
714   PORT_DIPNAME( 0x20, 0x20, "Fruechtebonus" )         PORT_DIPLOCATION("DIP:6")
715   PORT_DIPSETTING(    0x20, "Fruechtebonus Bleibt" )
716   PORT_DIPSETTING(    0x00, "Fruechtebonus Clear" )
717   PORT_DIPNAME( 0x40, 0x40, "DIP7")               PORT_DIPLOCATION("DIP:7")
718   PORT_DIPSETTING(    0x40, "Off (Aus)" )
719   PORT_DIPSETTING(    0x00, "On (Ein)" )
720   PORT_DIPNAME( 0x80, 0x80, "BH")                PORT_DIPLOCATION("DIP:8")
721   PORT_DIPSETTING(    0x80, "BH Dreifach")
722   PORT_DIPSETTING(    0x00, "BH Normal")
566723INPUT_PORTS_END
567724
568725
r15021r15022
575732   4,8,
576733   RGN_FRAC(1,2),
577734   4,
578   { RGN_FRAC(0,2) + 0, RGN_FRAC(0,2) + 4, RGN_FRAC(1,2) + 0, RGN_FRAC(1,2) + 4 }, //TODO: rom order is unknown
579   { 3, 2, 1, 0 },   /* tiles are x-flipped */
735   { RGN_FRAC(0,2), RGN_FRAC(0,2) + 4, RGN_FRAC(1,2), RGN_FRAC(1,2) + 4 },
736   { 3, 2, 1, 0 },
580737   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
581738   8*4*2
582739};
r15021r15022
586743   4,8,
587744   RGN_FRAC(1,3),
588745   6,
589   { RGN_FRAC(0,3) + 0, RGN_FRAC(0,3) + 4, RGN_FRAC(1,3) + 0, RGN_FRAC(1,3) + 4,RGN_FRAC(2,3) + 0, RGN_FRAC(2,3) + 4, }, //TODO: rom order is unknown
746   { RGN_FRAC(0,3) + 0, RGN_FRAC(0,3) + 4, RGN_FRAC(1,3) + 0, RGN_FRAC(1,3) + 4,RGN_FRAC(2,3) + 0, RGN_FRAC(2,3) + 4, },
590747   { 3, 2, 1, 0 },   /* tiles are x-flipped */
591748   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
592749   8*4*2
r15021r15022
601758   GFXDECODE_ENTRY( "gfx1", 0x0000, charlayout_4bpp, 0, 0x20 )
602759GFXDECODE_END
603760
604static GFXDECODE_START( amaticmg3 )
605   GFXDECODE_ENTRY( "gfx1", 0x0000, charlayout_6bpp, 0, 0x20 )
761static GFXDECODE_START( amaticmg2 )
762   GFXDECODE_ENTRY( "gfx1", 0x0000, charlayout_6bpp, 0, 0x10000/0x40 )
606763GFXDECODE_END
607764
608765/************************************
609766*          Sound Interface          *
610767************************************/
611768
612//static const ym3812_interface ym3812_config =
613//{
614//  sound_irq
615//};
769static const ym3812_interface ym3812_config =
770{
771   0
772};
616773
617774
618775/************************************
619776*          CRTC Interface           *
620777************************************/
621778
622//static const mc6845_interface mc6845_intf =
623//{
624//  "screen",   /* screen we are acting on */
625//  8,          /* number of pixels per video memory address */
626//  NULL,       /* before pixel update callback */
627//  NULL,       /* row update callback */
628//  NULL,       /* after pixel update callback */
629//  DEVCB_NULL, /* callback for display state changes */
630//  DEVCB_NULL, /* callback for cursor state changes */
631//  DEVCB_NULL, /* HSYNC callback */
632//  DEVCB_NULL, /* VSYNC callback */
633//  NULL        /* update address callback */
634//};
779static const mc6845_interface mc6845_intf =
780{
781   "screen",   /* screen we are acting on */
782   4,          /* number of pixels per video memory address */
783   NULL,       /* before pixel update callback */
784   NULL,       /* row update callback */
785   NULL,       /* after pixel update callback */
786   DEVCB_NULL, /* callback for display state changes */
787   DEVCB_NULL, /* callback for cursor state changes */
788   DEVCB_NULL, /* HSYNC callback */
789   DEVCB_NULL, /* VSYNC callback */
790   NULL        /* update address callback */
791};
635792
636793
637794/************************************
638795*      PPI 8255 (x3) Interface      *
639796************************************/
640797
641//static const ppi8255_interface ppi8255_intf[3] =
642//{
643//  {   /* (00-00) Mode X - Port X set as input */
644//      DEVCB_NULL,                     /* Port A read */
645//      DEVCB_NULL,                     /* Port B read */
646//      DEVCB_NULL,                     /* Port C read */
647//      DEVCB_NULL,                     /* Port A write */
648//      DEVCB_NULL,                     /* Port B write */
649//      DEVCB_NULL,                     /* Port C write */
650//  },
651//  {   /* (00-00) Mode X - Port X set as input */
652//      DEVCB_NULL,                     /* Port A read */
653//      DEVCB_NULL,                     /* Port B read */
654//      DEVCB_NULL,                     /* Port C read */
655//      DEVCB_NULL,                     /* Port A write */
656//      DEVCB_NULL,                     /* Port B write */
657//      DEVCB_NULL,                     /* Port C write */
658//  },
659//  {   /* (00-00) Mode X - Port X set as input */
660//      DEVCB_NULL,                     /* Port A read */
661//      DEVCB_NULL,                     /* Port B read */
662//      DEVCB_NULL,                     /* Port C read */
663//      DEVCB_NULL,                     /* Port A write */
664//      DEVCB_NULL,                     /* Port B write */
665//      DEVCB_NULL,                     /* Port C write */
666//  }
667//};
798static I8255A_INTERFACE( ppi8255_intf_0 )
799{
800   DEVCB_INPUT_PORT("IN0"),      /* Port A read */
801   DEVCB_NULL,                  /* Port A write */
802   DEVCB_INPUT_PORT("IN1"),      /* Port B read */
803   DEVCB_NULL,                  /* Port B write */
804   DEVCB_INPUT_PORT("IN2"),      /* Port C read */
805   DEVCB_NULL                  /* Port C write */
806};
668807
808static I8255A_INTERFACE( ppi8255_intf_1 )
809{
810   DEVCB_NULL,                  /* Port A read */
811   DEVCB_HANDLER(out_a_w),         /* Port A write */
812   DEVCB_INPUT_PORT("SW1"),      /* Port B read */
813   DEVCB_NULL,                  /* Port B write */
814   DEVCB_NULL,                  /* Port C read */
815   DEVCB_HANDLER(out_c_w)         /* Port C write */
816};
817
818static MACHINE_START( amaticmg )
819{
820   UINT8 *rombank = machine.root_device().memregion("maincpu")->base();
821
822   machine.root_device().membank("bank1")->configure_entries(0, 0x10, &rombank[0x8000], 0x4000);
823}
824
825static MACHINE_RESET( amaticmg )
826{
827   amaticmg_state *state = machine.driver_data<amaticmg_state>();
828
829   state->membank("bank1")->set_entry(0);
830   state->m_nmi_mask = 0;
831}
832
669833/************************************
670834*          Machine Drivers          *
671835************************************/
r15021r15022
675839   MCFG_CPU_ADD("maincpu", Z80, CPU_CLOCK)      /* WRONG! */
676840   MCFG_CPU_PROGRAM_MAP(amaticmg_map)
677841   MCFG_CPU_IO_MAP(amaticmg_portmap)
678   MCFG_CPU_VBLANK_INT("screen", irq0_line_hold)
842   MCFG_CPU_VBLANK_INT("screen", nmi_line_pulse) // no NMI mask?
679843
680844//  MCFG_NVRAM_ADD_0FILL("nvram")
681845
682846   /* 3x 8255 */
683//  MCFG_PPI8255_ADD( "ppi8255_0", ppi8255_intf[0] )
684//  MCFG_PPI8255_ADD( "ppi8255_1", ppi8255_intf[1] )
847   MCFG_I8255A_ADD( "ppi8255_0", ppi8255_intf_0 )
848   MCFG_I8255A_ADD( "ppi8255_1", ppi8255_intf_1 )
685849//  MCFG_PPI8255_ADD( "ppi8255_2", ppi8255_intf[2] )
686850
687851   /* video hardware */
r15021r15022
692856   MCFG_SCREEN_VISIBLE_AREA(0, 512-1, 0, 256-1)
693857   MCFG_SCREEN_UPDATE_STATIC(amaticmg)
694858
695//  MCFG_MC6845_ADD("crtc", MC6845, CRTC_CLOCK, mc6845_intf)
859   MCFG_MC6845_ADD("crtc", MC6845, CRTC_CLOCK, mc6845_intf)
696860
697861   MCFG_GFXDECODE(amaticmg)
698862
r15021r15022
700864   MCFG_PALETTE_LENGTH(0x200)
701865   MCFG_VIDEO_START(amaticmg)
702866
867   MCFG_MACHINE_START(amaticmg)
868   MCFG_MACHINE_RESET(amaticmg)
869
703870   /* sound hardware */
704//  MCFG_SPEAKER_STANDARD_MONO("mono")
871   MCFG_SPEAKER_STANDARD_MONO("mono")
705872
706//  MCFG_SOUND_ADD("ymsnd", YM3812, SND_CLOCK)
707//  MCFG_SOUND_CONFIG(ym3812_config)
708//  MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
873   MCFG_SOUND_ADD("ymsnd", YM3812, SND_CLOCK)
874   MCFG_SOUND_CONFIG(ym3812_config)
875   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
709876
710//  MCFG_SOUND_ADD("dac", DAC, 0)   /* Y3014B */
711//  MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
877//   MCFG_SOUND_ADD("dac", DAC, 0)   /* Y3014B */
878//   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
712879
713880MACHINE_CONFIG_END
714881
715static MACHINE_CONFIG_DERIVED( amaticmg3, amaticmg )
716882
717   MCFG_GFXDECODE(amaticmg3)
718   MCFG_PALETTE_INIT(amaticmg3)
883static INTERRUPT_GEN( amaticmg2_irq )
884{
885   amaticmg_state *state = device->machine().driver_data<amaticmg_state>();
886
887   if(state->m_nmi_mask)
888      device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
889}
890
891
892static MACHINE_CONFIG_DERIVED( amaticmg2, amaticmg )
893
894   MCFG_CPU_MODIFY("maincpu")
895   MCFG_CPU_IO_MAP(amaticmg2_portmap)
896   MCFG_CPU_VBLANK_INT("screen", amaticmg2_irq)
897
898   MCFG_SCREEN_MODIFY("screen")
899   MCFG_SCREEN_UPDATE_STATIC(amaticmg2)
900
901   MCFG_GFXDECODE(amaticmg2)
902   MCFG_PALETTE_INIT(amaticmg2)
719903   MCFG_PALETTE_LENGTH(0x10000)
720904MACHINE_CONFIG_END
721905
906
722907/************************************
723908*             Rom Load              *
724909************************************/
725910
726ROM_START( am_uslot )
911ROM_START( suprstar )
727912   ROM_REGION( 0x40000, "maincpu", ROMREGION_ERASE00 )
728913
729914   ROM_REGION( 0x20000, "mainprg", 0 )   /* encrypted program ROM...*/
730915   ROM_LOAD( "u3.bin",  0x00000, 0x20000, CRC(29bf4a95) SHA1(a73873f7cd1fdf5accc3e79f4619949f261400b8) )
731916
732   ROM_REGION( 0x30000, "gfx1", 0 )
733   ROM_LOAD( "u9.bin",  0x00000, 0x10000, CRC(823a736a) SHA1(a5227e3080367736aac1198d9dbb55efc4114624) )
734   ROM_LOAD( "u10.bin", 0x10000, 0x10000, CRC(6a811c81) SHA1(af01cd9b1ce6aca92df71febb05fe216b18cf42a) )
917   ROM_REGION( 0x10000, "gfx1", 0 )
918   ROM_LOAD( "u10.bin", 0x00000, 0x08000, CRC(6a811c81) SHA1(af01cd9b1ce6aca92df71febb05fe216b18cf42a) )
919   ROM_CONTINUE(        0x00000, 0x08000 )
920   ROM_LOAD( "u9.bin",  0x08000, 0x08000, CRC(823a736a) SHA1(a5227e3080367736aac1198d9dbb55efc4114624) )
921   ROM_CONTINUE(        0x08000, 0x08000 )
735922
736923   ROM_REGION( 0x0200, "proms", 0 )
737924   ROM_LOAD( "n82s147a.bin", 0x0000, 0x0200, CRC(dfeabd11) SHA1(21e8bbcf4aba5e4d672e5585890baf8c5bc77c98) )
r15021r15022
745932   ROM_LOAD( "mgi_vger_3.9-i-8201.i6.bin", 0x00000, 0x40000, CRC(9ce159f7) SHA1(101c277d579a69cb03f879288b2cecf838cf1741) )
746933
747934   ROM_REGION( 0x180000, "gfx1", 0 )
748   ROM_LOAD( "multi_2.4_zg1.i17.bin", 0x000000, 0x80000, CRC(4a60a718) SHA1(626991abee768da58e87c7cdfc4fcbae86c6ea2a) )
935   ROM_LOAD( "multi_2.4_zg1.i17.bin", 0x100000, 0x80000, CRC(4a60a718) SHA1(626991abee768da58e87c7cdfc4fcbae86c6ea2a) )
749936   ROM_LOAD( "multi_2.4_zg2.i18.bin", 0x080000, 0x80000, CRC(b504e1b8) SHA1(ffa17a2c212eb2fffb89b131868e69430cb41203) )
750   ROM_LOAD( "multi_2.4_zg3.i33.bin", 0x100000, 0x80000, CRC(9b66bb4d) SHA1(64035d2028a9b68164c87475a1ec9754453ad572) )
937   ROM_LOAD( "multi_2.4_zg3.i33.bin", 0x000000, 0x80000, CRC(9b66bb4d) SHA1(64035d2028a9b68164c87475a1ec9754453ad572) )
751938
752939   ROM_REGION( 0x20000/*0x0400*/, "proms", 0 )
753940   ROM_LOAD( "n82s147a_1.bin", 0x0000, 0x0200, NO_DUMP )
r15021r15022
761948   ROM_LOAD( "mg_iii_vger_3.5-i-8205.bin", 0x00000, 0x40000, CRC(21d64029) SHA1(d5c3fde02833a96dd7a43481a489bfc4a5c9609d) )
762949
763950   ROM_REGION( 0x180000, "gfx1", 0 )
764   ROM_LOAD( "mg_iii_51_zg1.bin", 0x000000, 0x80000, CRC(84f86874) SHA1(c483a50df6a9a71ddfdf8530a894135f9b852b89) )
951   ROM_LOAD( "mg_iii_51_zg1.bin", 0x100000, 0x80000, CRC(84f86874) SHA1(c483a50df6a9a71ddfdf8530a894135f9b852b89) )
765952   ROM_LOAD( "mg_iii_51_zg2.bin", 0x080000, 0x80000, CRC(4425e535) SHA1(726c322c5d0b391b82e49dd1797ebf0abfa4a65a) )
766   ROM_LOAD( "mg_iii_51_zg3.bin", 0x100000, 0x80000, CRC(36d4c0fa) SHA1(20352dbbb2ce2233be0f4f694ddf49b8f5d6a64f) )
953   ROM_LOAD( "mg_iii_51_zg3.bin", 0x000000, 0x80000, CRC(36d4c0fa) SHA1(20352dbbb2ce2233be0f4f694ddf49b8f5d6a64f) )
767954
768955   ROM_REGION( 0x20000, "proms", 0 )
769956   ROM_LOAD( "v.bin", 0x00000, 0x20000, CRC(524767e2) SHA1(03a108494f42365c820fdfbcba9496bda86f3081) )
r15021r15022
804991   }
805992}
806993
807static DRIVER_INIT( amaticmg )
994static DRIVER_INIT( ama8000_1_x )
808995{
809996   decrypt(machine, 0x4c2, 0xf5);
810997}
811998
812static DRIVER_INIT( amaticmg3 )
999static DRIVER_INIT( ama8000_2_i )
8131000{
8141001   decrypt(machine, 0x426, 0x55);
8151002}
r15021r15022
8191006*           Game Drivers            *
8201007************************************/
8211008
822/*    YEAR  NAME      PARENT  MACHINE   INPUT     INIT      ROT    COMPANY                FULLNAME                     FLAGS  */
823GAME( 1996, am_uslot, 0,      amaticmg, amaticmg, amaticmg, ROT0, "Amatic Trading GmbH", "Amatic Unknown Slots Game",  GAME_IMPERFECT_GRAPHICS | GAME_WRONG_COLORS | GAME_UNEMULATED_PROTECTION | GAME_NO_SOUND | GAME_NOT_WORKING )
824GAME( 2000, am_mg24,  0,      amaticmg3, amaticmg, amaticmg3, ROT0, "Amatic Trading GmbH", "Multi Game I (V.Ger 2.4)",   GAME_IMPERFECT_GRAPHICS | GAME_WRONG_COLORS | GAME_UNEMULATED_PROTECTION | GAME_NO_SOUND | GAME_NOT_WORKING )
825GAME( 2000, am_mg3,   0,      amaticmg3, amaticmg, amaticmg3, ROT0, "Amatic Trading GmbH", "Multi Game III (V.Ger 3.5)", GAME_IMPERFECT_GRAPHICS | GAME_WRONG_COLORS | GAME_UNEMULATED_PROTECTION | GAME_NO_SOUND | GAME_NOT_WORKING )
1009/*     YEAR  NAME      PARENT  MACHINE    INPUT     INIT         ROT     COMPANY                FULLNAME                     FLAGS                                                                                                        LAYOUT */
1010GAMEL( 1996, suprstar, 0,      amaticmg,  amaticmg, ama8000_1_x, ROT90, "Amatic Trading GmbH", "Super Stars",                GAME_IMPERFECT_SOUND,                                                                                        layout_suprstar )
1011GAME(  2000, am_mg24,  0,      amaticmg2, amaticmg, ama8000_2_i, ROT0,  "Amatic Trading GmbH", "Multi Game I (V.Ger 2.4)",   GAME_IMPERFECT_GRAPHICS | GAME_WRONG_COLORS | GAME_UNEMULATED_PROTECTION | GAME_NO_SOUND | GAME_NOT_WORKING )
1012GAME(  2000, am_mg3,   0,      amaticmg2, amaticmg, ama8000_2_i, ROT0,  "Amatic Trading GmbH", "Multi Game III (V.Ger 3.5)", GAME_IMPERFECT_GRAPHICS | GAME_WRONG_COLORS | GAME_UNEMULATED_PROTECTION | GAME_NO_SOUND | GAME_NOT_WORKING )
src/mame/drivers/bloodbro.c
r15021r15022
11/**************************************************************************
22
3Blood Bros, West Story [+Sky Smasher]
3Blood Bros, West Story & Sky Smasher
44TAD Corporation 1990
5568000 + Z80 + YM3931 + YM3812
66
r15021r15022
1414- runs too fast? (vblank flag somewhere?)
1515
1616
17Blood Bros  (c) 1990 Nihon System [Seibu hardware]
18-----------
19The manual states:
20
21 At Power On, if you touch the joystick, you will have DIP-SW setting on
22 the screen
23
24This works for all sets and the bootleg.
25
1726Sky Smasher  (c) 1990 Nihon System [Seibu hardware]
1827-----------
1928
2029Like some other Seibu hardware games, hold P1 right at boot to
21view DIP descriptions.
30view DIP descriptions. The manual states:
2231
32 At Power On, if you touch the joystick or SHOOT or MISSILE button, you will
33 have DIP-SW setting on the screen
34
2335Game does not appear to have cocktail mode. The screen hardware
2436is undoubtedly capable of flipscreen and layer priority flipping
2537however.(which is why we have GAME_NO_COCKTAIL despite the games
r15021r15022
100112    Dip Switch as in 'toki' (same manufacturer and similar hardware).
101113
102114
103DIP locations verified for:
104    - bloodbro (manual)
115DIP locations verified for Blood Bros. & Sky Smasher via manual & DIP-SW setting
116    screens at power up.
105117
106118**************************************************************************/
107119
r15021r15022
474486
475487ROM_START( bloodbro )
476488   ROM_REGION( 0x80000, "maincpu", 0 )
477   ROM_LOAD16_BYTE( "2j.u021",      0x00001, 0x20000, CRC(c0fdc3e4) SHA1(31968f693de2054a0c8ba50a8d44a371dd9c2848) )
478   ROM_LOAD16_BYTE( "1j.i022",      0x00000, 0x20000, CRC(2d7e0fdf) SHA1(8fe22d8a1ef7d562a475a5b6c98303b0cb1af561) )
479   ROM_LOAD16_BYTE( "bb_04.bin",    0x40001, 0x20000, CRC(fd951c2c) SHA1(f4031bf303c67c82f2f78f7456f78382d8c1ac85) )
480   ROM_LOAD16_BYTE( "bb_03.bin",    0x40000, 0x20000, CRC(18d3c460) SHA1(93b86af1199f0fedeaf1fe64d27ffede4b819e42) )
489   ROM_LOAD16_BYTE( "2j.u021",   0x00001, 0x20000, CRC(c0fdc3e4) SHA1(31968f693de2054a0c8ba50a8d44a371dd9c2848) )
490   ROM_LOAD16_BYTE( "1j.i022",   0x00000, 0x20000, CRC(2d7e0fdf) SHA1(8fe22d8a1ef7d562a475a5b6c98303b0cb1af561) )
491   ROM_LOAD16_BYTE( "bb_04.bin", 0x40001, 0x20000, CRC(fd951c2c) SHA1(f4031bf303c67c82f2f78f7456f78382d8c1ac85) )
492   ROM_LOAD16_BYTE( "bb_03.bin", 0x40000, 0x20000, CRC(18d3c460) SHA1(93b86af1199f0fedeaf1fe64d27ffede4b819e42) )
481493
482494   ROM_REGION( 0x20000, "audiocpu", 0 )
483   ROM_LOAD( "bb_07.bin",    0x000000, 0x08000, CRC(411b94e8) SHA1(6968441f64212c0935afeca68f07deaadf86d614) )
484   ROM_CONTINUE(             0x010000, 0x08000 )
495   ROM_LOAD( "bb_07.bin",   0x000000, 0x08000, CRC(411b94e8) SHA1(6968441f64212c0935afeca68f07deaadf86d614) )
496   ROM_CONTINUE(            0x010000, 0x08000 )
485497   ROM_COPY( "audiocpu", 0, 0x018000, 0x08000 )
486498
487499   ROM_REGION( 0x20000, "gfx1", 0 )
488   ROM_LOAD( "bb_05.bin",    0x00000, 0x10000, CRC(04ba6d19) SHA1(7333075c3323756d51917418b5234d785a9bee00) )   /* characters */
489   ROM_LOAD( "bb_06.bin",    0x10000, 0x10000, CRC(7092e35b) SHA1(659d30b2e2fd9ffa34a47e98193c8f0a87ac1315) )
500   ROM_LOAD( "bb_05.bin", 0x00000, 0x10000, CRC(04ba6d19) SHA1(7333075c3323756d51917418b5234d785a9bee00) )   /* characters */
501   ROM_LOAD( "bb_06.bin", 0x10000, 0x10000, CRC(7092e35b) SHA1(659d30b2e2fd9ffa34a47e98193c8f0a87ac1315) )
490502
491503   ROM_REGION( 0x100000, "gfx2", 0 )
492   ROM_LOAD( "bloodb.bk",   0x00000, 0x100000, CRC(1aa87ee6) SHA1(e7843c1e8a0f3a685f0b5d6e3a2eb3176c410847) )   /* Background+Foreground */
504   ROM_LOAD( "bloodb.bk", 0x00000, 0x100000, CRC(1aa87ee6) SHA1(e7843c1e8a0f3a685f0b5d6e3a2eb3176c410847) )   /* Background+Foreground */
493505
494506   ROM_REGION( 0x100000, "gfx3", 0 )
495   ROM_LOAD( "bloodb.obj",   0x00000, 0x100000, CRC(d27c3952) SHA1(de7306432b682f238b911507ad7aa2fa8acbee80) )   /* sprites */
507   ROM_LOAD( "bloodb.obj", 0x00000, 0x100000, CRC(d27c3952) SHA1(de7306432b682f238b911507ad7aa2fa8acbee80) )   /* sprites */
496508
497509   ROM_REGION( 0x40000, "oki", 0 )   /* ADPCM samples */
498   ROM_LOAD( "bb_08.bin",    0x00000, 0x20000, CRC(deb1b975) SHA1(08f2e9a0a23171201b71d381d091edcd3787c287) )
510   ROM_LOAD( "bb_08.bin",  0x00000, 0x20000, CRC(deb1b975) SHA1(08f2e9a0a23171201b71d381d091edcd3787c287) )
499511ROM_END
500512
501513ROM_START( bloodbroa )
502514   ROM_REGION( 0x80000, "maincpu", 0 )
503   ROM_LOAD16_BYTE( "2j.21",    0x00001, 0x20000, CRC(e8ca21b8) SHA1(65330368c29ec64ca03124d28a7f8b49d7a15566) )
504   ROM_LOAD16_BYTE( "1j.22",    0x00000, 0x20000, CRC(6b28cfc7) SHA1(dedd06cab61381f3e27dc14315f283d707d06bcb) )
505   ROM_LOAD16_BYTE( "bb_04.bin",    0x40001, 0x20000, CRC(fd951c2c) SHA1(f4031bf303c67c82f2f78f7456f78382d8c1ac85) )
506   ROM_LOAD16_BYTE( "bb_03.bin",    0x40000, 0x20000, CRC(18d3c460) SHA1(93b86af1199f0fedeaf1fe64d27ffede4b819e42) )
515   ROM_LOAD16_BYTE( "2j.21",     0x00001, 0x20000, CRC(e8ca21b8) SHA1(65330368c29ec64ca03124d28a7f8b49d7a15566) )
516   ROM_LOAD16_BYTE( "1j.22",     0x00000, 0x20000, CRC(6b28cfc7) SHA1(dedd06cab61381f3e27dc14315f283d707d06bcb) )
517   ROM_LOAD16_BYTE( "bb_04.bin", 0x40001, 0x20000, CRC(fd951c2c) SHA1(f4031bf303c67c82f2f78f7456f78382d8c1ac85) )
518   ROM_LOAD16_BYTE( "bb_03.bin", 0x40000, 0x20000, CRC(18d3c460) SHA1(93b86af1199f0fedeaf1fe64d27ffede4b819e42) )
507519
508520   ROM_REGION( 0x20000, "audiocpu", 0 )
509   ROM_LOAD( "bb_07.bin",    0x000000, 0x08000, CRC(411b94e8) SHA1(6968441f64212c0935afeca68f07deaadf86d614) )
510   ROM_CONTINUE(             0x010000, 0x08000 )
521   ROM_LOAD( "bb_07.bin",   0x000000, 0x08000, CRC(411b94e8) SHA1(6968441f64212c0935afeca68f07deaadf86d614) )
522   ROM_CONTINUE(            0x010000, 0x08000 )
511523   ROM_COPY( "audiocpu", 0, 0x018000, 0x08000 )
512524
513525   ROM_REGION( 0x20000, "gfx1", 0 )
514   ROM_LOAD( "bb_05.bin",    0x00000, 0x10000, CRC(04ba6d19) SHA1(7333075c3323756d51917418b5234d785a9bee00) )   /* characters */
515   ROM_LOAD( "bb_06.bin",    0x10000, 0x10000, CRC(7092e35b) SHA1(659d30b2e2fd9ffa34a47e98193c8f0a87ac1315) )
526   ROM_LOAD( "bb_05.bin", 0x00000, 0x10000, CRC(04ba6d19) SHA1(7333075c3323756d51917418b5234d785a9bee00) )   /* characters */
527   ROM_LOAD( "bb_06.bin", 0x10000, 0x10000, CRC(7092e35b) SHA1(659d30b2e2fd9ffa34a47e98193c8f0a87ac1315) )
516528
517529   ROM_REGION( 0x100000, "gfx2", 0 )
518   ROM_LOAD( "bloodb.bk",   0x00000, 0x100000, CRC(1aa87ee6) SHA1(e7843c1e8a0f3a685f0b5d6e3a2eb3176c410847) )   /* Background+Foreground */
530   ROM_LOAD( "bloodb.bk", 0x00000, 0x100000, CRC(1aa87ee6) SHA1(e7843c1e8a0f3a685f0b5d6e3a2eb3176c410847) )   /* Background+Foreground */
519531
520532   ROM_REGION( 0x100000, "gfx3", 0 )
521   ROM_LOAD( "bloodb.obj",   0x00000, 0x100000, CRC(d27c3952) SHA1(de7306432b682f238b911507ad7aa2fa8acbee80) )   /* sprites */
533   ROM_LOAD( "bloodb.obj", 0x00000, 0x100000, CRC(d27c3952) SHA1(de7306432b682f238b911507ad7aa2fa8acbee80) )   /* sprites */
522534
523535   ROM_REGION( 0x40000, "oki", 0 )   /* ADPCM samples */
524   ROM_LOAD( "bb_08.bin",    0x00000, 0x20000, CRC(deb1b975) SHA1(08f2e9a0a23171201b71d381d091edcd3787c287) )
536   ROM_LOAD( "bb_08.bin", 0x00000, 0x20000, CRC(deb1b975) SHA1(08f2e9a0a23171201b71d381d091edcd3787c287) )
525537ROM_END
526538
527539ROM_START( bloodbrob )
528540   ROM_REGION( 0x80000, "maincpu", 0 )
529   ROM_LOAD16_BYTE( "bloodbros02.bin",    0x00001, 0x20000, CRC(204dca6e) SHA1(f04cb2116d699ac2deec2d55597beb5d7b3dc793) )
530   ROM_LOAD16_BYTE( "bloodbros01.bin",    0x00000, 0x20000, CRC(ac6719e7) SHA1(bcefd61ed5d2f5eeb4424243f03037c7d123b9f6) )
531   ROM_LOAD16_BYTE( "bb_04.bin",    0x40001, 0x20000, CRC(fd951c2c) SHA1(f4031bf303c67c82f2f78f7456f78382d8c1ac85) )
532   ROM_LOAD16_BYTE( "bb_03.bin",    0x40000, 0x20000, CRC(18d3c460) SHA1(93b86af1199f0fedeaf1fe64d27ffede4b819e42) )
541   ROM_LOAD16_BYTE( "bloodbros02.bin", 0x00001, 0x20000, CRC(204dca6e) SHA1(f04cb2116d699ac2deec2d55597beb5d7b3dc793) )
542   ROM_LOAD16_BYTE( "bloodbros01.bin", 0x00000, 0x20000, CRC(ac6719e7) SHA1(bcefd61ed5d2f5eeb4424243f03037c7d123b9f6) )
543   ROM_LOAD16_BYTE( "bb_04.bin",       0x40001, 0x20000, CRC(fd951c2c) SHA1(f4031bf303c67c82f2f78f7456f78382d8c1ac85) )
544   ROM_LOAD16_BYTE( "bb_03.bin",       0x40000, 0x20000, CRC(18d3c460) SHA1(93b86af1199f0fedeaf1fe64d27ffede4b819e42) )
533545
534546   ROM_REGION( 0x20000, "audiocpu", 0 )
535   ROM_LOAD( "bb_07.bin",    0x000000, 0x08000, CRC(411b94e8) SHA1(6968441f64212c0935afeca68f07deaadf86d614) )
536   ROM_CONTINUE(             0x010000, 0x08000 )
547   ROM_LOAD( "bb_07.bin",   0x000000, 0x08000, CRC(411b94e8) SHA1(6968441f64212c0935afeca68f07deaadf86d614) )
548   ROM_CONTINUE(            0x010000, 0x08000 )
537549   ROM_COPY( "audiocpu", 0, 0x018000, 0x08000 )
538550
539551   ROM_REGION( 0x20000, "gfx1", 0 )
540   ROM_LOAD( "bb_05.bin",    0x00000, 0x10000, CRC(04ba6d19) SHA1(7333075c3323756d51917418b5234d785a9bee00) )   /* characters */
541   ROM_LOAD( "bb_06.bin",    0x10000, 0x10000, CRC(7092e35b) SHA1(659d30b2e2fd9ffa34a47e98193c8f0a87ac1315) )
552   ROM_LOAD( "bb_05.bin", 0x00000, 0x10000, CRC(04ba6d19) SHA1(7333075c3323756d51917418b5234d785a9bee00) )   /* characters */
553   ROM_LOAD( "bb_06.bin", 0x10000, 0x10000, CRC(7092e35b) SHA1(659d30b2e2fd9ffa34a47e98193c8f0a87ac1315) )
542554
543555   ROM_REGION( 0x100000, "gfx2", 0 )
544   ROM_LOAD( "bloodb.bk",   0x00000, 0x100000, CRC(1aa87ee6) SHA1(e7843c1e8a0f3a685f0b5d6e3a2eb3176c410847) )   /* Background+Foreground */
556   ROM_LOAD( "bloodb.bk", 0x00000, 0x100000, CRC(1aa87ee6) SHA1(e7843c1e8a0f3a685f0b5d6e3a2eb3176c410847) )   /* Background+Foreground */
545557
546558   ROM_REGION( 0x100000, "gfx3", 0 )
547   ROM_LOAD( "bloodb.obj",   0x00000, 0x100000, CRC(d27c3952) SHA1(de7306432b682f238b911507ad7aa2fa8acbee80) )   /* sprites */
559   ROM_LOAD( "bloodb.obj", 0x00000, 0x100000, CRC(d27c3952) SHA1(de7306432b682f238b911507ad7aa2fa8acbee80) )   /* sprites */
548560
549561   ROM_REGION( 0x40000, "oki", 0 )   /* ADPCM samples */
550   ROM_LOAD( "bb_08.bin",    0x00000, 0x20000, CRC(deb1b975) SHA1(08f2e9a0a23171201b71d381d091edcd3787c287) )
562   ROM_LOAD( "bb_08.bin", 0x00000, 0x20000, CRC(deb1b975) SHA1(08f2e9a0a23171201b71d381d091edcd3787c287) )
551563ROM_END
552564
553565
554566ROM_START( weststry )
555567   ROM_REGION( 0x80000, "maincpu", 0 )   /* 64k for cpu code */
556   ROM_LOAD16_BYTE( "ws13.bin",    0x00001, 0x20000, CRC(158e302a) SHA1(52cc1bf526424ff025a6b79f3fc7bba4b9bbfcbb) )
557   ROM_LOAD16_BYTE( "ws15.bin",    0x00000, 0x20000, CRC(672e9027) SHA1(71cb9fcef04edb972ba88de45d605dcff539ea2d) )
558   ROM_LOAD16_BYTE( "bb_04.bin",   0x40001, 0x20000, CRC(fd951c2c) SHA1(f4031bf303c67c82f2f78f7456f78382d8c1ac85) )
559   ROM_LOAD16_BYTE( "bb_03.bin",   0x40000, 0x20000, CRC(18d3c460) SHA1(93b86af1199f0fedeaf1fe64d27ffede4b819e42) )
568   ROM_LOAD16_BYTE( "ws13.bin",  0x00001, 0x20000, CRC(158e302a) SHA1(52cc1bf526424ff025a6b79f3fc7bba4b9bbfcbb) )
569   ROM_LOAD16_BYTE( "ws15.bin",  0x00000, 0x20000, CRC(672e9027) SHA1(71cb9fcef04edb972ba88de45d605dcff539ea2d) )
570   ROM_LOAD16_BYTE( "bb_04.bin", 0x40001, 0x20000, CRC(fd951c2c) SHA1(f4031bf303c67c82f2f78f7456f78382d8c1ac85) )
571   ROM_LOAD16_BYTE( "bb_03.bin", 0x40000, 0x20000, CRC(18d3c460) SHA1(93b86af1199f0fedeaf1fe64d27ffede4b819e42) )
560572
561573   ROM_REGION( 0x20000, "audiocpu", 0 )   /* 64k for sound cpu code */
562574   ROM_LOAD( "ws17.bin",    0x000000, 0x08000, CRC(e00a8f09) SHA1(e7247ce0ab99d0726f31dee5de5ba33f4ebd183e) )
r15021r15022
564576   ROM_COPY( "audiocpu", 0, 0x018000, 0x08000 )
565577
566578   ROM_REGION( 0x20000, "gfx1", 0 ) // first half of these is blank
567   ROM_LOAD( "ws09.bin",    0x00000, 0x08000, CRC(f05b2b3e) SHA1(6570d795d68655ace9668f32dc0bf5c2d2372411) )   /* characters */
568   ROM_CONTINUE(            0x00000, 0x08000 )
569   ROM_LOAD( "ws11.bin",    0x08000, 0x08000, CRC(2b10e3d2) SHA1(0f5045615b44e2300745fd3afac7f1441352cca5) )
570   ROM_CONTINUE(            0x08000, 0x08000 )
571   ROM_LOAD( "ws10.bin",    0x10000, 0x08000, CRC(efdf7c82) SHA1(65392697f56473cfe90d9733b9c49f2da6f9b7e6) )
572   ROM_CONTINUE(            0x10000, 0x08000 )
573   ROM_LOAD( "ws12.bin",    0x18000, 0x08000, CRC(af993578) SHA1(b250b562deeab3bb2c79002e5e1f0b6e17986848) )
574   ROM_CONTINUE(            0x18000, 0x08000 )
579   ROM_LOAD( "ws09.bin", 0x00000, 0x08000, CRC(f05b2b3e) SHA1(6570d795d68655ace9668f32dc0bf5c2d2372411) )   /* characters */
580   ROM_CONTINUE(         0x00000, 0x08000 )
581   ROM_LOAD( "ws11.bin", 0x08000, 0x08000, CRC(2b10e3d2) SHA1(0f5045615b44e2300745fd3afac7f1441352cca5) )
582   ROM_CONTINUE(         0x08000, 0x08000 )
583   ROM_LOAD( "ws10.bin", 0x10000, 0x08000, CRC(efdf7c82) SHA1(65392697f56473cfe90d9733b9c49f2da6f9b7e6) )
584   ROM_CONTINUE(         0x10000, 0x08000 )
585   ROM_LOAD( "ws12.bin", 0x18000, 0x08000, CRC(af993578) SHA1(b250b562deeab3bb2c79002e5e1f0b6e17986848) )
586   ROM_CONTINUE(         0x18000, 0x08000 )
575587
576588   ROM_REGION( 0x100000, "gfx2", 0 )
577   ROM_LOAD( "ws01.bin",    0x20000, 0x20000, CRC(32bda4bc) SHA1(ed0c0740c7af513b341b2b7ff3e0bf6045e930e9) )   /* Foreground */
578   ROM_LOAD( "ws03.bin",    0x60000, 0x20000, CRC(046b51f8) SHA1(25af752caebdec762582fc0130cf14546110bb54) )
579   ROM_LOAD( "ws02.bin",    0xa0000, 0x20000, CRC(ed9d682e) SHA1(0f79ea09a7af367d175081f72f2bc94f6caad463) )
580   ROM_LOAD( "ws04.bin",    0xe0000, 0x20000, CRC(75f082e5) SHA1(b29f09a3cc9a0ac3f982be3981f5e895050c49e8) )
581   ROM_LOAD( "ws05.bin",    0x00000, 0x20000, CRC(007c8dc0) SHA1(f44576da3b89d6a889fdb564825ac6ce3bb4cffe) )   /* Background */
582   ROM_LOAD( "ws07.bin",    0x40000, 0x20000, CRC(0f0c8d9a) SHA1(f5fe9b5ee4c8ffd7caf5313d13fb5f6e181ed9b6) )
583   ROM_LOAD( "ws06.bin",    0x80000, 0x20000, CRC(459d075e) SHA1(24cd0bffe7c5bbccf653ced0b73579059603d187) )
584   ROM_LOAD( "ws08.bin",    0xc0000, 0x20000, CRC(4d6783b3) SHA1(9870fe9570afeff179b6080581fd6bb187898ff0) )
589   ROM_LOAD( "ws01.bin", 0x20000, 0x20000, CRC(32bda4bc) SHA1(ed0c0740c7af513b341b2b7ff3e0bf6045e930e9) )   /* Foreground */
590   ROM_LOAD( "ws03.bin", 0x60000, 0x20000, CRC(046b51f8) SHA1(25af752caebdec762582fc0130cf14546110bb54) )
591   ROM_LOAD( "ws02.bin", 0xa0000, 0x20000, CRC(ed9d682e) SHA1(0f79ea09a7af367d175081f72f2bc94f6caad463) )
592   ROM_LOAD( "ws04.bin", 0xe0000, 0x20000, CRC(75f082e5) SHA1(b29f09a3cc9a0ac3f982be3981f5e895050c49e8) )
593   ROM_LOAD( "ws05.bin", 0x00000, 0x20000, CRC(007c8dc0) SHA1(f44576da3b89d6a889fdb564825ac6ce3bb4cffe) )   /* Background */
594   ROM_LOAD( "ws07.bin", 0x40000, 0x20000, CRC(0f0c8d9a) SHA1(f5fe9b5ee4c8ffd7caf5313d13fb5f6e181ed9b6) )
595   ROM_LOAD( "ws06.bin", 0x80000, 0x20000, CRC(459d075e) SHA1(24cd0bffe7c5bbccf653ced0b73579059603d187) )
596   ROM_LOAD( "ws08.bin", 0xc0000, 0x20000, CRC(4d6783b3) SHA1(9870fe9570afeff179b6080581fd6bb187898ff0) )
585597
586598   ROM_REGION( 0x100000, "gfx3", ROMREGION_INVERT )
587   ROM_LOAD( "ws25.bin",    0x00000, 0x20000, BAD_DUMP CRC(8092e8e9) SHA1(eabe58ac0f88234b0dddf361f56aad509a83012e) )   /* sprites */
588   ROM_LOAD( "ws26.bin",    0x20000, 0x20000, BAD_DUMP CRC(f6a1f42c) SHA1(6d5503e1a9b00104970292d22301ed28893c5223) )
589   ROM_LOAD( "ws23.bin",    0x40000, 0x20000, CRC(43d58e24) SHA1(99e255faa9716d9102a1223419084fc209ab4024) )
590   ROM_LOAD( "ws24.bin",    0x60000, 0x20000, CRC(20a867ea) SHA1(d3985002931fd4180fc541d61a94371871f3709d) )
591   ROM_LOAD( "ws21.bin",    0x80000, 0x20000, CRC(e23d7296) SHA1(33bbced960be22efc7d2681e06a27feba09e0fc0) )
592   ROM_LOAD( "ws22.bin",    0xa0000, 0x20000, CRC(7150a060) SHA1(73bdd7d6752f7fe9e23073d835dbc468d57865fa) )
593   ROM_LOAD( "ws19.bin",    0xc0000, 0x20000, CRC(c5dd0a96) SHA1(4696ab1b02d40c54a7dacf0bdf90b624b7d6812e) )
594   ROM_LOAD( "ws20.bin",    0xe0000, 0x20000, CRC(f1245c16) SHA1(f3941bf5830995f65a5378326fdb72687fbbddcf) )
599   ROM_LOAD( "ws25.bin", 0x00000, 0x20000, BAD_DUMP CRC(8092e8e9) SHA1(eabe58ac0f88234b0dddf361f56aad509a83012e) )   /* sprites */
600   ROM_LOAD( "ws26.bin", 0x20000, 0x20000, BAD_DUMP CRC(f6a1f42c) SHA1(6d5503e1a9b00104970292d22301ed28893c5223) )
601   ROM_LOAD( "ws23.bin", 0x40000, 0x20000, CRC(43d58e24) SHA1(99e255faa9716d9102a1223419084fc209ab4024) )
602   ROM_LOAD( "ws24.bin", 0x60000, 0x20000, CRC(20a867ea) SHA1(d3985002931fd4180fc541d61a94371871f3709d) )
603   ROM_LOAD( "ws21.bin", 0x80000, 0x20000, CRC(e23d7296) SHA1(33bbced960be22efc7d2681e06a27feba09e0fc0) )
604   ROM_LOAD( "ws22.bin", 0xa0000, 0x20000, CRC(7150a060) SHA1(73bdd7d6752f7fe9e23073d835dbc468d57865fa) )
605   ROM_LOAD( "ws19.bin", 0xc0000, 0x20000, CRC(c5dd0a96) SHA1(4696ab1b02d40c54a7dacf0bdf90b624b7d6812e) )
606   ROM_LOAD( "ws20.bin", 0xe0000, 0x20000, CRC(f1245c16) SHA1(f3941bf5830995f65a5378326fdb72687fbbddcf) )
595607
596608   ROM_REGION( 0x40000, "oki", 0 )   /* ADPCM samples */
597   ROM_LOAD( "bb_08.bin",    0x00000, 0x20000, CRC(deb1b975) SHA1(08f2e9a0a23171201b71d381d091edcd3787c287) )
609   ROM_LOAD( "bb_08.bin", 0x00000, 0x20000, CRC(deb1b975) SHA1(08f2e9a0a23171201b71d381d091edcd3787c287) )
598610ROM_END
599611
600612ROM_START( skysmash )
601613   ROM_REGION( 0x80000, "maincpu", 0 )
602   ROM_LOAD16_BYTE( "rom5",    0x00000, 0x20000, CRC(867f9897) SHA1(7751f9d03d71bd5db0b82bda6e4d5231a30c1ad0) )
603   ROM_LOAD16_BYTE( "rom6",    0x00001, 0x20000, CRC(e9c1d308) SHA1(d7032345b91f87de64ad09ffea49e39b755cac44) )
604   ROM_LOAD16_BYTE( "rom7",    0x40000, 0x20000, CRC(d209db4d) SHA1(1cf85d39d12e92c1b97f7e5a148f3ad56cdca963) )
605   ROM_LOAD16_BYTE( "rom8",    0x40001, 0x20000, CRC(d3646728) SHA1(898606be662214d2ba99e9a3e3cc0c7e7609a719) )
614   ROM_LOAD16_BYTE( "rom5", 0x00000, 0x20000, CRC(867f9897) SHA1(7751f9d03d71bd5db0b82bda6e4d5231a30c1ad0) )
615   ROM_LOAD16_BYTE( "rom6", 0x00001, 0x20000, CRC(e9c1d308) SHA1(d7032345b91f87de64ad09ffea49e39b755cac44) )
616   ROM_LOAD16_BYTE( "rom7", 0x40000, 0x20000, CRC(d209db4d) SHA1(1cf85d39d12e92c1b97f7e5a148f3ad56cdca963) )
617   ROM_LOAD16_BYTE( "rom8", 0x40001, 0x20000, CRC(d3646728) SHA1(898606be662214d2ba99e9a3e3cc0c7e7609a719) )
606618
607619   ROM_REGION( 0x20000, "audiocpu", 0 )
608   ROM_LOAD( "rom2",    0x000000, 0x08000, CRC(75b194cf) SHA1(6aaf36cdab06c0aa5328f5176557387a5d3f7d26) )
609   ROM_CONTINUE(        0x010000, 0x08000 )
620   ROM_LOAD( "rom2",        0x000000, 0x08000, CRC(75b194cf) SHA1(6aaf36cdab06c0aa5328f5176557387a5d3f7d26) )
621   ROM_CONTINUE(            0x010000, 0x08000 )
610622   ROM_COPY( "audiocpu", 0, 0x018000, 0x08000 )
611623
612624   ROM_REGION( 0x20000, "gfx1", 0 )
613   ROM_LOAD( "rom3",    0x00000, 0x10000, CRC(fbb241be) SHA1(cd94c328891538bbd8c062d90a47ddf3d7d05bb0) )   /* characters */
614   ROM_LOAD( "rom4",    0x10000, 0x10000, CRC(ad3cde81) SHA1(2bd0c707e5b67d3699a743d989cb5384cbe37ff7) )
625   ROM_LOAD( "rom3", 0x00000, 0x10000, CRC(fbb241be) SHA1(cd94c328891538bbd8c062d90a47ddf3d7d05bb0) )   /* characters */
626   ROM_LOAD( "rom4", 0x10000, 0x10000, CRC(ad3cde81) SHA1(2bd0c707e5b67d3699a743d989cb5384cbe37ff7) )
615627
616628   ROM_REGION( 0x100000, "gfx2", 0 )
617   ROM_LOAD( "rom9",    0x00000, 0x100000, CRC(b0a5eecf) SHA1(9e8191c7ae4a32dc16aebc37fa942afc531eddd4) )   /* Background + Foreground */
629   ROM_LOAD( "rom9", 0x00000, 0x100000, CRC(b0a5eecf) SHA1(9e8191c7ae4a32dc16aebc37fa942afc531eddd4) )   /* Background + Foreground */
618630
619631   ROM_REGION( 0x80000, "gfx3", 0 )
620   ROM_LOAD( "rom10",   0x00000, 0x080000, CRC(1bbcda5d) SHA1(63915221f70a7dfda6a4d8ac7f5c663c9316610a) )   /* sprites */
632   ROM_LOAD( "rom10", 0x00000, 0x080000, CRC(1bbcda5d) SHA1(63915221f70a7dfda6a4d8ac7f5c663c9316610a) )   /* sprites */
621633
622634   ROM_REGION( 0x40000, "oki", 0 )   /* ADPCM samples */
623   ROM_LOAD( "rom1",    0x00000, 0x20000, CRC(e69986f6) SHA1(de38bf2d5638cb40740882e1abccf7928e43a5a6) )
635   ROM_LOAD( "rom1", 0x00000, 0x20000, CRC(e69986f6) SHA1(de38bf2d5638cb40740882e1abccf7928e43a5a6) )
624636ROM_END
625637
626638
627639/* Game Drivers */
628640
629GAME( 1990, bloodbro, 0,        bloodbro, bloodbro, 0,        ROT0,   "TAD Corporation", "Blood Bros. (set 1)", GAME_NO_COCKTAIL )
630GAME( 1990, bloodbroa,bloodbro, bloodbro, bloodbro, 0,        ROT0,   "TAD Corporation", "Blood Bros. (set 2)", GAME_NO_COCKTAIL )
631GAME( 1990, bloodbrob,bloodbro, bloodbro, bloodbro, 0,        ROT0,   "TAD Corporation", "Blood Bros. (set 3)", GAME_NO_COCKTAIL )
632GAME( 1990, weststry, bloodbro, weststry, weststry, 0,        ROT0,   "bootleg (Datsu)", "West Story (bootleg of Blood Bros.)", GAME_NO_COCKTAIL | GAME_NO_SOUND )
633GAME( 1990, skysmash, 0,        skysmash, skysmash, 0,        ROT270, "Nihon System", "Sky Smasher", 0 )
641GAME( 1990, bloodbro, 0,        bloodbro, bloodbro, 0, ROT0,   "TAD Corporation", "Blood Bros. (set 1)", GAME_NO_COCKTAIL )
642GAME( 1990, bloodbroa,bloodbro, bloodbro, bloodbro, 0, ROT0,   "TAD Corporation", "Blood Bros. (set 2)", GAME_NO_COCKTAIL )
643GAME( 1990, bloodbrob,bloodbro, bloodbro, bloodbro, 0, ROT0,   "TAD Corporation", "Blood Bros. (set 3)", GAME_NO_COCKTAIL )
644GAME( 1990, weststry, bloodbro, weststry, weststry, 0, ROT0,   "bootleg (Datsu)", "West Story (bootleg of Blood Bros.)", GAME_NO_COCKTAIL | GAME_NO_SOUND )
645GAME( 1990, skysmash, 0,        skysmash, skysmash, 0, ROT270, "Nihon System",    "Sky Smasher", 0 )
src/mame/drivers/flower.c
r15021r15022
121121   AM_RANGE(0xa102, 0xa102) AM_READ_PORT("IN0CPU0")
122122   AM_RANGE(0xa103, 0xa103) AM_READ_PORT("IN1CPU0")
123123   AM_RANGE(0xa400, 0xa400) AM_WRITE(sound_command_w)
124   AM_RANGE(0xc000, 0xddff) AM_RAM
124   AM_RANGE(0xc000, 0xddff) AM_RAM AM_SHARE("mainram1")
125125   AM_RANGE(0xde00, 0xdfff) AM_RAM AM_SHARE("spriteram")
126   AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(flower_textram_w)  AM_SHARE("textram")
127   AM_RANGE(0xe000, 0xefff) AM_RAM // only cleared?
128   AM_RANGE(0xf000, 0xf1ff) AM_RAM_WRITE(flower_bg0ram_w)   AM_SHARE("bg0ram")
129   AM_RANGE(0xf200, 0xf200) AM_RAM  AM_SHARE("bg0_scroll")
130   AM_RANGE(0xf800, 0xf9ff) AM_RAM_WRITE(flower_bg1ram_w)  AM_SHARE("bg1ram")
126   AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(flower_textram_w) AM_SHARE("textram")
127   AM_RANGE(0xe000, 0xefff) AM_RAM AM_SHARE("mainram2") // only cleared?
128   AM_RANGE(0xf000, 0xf1ff) AM_RAM_WRITE(flower_bg0ram_w) AM_SHARE("bg0ram")
129   AM_RANGE(0xf200, 0xf200) AM_RAM AM_SHARE("bg0_scroll")
130   AM_RANGE(0xf800, 0xf9ff) AM_RAM_WRITE(flower_bg1ram_w) AM_SHARE("bg1ram")
131131   AM_RANGE(0xfa00, 0xfa00) AM_RAM AM_SHARE("bg1_scroll")
132132ADDRESS_MAP_END
133133
src/mame/drivers/meyc8088.c
r15021r15022
1010  also thanks to Darrell Hal Smith, Kevin Mullins
1111
1212
13  TODO:
14  - fix vblank failure
15  - inputs
16
1317****************************************************************/
1418
1519#include "emu.h"
1620#include "cpu/i86/i86.h"
1721#include "machine/i8155.h"
1822#include "sound/dac.h"
23#include "machine/nvram.h"
1924
2025class meyc8088_state : public driver_device
2126{
r15021r15022
4954static SCREEN_UPDATE_IND16( meyc8088 )
5055{
5156   meyc8088_state *state = screen.machine().driver_data<meyc8088_state>();
57   UINT8 v[5];
58   v[4] = state->m_status << 2 & 0x10; // video5: color prom d4
5259
53   for (int y = 0; y < 512; y++)
60   if (~state->m_status & 2)
5461   {
55      for (int x = 0; x < 64; x++)
56      {
57         UINT8 data = state->m_vram[y*64+x];
58         for (int i = 0; i < 8; i++)
59         {
60            bitmap.pix16(y, x << 3 | i) = (data << i & 0x80) ? 1 : 0;
61         }
62      // screen off
63      bitmap.fill(v[4]);
64      return 0;
65   }
6266
63      }
67   for (offs_t offs = 0x800; offs < 0x4000; offs+=2)
68   {
69      UINT8 y = (offs-0x800) >> 6;
70      UINT8 x = (offs-0x800) << 2;
71
72      v[0] = state->m_vram[offs|0x0000]; // video1: color prom d0
73      v[1] = state->m_vram[offs|0x0001]; // video2: color prom d1
74      v[2] = state->m_vram[offs|0x4000]; // video3: color prom d2
75      v[3] = state->m_vram[offs|0x4001]; // video4: color prom d3
76
77      for (int i = 0; i < 8; i++)
78         bitmap.pix16(y, x | i) = ((v[0] << i) >> 7 & 1) | ((v[1] << i) >> 6 & 2) | ((v[2] << i) >> 5 & 4) | ((v[3] << i) >> 4 & 8) | v[4];
6479   }
6580
6681   return 0;
6782}
6883
84static SCREEN_VBLANK( meyc8088 )
85{
86   meyc8088_state *state = screen.machine().driver_data<meyc8088_state>();
6987
88   // INTR on LC255 (pulses at start and end of vblank), INTA hardwired to $20
89   generic_pulse_irq_line_and_vector(state->m_maincpu, 0, 0x20, 1);
90}
91
92
7093/***************************************************************************
7194
7295  I/O
r15021r15022
107130
108131
109132static ADDRESS_MAP_START( meyc8088_map, AS_PROGRAM, 8, meyc8088_state )
110   AM_RANGE(0x00000, 0x007ff) AM_RAM
133   AM_RANGE(0x00000, 0x007ff) AM_RAM AM_SHARE("nvram")
111134   AM_RANGE(0x70000, 0x77fff) AM_RAM AM_SHARE("vram")
112135   AM_RANGE(0xb0000, 0xb00ff) AM_DEVREADWRITE("i8155_2", i8155_device, memory_r, memory_w)
113136   AM_RANGE(0xb0800, 0xb0807) AM_DEVREADWRITE("i8155_2", i8155_device, io_r, io_w)
114137   AM_RANGE(0xb1000, 0xb10ff) AM_DEVREADWRITE("i8155_1", i8155_device, memory_r, memory_w)
115138   AM_RANGE(0xb1800, 0xb1807) AM_DEVREADWRITE("i8155_1", i8155_device, io_r, io_w)
116139   AM_RANGE(0xb2000, 0xb2000) AM_WRITE(drive_w)
117//  AM_RANGE(0xb3000, 0xb3000) AM_NOP // 8251A, debug related
118//  AM_RANGE(0xb3800, 0xb3800) AM_NOP // "
140   AM_RANGE(0xb3000, 0xb3000) AM_NOP // i8251A data (debug related, unpopulated on sold boards)
141   AM_RANGE(0xb3800, 0xb3800) AM_NOP // "
119142   AM_RANGE(0xb4000, 0xb4000) AM_READWRITE(screen_flip_r, screen_flip_w)
120143   AM_RANGE(0xb5000, 0xb5000) AM_READWRITE(video5_flip_r, video5_flip_w)
121144   AM_RANGE(0xf8000, 0xfffff) AM_ROM
122145ADDRESS_MAP_END
123146
124147
148static READ8_DEVICE_HANDLER(meyc8088_input_r)
149{
150   meyc8088_state *state = device->machine().driver_data<meyc8088_state>();
151   UINT8 ret = 0xff;
152
153   // multiplexed switch inputs
154   if (~state->m_common & 1) ret &= input_port_read_safe(device->machine(), "C0", 0); // bit switches
155   if (~state->m_common & 2) ret &= input_port_read_safe(device->machine(), "C1", 0); // control switches
156   if (~state->m_common & 4) ret &= input_port_read_safe(device->machine(), "C2", 0); // light switches
157   if (~state->m_common & 8) ret &= input_port_read_safe(device->machine(), "C3", 0); // light switches
158
159   return ret;
160}
161
162static READ8_DEVICE_HANDLER(meyc8088_status_r)
163{
164   meyc8088_state *state = device->machine().driver_data<meyc8088_state>();
165
166   // d0: /CR2
167   // d1: screen on
168   // d2: video5
169   // d3: N/C
170   // d4: battery ok
171   // d5: /drive on
172   return (state->m_status & 7) | 0x18;
173}
174
175
125176static WRITE8_DEVICE_HANDLER(meyc8088_lights1_w)
126177{
127178   // lite 1-8
r15021r15022
148199
149200   // d2-d5: /common
150201   state->m_common = data >> 2 & 0xf;
151
152   logerror("i8155 Port C: %02X\n", data);
153202}
154203
155static WRITE_LINE_DEVICE_HANDLER(meyc8088_i8155_1_timer_out)
204static WRITE_LINE_DEVICE_HANDLER(meyc8088_sound_out)
156205{
157   // clock 8251A
158   //logerror("Timer 1 out %d\n", state);
206   dac_signed_w(device->machine().device("dac"), 0, state ? 0x7f : 0);
159207}
160208
161static WRITE_LINE_DEVICE_HANDLER(meyc8088_i8155_2_timer_out)
162{
163   // sound dac
164   //logerror("Timer 2 out %d\n", state);
165}
166209
167
168static READ8_DEVICE_HANDLER(meyc8088_status_r)
169{
170   meyc8088_state *state = device->machine().driver_data<meyc8088_state>();
171
172   // d0: /CR2
173   // d1: screen on
174   // d2: video5
175   // d3: N/C
176   // d4: battery ok
177   // d5: /drive on
178   return (state->m_status & 7) | 0x18;
179}
180
181210static const i8155_interface i8155_intf[2] =
182211{
183212   {
184213      // all ports set to input
185      DEVCB_INPUT_PORT("IN0"),
214      DEVCB_HANDLER(meyc8088_input_r),
186215      DEVCB_NULL,
187      DEVCB_INPUT_PORT("IN1"),
216      DEVCB_INPUT_PORT("SW"), // filtered switch inputs
188217      DEVCB_NULL,
189218      DEVCB_HANDLER(meyc8088_status_r),
190219      DEVCB_NULL,
191      DEVCB_LINE(meyc8088_i8155_1_timer_out)
220      DEVCB_NULL // i8251A trigger txc/rxc (debug related, unpopulated on sold boards)
192221   },
193222   {
194223      // all ports set to output
r15021r15022
198227      DEVCB_HANDLER(meyc8088_lights1_w),
199228      DEVCB_NULL,
200229      DEVCB_HANDLER(meyc8088_common_w),
201      DEVCB_LINE(meyc8088_i8155_2_timer_out)
230      DEVCB_LINE(meyc8088_sound_out)
202231   }
203232};
204233
r15021r15022
210239***************************************************************************/
211240
212241static INPUT_PORTS_START( gldarrow )
213   PORT_START("IN0")
214   PORT_DIPNAME( 0x01, 0x01, "IN0 1" )
242   PORT_START("SW")
243   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_VBLANK )
244   PORT_DIPNAME( 0x02, 0x02, "SW 2" )
245   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
246   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
247   PORT_DIPNAME( 0x04, 0x04, "SW 3" )
248   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
249   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
250   PORT_DIPNAME( 0x08, 0x08, "SW 4" )
251   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
252   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
253   PORT_DIPNAME( 0x10, 0x10, "SW 5" )
254   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
255   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
256   PORT_DIPNAME( 0x20, 0x20, "SW 6" )
257   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
258   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
259   PORT_DIPNAME( 0x40, 0x40, "SW 7" )
260   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
261   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
262   PORT_DIPNAME( 0x80, 0x80, "SW 8" )
263   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
264   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
265
266   PORT_START("C0")
267   PORT_DIPNAME( 0x01, 0x00, "Bit Switch 1" )      PORT_DIPLOCATION("BSW:1")
268   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
269   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
270   PORT_DIPNAME( 0x02, 0x00, "Bit Switch 2" )      PORT_DIPLOCATION("BSW:2")
271   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
272   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
273   PORT_DIPNAME( 0x04, 0x00, "Bit Switch 3" )      PORT_DIPLOCATION("BSW:3")
274   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
275   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
276   PORT_DIPNAME( 0x08, 0x00, "Bit Switch 4" )      PORT_DIPLOCATION("BSW:4")
277   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
278   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
279   PORT_DIPNAME( 0x10, 0x00, "Bit Switch 5" )      PORT_DIPLOCATION("BSW:5")
280   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
281   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
282   PORT_DIPNAME( 0x20, 0x00, "Bit Switch 6" )      PORT_DIPLOCATION("BSW:6")
283   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
284   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
285   PORT_DIPNAME( 0x40, 0x00, "Bit Switch 7" )      PORT_DIPLOCATION("BSW:7")
286   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
287   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
288   PORT_DIPNAME( 0x80, 0x00, "Bit Switch 8" )      PORT_DIPLOCATION("BSW:8")
289   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
290   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
291
292   PORT_START("C1")
293   PORT_DIPNAME( 0x01, 0x01, "C1 1" )
215294   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
216295   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
217   PORT_DIPNAME( 0x02, 0x02, "IN0 2" )
296   PORT_DIPNAME( 0x02, 0x02, "C1 2" )
218297   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
219298   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
220   PORT_DIPNAME( 0x04, 0x04, "IN0 3" )
299   PORT_DIPNAME( 0x04, 0x04, "C1 3" )
221300   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
222301   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
223   PORT_DIPNAME( 0x08, 0x08, "IN0 4" )
302   PORT_DIPNAME( 0x08, 0x08, "C1 4" )
224303   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
225304   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
226   PORT_DIPNAME( 0x10, 0x10, "IN0 5" )
305   PORT_DIPNAME( 0x10, 0x10, "C1 5" )
227306   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
228307   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
229   PORT_DIPNAME( 0x20, 0x20, "IN0 6" )
308   PORT_DIPNAME( 0x20, 0x20, "C1 6" )
230309   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
231310   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
232   PORT_DIPNAME( 0x40, 0x40, "IN0 7" )
311   PORT_DIPNAME( 0x40, 0x40, "C1 7" )
233312   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
234313   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
235   PORT_DIPNAME( 0x80, 0x80, "IN0 8" )
314   PORT_DIPNAME( 0x80, 0x80, "C1 8" )
236315   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
237316   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
238317
239   PORT_START("IN1")
240   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_VBLANK )
241   PORT_DIPNAME( 0x02, 0x02, "IN1 2" )
318   PORT_START("C2")
319   PORT_DIPNAME( 0x01, 0x01, "C2 1" )
320   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
321   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
322   PORT_DIPNAME( 0x02, 0x02, "C2 2" )
242323   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
243324   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
244   PORT_DIPNAME( 0x04, 0x04, "IN1 3" )
325   PORT_DIPNAME( 0x04, 0x04, "C2 3" )
245326   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
246327   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
247   PORT_DIPNAME( 0x08, 0x08, "IN1 4" )
328   PORT_DIPNAME( 0x08, 0x08, "C2 4" )
248329   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
249330   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
250   PORT_DIPNAME( 0x10, 0x10, "IN1 5" )
331   PORT_DIPNAME( 0x10, 0x10, "C2 5" )
251332   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
252333   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
253   PORT_DIPNAME( 0x20, 0x20, "IN1 6" )
334   PORT_DIPNAME( 0x20, 0x20, "C2 6" )
254335   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
255336   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
256   PORT_DIPNAME( 0x40, 0x40, "IN1 7" )
337   PORT_DIPNAME( 0x40, 0x40, "C2 7" )
257338   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
258339   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
259   PORT_DIPNAME( 0x80, 0x80, "IN1 8" )
340   PORT_DIPNAME( 0x80, 0x80, "C2 8" )
260341   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
261342   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
262343
263   PORT_START("IN2")
264   PORT_DIPNAME( 0x01, 0x01, "IN2 1" )
344   PORT_START("C3")
345   PORT_DIPNAME( 0x01, 0x01, "C3 1" )
265346   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
266347   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
267   PORT_DIPNAME( 0x02, 0x02, "IN2 2" )
348   PORT_DIPNAME( 0x02, 0x02, "C3 2" )
268349   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
269350   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
270   PORT_DIPNAME( 0x04, 0x04, "IN2 3" )
351   PORT_DIPNAME( 0x04, 0x04, "C3 3" )
271352   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
272353   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
273   PORT_DIPNAME( 0x08, 0x08, "IN2 4" )
354   PORT_DIPNAME( 0x08, 0x08, "C3 4" )
274355   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
275356   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
276   PORT_DIPNAME( 0x10, 0x10, "IN2 5" )
357   PORT_DIPNAME( 0x10, 0x10, "C3 5" )
277358   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
278359   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
279   PORT_DIPNAME( 0x20, 0x20, "IN2 6" )
360   PORT_DIPNAME( 0x20, 0x20, "C3 6" )
280361   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
281362   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
282   PORT_DIPNAME( 0x40, 0x40, "IN2 7" )
363   PORT_DIPNAME( 0x40, 0x40, "C3 7" )
283364   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
284365   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
285   PORT_DIPNAME( 0x80, 0x80, "IN2 8" )
366   PORT_DIPNAME( 0x80, 0x80, "C3 8" )
286367   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
287368   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
288369INPUT_PORTS_END
r15021r15022
294375
295376***************************************************************************/
296377
297static INTERRUPT_GEN( meyc8088_irq )
298{
299   // INTR on LC255, INTA hardwired to $20
300   device_set_input_line_and_vector(device, 0, HOLD_LINE, 0x20);
301}
302
303378static MACHINE_CONFIG_START( meyc8088, meyc8088_state )
304379
305380   /* basic machine hardware */
306381   MCFG_CPU_ADD("maincpu", I8088, XTAL_15MHz / 3)
307382   MCFG_CPU_PROGRAM_MAP(meyc8088_map)
308   MCFG_CPU_VBLANK_INT("screen", meyc8088_irq)
309383
310   MCFG_I8155_ADD("i8155_1", XTAL_15MHz / 3, i8155_intf[0])
311   MCFG_I8155_ADD("i8155_2", XTAL_15MHz / 3, i8155_intf[1])
384   MCFG_I8155_ADD("i8155_1", XTAL_15MHz / (3*2*1), i8155_intf[0])
385   MCFG_I8155_ADD("i8155_2", XTAL_15MHz / (3*2*32), i8155_intf[1])
312386
387   MCFG_NVRAM_ADD_0FILL("nvram")
388
313389   /* video hardware */
314390   MCFG_SCREEN_ADD("screen", RASTER)
315   MCFG_SCREEN_REFRESH_RATE(60)
316   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500))
317   MCFG_SCREEN_SIZE(512,512)
318   MCFG_SCREEN_VISIBLE_AREA(0, 512-1, 0, 512-1)
391   MCFG_SCREEN_RAW_PARAMS(XTAL_15MHz/3, 320, 0, 256, 261, 0, 224)
319392   MCFG_SCREEN_UPDATE_STATIC(meyc8088)
393   MCFG_SCREEN_VBLANK_STATIC(meyc8088)
320394
321   MCFG_PALETTE_LENGTH(8)
395   MCFG_PALETTE_LENGTH(32)
322396
397   /* sound hardware */
398   MCFG_SPEAKER_STANDARD_MONO("mono")
399
400   MCFG_SOUND_ADD("dac", DAC, 0)
401   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
323402MACHINE_CONFIG_END
324403
325404
r15021r15022
334413ROM_END
335414
336415
337GAME( 1984, gldarrow, 0,        meyc8088, gldarrow, 0, ROT0,  "Meyco Games, Inc.", "Golden Arrow", GAME_NOT_WORKING | GAME_NO_SOUND )
416GAME( 1984, gldarrow, 0,        meyc8088, gldarrow, 0, ROT0,  "Meyco Games, Inc.", "Golden Arrow", GAME_NOT_WORKING | GAME_WRONG_COLORS )
src/emu/video/mc6845.c
r15021r15022
746746      if (m_end_update != NULL)
747747         m_end_update(this, bitmap, cliprect, param);
748748   }
749   //else
750      //popmessage("Invalid MC6845 screen parameters - display disabled!!!");
749   else
750      popmessage("Invalid MC6845 screen parameters - display disabled!!!");
751751   return 0;
752752}
753753
src/emu/rendersw.c
r15021r15022
6060   // internal helpers
6161   static inline bool is_opaque(float alpha) { return (alpha >= (_NoDestRead ? 0.5f : 1.0f)); }
6262   static inline bool is_transparent(float alpha) { return (alpha < (_NoDestRead ? 0.5f : 0.0001f)); }
63   static inline rgb_t apply_intensity(rgb_t color, int intensity) { return MAKE_RGB((RGB_RED(color) * intensity) >> 8, (RGB_GREEN(color) * intensity) >> 8, (RGB_BLUE(color) * intensity) >> 8); }
63   static inline rgb_t apply_intensity(int intensity, rgb_t color) { return MAKE_RGB((RGB_RED(color) * intensity) >> 8, (RGB_GREEN(color) * intensity) >> 8, (RGB_BLUE(color) * intensity) >> 8); }
6464   static inline float round_nearest(float f) { return floor(f + 0.5f); }
6565
6666   // destination pixels are written based on the values of the template parameters
src/emu/rendlay.c
r15021r15022
486486      {
487487         m_maxstate = xml_get_attribute_int_with_subst(machine, *compnode, "maxstate", 999);
488488      }
489      if (newcomp.m_type == component::CTYPE_REEL)
490      {
491         m_maxstate = 65536;
492      }
489493   }
490494
491495   // determine the scale/offset for normalization
r15021r15022
642646      m_type = CTYPE_SIMPLECOUNTER;
643647      m_digits = xml_get_attribute_int_with_subst(machine, compnode, "digits", 2);
644648   }
649   // fruit machine reels
650   else if (strcmp(compnode.name, "reel") == 0)
651   {
652      m_type = CTYPE_REEL;
645653
654      astring symbollist = xml_get_attribute_string_with_subst(machine, compnode, "symbollist", "0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15");
655
656      // split out position names from string and figure out our number of symbols
657      int location = -1;
658      m_numstops = 0;
659      location=symbollist.find(0,",");
660      while (location!=-1)
661      {   
662         m_stopnames[m_numstops] = symbollist;   
663         m_stopnames[m_numstops].substr(0, location);
664         symbollist.substr(location+1, symbollist.len()-(location-1));
665         m_numstops++;
666         location=symbollist.find(0,",");
667      }
668      m_stopnames[m_numstops++] = symbollist;
669
670      m_stateoffset = xml_get_attribute_int_with_subst(machine, compnode, "stateoffset", 0);
671      m_numsymbolsvisible = xml_get_attribute_int_with_subst(machine, compnode, "numsymbolsvisible", 3);
672      m_reelreversed = xml_get_attribute_int_with_subst(machine, compnode, "reelreversed", 0);
673   }
646674   // led7seg nodes
647675   else if (strcmp(compnode.name, "led7seg") == 0)
648676      m_type = CTYPE_LED7SEG;
r15021r15022
744772         draw_simplecounter(machine, dest, bounds, state);
745773         break;
746774
775      case CTYPE_REEL:
776         draw_reel(machine, dest, bounds, state);
777         break;
778
747779      default:
748780         throw emu_fatalerror("Unknown component type requested draw()");
749781   }
r15021r15022
940972   draw_text(machine, dest, bounds);
941973}
942974
975/* state is a normalized value between 0 and 65536 so that we don't need to worry about how many motor steps here or in the .lay, only the number of symbols */
976void layout_element::component::draw_reel(running_machine &machine, bitmap_argb32 &dest, const rectangle &bounds, int state)
977{
978   const int max_state_used = 0x10000;
943979
980   // shift the reels a bit based on this param, allows fine tuning
981   int use_state = (state + m_stateoffset) % max_state_used;
982
983   // compute premultiplied colors
984   UINT32 r = m_color.r * 255.0;
985   UINT32 g = m_color.g * 255.0;
986   UINT32 b = m_color.b * 255.0;
987   UINT32 a = m_color.a * 255.0;
988
989   // get the width of the string
990   render_font *font = machine.render().font_alloc("default");
991   float aspect = 1.0f;
992   INT32 width;
993   int curry = 0;
994   int num_shown = m_numsymbolsvisible;
995
996   int ourheight = bounds.height();
997
998   for (int fruit = 0;fruit<m_numstops;fruit++)
999   {
1000
1001
1002      int basey;
1003
1004      if (m_reelreversed==1)
1005      {
1006         basey = bounds.min_y + ((use_state)*(ourheight/num_shown)/(max_state_used/m_numstops)) + curry;
1007      }
1008      else
1009      {
1010         basey = bounds.min_y - ((use_state)*(ourheight/num_shown)/(max_state_used/m_numstops)) + curry;
1011      }
1012           
1013      // wrap around...
1014      if (basey < bounds.min_y)
1015         basey += ((max_state_used)*(ourheight/num_shown)/(max_state_used/m_numstops));
1016      if (basey > bounds.max_y)
1017         basey -= ((max_state_used)*(ourheight/num_shown)/(max_state_used/m_numstops));
1018
1019      int endpos = basey+ourheight/num_shown;
1020
1021      // only render the symbol / text if it's atually in view because the code is SLOW
1022      if ((endpos >= bounds.min_y) && (basey <= bounds.max_y))
1023      {
1024
1025         while (1)
1026         {
1027            width = font->string_width(ourheight/num_shown, aspect, m_stopnames[fruit]);
1028            if (width < bounds.width())
1029               break;
1030            aspect *= 0.9f;
1031         }
1032   
1033         INT32 curx;
1034         curx = bounds.min_x + (bounds.width() - width) / 2;
1035
1036
1037         // allocate a temporary bitmap
1038         bitmap_argb32 tempbitmap(dest.width(), dest.height());
1039
1040         // loop over characters
1041         for (const char *s = m_stopnames[fruit]; *s != 0; s++)
1042         {
1043            // get the font bitmap
1044            rectangle chbounds;
1045            font->get_scaled_bitmap_and_bounds(tempbitmap, ourheight/num_shown, aspect, *s, chbounds);
1046
1047            // copy the data into the target
1048            for (int y = 0; y < chbounds.height(); y++)
1049            {
1050               int effy = basey + y;
1051
1052               if (effy >= bounds.min_y && effy <= bounds.max_y)
1053               {
1054                  UINT32 *src = &tempbitmap.pix32(y);
1055                  UINT32 *d = &dest.pix32(effy);
1056                  for (int x = 0; x < chbounds.width(); x++)
1057                  {
1058                     int effx = curx + x + chbounds.min_x;
1059                     if (effx >= bounds.min_x && effx <= bounds.max_x)
1060                     {
1061
1062                        UINT32 spix = RGB_ALPHA(src[x]);
1063                        if (spix != 0)
1064                        {
1065                           UINT32 dpix = d[effx];
1066                           UINT32 ta = (a * (spix + 1)) >> 8;
1067                           UINT32 tr = (r * ta + RGB_RED(dpix) * (0x100 - ta)) >> 8;
1068                           UINT32 tg = (g * ta + RGB_GREEN(dpix) * (0x100 - ta)) >> 8;
1069                           UINT32 tb = (b * ta + RGB_BLUE(dpix) * (0x100 - ta)) >> 8;
1070                           d[effx] = MAKE_ARGB(0xff, tr, tg, tb);
1071                        }
1072                     }
1073                  }
1074               }
1075            }
1076
1077            // advance in the X direction
1078            curx += font->char_width(ourheight/num_shown, aspect, *s);
1079
1080         }
1081      }
1082      curry += ourheight/num_shown;
1083   }
1084
1085   // free the temporary bitmap and font
1086   machine.render().font_free(font);
1087}
1088
1089
1090
1091
9441092//-------------------------------------------------
9451093//  load_bitmap - load a PNG file with artwork for
9461094//  a component
src/emu/rendlay.h
r15021r15022
122122         CTYPE_LED16SEGSC,
123123         CTYPE_DOTMATRIX,
124124         CTYPE_SIMPLECOUNTER,
125         CTYPE_REEL,
125126         CTYPE_MAX
126127      };
127128
r15021r15022
130131      void draw_disk(bitmap_argb32 &dest, const rectangle &bounds);
131132      void draw_text(running_machine &machine, bitmap_argb32 &dest, const rectangle &bounds);
132133      void draw_simplecounter(running_machine &machine, bitmap_argb32 &dest, const rectangle &bounds, int state);
134      void draw_reel(running_machine &machine, bitmap_argb32 &dest, const rectangle &bounds, int state);
133135      void load_bitmap();
134136      void draw_led7seg(bitmap_argb32 &dest, const rectangle &bounds, int pattern);
135137      void draw_led14seg(bitmap_argb32 &dest, const rectangle &bounds, int pattern);
r15021r15022
162164      astring            m_imagefile;   // name of the image file (for lazy loading)
163165      astring            m_alphafile;   // name of the alpha file (for lazy loading)
164166      bool            m_hasalpha;      // is there any alpha component present?
167
168      #define MAX_STOPS 256
169      // stuff for fruit machine reels
170      int               m_numstops;
171      astring            m_stopnames[MAX_STOPS];
172      int               m_stateoffset;
173      int               m_reelreversed;
174      int               m_numsymbolsvisible;
175
165176   };
166177
167178   // a texture encapsulates a texture for a given element in a given state
src/emu/memory.c
r15021r15022
29302930            throw emu_fatalerror("Unable to allocate bank for RAM/ROM area %X-%X\n", bytestart, byteend);
29312931      }
29322932
2933      // allocate the bank
2933      // if no tag, create a unique one
29342934      membank = global_alloc(memory_bank(*this, banknum, bytestart, byteend, tag));
2935      manager().m_banklist.append(*membank);
2936
2937      // for named banks, add to the map and register for save states
2938      if (tag != NULL)
2939         manager().m_bankmap.add_unique_hash(tag, membank, false);
2935      astring temptag;
2936      if (tag == NULL)
2937         tag = temptag.format("anon_%p", membank);
2938      manager().m_banklist.append(tag, *membank);
29402939   }
29412940
29422941   // add a reference for this space
src/emu/memory.h
r15021r15022
829829private:
830830   // internal helpers
831831   memory_bank *first_bank() const { return m_banklist.first(); }
832   memory_bank *bank(const char *tag) const { return m_bankmap.find(tag); }
832   memory_bank *bank(const char *tag) const { return m_banklist.find(tag); }
833833   memory_region *region(const char *tag) { return m_regionlist.find(tag); }
834834   memory_share *shared(const char *tag) { return m_sharelist.find(tag); }
835835   void bank_reattach();
r15021r15022
844844   simple_list<address_space>   m_spacelist;         // list of address spaces
845845   simple_list<memory_block>   m_blocklist;         // head of the list of memory blocks
846846
847   simple_list<memory_bank>   m_banklist;            // data gathered for each bank
848   tagmap_t<memory_bank *>      m_bankmap;            // map for fast bank lookups
847   tagged_list<memory_bank>   m_banklist;            // data gathered for each bank
849848   UINT8                  m_banknext;            // next bank to allocate
850849
851850   tagged_list<memory_share>   m_sharelist;         // map for share lookups

Previous 15994 Revisions Next


© 1998-2018 The MESS Team