Previous 199869 Revisions Next

r29235 Friday 4th April, 2014 at 01:14:22 UTC by Roberto Fresca
Double Crown: Added button-lamps support, coin in and coin out
counters, MAX693 watchdog reset, minor input fixes, and added
technical notes. [Roberto Fresca]
[src/mame]mame.mak
[src/mame/drivers]dblcrown.c
[src/mame/layout]dblcrown.lay*

trunk/src/mame/layout/dblcrown.lay
r0r29235
1<?xml version="1.0"?>
2<mamelayout version="2">
3<!--
4     Double Crown control panel
5     Written by Roberto Fresca.
6-->
7
8<!-- define button-lamps -->
9
10   <element name="hold1" defstate="0">
11      <rect state="1">
12         <color red="1.0" green="0.0" blue="0.0" />
13      </rect>
14      <rect state="0">
15         <color red="0.15" green="0.0" blue="0.0" />
16      </rect>
17      <text string="HOLD 1">
18         <color red="0.0" green="0.0" blue="0.0" />
19         <bounds x="0" y="0.3" width="1" height="0.4" />
20      </text>
21   </element>
22
23   <element name="hold2" defstate="0">
24      <rect state="1">
25         <color red="1.0" green="0.0" blue="0.0" />
26      </rect>
27      <rect state="0">
28         <color red="0.15" green="0.0" blue="0.0" />
29      </rect>
30      <text string="HOLD 2">
31         <color red="0.0" green="0.0" blue="0.0" />
32         <bounds x="0" y="0.3" width="1" height="0.4" />
33      </text>
34   </element>
35
36   <element name="hold3" defstate="0">
37      <rect state="1">
38         <color red="1.0" green="0.0" blue="0.0" />
39      </rect>
40      <rect state="0">
41         <color red="0.15" green="0.0" blue="0.0" />
42      </rect>
43      <text string="HOLD 3">
44         <color red="0.0" green="0.0" blue="0.0" />
45         <bounds x="0" y="0.3" width="1" height="0.4" />
46      </text>
47   </element>
48
49   <element name="hold4" defstate="0">
50      <rect state="1">
51         <color red="1.0" green="0.0" blue="0.0" />
52      </rect>
53      <rect state="0">
54         <color red="0.15" green="0.0" blue="0.0" />
55      </rect>
56      <text string="HOLD 4">
57         <color red="0.0" green="0.0" blue="0.0" />
58         <bounds x="0" y="0.3" width="1" height="0.4" />
59      </text>
60   </element>
61
62   <element name="hold5" defstate="0">
63      <rect state="1">
64         <color red="1.0" green="0.0" blue="0.0" />
65      </rect>
66      <rect state="0">
67         <color red="0.15" green="0.0" blue="0.0" />
68      </rect>
69      <text string="HOLD 5">
70         <color red="0.0" green="0.0" blue="0.0" />
71         <bounds x="0" y="0.3" width="1" height="0.4" />
72      </text>
73   </element>
74
75   <element name="bet" defstate="0">
76      <rect state="1">
77         <color red="1.0" green="0.0" blue="1.0" />
78      </rect>
79      <rect state="0">
80         <color red="0.15" green="0.0" blue="0.15" />
81      </rect>
82      <text string="BET">
83         <color red="0.0" green="0.0" blue="0.0" />
84         <bounds x="0" y="0.3" width="1" height="0.4" />
85      </text>
86   </element>
87
88   <element name="deal" defstate="0">
89      <rect state="1">
90         <color red="0.0" green="1.0" blue="0.0" />
91      </rect>
92      <rect state="0">
93         <color red="0.0" green="0.15" blue="0.0" />
94      </rect>
95      <text string="DEAL">
96         <color red="0.0" green="0.0" blue="0.0" />
97         <bounds x="0" y="0.3" width="1" height="0.4" />
98      </text>
99   </element>
100
101
102<!-- define basic elements -->
103
104   <element name="cpanel">
105      <rect>
106         <color red="0.0" green="0.0" blue="0.0" />
107      </rect>
108   </element>
109
110   <element name="hold_b" defstate="0">
111      <rect state="1">
112         <color red="0.8" green="0.0" blue="0.0" />
113      </rect>
114      <rect state="0">
115         <color red="0.1" green="0.0" blue="0.0" />
116      </rect>
117   </element>
118
119   <element name="bet_b" defstate="0">
120      <rect state="1">
121         <color red="0.8" green="0.0" blue="0.8" />
122      </rect>
123      <rect state="0">
124         <color red="0.1" green="0.0" blue="0.1" />
125      </rect>
126   </element>
127
128   <element name="deal_b" defstate="0">
129      <rect state="1">
130         <color red="0.0" green="0.8" blue="0.0" />
131      </rect>
132      <rect state="0">
133         <color red="0.0" green="0.1" blue="0.0" />
134      </rect>
135   </element>
136
137
138<!-- define background -->
139
140   <view name="Button Lamps">
141      <screen index="0">
142         <bounds left="0" top="0" right="4" bottom="3" />
143      </screen>
144
145      <bezel element="cpanel">
146         <bounds left="0" right="4" top="3" bottom="3.34" />
147      </bezel>
148
149<!-- define lamps -->
150
151      <bezel name="lamp0" element="deal_b">
152         <bounds x="3.50" y="3.05" width="0.40" height="0.24" />
153      </bezel>
154      <bezel name="lamp0" element="deal">
155         <bounds x="3.52" y="3.07" width="0.36" height="0.20" />
156      </bezel>
157
158
159      <bezel name="lamp1" element="bet_b">
160         <bounds x="3.00" y="3.05" width="0.40" height="0.24" />
161      </bezel>
162      <bezel name="lamp1" element="bet">
163         <bounds x="3.02" y="3.07" width="0.36" height="0.20" />
164      </bezel>
165
166
167      <bezel name="lamp3" element="hold_b">
168         <bounds x="2.10" y="3.05" width="0.40" height="0.24" />
169      </bezel>
170      <bezel name="lamp3" element="hold5">
171         <bounds x="2.12" y="3.07" width="0.36" height="0.20" />
172      </bezel>
173
174
175      <bezel name="lamp4" element="hold_b">
176         <bounds x="1.60" y="3.05" width="0.40" height="0.24" />
177      </bezel>
178      <bezel name="lamp4" element="hold4">
179         <bounds x="1.62" y="3.07" width="0.36" height="0.20" />
180      </bezel>
181
182
183      <bezel name="lamp5" element="hold_b">
184         <bounds x="1.10" y="3.05" width="0.40" height="0.24" />
185      </bezel>
186      <bezel name="lamp5" element="hold3">
187         <bounds x="1.12" y="3.07" width="0.36" height="0.20" />
188      </bezel>
189
190
191      <bezel name="lamp6" element="hold_b">
192         <bounds x="0.60" y="3.05" width="0.40" height="0.24" />
193      </bezel>
194      <bezel name="lamp6" element="hold2">
195         <bounds x="0.62" y="3.07" width="0.36" height="0.20" />
196      </bezel>
197
198
199      <bezel name="lamp7" element="hold_b">
200         <bounds x="0.10" y="3.05" width="0.40" height="0.24" />
201      </bezel>
202      <bezel name="lamp7" element="hold1">
203         <bounds x="0.12" y="3.07" width="0.36" height="0.20" />
204      </bezel>
205
206
207   </view>
208</mamelayout>
Property changes on: trunk/src/mame/layout/dblcrown.lay
Added: svn:mime-type
   + text/xml
