1 // license:BSD-3-Clause
2 // copyright-holders:David Haywood, MetalliC
3 /* Multifish */
4 
5 
6 #include "sound/ay8910.h"
7 #include "cpu/z80/z80.h"
8 #include "machine/timekpr.h"
9 #include "machine/watchdog.h"
10 #include "machine/ticket.h"
11 #include "emupal.h"
12 #include "screen.h"
13 #include "tilemap.h"
14 
15 #define igrosoft_gamble_ROM_SIZE 0x80000
16 #define igrosoft_gamble_VIDRAM_SIZE (0x2000*0x04)
17 
18 class igrosoft_gamble_state : public driver_device
19 {
20 public:
igrosoft_gamble_state(const machine_config & mconfig,device_type type,const char * tag)21 	igrosoft_gamble_state(const machine_config &mconfig, device_type type, const char *tag) :
22 		driver_device(mconfig, type, tag),
23 		m_maincpu(*this, "maincpu"),
24 		m_m48t35(*this, "m48t35" ),
25 		m_gfxdecode(*this, "gfxdecode"),
26 		m_screen(*this, "screen"),
27 		m_palette(*this, "palette"),
28 		m_hopper(*this, "hopper"),
29 		m_lamps(*this, "lamp%u", 0U)
30 	{ }
31 
32 	void rollfr(machine_config &config);
33 	void igrosoft_gamble(machine_config &config);
34 
35 	void init_customl();
36 	void init_island2l();
37 	void init_keksl();
38 	void init_pirate2l();
39 	void init_fcockt2l();
40 	void init_sweetl2l();
41 	void init_gnomel();
42 	void init_crzmonent();
43 	void init_fcocktent();
44 	void init_garageent();
45 	void init_rclimbent();
46 	void init_sweetl2ent();
47 	void init_resdntent();
48 	void init_island2ent();
49 	void init_pirate2ent();
50 	void init_keksent();
51 	void init_gnomeent();
52 	void init_lhauntent();
53 	void init_fcockt2ent();
54 	void init_crzmon2();
55 	void init_crzmon2lot();
56 	void init_crzmon2ent();
57 	void init_islandent();
58 	void init_pirateent();
59 	void init_sweetlent();
60 	void init_rollfruit();
61 
62 private:
63 	void igrosoft_gamble_vid_w(offs_t offset, uint8_t data);
64 	void igrosoft_gamble_bank_w(uint8_t data);
65 	uint8_t bankedram_r(offs_t offset);
66 	void bankedram_w(offs_t offset, uint8_t data);
67 	void igrosoft_gamble_rambank_w(uint8_t data);
68 	uint8_t ray_r();
69 	void igrosoft_gamble_hopper_w(uint8_t data);
70 	void rollfr_hopper_w(uint8_t data);
71 	void igrosoft_gamble_lamps1_w(uint8_t data);
72 	void igrosoft_gamble_lamps2_w(uint8_t data);
73 	void igrosoft_gamble_lamps3_w(uint8_t data);
74 	void igrosoft_gamble_counters_w(uint8_t data);
75 	void igrosoft_gamble_f3_w(uint8_t data);
76 	void igrosoft_gamble_dispenable_w(uint8_t data);
77 	uint8_t igrosoft_gamble_timekeeper_r(offs_t offset);
78 	void igrosoft_gamble_timekeeper_w(offs_t offset, uint8_t data);
79 	TILE_GET_INFO_MEMBER(get_igrosoft_gamble_tile_info);
80 	TILE_GET_INFO_MEMBER(get_igrosoft_gamble_reel_tile_info);
81 	uint32_t screen_update_igrosoft_gamble(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
82 	void igrosoft_gamble_map(address_map &map);
83 	void igrosoft_gamble_portmap(address_map &map);
84 	void rollfr_portmap(address_map &map);
85 
86 	virtual void machine_start() override;
87 	virtual void machine_reset() override;
88 	virtual void video_start() override;
89 
90 	/* Video related */
91 
92 	int m_disp_enable;
93 	int m_xor_paltype;
94 	int m_xor_palette;
95 
96 	tilemap_t *m_tilemap;
97 	tilemap_t *m_reel_tilemap;
98 
99 	/* Misc related */
100 
101 	uint8_t m_rambk;
102 
103 	uint8_t m_vid[igrosoft_gamble_VIDRAM_SIZE];
104 	required_device<cpu_device> m_maincpu;
105 	required_device<timekeeper_device> m_m48t35;
106 	required_device<gfxdecode_device> m_gfxdecode;
107 	required_device<screen_device> m_screen;
108 	required_device<palette_device> m_palette;
109 	required_device<ticket_dispenser_device> m_hopper;
110 	output_finder<13> m_lamps;
111 };
112 
113 
114 INPUT_PORTS_EXTERN( igrosoft_gamble );
115