1
/**********************************************************************************
5
Driver by Roberto Fresca.
8
***********************************************************************************
11
The hardware is composed by:
13
CPU: 1x R65C02P2 (main) at 2MHz.
14
1x EP87C750EBPN (8-bit microcontroller family 1K/64 OTP ROM, low pin count)
16
Sound: 1x WF19054 (AY-3-8910 compatible) at 2MHz.
17
1x TDA2003 (audio amp).
19
Video: 1x HD46505 (CRT controller)
22
RAM: 1x Elite MT LP62256E-70LL (32Kx8 SRAM, 70ns)
23
NVRAM: 1x Elite MT LP6264D-70LL (8Kx8 SRAM, 70ns)
24
ROMs: 1x TMS27C512 (10).
29
PLDs: 1x PALCE22V10H (read protected)
31
Clock: 1x 16MHz Crystal.
33
Other: 1x JAMMA edge connector.
35
1x 8 DIP switches bank (SW1).
36
1x 4 DIP switches bank (SW2).
37
3x pushbutton (SW3-statistic, SW4-management, SW5-ricarica).
43
- The game is based on Funworld/Tab/CMC games, but the hardware is completely different.
44
It has more complex improvements (encryption, MCU, banks, etc...)
45
- The program ROM is encrypted.
46
- The color palettes are stored in a normal ROM.
49
***********************************************************************************
55
$0000 - $7FFF Still unknown...
56
$8000 - $FFFF ROM Space.
59
***********************************************************************************
62
Connectors, DIPs and instructions,
63
from original datasheet...
65
---------------------|--|-----------------
67
---------------------|--|-----------------
70
Ricarica |03| +12V. Lamp.
71
Remote |04| +5V. Lamp.
72
Cancel / Play Take |05| Lamp Cancel (Play Take)
74
Hold 5 / Half Take |07| Lamp Hold 5 / Half Take
75
Hold 1 |08| Lamp Hold 1
76
Hold 2 / Small |09| Lamp Hold 2 / Small
77
Hold 4 / Big |10| Lamp Hold 4 / Big
78
Hold 3 |11| Lamp Hold 3
79
Ticket sensor |12| Ticket drive
80
Coin 1 A |13| Coin 2 B
85
Hopper sensor |18| GND
86
Speaker (+) |19| Speaker (-)
87
Hopper drive |20| Charge Counter
88
Factory Counter |21| Discharge Counter
89
+5V. Counter |22| +12V. Counter
98
------------------------------------------------------------
99
DIP SW.#1 1 2 3 4 5 6 7 8
100
------------------------------------------------------------
105
Ticket + hopper OFF ON
106
Ticket + hopper ON ON
107
CoinA: 1 coin 1 credit OFF OFF
108
CoinA: 1 coin 5 credits OFF ON
109
CoinA: 1 coin 2 credits ON OFF
110
CoinA: 1 coin 10 credits ON ON
113
Skills without consuming 1 coin OFF
114
Skills consuming 1 coin ON
115
Select with cards OFF
116
Select without cards ON
117
------------------------------------------------------------
119
--------------------------------------------
121
--------------------------------------------
122
Game with cards OFF OFF
123
Game with balls ON OFF
124
Game with roses OFF ON
125
Game allow choose ON ON
128
Normal Points Table OFF
129
Points Table in Super Game ON
130
--------------------------------------------
136
Turn on the machine getting STATISTIC & MANAGEMENT buttons pressed.
138
STATISTICS = Show credits in/out.
139
To cancel statistics press CANCEL for some seconds.
141
MANAGEMENT = Settings.
142
The following menu will show up:
144
HOLD3 = Verify In/Out, even when the stats were cleared.
145
HOLD2 + HOLD4 = Modify maximum bet, pressing HOLD1.
146
Modify minimum bet, pressing HOLD2.
147
Modify percentage (1, 2, 3, 4), pressing HOLD3.
149
Press START to exit from programming mode.
152
***********************************************************************************
156
- Added technical notes.
161
- Decrypt the program ROMs.
164
- Fix color decode routines.
167
- Dump/decap the MCU.
170
***********************************************************************************/
173
#define MASTER_CLOCK XTAL_16MHz
176
#include "cpu/m6502/m6502.h"
177
#include "video/mc6845.h"
178
#include "sound/ay8910.h"
179
#include "machine/nvram.h"
180
#include "includes/funworld.h"
183
class _4roses_state : public funworld_state
186
_4roses_state(const machine_config &mconfig, device_type type, const char *tag)
187
: funworld_state(mconfig, type, tag) { }
192
/**********************
193
* Read/Write Handlers *
194
**********************/
198
/*************************
199
* Memory map information *
200
*************************/
202
static ADDRESS_MAP_START( 4roses_map, AS_PROGRAM, 8 )
203
AM_RANGE(0x0000, 0x07ff) AM_RAM // AM_SHARE("nvram")
204
AM_RANGE(0x6000, 0x6fff) AM_RAM_WRITE(funworld_videoram_w) AM_BASE_MEMBER(funworld_state, m_videoram)
205
AM_RANGE(0x7000, 0x7fff) AM_RAM_WRITE(funworld_colorram_w) AM_BASE_MEMBER(funworld_state, m_colorram)
206
AM_RANGE(0x8000, 0xffff) AM_ROM
217
/*************************
219
*************************/
221
static INPUT_PORTS_START( 4roses )
223
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("0-1") PORT_CODE(KEYCODE_1)
224
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("0-2") PORT_CODE(KEYCODE_2)
225
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("0-3") PORT_CODE(KEYCODE_3)
226
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("0-4") PORT_CODE(KEYCODE_4)
227
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("0-5") PORT_CODE(KEYCODE_5)
228
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("0-6") PORT_CODE(KEYCODE_6)
229
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("0-7") PORT_CODE(KEYCODE_7)
230
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("0-8") PORT_CODE(KEYCODE_8)
233
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("1-1") PORT_CODE(KEYCODE_Q)
234
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("1-2") PORT_CODE(KEYCODE_W)
235
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("1-3") PORT_CODE(KEYCODE_E)
236
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("1-4") PORT_CODE(KEYCODE_R)
237
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("1-5") PORT_CODE(KEYCODE_T)
238
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("1-6") PORT_CODE(KEYCODE_Y)
239
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("1-7") PORT_CODE(KEYCODE_U)
240
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("1-8") PORT_CODE(KEYCODE_I)
243
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("2-1") PORT_CODE(KEYCODE_A)
244
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("2-2") PORT_CODE(KEYCODE_S)
245
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("2-3") PORT_CODE(KEYCODE_D)
246
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("2-4") PORT_CODE(KEYCODE_F)
247
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("2-5") PORT_CODE(KEYCODE_G)
248
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("2-6") PORT_CODE(KEYCODE_H)
249
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("2-7") PORT_CODE(KEYCODE_J)
250
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("2-8") PORT_CODE(KEYCODE_K)
253
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("3-1") PORT_CODE(KEYCODE_Z)
254
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("3-2") PORT_CODE(KEYCODE_X)
255
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("3-3") PORT_CODE(KEYCODE_C)
256
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("3-4") PORT_CODE(KEYCODE_V)
257
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("3-5") PORT_CODE(KEYCODE_B)
258
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("3-6") PORT_CODE(KEYCODE_N)
259
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("3-7") PORT_CODE(KEYCODE_M)
260
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("3-8") PORT_CODE(KEYCODE_L)
263
PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
264
PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
265
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
266
PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
267
PORT_DIPSETTING( 0x02, DEF_STR( Off ) )
268
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
269
PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
270
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
271
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
272
PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
273
PORT_DIPSETTING( 0x08, DEF_STR( Off ) )
274
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
275
PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
276
PORT_DIPSETTING( 0x10, DEF_STR( Off ) )
277
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
278
PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
279
PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
280
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
281
PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
282
PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
283
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
284
PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
285
PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
286
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
288
PORT_START("SW2") /* this bank is x4 DIP switches */
289
PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
290
PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
291
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
292
PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
293
PORT_DIPSETTING( 0x02, DEF_STR( Off ) )
294
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
295
PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
296
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
297
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
298
PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
299
PORT_DIPSETTING( 0x08, DEF_STR( Off ) )
300
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
301
PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
302
PORT_DIPSETTING( 0x10, DEF_STR( Off ) )
303
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
304
PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
305
PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
306
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
307
PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
308
PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
309
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
310
PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
311
PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
312
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
316
/*************************
318
*************************/
320
static const gfx_layout charlayout =
322
/* WRONG... Must be changed */
328
// { 0, 4, 0x8000*8, 0x8000*8+4 },
329
{ RGN_FRAC(0,2), RGN_FRAC(0,2) + 4, RGN_FRAC(1,2), RGN_FRAC(1,2) + 4 },
331
{ 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
336
/******************************
337
* Graphics Decode Information *
338
******************************/
340
static GFXDECODE_START( 4roses )
341
GFXDECODE_ENTRY( "gfx1", 0x0000, charlayout, 0, 16 )
345
/************************
347
************************/
349
static const ay8910_interface ay8910_intf =
351
AY8910_LEGACY_OUTPUT,
352
AY8910_DEFAULT_LOADS,
353
DEVCB_NULL, /* portA in */
354
DEVCB_NULL, /* portB in */
355
DEVCB_NULL, /* portA out */
356
DEVCB_NULL /* portB out */
360
/************************
362
************************/
364
static const mc6845_interface mc6845_intf =
366
"screen", /* screen we are acting on */
367
8, /* number of pixels per video memory address */
368
NULL, /* before pixel update callback */
369
NULL, /* row update callback */
370
NULL, /* after pixel update callback */
371
DEVCB_NULL, /* callback for display state changes */
372
DEVCB_NULL, /* callback for cursor state changes */
373
DEVCB_NULL, /* HSYNC callback */
374
DEVCB_NULL, /* VSYNC callback */
375
NULL /* update address callback */
379
/**************************
381
**************************/
383
static MACHINE_CONFIG_START( 4roses, _4roses_state )
384
/* basic machine hardware */
385
MCFG_CPU_ADD("maincpu", M65C02, MASTER_CLOCK/8) /* 2MHz, guess */
386
MCFG_CPU_PROGRAM_MAP(4roses_map)
387
MCFG_CPU_VBLANK_INT("screen", nmi_line_pulse)
389
// MCFG_NVRAM_ADD_0FILL("nvram")
393
MCFG_SCREEN_ADD("screen", RASTER)
394
MCFG_SCREEN_REFRESH_RATE(60)
395
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
396
MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
397
MCFG_SCREEN_SIZE((124+1)*4, (30+1)*8) /* guess. taken from funworld games */
398
MCFG_SCREEN_VISIBLE_AREA(0*4, 96*4-1, 0*8, 29*8-1) /* guess. taken from funworld games */
399
MCFG_SCREEN_UPDATE(funworld)
401
MCFG_GFXDECODE(4roses)
403
MCFG_PALETTE_LENGTH(0x1000)
404
MCFG_PALETTE_INIT(funworld)
405
MCFG_VIDEO_START(funworld)
407
// MCFG_MC6845_ADD("crtc", MC6845, MASTER_CLOCK/8, mc6845_intf) /* 2MHz, guess */
410
MCFG_SPEAKER_STANDARD_MONO("mono")
412
MCFG_SOUND_ADD("ay8910", AY8910, MASTER_CLOCK/8) /* 2MHz, guess */
413
MCFG_SOUND_CONFIG(ay8910_intf)
414
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 2.5)
418
/*************************
420
*************************/
423
ROM_REGION( 0x10000, "maincpu", 0 ) /* encrypted program ROM...*/
424
ROM_LOAD( "4.10.u32", 0x00000, 0x10000, CRC(e94440e9) SHA1(b2f81ba79f1f40ed35e45fd80c17eb8529ccdb4c) )
426
ROM_REGION( 0x0400, "mcu", 0 ) /* protected... no dump available */
427
ROM_LOAD( "ep87c750ebpn_no_dump.u41", 0x0000, 0x0400, NO_DUMP )
429
ROM_REGION( 0x80000, "gfx1", 0 )
430
ROM_LOAD( "30.u17", 0x00000, 0x80000, CRC(daefacc2) SHA1(5896e9da06fde39770fcdc585881b8c689b34369) )
432
ROM_REGION( 0x18000, "proms", 0 )
433
ROM_LOAD( "20.u43", 0x00000, 0x08000, CRC(f206b4d3) SHA1(dfee226a9e01ddacf09995ec4e027b0ed4dffe7e) )
434
ROM_LOAD( "10.u39", 0x08000, 0x10000, CRC(87dcf9c5) SHA1(b289527b8d9db1e91adf85b53233415c6969f4d4) )
436
ROM_REGION( 0x02dd, "plds", 0 )
437
ROM_LOAD( "palce22v10h.u29", 0x0000, 0x02dd, BAD_DUMP CRC(5c4e9024) SHA1(e9d1e4df3d79c21f4ce053a84bb7b7a43d650f91) )
441
ROM_REGION( 0x10000, "maincpu", 0 ) /* encrypted program ROM...*/
442
ROM_LOAD( "4.u15", 0x00000, 0x10000, CRC(66bb5b67) SHA1(438371c3918f0a285cb19caa650739df9fb24800) )
444
ROM_REGION( 0x0400, "mcu", 0 ) /* protected... no dump available */
445
ROM_LOAD( "ep87c750ebpn_no_dump.u41", 0x0000, 0x0400, NO_DUMP )
447
ROM_REGION( 0x80000, "gfx1", 0 )
448
ROM_LOAD( "30.u17", 0x00000, 0x80000, CRC(daefacc2) SHA1(5896e9da06fde39770fcdc585881b8c689b34369) )
450
ROM_REGION( 0x20000, "proms", 0 )
451
ROM_LOAD( "20.ub5", 0x00000, 0x10000, CRC(01cc8b15) SHA1(f8e1fa7c0a4ae35debf8eecde31471049308cd60) )
452
ROM_LOAD( "10.ua5", 0x10000, 0x10000, CRC(87dcf9c5) SHA1(b289527b8d9db1e91adf85b53233415c6969f4d4) )
454
ROM_REGION( 0x02dd, "plds", 0 )
455
ROM_LOAD( "palce22v10h.u29", 0x0000, 0x02dd, BAD_DUMP CRC(5c4e9024) SHA1(e9d1e4df3d79c21f4ce053a84bb7b7a43d650f91) )
459
/**************************
460
* Driver Initialization *
461
**************************/
463
static DRIVER_INIT( 4roses )
469
/*************************
471
*************************/
473
/* YEAR NAME PARENT MACHINE INPUT INIT ROT COMPANY FULLNAME FLAGS */
474
GAME( 1999, 4roses, 0, 4roses, 4roses, 4roses, ROT0, "<unknown>", "Four Roses (encrypted, set 1)", GAME_IMPERFECT_GRAPHICS | GAME_WRONG_COLORS | GAME_UNEMULATED_PROTECTION | GAME_NO_SOUND | GAME_NOT_WORKING )
475
GAME( 1999, 4rosesa, 4roses, 4roses, 4roses, 4roses, ROT0, "<unknown>", "Four Roses (encrypted, set 2)", GAME_IMPERFECT_GRAPHICS | GAME_WRONG_COLORS | GAME_UNEMULATED_PROTECTION | GAME_NO_SOUND | GAME_NOT_WORKING )