Skip to content

Commit 4033f44

Browse files
committed
igt/gkigt.cpp: suppress SENET readback for now, fix base video ROM banks, document workaround for i960 init crash
1 parent 3bd2fa4 commit 4033f44

File tree

1 file changed

+55
-46
lines changed

1 file changed

+55
-46
lines changed

src/mame/igt/gkigt.cpp

+55-46
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ IGT Gameking 960
1414
- all games will eventually print "RTC device: SOFTWARE", expecting an optional device somewhere. Later boards have a RTC62423;
1515
- bmoonii, ms5, ms14, dblheart, mystjag: crashes in i960 with unhandled 00 after RAM error.
1616
\- Do they all need NVRAM setchips?
17-
\- Crash may be related to lack of irq service;
18-
- watchdog (ADM691AAN on bmoonii board);
17+
\- Should probably not get there, the watchdog would kick much earlier ...
18+
- watchdog (ADM691AAN on bmoonii board, "Telltale");
19+
\- All games hangs on soft reset;
1920
- All games are silent;
2021
\- bmoonii has a YM2413 on main board, tied with a XTAL(3'579'545).
2122
\- some extra stuff routes thru QUART chips (namely SRESET comes from there)
2223
\- ymz should require snd roms being hooked up to its internal memory map thru ROM_COPY;
23-
- Hangs on soft reset;
2424
2525
gkigt4 debug hang points:
2626
bp 8035d58,1,{r8=1;g} ; skip QUART not running (will save to NVRAM afterwards)
@@ -29,6 +29,11 @@ bp 80249f4,1,{g4=1;g} ; ^
2929
bp 80773f4,1,{g4=0;g} ; irq 2?
3030
bp 8177f48,1,{ip+=4;g} ; EEPROM CRC error / identification failure
3131
32+
workaround for init crashes:
33+
`Fatal error: I960: <logged IP>: Unhandled 00`
34+
bp <logged IP>,1,{ ip|=0x08000000;hardreset } ; the first time around,
35+
; will initialize NVRAM stack to valid values
36+
3237
===================================================================================================
3338
3439
Game King board types:
@@ -153,10 +158,7 @@ class igt_gameking_state : public driver_device
153158
virtual void machine_start() override ATTR_COLD;
154159
virtual void machine_reset() override ATTR_COLD;
155160

156-
[[maybe_unused]] uint16_t version_r();
157-
158161
void igt_gameking_map(address_map &map) ATTR_COLD;
159-
void igt_ms72c_map(address_map &map) ATTR_COLD;
160162
void ramdac_map(address_map &map) ATTR_COLD;
161163

162164
required_device<cpu_device> m_maincpu;
@@ -181,12 +183,13 @@ void igt_gameking_state::video_start()
181183
}
182184

183185
// TODO: incomplete, several missing bit meanings
184-
// ms14 uses bit 16 for something, currently draws solid white
185-
// (concealing bitmap layer, would be ROM unmapped space)
186+
// - for banking bit 19 is trusted by gkigt4, bit 16 for ms3, 18-17 assumed to be linear
187+
// - bits 15-12 are always 0xf?
188+
// - bits 23-20 used, unknown purpose (at least 1 bit of extra tile bank)
186189
TILE_GET_INFO_MEMBER(igt_gameking_state::get_bg_tile_info)
187190
{
188191
const u32 entry = m_bg_vram[tile_index];
189-
int const tile = (entry & 0xffff) | (BIT(entry, 19) << 16);
192+
int const tile = (entry & 0x0fff) | (entry & 0x000f'0000) >> 4;
190193
int const color = (entry >> 24) & 0xf;
191194

192195
tileinfo.set(0, tile, color, 0);
@@ -231,7 +234,9 @@ void igt_gameking_state::igt_gameking_map(address_map &map)
231234
// map(0x0ac00000, 0x0ac0000f) - board identifiers?
232235
// map(0x0ae00000, 0x0ae0000f) /
233236

234-
// it's unclear how much of this is saved and how much total RAM there is.
237+
// TODO: fix ranges between CMOS and regular work RAM
238+
// - bmoonii PCB has two M48Z128Y (-> 0x20000 x2)
239+
// - ms3 maps CMOS ranges at 0x1002'0000-0x1003'ffff only
235240
map(0x10000000, 0x1001ffff).flags(i960_cpu_device::BURST).ram().share("nvram");
236241
map(0x10020000, 0x17ffffff).flags(i960_cpu_device::BURST).ram();
237242

@@ -249,47 +254,60 @@ void igt_gameking_state::igt_gameking_map(address_map &map)
249254
return res;
250255
}
251256
));
257+
map(0x18200002, 0x18200003).lr16(
258+
NAME([this] () {
259+
// TODO: unknown value required, checked at "Cold powerup machine setup" in some games
260+
// coming from Xilinx anyway?
261+
262+
logerror("%s: version read\n", machine().describe_context());
263+
return 0x0038;
264+
}
265+
));
252266

