1 // license:BSD-3-Clause
2 // copyright-holders:Guru
3 /* Hide & Seek
4 
5 the AG-2 AX51201 should be the follow-up to the AG-1 AX51101 in gunpey.cpp
6 
7 AS:
8 Current ROM code barely contains some valid SH-2 opcodes but not enough for a HD64F7045F28. i.e. It doesn't contain VBR set-up, valid irq routines,
9 a valid irq table and no internal SH-2 i/o set-up. sub-routine at 0xe0 also points to 0x4b0, which is full of illegal opcodes with current ROM.
10 The HD64F7045F28 manual says that there's an on-chip ROM at 0-0x3ffff (page 168), meaning that this one definitely needs a trojan/decap (and also an SH-2 core
11 that supports the very different i/o map ;-)
12 
13 Guru:
14 It's called Hide and Seek. I don't know the manufacturer.
15 I dumped the ROMs and with a byte swap on U10 I see plain text with words like BET, PAYOUT, HIT etc so it looks like some kind of gambling game.
16 Main program ROMs are 16M flashROMs. The rest are 128M flashROMs. ROMs U8, U9 and U11 are empty.
17 PCB number is BO-023C
18 The CPU is a SH2 HD64F7045F28. Connected xtal is 7.3728MHz.
19 Main RAM is 2x NEC D431000 (128k x8-bit SRAM).
20 There are 3 chips NEC DX-102 (used on seta2/ssv).
21 The main gfx chip is a new type not previously used in MAME I think. Number is AG-2 AX51201. Connected OSC is 25MHz
22 Video RAM is 2x Etrontech EM639165TS-7G (8M x16-bit SDRAM)
23 Sound is OKI M9810. Connected xtal unknown speed. Written on it is 409G649.
24 Other stuff: NEC D4992 (RTC?) and xtal possibly 32.768kHz, 3V coin battery, 93L46 EEPROM, 1x 8-position DIPSW, 2x Lattice iM4A3-64 CPLDs; one on the main board and one on the ROM board.
25 */
26 
27 
28 
29 #include "emu.h"
30 #include "cpu/sh/sh2.h"
31 #include "emupal.h"
32 #include "screen.h"
33 #include "speaker.h"
34 
35 
36 class hideseek_state : public driver_device
37 {
38 public:
hideseek_state(const machine_config & mconfig,device_type type,const char * tag)39 	hideseek_state(const machine_config &mconfig, device_type type, const char *tag)
40 		: driver_device(mconfig, type, tag)
41 		, m_maincpu(*this, "maincpu")
42 	{
43 	}
44 
45 	void hideseek(machine_config &config);
46 
47 	void init_hideseek();
48 
49 protected:
50 	virtual void video_start() override;
51 
52 private:
53 	void hideseek_palette(palette_device &palette) const;
54 	uint32_t screen_update_hideseek(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
55 
56 	void mem_map(address_map &map);
57 
58 	required_device<cpu_device> m_maincpu;
59 };
60 
61 
video_start()62 void hideseek_state::video_start()
63 {
64 }
65 
66 
screen_update_hideseek(screen_device & screen,bitmap_ind16 & bitmap,const rectangle & cliprect)67 uint32_t hideseek_state::screen_update_hideseek(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
68 {
69 	return 0;
70 }
71 
mem_map(address_map & map)72 void hideseek_state::mem_map(address_map &map)
73 {
74 	map(0x00000000, 0x0003ffff).rom(); // On-chip ROM
75 	map(0x00200000, 0x0023ffff).ram(); // CS0
76 	map(0x00400000, 0x005fffff).rom().region("prg", 0); // CS1
77 	// CS2 - CS3
78 	map(0x01000000, 0x01ffffff).ram(); // DRAM
79 	map(0xffff8000, 0xffff87ff).ram(); // HD64F7045F28 i/os
80 	map(0xfffff000, 0xffffffff).ram(); // on-chip RAM
81 //  map(0x06000000, 0x07ffffff).rom().region("blit_data", 0);
82 }
83 
84 
85 
INPUT_PORTS_START(hideseek)86 static INPUT_PORTS_START( hideseek )
87 INPUT_PORTS_END
88 
89 
90 
91 static GFXLAYOUT_RAW( hideseek, 2048, 1, 2048*8, 2048*8 )
92 
93 static GFXDECODE_START( gfx_hideseek )
94 	GFXDECODE_ENTRY( "blit_data", 0, hideseek,     0x0000, 0x1 )
95 GFXDECODE_END
96 
97 
98 void hideseek_state::hideseek_palette(palette_device &palette) const
99 {
100 	for (int i = 0; i < 0x8000; i++)
101 		palette.set_pen_color(i, rgb_t(pal5bit((i >> 10)&0x1f), pal5bit((i >> 5)&0x1f), pal5bit((i >> 0)&0x1f)));
102 }
103 
104 
105 
hideseek(machine_config & config)106 void hideseek_state::hideseek(machine_config &config)
107 {
108 	/* basic machine hardware */
109 	SH2(config, m_maincpu, 7372800 * 4);
110 	m_maincpu->set_addrmap(AS_PROGRAM, &hideseek_state::mem_map);
111 //  TIMER(config, "scantimer").configure_scanline(FUNC(hideseek_state::hideseek_scanline), "screen", 0, 1);
112 
113 	/* video hardware */
114 	screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
115 	screen.set_refresh_hz(60);
116 	screen.set_vblank_time(ATTOSECONDS_IN_USEC(0));
117 	screen.set_size(64*8, 32*8);
118 	screen.set_visarea(0*8, 64*8-1, 0*8, 32*8-1);
119 	screen.set_screen_update(FUNC(hideseek_state::screen_update_hideseek));
120 	screen.set_palette("palette");
121 
122 	PALETTE(config, "palette", FUNC(hideseek_state::hideseek_palette), 0x10000);
123 	GFXDECODE(config, "gfxdecode", "palette", gfx_hideseek);
124 
125 	SPEAKER(config, "lspeaker").front_left();
126 	SPEAKER(config, "rspeaker").front_right();
127 
128 	/* sound : M9810 */
129 }
130 
131 
132 ROM_START( hideseek )
133 	ROM_REGION( 0x200000, "maincpu", ROMREGION_ERASE00)
134 	ROM_LOAD( "hd64f7045f28_internal_rom.bin",  0x000000, 0x040000, NO_DUMP ) // on chip ROM
135 	ROM_FILL(         0, 1, 0x00 )
136 	ROM_FILL(         1, 1, 0x40 )
137 	ROM_FILL(         2, 1, 0x00 )
138 	ROM_FILL(         3, 1, 0x00 )
139 	ROM_FILL(         4, 1, 0x01 )
140 	ROM_FILL(         5, 1, 0xff )
141 	ROM_FILL(         6, 1, 0xff )
142 	ROM_FILL(         7, 1, 0xfc )
143 
144 	ROM_REGION32_BE( 0x400000, "prg", 0 ) /* SH2 code */
145 	ROM_LOAD16_WORD_SWAP( "29f160te.u10",  0x000000, 0x200000, CRC(44539f9b) SHA1(2e531455e5445e09e99494e47d96866e8ee07135) )
146 	ROM_LOAD16_WORD_SWAP( "29f160te.u11",  0x200000, 0x200000, CRC(9a4109e5) SHA1(ba59caac5f5a80fc52c507d8a47f322a380aa9a1) ) /* empty! */
147 
148 	ROM_REGION( 0x4000000, "blit_data", 0 )
149 	ROM_LOAD16_WORD_SWAP( "s29gl128n.u6",  0x0000000, 0x1000000,  CRC(2d6632f3) SHA1(e8d91bcc6975f5c07b438d29e8a23d403c7e52aa) )
150 	ROM_LOAD16_WORD_SWAP( "s29gl128n.u7",  0x1000000, 0x1000000,  CRC(9af057bf) SHA1(e905d0dfa5b866d7317adafe03fcdfadd1e44d78) )
CRC(a47ca14a)151 	ROM_LOAD16_WORD_SWAP( "s29gl128n.u8",  0x2000000, 0x1000000,  CRC(a47ca14a) SHA1(3b4417fc421cee30a9ad0fd9319220a8dae32da2) ) /* empty! */
152 	ROM_LOAD16_WORD_SWAP( "s29gl128n.u9",  0x3000000, 0x1000000,  CRC(a47ca14a) SHA1(3b4417fc421cee30a9ad0fd9319220a8dae32da2) ) /* empty! */
153 
154 
155 	ROM_REGION( 0x1000000, "ymz", 0 )
156 	ROM_LOAD( "s29gl128n.u4",  0x000000, 0x1000000, CRC(b8eb7cdb) SHA1(a90c70058e50f3369a6e517e0a534b9ef1e0087c) )
157 ROM_END
158 
159 
160 
161 void hideseek_state::init_hideseek()
162 {
163 }
164 
165 
166 GAME( 200?, hideseek, 0, hideseek, hideseek, hideseek_state, init_hideseek, ROT0, "<unknown>", "Hide & Seek", MACHINE_NOT_WORKING | MACHINE_NO_SOUND )
167