Added: svn:eol-style
   + native
trunk/src/mame/drivers/dblcrown.c
r29234r29235
11// license:MAME
2// copyright-holders:Angelo Salese
2// copyright-holders: Angelo Salese, Roberto Fresca.
33/***************************************************************************
44
55    Double Crown (c) 1997 Cadence Technology / Dyna
66
7    driver by Angelo Salese
7    Driver by Angelo Salese
8   Additional work by Roberto Fresca.
89
910    TODO:
1011    - Bogus "Hole" in main screen display;
1112    - Is the background pen really black?
1213    - Lots of unmapped I/Os (game doesn't make much use of the HW);
13    - outputs / lamps;
1414    - video / irq timings;
1515
1616    Notes:
r29234r29235
2222      these ...
2323
2424============================================================================
25
2526    Excellent System
2627    boardlabel: ES-9411B
2728
r29234r29235
3334    2 * N341256P-25 - CMOS SRAM 256K-BIT(32KX8)
3435    4 * dipsw 8pos
3536    YMZ284-D (ay8910, but without i/o ports)
36    MAXIM MAX693ACPE is a "Microprocessor Supervisory Circuit", for watchdog? and for keeping nvram stable?
37    MAXIM MAX693ACPE is a "Microprocessor Supervisory Circuit", for watchdog
38   and for nvram functions.
3739
3840***************************************************************************/
3941
4042
43#define MAIN_CLOCK         XTAL_28_63636MHz
44#define CPU_CLOCK         MAIN_CLOCK / 6
45#define SND_CLOCK         MAIN_CLOCK / 12
46
4147#include "emu.h"
4248#include "cpu/z80/z80.h"
4349#include "sound/ay8910.h"
4450#include "machine/nvram.h"
4551
46#define MAIN_CLOCK XTAL_28_63636MHz
47
52#include "dblcrown.lh"
4853#define DEBUG_VRAM
4954
5055class dblcrown_state : public driver_device
r29234r29235
9095   DECLARE_WRITE8_MEMBER(output_w);
9196   DECLARE_READ8_MEMBER(lamps_r);
9297   DECLARE_WRITE8_MEMBER(lamps_w);
98   DECLARE_WRITE8_MEMBER(watchdog_w);
9399
94100   TIMER_DEVICE_CALLBACK_MEMBER(dblcrown_irq_scanline);
95101   DECLARE_PALETTE_INIT(dblcrown);
102
96103protected:
97104   // driver_device overrides
98105   virtual void machine_start();
r29234r29235
103110
104111void dblcrown_state::video_start()
105112{
106   m_pal_ram = auto_alloc_array(machine(), UINT8, 0x200*2);
107   m_vram = auto_alloc_array(machine(), UINT8, 0x1000*0x10);
113   m_pal_ram = auto_alloc_array(machine(), UINT8, 0x200 * 2);
114   m_vram = auto_alloc_array(machine(), UINT8, 0x1000 * 0x10);
108115
109   save_pointer(NAME(m_vram), 0x1000*0x10);
116   save_pointer(NAME(m_vram), 0x1000 * 0x10);
110117}
111118
112119UINT32 dblcrown_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect )
r29234r29235
118125
119126   count = 0xa000;
120127
121   for (y=0;y<16;y++)
128   for (y = 0; y < 16; y++)
122129   {
123      for (x=0;x<32;x++)
130      for (x = 0; x < 32; x++)
124131      {
125         UINT16 tile = ((m_vram[count])|(m_vram[count+1]<<8)) & 0xfff;
132         UINT16 tile = ((m_vram[count]) | (m_vram[count+1] << 8)) & 0xfff;
126133         UINT8 col = (m_vram[count+1] >> 4);
127134
128         gfx_2->opaque(bitmap,cliprect,tile,col,0,0,x*16,y*16);
135         gfx_2->opaque(bitmap, cliprect, tile, col, 0, 0, x * 16, y * 16);
129136
130         count+=2;
137         count += 2;
131138      }
132139   }
133140
134141   count = 0xb000;
135142
136   for (y=0;y<32;y++)
143   for (y = 0; y < 32; y++)
137144   {
138      for (x=0;x<64;x++)
145      for (x = 0; x < 64; x++)
139146      {
140         UINT16 tile = ((m_vram[count])|(m_vram[count+1]<<8)) & 0xfff;
141         UINT8 col = (m_vram[count+1] >> 4); // ok?
147         UINT16 tile = ((m_vram[count]) | (m_vram[count + 1] << 8)) & 0xfff;
148         UINT8 col = (m_vram[count + 1] >> 4); // ok?
142149
143         gfx->transpen(bitmap,cliprect,tile,col,0,0,x*8,y*8,0);
150         gfx->transpen(bitmap, cliprect, tile, col, 0, 0, x * 8, y * 8, 0);
144151
145         count+=2;
152         count += 2;
146153      }
147154   }
148155
149
150156   return 0;
151157}
152158
r29234r29235
187193   //  offset+=0x200;
188194
189195   m_pal_ram[offset] = data;
190   offset>>=1;
191   datax = m_pal_ram[offset*2] + 256*m_pal_ram[offset*2 + 1];
196   offset >>= 1;
197   datax = m_pal_ram[offset * 2] + 256 * m_pal_ram[offset * 2 + 1];
192198
193   r = ((datax)&0x000f)>>0;
194   g = ((datax)&0x00f0)>>4;
195   b = ((datax)&0x0f00)>>8;
199   r = ((datax) & 0x000f) >> 0;
200   g = ((datax) & 0x00f0) >> 4;
201   b = ((datax) & 0x0f00) >> 8;
196202   /* TODO: remaining bits */
197203
198204   m_palette->set_pen_color(offset, pal4bit(r), pal4bit(g), pal4bit(b));
r29234r29235
255261
256262   res = 0;
257263
258   for(i=0;i<4;i++)
264   for(i = 0; i < 4; i++)
259265   {
260266      if(m_mux_data & 1 << i)
261267         res |= ioport(muxnames[i])->read();
r29234r29235
272278
273279   res = 0xff;
274280
275   for(i=0;i<4;i++)
281   for(i = 0; i < 4; i++)
276282   {
277283      if(ioport(muxnames[i])->read() != 0xff)
278284         res &= ~(1 << i);
r29234r29235
283289
284290WRITE8_MEMBER( dblcrown_state::output_w )
285291{
286   // bit 4: coin counter
292/*  bits
293  7654 3210
294  ---- -x--  unknown (active after deal)
295  ---- x---  Payout counter pulse
296  ---x ----  Coin In counter pulse
297  -x-- ----  unknown (active after deal)
298  x-x- --xx  unknown
299*/
287300
288   //popmessage("%02x",data);
301   coin_counter_w(machine(), 0, data & 0x10);   /* Coin In counter pulse */
302   coin_counter_w(machine(), 1 ,data & 0x08);   /* Payout counter pulse */
303
304//   popmessage("out: %02x",data);
289305}
290306
291307
r29234r29235
296312
297313WRITE8_MEMBER( dblcrown_state::lamps_w )
298314{
299   //popmessage("%02x",data);
315/*  bits
316  7654 3210
317  ---- ---x  Deal
318  ---- --x-  Bet
319  ---- -x--  unknown
320  ---- x---  Hold 5
321  ---x ----  Hold 4
322  --x- ----  Hold 3
323  -x-- ----  Hold 2
324  x--- ----  Hold 1
325*/
326   output_set_lamp_value(0, (data) & 1);       /* Deal */
327   output_set_lamp_value(1, (data >> 1) & 1);  /* Bet */
328   output_set_lamp_value(2, (data >> 2) & 1);  /* unknown */
329   output_set_lamp_value(3, (data >> 3) & 1);  /* Hold 5 */
330   output_set_lamp_value(4, (data >> 4) & 1);  /* Hold 4 */
331   output_set_lamp_value(5, (data >> 5) & 1);  /* Hold 3 */
332   output_set_lamp_value(6, (data >> 6) & 1);  /* Hold 2 */
333   output_set_lamp_value(7, (data >> 7) & 1);  /* Hold 1 */
334
300335   m_lamps_data = data;
336//   popmessage("lamps: %02X", data);
301337}
302338
339WRITE8_MEMBER(dblcrown_state::watchdog_w)
340/*
341  Always 0x01...
342*/
343{
344   if (data & 0x01)      /* check for refresh value (0x01) */
345   {
346      machine().watchdog_reset();
347   }
348   else
349   {
350      popmessage("Watchdog: %02x", data);
351   }
352}
353
354
303355static ADDRESS_MAP_START( dblcrown_map, AS_PROGRAM, 8, dblcrown_state )
304356   ADDRESS_MAP_UNMAP_HIGH
305357   AM_RANGE(0x0000, 0x7fff) AM_ROM
r29234r29235
324376   AM_RANGE(0x03, 0x03) AM_READ_PORT("DSWD")
325377   AM_RANGE(0x04, 0x04) AM_READ(in_mux_r)
326378   AM_RANGE(0x05, 0x05) AM_READ(in_mux_type_r)
327   AM_RANGE(0x10, 0x10) AM_READWRITE(lamps_r,lamps_w)
328   AM_RANGE(0x11, 0x11) AM_READWRITE(bank_r,bank_w)
329   AM_RANGE(0x12, 0x12) AM_READWRITE(mux_r,mux_w)
379   AM_RANGE(0x10, 0x10) AM_READWRITE(lamps_r, lamps_w)
380   AM_RANGE(0x11, 0x11) AM_READWRITE(bank_r, bank_w)
381   AM_RANGE(0x12, 0x12) AM_READWRITE(mux_r, mux_w)
330382   AM_RANGE(0x20, 0x21) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
331//  AM_RANGE(0x30, 0x30) always 1?
383   AM_RANGE(0x30, 0x30) AM_WRITE(watchdog_w)
332384   AM_RANGE(0x40, 0x40) AM_WRITE(output_w)
333385ADDRESS_MAP_END
334386
r29234r29235
379431   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
380432   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
381433   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
382   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
383   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
384   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
434   PORT_DIPNAME( 0x20, 0x20, "Hold Type" )
435   PORT_DIPSETTING(    0x20, "Hold" )
436   PORT_DIPSETTING(    0x00, "Discard" )
385437   PORT_DIPNAME( 0x40, 0x40, "Input Test" )
386438   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
387439   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r29234r29235
561613static MACHINE_CONFIG_START( dblcrown, dblcrown_state )
562614
563615   /* basic machine hardware */
564   MCFG_CPU_ADD("maincpu",Z80,MAIN_CLOCK/6)
616   MCFG_CPU_ADD("maincpu", Z80, CPU_CLOCK)
565617   MCFG_CPU_PROGRAM_MAP(dblcrown_map)
566618   MCFG_CPU_IO_MAP(dblcrown_io)
567619   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", dblcrown_state, dblcrown_irq_scanline, "screen", 0, 1)
620   MCFG_WATCHDOG_TIME_INIT(attotime::from_msec(1000))   /* 1000 ms. (minimal of MAX693A watchdog long timeout period with internal oscillator) */
568621
569622   /* video hardware */
570623   MCFG_SCREEN_ADD("screen", RASTER)
r29234r29235
584637
585638   /* sound hardware */
586639   MCFG_SPEAKER_STANDARD_MONO("mono")
587   MCFG_SOUND_ADD("aysnd", AY8910, MAIN_CLOCK/12)
640   MCFG_SOUND_ADD("aysnd", AY8910, SND_CLOCK)
588641   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
589642MACHINE_CONFIG_END
590643
r29234r29235
611664   ROM_LOAD("palce16v8h.u39", 0x0000, 0x0117, CRC(c74231ee) SHA1(f1b9e98f1fde53eee64d5da38fb8a6c22b6333e2) )
612665ROM_END
613666
614GAME( 1997, dblcrown,  0,   dblcrown,  dblcrown,  driver_device, 0,       ROT0, "Cadence Technology",  "Double Crown (v1.0.3)", GAME_IMPERFECT_GRAPHICS ) // 1997 DYNA copyright in tile GFX
667
668/*     YEAR  NAME      PARENT    MACHINE   INPUT     STATE          INIT   ROT    COMPANY                FULLNAME                FLAGS                    LAYOUT  */
669GAMEL( 1997, dblcrown, 0,        dblcrown, dblcrown, driver_device, 0,     ROT0, "Cadence Technology",  "Double Crown (v1.0.3)", GAME_IMPERFECT_GRAPHICS, layout_dblcrown ) // 1997 DYNA copyright in tile GFX
trunk/src/mame/mame.mak
r29234r29235
24152415
24162416$(DRIVERS)/darius.o:    $(LAYOUT)/darius.lh
24172417
2418$(DRIVERS)/dblcrown.o:  $(LAYOUT)/dblcrown.lh
2419
24182420$(DRIVERS)/de_2.o:      $(LAYOUT)/de2.lh \
24192421         $(LAYOUT)/de2a3.lh
24202422

Previous 199869 Revisions Next


© 1997-2024 The MAME Team