253267
// 28000000: MEZ2 SEL, also connected to ymz chip select?
268+
map(0x28000000, 0x28000003).rw(m_opll, FUNC(ym2413_device::read), FUNC(ym2413_device::write)).umask32(0x00ff00ff);
254269
// 28010000: first 28C94 QUART (QRT1 SEL)
270+
map(0x28010000, 0x2801007f).rw(m_quart[0], FUNC(sc28c94_device::read), FUNC(sc28c94_device::write)).umask32(0x00ff00ff);
255271
// 28020000: SENET SEL
272+
map(0x280201fa, 0x280201fa).lrw8(
273+
NAME([this] () {
274+
logerror("SENET $1fa read\n");
275+
return 0;
276+
}),
277+
NAME([this] (u8 data) {
278+
logerror("SENET $1fa write %02x\n", data);
279+
})
280+
);
281+
map(0x280201fc, 0x280201fc).lrw8(
282+
NAME([this] () {
283+
logerror("SENET $1fc read\n");
284+
return 0;
285+
}),
286+
NAME([this] (u8 data) {
287+
logerror("SENET $1fc write %02x\n", data);
288+
})
289+
);
290+
// map(0x28020000, 0x280205ff).flags(i960_cpu_device::BURST).ram();
256291
// 28030000: WCHDOG SEL
257-
// 28040000: second 28C94 QUART (QRT2 SEL)
258-
// 28050000: SOUND SEL
259-
// 28060000: COLOR SEL
260-
// 28070000: OUT SEL
261-
map(0x28000000, 0x28000003).rw(m_opll, FUNC(ym2413_device::read), FUNC(ym2413_device::write)).umask32(0x00ff00ff);
262-
map(0x28010000, 0x2801007f).rw(m_quart[0], FUNC(sc28c94_device::read), FUNC(sc28c94_device::write)).umask32(0x00ff00ff);
263-
map(0x28020000, 0x280205ff).flags(i960_cpu_device::BURST).ram(); // CMOS?
264292
map(0x28030000, 0x28030003).nopr();
293+
// 28040000: second 28C94 QUART (QRT2 SEL)
265294
map(0x28040000, 0x2804007f).rw(m_quart[1], FUNC(sc28c94_device::read), FUNC(sc28c94_device::write)).umask32(0x00ff00ff);
266-
// TODO: this overlay should come from the QUART device
295+
// TODO: these overlays should come from the QUART devices
296+
map(0x28010038, 0x2801003b).portr("IN1").nopw();
267297
map(0x28040038, 0x2804003b).portr("IN2").nopw();
268-
298+
// 28050000: SOUND SEL
269299
map(0x28050000, 0x28050003).rw("ymz", FUNC(ymz280b_device::read), FUNC(ymz280b_device::write)).umask32(0x00ff00ff);
300+
// 28060000: COLOR SEL
270301
map(0x28060000, 0x28060000).w("ramdac", FUNC(ramdac_device::index_w));
271302
map(0x28060002, 0x28060002).w("ramdac", FUNC(ramdac_device::pal_w));
272303
map(0x28060004, 0x28060004).w("ramdac", FUNC(ramdac_device::mask_w));
304+
// 28070000: OUT SEL
273305

274306
map(0x3b000000, 0x3b1fffff).flags(i960_cpu_device::BURST).rom().region("snd", 0);
275307

276308
map(0xa1000000, 0xa1011fff).flags(i960_cpu_device::BURST).ram(); // used by gkkey for restart IAC
277309
}
278310

