Skip to content

Commit

Permalink
misc/xtom3d: Implement PIU10 PCB board for Pump It Up hardware config…
Browse files Browse the repository at this point in the history
…uration
  • Loading branch information
987123879113 committed Apr 12, 2024
1 parent e02d2e4 commit 0d00bc8
Show file tree
Hide file tree
Showing 3 changed files with 330 additions and 1 deletion.
74 changes: 73 additions & 1 deletion src/mame/misc/xtom3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,61 @@ ROM BOARD
---------
MX29F1610MC 16M FlashROM (x7)
---
Pump It Up MK-III
SPACE11_3 board (front plane PCB)
-----------
6 pin and 4 pin power connectors (+12V and +5V on both) on back side of PCB
2x 4 pin power headers on front
2 pin COMM header on back side
3 pin PCM header on back side, connects to CN5 on SPACE12_1 board?
2x HD34PIN header on back side, connects to CN2 and CN3 of SPACE12_1 board
2x5 pin header on back side
6 pin Video header (R, G, B, GND, HSYNC, VSYNC) from back side, connecting to VGA header on front side
HS10PIN labeled 1P on front
HS10PIN labeled LAMP on front
HS10PIN labeled 2P on front
3x HS3PIN on front
TEST, SERV, CLR buttons on front
4 pin header unlabeled on front
CN5 JAMMA(?) connector
SPACE12_1 board
-----------
A40MX04 QFP84 CPLD
U6 CSI CAT93C46P 1KB eeproom
U7 Unpopulated 8 pin socket
U8 KS74HCTLS125N
U5, U9, U10, U11, U12, U13, U14 HD74LS14P
U15, U16, U17, U18 ULN2803A
U19, U20, U21, U22 HD74LS245P
U23, U26 L9940 LTV847CD
U24, U25 L9944 LTV847
U27 Sharp PC817
U28 Yamaha YMZ280B-F
U29 Yamaha YAC516
U31, U32 HA17558
U101 SN75176BP
U100 Unpopulated socket
U102 Unpopulated MAX232
J1 connects to main PCB
CN1 PCN96, connects to PIU10
CN2 34 pin connector
CN3 34 pin connector
CN5 3 pin connector, audio?
CN100 2 pin connector
Unnamed 5 pin connector
DB25PIN Unpopulated header near A40MX04
HS3PIN Unpopulated header near A40MX04
1.8432MHz XTAL near A40MX04
169NDK19 XTAL (16.9344MHz) near Yamaha YMZ280B-F
**************************************************************************************************/


Expand Down Expand Up @@ -89,6 +144,8 @@ MX29F1610MC 16M FlashROM (x7)
#include "sound/ymz280b.h"
#include "video/voodoo_pci.h"

#include "xtom3d_piu10.h"

#include "speaker.h"

#define LOG_FLASH (1U << 1)
Expand Down Expand Up @@ -182,6 +239,7 @@ u8 isa16_oksan_rom_disk::read(offs_t offset)
return rom_data;
}
}

return 0;
}

