Skip to content

Commit

Permalink
konami/nwk-tr.cpp: implement broadcast CG select
Browse files Browse the repository at this point in the history
  • Loading branch information
angelosa committed Feb 6, 2025
1 parent 7d7fe08 commit 24cb885
Showing 1 changed file with 72 additions and 44 deletions.
116 changes: 72 additions & 44 deletions src/mame/konami/nwk-tr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,7 @@ void nwktr_state::sysreg_w(offs_t offset, uint8_t data)
}

case 7:
{
/*
0x80 = EXRES1
0x40 = EXRES0
Expand All @@ -415,15 +416,16 @@ void nwktr_state::sysreg_w(offs_t offset, uint8_t data)
if (BIT(data, 6)) // CG Board 0 IRQ Ack
m_maincpu->set_input_line(INPUT_LINE_IRQ0, CLEAR_LINE);

m_konppc->set_cgboard_id((data >> 4) & 0x3);

// Racing Jam sets CG board ID to 2 when writing to the tilemap chip.
// This could mean broadcast to both CG boards?
// NOTE: racingj writes a 2 to broadcast writes to both CG boards
// it also sets a 3 during POST, assume to just unmap the space.
const u8 exid = (data >> 4) & 0x3;
m_konppc->set_cgboard_id(exid);

m_exrgb = BIT(data, 0); // Select which CG Board outputs signal

m_cg_view.select(m_konppc->get_cgboard_id() ? 1 : 0);
m_cg_view.select(exid);
break;
}

default:
break;
Expand Down Expand Up @@ -491,6 +493,34 @@ void nwktr_state::ppc_map(address_map &map)
m_cg_view[1](0x74010000, 0x7401ffff).ram().w(m_palette[1], FUNC(palette_device::write32)).share("palette2");
m_cg_view[1](0x74020000, 0x7403ffff).rw(m_k001604[1], FUNC(k001604_device::tile_r), FUNC(k001604_device::tile_w));
m_cg_view[1](0x74040000, 0x7407ffff).rw(m_k001604[1], FUNC(k001604_device::char_r), FUNC(k001604_device::char_w));
// racingj broadcast
m_cg_view[2](0x74000000, 0x740000ff).lw32(
NAME([this] (offs_t offset, u32 data, u32 mem_mask) {
m_k001604[0]->reg_w(offset, data, mem_mask);
m_k001604[1]->reg_w(offset, data, mem_mask);
})
);
m_cg_view[2](0x74010000, 0x7401ffff).lw32(
NAME([this] (offs_t offset, u32 data, u32 mem_mask) {
m_palette[0]->write32(offset, data, mem_mask);
m_palette[1]->write32(offset, data, mem_mask);
})
);
m_cg_view[2](0x74020000, 0x7403ffff).lw32(
NAME([this] (offs_t offset, u32 data, u32 mem_mask) {
m_k001604[0]->tile_w(offset, data, mem_mask);
m_k001604[1]->tile_w(offset, data, mem_mask);
})
);
m_cg_view[2](0x74040000, 0x7407ffff).lw32(
NAME([this] (offs_t offset, u32 data, u32 mem_mask) {
m_k001604[0]->char_w(offset, data, mem_mask);
m_k001604[1]->char_w(offset, data, mem_mask);
})
);
// racingj POST only, assume unmapped
m_cg_view[3](0x74000000, 0x7407ffff).unmaprw();

map(0x78000000, 0x7800ffff).rw(m_konppc, FUNC(konppc_device::cgboard_dsp_shared_r_ppc), FUNC(konppc_device::cgboard_dsp_shared_w_ppc));
map(0x780c0000, 0x780c0003).rw(m_konppc, FUNC(konppc_device::cgboard_dsp_comm_r_ppc), FUNC(konppc_device::cgboard_dsp_comm_w_ppc));
map(0x7d000000, 0x7d00ffff).r(FUNC(nwktr_state::sysreg_r));
Expand Down Expand Up @@ -1746,53 +1776,51 @@ ROM_END

/*****************************************************************************/

#define GAME_FLAGS (MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND )

// GNxxx -> 5+R gear shift (8-way joystick), clutch pedal, hand brake lever
// GYxxx -> Same as GN but intended for the 'super deluxe' cab (Cobra system). GY676 RTC is interchangable between Cobra and NWK-TR Racing Jam
// GPxxx, GExxx, GMxxx -> up/down gear shift, no clutch, hand brake lever
// GQxxx -> up/down gear shift, no clutch, no hand brake lever
// Change the first two bytes in the NVRAM and fix the checksum at 0x0e-0x0f (calculated as the negated sum of 0x00-0x0e as 16-bit big endian values)
// to generate new NVRAMs.
GAME( 1998, racingj, 0, nwktr, nwktr_gq, nwktr_state, init_racingj, ROT0, "Konami", "Racing Jam (GQ676UAC)", GAME_FLAGS )
GAME( 1998, racingje, racingj, nwktr, nwktr_gq, nwktr_state, init_racingj, ROT0, "Konami", "Racing Jam (GQ676EAC)", GAME_FLAGS )
GAME( 1998, racingjj, racingj, nwktr, nwktr_gq, nwktr_state, init_racingj, ROT0, "Konami", "Racing Jam (GQ676JAC)", GAME_FLAGS )
GAME( 1998, racingja, racingj, nwktr, nwktr_gq, nwktr_state, init_racingj, ROT0, "Konami", "Racing Jam (GQ676AAC)", GAME_FLAGS )
GAME( 1998, racingjm, racingj, nwktr, nwktr_gm, nwktr_state, init_racingj, ROT0, "Konami", "Racing Jam (GM676UAC)", GAME_FLAGS )
GAME( 1998, racingjme, racingj, nwktr, nwktr_gm, nwktr_state, init_racingj, ROT0, "Konami", "Racing Jam (GM676EAC)", GAME_FLAGS )
GAME( 1998, racingjmj, racingj, nwktr, nwktr_gm, nwktr_state, init_racingj, ROT0, "Konami", "Racing Jam (GM676JAC)", GAME_FLAGS )
GAME( 1998, racingjma, racingj, nwktr, nwktr_gm, nwktr_state, init_racingj, ROT0, "Konami", "Racing Jam (GM676AAC)", GAME_FLAGS )
GAME( 1998, racingjn, racingj, nwktr, nwktr_gn, nwktr_state, init_racingj, ROT0, "Konami", "Racing Jam (GN676UAC)", GAME_FLAGS )
GAME( 1998, racingjne, racingj, nwktr, nwktr_gn, nwktr_state, init_racingj, ROT0, "Konami", "Racing Jam (GN676EAC)", GAME_FLAGS )
GAME( 1998, racingjnj, racingj, nwktr, nwktr_gn, nwktr_state, init_racingj, ROT0, "Konami", "Racing Jam (GN676JAC)", GAME_FLAGS )
GAME( 1998, racingjna, racingj, nwktr, nwktr_gn, nwktr_state, init_racingj, ROT0, "Konami", "Racing Jam (GN676AAC)", GAME_FLAGS )

GAME( 1998, racingj2, 0, nwktr, nwktr_gq, nwktr_state, init_racingj, ROT0, "Konami", "Racing Jam: Chapter II (GQ888UAA)", GAME_FLAGS )
GAME( 1998, racingj2e, racingj2, nwktr, nwktr_gq, nwktr_state, init_racingj, ROT0, "Konami", "Racing Jam: Chapter II (GQ888EAA)", GAME_FLAGS )
GAME( 1998, racingj2j, racingj2, nwktr, nwktr_gq, nwktr_state, init_racingj, ROT0, "Konami", "Racing Jam: Chapter II (GQ888JAA)", GAME_FLAGS )
GAME( 1998, racingj2a, racingj2, nwktr, nwktr_gq, nwktr_state, init_racingj, ROT0, "Konami", "Racing Jam: Chapter II (GQ888AAA)", GAME_FLAGS )
GAME( 1998, racingj2m, racingj2, nwktr, nwktr_gm, nwktr_state, init_racingj, ROT0, "Konami", "Racing Jam: Chapter II (GM888UAA)", GAME_FLAGS )
GAME( 1998, racingj2me, racingj2, nwktr, nwktr_gm, nwktr_state, init_racingj, ROT0, "Konami", "Racing Jam: Chapter II (GM888EAA)", GAME_FLAGS )
GAME( 1998, racingj2mj, racingj2, nwktr, nwktr_gm, nwktr_state, init_racingj, ROT0, "Konami", "Racing Jam: Chapter II (GM888JAA)", GAME_FLAGS )
GAME( 1998, racingj2ma, racingj2, nwktr, nwktr_gm, nwktr_state, init_racingj, ROT0, "Konami", "Racing Jam: Chapter II (GM888AAA)", GAME_FLAGS )
GAME( 1998, racingj2n, racingj2, nwktr, nwktr_gn, nwktr_state, init_racingj, ROT0, "Konami", "Racing Jam: Chapter II (GN888UAA)", GAME_FLAGS )
GAME( 1998, racingj2ne, racingj2, nwktr, nwktr_gn, nwktr_state, init_racingj, ROT0, "Konami", "Racing Jam: Chapter II (GN888EAA)", GAME_FLAGS )
GAME( 1998, racingj2nj, racingj2, nwktr, nwktr_gn, nwktr_state, init_racingj, ROT0, "Konami", "Racing Jam: Chapter II (GN888JAA)", GAME_FLAGS )
GAME( 1998, racingj2na, racingj2, nwktr, nwktr_gn, nwktr_state, init_racingj, ROT0, "Konami", "Racing Jam: Chapter II (GN888AAA)", GAME_FLAGS )
GAME( 1998, racingj, 0, nwktr, nwktr_gq, nwktr_state, init_racingj, ROT0, "Konami", "Racing Jam (GQ676UAC)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND )
GAME( 1998, racingje, racingj, nwktr, nwktr_gq, nwktr_state, init_racingj, ROT0, "Konami", "Racing Jam (GQ676EAC)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND )
GAME( 1998, racingjj, racingj, nwktr, nwktr_gq, nwktr_state, init_racingj, ROT0, "Konami", "Racing Jam (GQ676JAC)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND )
GAME( 1998, racingja, racingj, nwktr, nwktr_gq, nwktr_state, init_racingj, ROT0, "Konami", "Racing Jam (GQ676AAC)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND )
GAME( 1998, racingjm, racingj, nwktr, nwktr_gm, nwktr_state, init_racingj, ROT0, "Konami", "Racing Jam (GM676UAC)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND )
GAME( 1998, racingjme, racingj, nwktr, nwktr_gm, nwktr_state, init_racingj, ROT0, "Konami", "Racing Jam (GM676EAC)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND )
GAME( 1998, racingjmj, racingj, nwktr, nwktr_gm, nwktr_state, init_racingj, ROT0, "Konami", "Racing Jam (GM676JAC)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND )
GAME( 1998, racingjma, racingj, nwktr, nwktr_gm, nwktr_state, init_racingj, ROT0, "Konami", "Racing Jam (GM676AAC)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND )
GAME( 1998, racingjn, racingj, nwktr, nwktr_gn, nwktr_state, init_racingj, ROT0, "Konami", "Racing Jam (GN676UAC)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND )
GAME( 1998, racingjne, racingj, nwktr, nwktr_gn, nwktr_state, init_racingj, ROT0, "Konami", "Racing Jam (GN676EAC)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND )
GAME( 1998, racingjnj, racingj, nwktr, nwktr_gn, nwktr_state, init_racingj, ROT0, "Konami", "Racing Jam (GN676JAC)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND )
GAME( 1998, racingjna, racingj, nwktr, nwktr_gn, nwktr_state, init_racingj, ROT0, "Konami", "Racing Jam (GN676AAC)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND )

GAME( 1998, racingj2, 0, nwktr, nwktr_gq, nwktr_state, init_racingj, ROT0, "Konami", "Racing Jam: Chapter II (GQ888UAA)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND )
GAME( 1998, racingj2e, racingj2, nwktr, nwktr_gq, nwktr_state, init_racingj, ROT0, "Konami", "Racing Jam: Chapter II (GQ888EAA)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND )
GAME( 1998, racingj2j, racingj2, nwktr, nwktr_gq, nwktr_state, init_racingj, ROT0, "Konami", "Racing Jam: Chapter II (GQ888JAA)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND )
GAME( 1998, racingj2a, racingj2, nwktr, nwktr_gq, nwktr_state, init_racingj, ROT0, "Konami", "Racing Jam: Chapter II (GQ888AAA)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND )
GAME( 1998, racingj2m, racingj2, nwktr, nwktr_gm, nwktr_state, init_racingj, ROT0, "Konami", "Racing Jam: Chapter II (GM888UAA)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND )
GAME( 1998, racingj2me, racingj2, nwktr, nwktr_gm, nwktr_state, init_racingj, ROT0, "Konami", "Racing Jam: Chapter II (GM888EAA)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND )
GAME( 1998, racingj2mj, racingj2, nwktr, nwktr_gm, nwktr_state, init_racingj, ROT0, "Konami", "Racing Jam: Chapter II (GM888JAA)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND )
GAME( 1998, racingj2ma, racingj2, nwktr, nwktr_gm, nwktr_state, init_racingj, ROT0, "Konami", "Racing Jam: Chapter II (GM888AAA)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND )
GAME( 1998, racingj2n, racingj2, nwktr, nwktr_gn, nwktr_state, init_racingj, ROT0, "Konami", "Racing Jam: Chapter II (GN888UAA)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND )
GAME( 1998, racingj2ne, racingj2, nwktr, nwktr_gn, nwktr_state, init_racingj, ROT0, "Konami", "Racing Jam: Chapter II (GN888EAA)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND )
GAME( 1998, racingj2nj, racingj2, nwktr, nwktr_gn, nwktr_state, init_racingj, ROT0, "Konami", "Racing Jam: Chapter II (GN888JAA)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND )
GAME( 1998, racingj2na, racingj2, nwktr, nwktr_gn, nwktr_state, init_racingj, ROT0, "Konami", "Racing Jam: Chapter II (GN888AAA)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND )

// JAx, ABx --> 5+R gear shift (8-way joystick), clutch pedal, hand brake lever
// JCx, ACx, UDx --> up/down gear shift, no clutch, hand brake lever
// EDx --> prompts you to select if you have a hand brake lever installed, a clutch pedal installed,
// gear shifter type (up/down, 4 pos, or 5+R), and gear shifter's display position.
GAME( 1998, thrilld, 0, nwktr_lan_b, nwktr_gm, nwktr_state, init_thrilld, ROT0, "Konami", "Thrill Drive (UDE)", GAME_FLAGS )
GAME( 1998, thrilldj, thrilld, nwktr_lan_b, nwktr_gm, nwktr_state, init_thrilld, ROT0, "Konami", "Thrill Drive (JCE)", GAME_FLAGS )
GAME( 1998, thrilldja, thrilld, nwktr_lan_b, nwktr_gn, nwktr_state, init_thrilld, ROT0, "Konami", "Thrill Drive (JAE)", GAME_FLAGS )
GAME( 1998, thrillde, thrilld, nwktr_lan_b, thrillde, nwktr_state, init_thrilld, ROT0, "Konami", "Thrill Drive (EDE)", GAME_FLAGS )
GAME( 1998, thrillda, thrilld, nwktr_lan_b, nwktr_gm, nwktr_state, init_thrilld, ROT0, "Konami", "Thrill Drive (ACE)", GAME_FLAGS )
GAME( 1998, thrilldab, thrilld, nwktr_lan_b, nwktr_gn, nwktr_state, init_thrilld, ROT0, "Konami", "Thrill Drive (ABE)", GAME_FLAGS )
GAME( 1998, thrilldb, thrilld, nwktr_lan_b, nwktr_gm, nwktr_state, init_thrilld, ROT0, "Konami", "Thrill Drive (UDB)", GAME_FLAGS )
GAME( 1998, thrilldbj, thrilld, nwktr_lan_b, nwktr_gm, nwktr_state, init_thrilld, ROT0, "Konami", "Thrill Drive (JCB)", GAME_FLAGS )
GAME( 1998, thrilldbja, thrilld, nwktr_lan_b, nwktr_gn, nwktr_state, init_thrilld, ROT0, "Konami", "Thrill Drive (JAB)", GAME_FLAGS )
GAME( 1998, thrilldbe, thrilld, nwktr_lan_b, thrillde, nwktr_state, init_thrilld, ROT0, "Konami", "Thrill Drive (EDB)", GAME_FLAGS )
GAME( 1998, thrilldba, thrilld, nwktr_lan_b, nwktr_gm, nwktr_state, init_thrilld, ROT0, "Konami", "Thrill Drive (ACB)", GAME_FLAGS )
GAME( 1998, thrilldbab, thrilld, nwktr_lan_b, nwktr_gn, nwktr_state, init_thrilld, ROT0, "Konami", "Thrill Drive (ABB)", GAME_FLAGS )
GAME( 1998, thrilld, 0, nwktr_lan_b, nwktr_gm, nwktr_state, init_thrilld, ROT0, "Konami", "Thrill Drive (UDE)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND )
GAME( 1998, thrilldj, thrilld, nwktr_lan_b, nwktr_gm, nwktr_state, init_thrilld, ROT0, "Konami", "Thrill Drive (JCE)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND )
GAME( 1998, thrilldja, thrilld, nwktr_lan_b, nwktr_gn, nwktr_state, init_thrilld, ROT0, "Konami", "Thrill Drive (JAE)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND )
GAME( 1998, thrillde, thrilld, nwktr_lan_b, thrillde, nwktr_state, init_thrilld, ROT0, "Konami", "Thrill Drive (EDE)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND )
GAME( 1998, thrillda, thrilld, nwktr_lan_b, nwktr_gm, nwktr_state, init_thrilld, ROT0, "Konami", "Thrill Drive (ACE)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND )
GAME( 1998, thrilldab, thrilld, nwktr_lan_b, nwktr_gn, nwktr_state, init_thrilld, ROT0, "Konami", "Thrill Drive (ABE)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND )
GAME( 1998, thrilldb, thrilld, nwktr_lan_b, nwktr_gm, nwktr_state, init_thrilld, ROT0, "Konami", "Thrill Drive (UDB)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND )
GAME( 1998, thrilldbj, thrilld, nwktr_lan_b, nwktr_gm, nwktr_state, init_thrilld, ROT0, "Konami", "Thrill Drive (JCB)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND )
GAME( 1998, thrilldbja, thrilld, nwktr_lan_b, nwktr_gn, nwktr_state, init_thrilld, ROT0, "Konami", "Thrill Drive (JAB)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND )
GAME( 1998, thrilldbe, thrilld, nwktr_lan_b, thrillde, nwktr_state, init_thrilld, ROT0, "Konami", "Thrill Drive (EDB)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND )
GAME( 1998, thrilldba, thrilld, nwktr_lan_b, nwktr_gm, nwktr_state, init_thrilld, ROT0, "Konami", "Thrill Drive (ACB)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND )
GAME( 1998, thrilldbab, thrilld, nwktr_lan_b, nwktr_gn, nwktr_state, init_thrilld, ROT0, "Konami", "Thrill Drive (ABB)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND )

9 comments on commit 24cb885

@Hydreigon223
Copy link
Contributor

@Hydreigon223 Hydreigon223 commented on 24cb885 Feb 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible to convert the k001604 device reg area into an address map instead of a switch case mess with this change in effect?

Also 0x2 for exid sets it to write to cg board 1 only. It's 0x3 that sets it for a broadcast write.

@angelosa
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see a switch case here, beyond the one in sysregs_w which should really be decoupled at root.

@Hydreigon223
Copy link
Contributor

@Hydreigon223 Hydreigon223 commented on 24cb885 Feb 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's https://github.com/mamedev/mame/blob/master/src/mame/konami/k001604.cpp reg_r and reg_w I would have planned to decouple in the near future. That's my concern.

Edit: Or...I could create two address maps (read and write) out of reg_r and reg_w.

Edit 2: I will likely put untangling sysreg_r and w for zr107, gticlub and nwk-tr for a future PR as those are straightforward. Hornet on the other hand isn't.

@angelosa
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

regs_r and regs_w should be a single io_map address map yes,

Also 0x2 for exid sets it to write to cg board 1 only. It's 0x3 that sets it for a broadcast write.

What's 1 then? Just unmapped or mirror of 0?

@Hydreigon223
Copy link
Contributor

@Hydreigon223 Hydreigon223 commented on 24cb885 Feb 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding m_exid:

0x0: None/unmapped
0x1: CG Board 0 (master)
0x2: CG Board 1 (slave)
0x3: Both

Proof of m_exid = 0x3 being a simultaneous write to both cg boards is from setting two watchpoints at m_exid and k001604:regs_r and regs_w in racingj. The last value written to the byte m_exid is located before it writes to the tilemap register area for initialization before POST is 0xF0 thus enabling both exid bits. The next time racingj will write to m_exid is after its tilemap register initialization.

This long statement of what I did has prompted me to do the same for other Konami PPC games to see how they behave with their exid bits before POST. sscope will come later today after I'm done with work.

Edit: My previous statement is incorrect, see below.

@happppp
Copy link
Member

@happppp happppp commented on 24cb885 Feb 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks more sane than what Kale did, but it does not work.

Try this quick hack and you get missing tilemap layer graphics:
if (exid==0) m_cg_view.disable();
if (exid==1) m_cg_view.select(0);
if (exid==2) m_cg_view.select(1);
if (exid==3) m_cg_view.select(2);

If you assume it's active-low, it will work. But I'm not sure it's worth the assumption that the hw is configured with the ability to write to both boards simultaneously when it fixes nothing at all and it contradicts Hydreigon's 'proof'.
if (exid==3) m_cg_view.disable();
if (exid==2) m_cg_view.select(0);
if (exid==1) m_cg_view.select(1);
if (exid==0) m_cg_view.select(2);

@angelosa
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doing as what you are suggesting just completely blanks the screen/throws heaps of unmapped space accesses, plus it's not what's happening (it generally writes a 2). What's your source of all this?

@Hydreigon223
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe...I'm going to have to end this discussion here after my analysis of the two exid bits with various other games. This was the behavior I recorded for the following games written to the byte m_exid would be assigned to before initializing tilemap regs:

  • slrasslt: 0xC0
  • thrilld: 0xE0
  • sscope: 0xC0 (writes CRTC parameters to tilemap that more fits medium resolution) then 0xD0 (same thing but fits standard resolution)
  • racingj: 0xF0 then 0xE0

This means, at most, only the EXID0 bit determines which CG board to read and write while EXID1's purpose is currently unknown. While I had a very long day of work, I'm glad to have double checked this behavior with other games.

@angelosa
Copy link
Member Author

@angelosa angelosa commented on 24cb885 Feb 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is pretty clear being inconclusive, I'll just revert it later if @happppp doesn't beat me to it.

First off: bits 7 and 6 aren't really used in this context, those are irq ack lines. Then this is (yet again) the wrong perspective about #11343 , it's probably doing a more educated chip select for the CRTC interfacing (that part is a stub under the hood at best).

Please sign in to comment.