279-
// TODO: unknown value required, checked at "Cold powerup machine setup"
280-
// should really be just like above and be video related flags?
281-
// NOTE: maps to the lower 8-bit than the video flags hooked above ...
282-
uint16_t igt_gameking_state::version_r()
283-
{
284-
return 0xf777;
285-
}
286-
287-
void igt_gameking_state::igt_ms72c_map(address_map &map)
288-
{
289-
igt_gameking_map(map);
290-
// map(0x18200003, 0x18200003).lr8(FUNC(igt_gameking_state::version_r));
291-
}
292-
293311
static INPUT_PORTS_START( igt_gameking )
294312
PORT_START("IN1")
295313
PORT_DIPNAME( 0x01, 0x01, "IN1" )
@@ -490,10 +508,8 @@ static INPUT_PORTS_START( igt_gameking )
490508
PORT_DIPSETTING( 0x800000, DEF_STR( Off ) )
491509
PORT_DIPSETTING( 0x000000, DEF_STR( On ) )
492510
PORT_BIT( 0xff00ff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
493-
494511
INPUT_PORTS_END
495512

496-
// TODO: incomplete decoding
497513
static const gfx_layout igt_gameking_layout =
498514
{
499515
4,4,
@@ -557,6 +573,9 @@ void igt_gameking_state::igt_gameking(machine_config &config)
557573
diag.rxd_handler().set(m_quart[0], FUNC(sc28c94_device::rx_d_w));
558574
diag.set_option_device_input_defaults("terminal", DEVICE_INPUT_DEFAULTS_NAME(terminal));
559575

576+
// TODO: SENET here
577+
// uses I960_IRQ2
578+
560579
PALETTE(config, m_palette).set_entries(0x100);
561580

562581
ramdac_device &ramdac(RAMDAC(config, "ramdac", 0, m_palette));
@@ -574,16 +593,6 @@ void igt_gameking_state::igt_gameking(machine_config &config)
574593
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_1);
575594
}
576595

577-
void igt_gameking_state::igt_ms72c(machine_config &config)
578-
{
579-
igt_gameking(config);
580-
m_maincpu->set_addrmap(AS_PROGRAM, &igt_gameking_state::igt_ms72c_map);
581-
582-
// TODO: pinpoint enable/acknowledge
583-
// clears a bit in $280201fc from there, may really expect vectored irqs from i960 instead ...
584-
// irq2 comes from SENET device
585-
// m_screen->screen_vblank().set_inputline(m_maincpu, I960_IRQ2);
586-
}
587596

588597
// TODO: standardize ROM labels
589598
// `${socket_name}_${printed_label}.${ROM position}`, ms14 for an example
@@ -953,7 +962,7 @@ GAME( 1998, dblheart, 0, igt_gameking, igt_gameking, igt_gameking_state, e
953962
GAME( 1998, ms3, 0, igt_gameking, igt_gameking, igt_gameking_state, empty_init, ROT0, "IGT", "Multistar 3", MACHINE_NOT_WORKING | MACHINE_NO_SOUND )
954963
GAME( 1998, ms5, 0, igt_gameking, igt_gameking, igt_gameking_state, empty_init, ROT0, "IGT", "Multistar 5", MACHINE_NOT_WORKING | MACHINE_NO_SOUND )
955964
GAME( 1999, mystjag, 0, igt_gameking, igt_gameking, igt_gameking_state, empty_init, ROT0, "IGT", "Mystic Jaguar", MACHINE_NOT_WORKING | MACHINE_NO_SOUND )
956-
GAME( 2000, ms72c, 0, igt_ms72c, igt_gameking, igt_gameking_state, empty_init, ROT0, "IGT", "Multistar 7 2c", MACHINE_NOT_WORKING | MACHINE_NO_SOUND )
965+
GAME( 2000, ms72c, 0, igt_gameking, igt_gameking, igt_gameking_state, empty_init, ROT0, "IGT", "Multistar 7 2c", MACHINE_NOT_WORKING | MACHINE_NO_SOUND )
957966
GAME( 2003, gkigt4, 0, igt_gameking, igt_gameking, igt_gameking_state, empty_init, ROT0, "IGT", "Game King (v4.x)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND )
958967
GAME( 2003, gkigt4ms, gkigt4, igt_gameking, igt_gameking, igt_gameking_state, empty_init, ROT0, "IGT", "Game King (v4.x, MS)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND )
959968
GAME( 2003, gkigt43, gkigt4, igt_gameking, igt_gameking, igt_gameking_state, empty_init, ROT0, "IGT", "Game King (v4.3)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND )

0 commit comments

Comments
 (0)