Expand Down Expand Up @@ -424,6 +482,7 @@ void isa16_xtom3d_io_sound::io_map(address_map &map)
{
// $2a0-$2a3 sound
map(0x00, 0x03).rw("ymz", FUNC(ymz280b_device::read), FUNC(ymz280b_device::write)).umask16(0x00ff);
// map(0x04, 0x07).noprw(); // lights/outputs?
map(0x08, 0x09).lr8(
NAME([this] (offs_t offset) {
return offset & 1 ? m_system->read() : m_in0->read();
Expand Down Expand Up @@ -572,6 +631,7 @@ class xtom3d_state : public driver_device
// void vblank_assert(int state);

static void romdisk_config(device_t *device);
static void piu10_config(device_t *device);
// static void cdrom_config(device_t *device);
};

Expand All @@ -587,6 +647,7 @@ void xtom3d_isa_cards(device_slot_interface &device)
device.option_add_internal("oksan_lpc", ISA16_OKSAN_LPC);
device.option_add_internal("xtom3d_io_sound", ISA16_XTOM3D_IO_SOUND);
device.option_add_internal("pumpitup_io_sound", ISA16_PUMPITUP_IO_SOUND);
device.option_add_internal("pumpitup_piu10", ISA16_PIU10);
}

void xtom3d_state::romdisk_config(device_t *device)
Expand All @@ -595,6 +656,13 @@ void xtom3d_state::romdisk_config(device_t *device)
romdisk.set_rom_tag("game_rom");
}

void xtom3d_state::piu10_config(device_t *device)
{
isa16_piu10 &piu10 = *downcast<isa16_piu10 *>(device);
piu10.add_route(0, ":lmicrophone", 0.25);
piu10.add_route(1, ":rmicrophone", 0.25);
}

// TODO: unverified PCI config space
void xtom3d_state::xtom3d(machine_config &config)
{
Expand Down Expand Up @@ -672,6 +740,7 @@ void xtom3d_state::pumpitup(machine_config &config)
m_pci_ide->subdevice<bus_master_ide_controller_device>("ide1")->slot(0).set_default_option("cdrom");
m_pci_ide->subdevice<bus_master_ide_controller_device>("ide1")->slot(0).set_option_machine_config("cdrom", cdrom_config);

ISA16_SLOT(config.replace(), "board1", 0, "pci:07.0:isabus", xtom3d_isa_cards, "pumpitup_piu10", true).set_option_machine_config("pumpitup_piu10", piu10_config);
ISA16_SLOT(config.replace(), "isa1", 0, "pci:07.0:isabus", xtom3d_isa_cards, "pumpitup_io_sound", true);
}

Expand All @@ -698,13 +767,16 @@ ROM_END
#define PUMPITUP_BIOS \
ROM_REGION32_LE(0x20000, "pci:07.0", 0) \
ROM_LOAD( "bios.u22", 0x000000, 0x020000, CRC(f7c58044) SHA1(fd967d009e0d3c8ed9dd7be852946f2b9dee7671) ) \
ROM_REGION32_LE(0x1000000, "board1:game_rom", ROMREGION_ERASEFF ) \
ROM_REGION(0x200000, "board1:pumpitup_piu10:flash_u8", ROMREGION_ERASEFF ) \
ROM_LOAD( "piu10.u8", 0x000000, 0x200000, CRC(5911e31a) SHA1(295723b9b7da9e55b5dd5586b23b06355f4837ef) ) \
ROM_REGION(0x400000, "isa1:pumpitup_io_sound:ymz", ROMREGION_ERASEFF ) \
ROM_LOAD( "piu10.u9", 0x000000, 0x200000, CRC(9c436cfa) SHA1(480ea52e74721d1963ced41be5c482b7b913ccd2) )

ROM_START( pumpitup )
PUMPITUP_BIOS

ROM_REGION( 0x8, "board1:pumpitup_piu10:cat702", 0 )
ROM_LOAD_OPTIONAL( "cat702.bin", 0x000000, 0x000008, BAD_DUMP )
ROM_END

ROM_START( pumpit1 )
Expand Down
204 changes: 204 additions & 0 deletions src/mame/misc/xtom3d_piu10.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@
/*
ISA16 PIU10
PIU10 000614
-----------
HS3PIN labeled POWER
CD-IN 4 pin header but only 3 pins populated
(audio) OUT 4 pin header but only 3 pins populated, markings nearby show pinout of "OUTR GND OUTL GND"
6 pin power headers in corner
U1, U2, U3 HD74LS138P
U4, U5, U14 HD74LS245P
U6 HD74LS139P
U7 PST518
U8, U9, U10 MX 29F1610MC-12 (U10 unpopulated) with optional "MONO" configuration beside it
U11 ATMEL ATF1500A I5JC 0015
U12 Micronas MAS3507D F10
U13 Micronas DAC3350A C2
U15 HD74LS273P
U16 HD74LS125AP
U18, U19 7809CT Linear Voltage Regulator
U20 UTC 78L05 WK
U21, U22 HA17358
CN1 PCN96, connects to SPACE12_1
CN3, CN4 Unpopulated 4 pin headers
14.7456MHz XTAL near Micronas chips
CAT702 security data:
https://github.com/pumpitupdev/pumptools/blob/b809d8674925d3c6e6b25efa91dccc04a460a62f/src/main/sec/lockchip/lockchip-defs.h
*/

#include "emu.h"
#include "xtom3d_piu10.h"


DEFINE_DEVICE_TYPE(ISA16_PIU10, isa16_piu10, "isa16_piu10", "ISA16 PIU10 for MK-III")

isa16_piu10::isa16_piu10(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, ISA16_PIU10, tag, owner, clock)
, device_isa16_card_interface(mconfig, *this)
, m_cat702(*this, "cat702")
, m_dac3350a(*this, "dac3350a")
, m_mas3507d(*this, "mas3507d")
, m_flash(*this, "flash_u8")
{
}

void isa16_piu10::device_start()
{
set_isa_device();

save_item(NAME(m_addr));
save_item(NAME(m_dest));
save_item(NAME(m_flash_unlock));
save_item(NAME(m_mp3_demand));
save_item(NAME(m_mp3_mpeg_frame_sync));
save_item(NAME(m_cat702_data));
}

void isa16_piu10::device_reset()
{
m_addr = m_dest = 0;
m_flash_unlock = false;

m_mp3_demand = 1;
m_mp3_mpeg_frame_sync = 1;

m_cat702_data = 0;
}

void isa16_piu10::device_add_mconfig(machine_config &config)
{
MACRONIX_29F1610MC_16BIT(config, m_flash);

CAT702_PIU(config, m_cat702, 0);
m_cat702->dataout_handler().set([this] (u16 data) {
m_cat702_data = data & 1;
});

DAC3350A(config, m_dac3350a);

MAS3507D(config, m_mas3507d);
m_mas3507d->mpeg_frame_sync_cb().set(*this, FUNC(isa16_piu10::mas3507d_mpeg_frame_sync));
m_mas3507d->demand_cb().set(*this, FUNC(isa16_piu10::mas3507d_demand));
m_mas3507d->add_route(0, m_dac3350a, 1.0, 0);
m_mas3507d->add_route(1, m_dac3350a, 1.0, 1);
}

void isa16_piu10::remap(int space_id, offs_t start, offs_t end)
{
if (space_id == AS_IO)
{
m_isa->install16_device(0x02d0, 0x02df, read16sm_delegate(*this, FUNC(isa16_piu10::read)), write16sm_delegate(*this, FUNC(isa16_piu10::write)));
}
}

uint16_t isa16_piu10::read(offs_t offset)
{
switch (offset)
{
case 0x5: // 2da
if (m_dest == 0x008)
{
uint16_t r = 0;

r |= (m_cat702_data & 1) << 5;

r |= m_mp3_mpeg_frame_sync << 2; // every 256th transition the game will set the internal playback position timestamp to counter*6.2687998 to sync with the MP3 decoder chip (counter*6.2687998/240 = (1152*counter)/44100)
r |= 1 << 1; // the MP3 data send function loops until this is 1 before sending MP3 data byte
r |= m_mp3_demand << 0; // if not set then MP3 data send function early returns

return r;
}
else if (m_dest == 0)
{
const uint32_t offs = m_addr;
if (m_flash_unlock)
m_addr++;
return m_flash->read(offs);
}
break;
}

logerror("%s: unknown read %d %03x %06x %02x\n", machine().describe_context(), m_flash_unlock, m_dest, m_addr, offset);

return 0;
}

void isa16_piu10::write(offs_t offset, uint16_t data)
{
switch(offset)
{
// address port, bottom 16-bits are location and top 16-bits are target device
case 0x0: // 2d0
m_addr &= 0xfff00;
m_addr |= data & 0xff;
break;
case 0x1: // 2d2
m_addr &= 0xf00ff;
m_addr |= (data & 0xff) << 8;
break;

case 0x2: // 2d4
m_addr &= 0x0ffff;
m_addr |= (data & 0xf) << 16;

m_dest &= 0xff0;
m_dest |= (data >> 4) & 0xf;
break;
case 0x3: // 2d6
m_dest &= 0x00f;
m_dest |= (data & 0xff) << 4;
break;

// data port
case 0x5: // 2da
{
if (m_dest == 0x010)
{
m_cat702->write_datain(BIT(data, 5));
m_cat702->write_clock(BIT(data, 4));
m_cat702->write_select(BIT(data, 3));

m_dac3350a->i2c_sda_w(BIT(data, 1));
m_dac3350a->i2c_scl_w(BIT(data, 0));
}
else if (m_dest == 0x008)
{
m_mas3507d->sid_w(data);
}
else if (m_dest == 0 && m_flash_unlock)
{
m_flash->write(m_addr, data);
}
else
{
logerror("%s: unknown write %d %03x %06x %02x %02x\n", machine().describe_context(), m_flash_unlock, m_dest, m_addr, offset, data);
}
break;
}

// chip enable, 0 -> 1 transitions
case 0x6: // 2dc
m_flash_unlock = BIT(data, 3);
break;

default:
logerror("%s: unknown write %d %03x %06x %02x %02x\n", machine().describe_context(), m_flash_unlock, m_dest, m_addr, offset, data);
break;
}
}

void isa16_piu10::mas3507d_mpeg_frame_sync(int state)
{
m_mp3_mpeg_frame_sync ^= state;
}

void isa16_piu10::mas3507d_demand(int state)
{
m_mp3_demand = state;
}
Loading

0 comments on commit 0d00bc8

Please sign in to comment.