pc/champ2.cpp: convert to pt319a motherboard

This commit is contained in:
angelosa 2024-08-27 17:28:42 +02:00
parent 528a7927ba
commit 0c9a31c5e1
2 changed files with 77 additions and 48 deletions

View file

@ -35676,7 +35676,7 @@ pcd3nsl // Siemens-Nixdorf PCD-3Nsl
pcd3nsx // Siemens-Nixdorf PCD-3Nsx
php3239 // Philips P3239
ppm3333p // DTK Computer PPM-3333P
pt319a // Pint PT-319A motherboard (386sx)
pt319a // Pine PT-319A motherboard (386sx)
scamp386sx // motherboards using the SCAMPSX chipset (386sx)
scsxaio // Peacock 386sx Ver. 2.0 motherboard SCsxAIO (386sx)
sh386sx20 // Shuttle 386SX REV 2.0A motherboard (386sx)

View file

@ -4,19 +4,26 @@
Countertop Champ II? (c) 1993 U.S. Games
Dump contains a MS-DOS 3.3 ROM disk, presumably for a bartop style multigame/quiz/fortune teller.
Bartop style multigame/quiz/fortune teller
Dump contains a MS-DOS 3.3 ROM disk, ebay auction shows a Pine Technology PT-319A
(SARC RC2016A5 chipset) + 2 other populated ISA16 cards out of 6.
TODO:
- Host MB unknown, may be an higher CPU socket;
- Jumps in unpopulated RAM area as soon as it banks (PC=ca029 -> 0000:36AF), area may be
multibanked instead;
**************************************************************************************************/
#include "emu.h"
#include "cpu/i86/i86.h"
#include "bus/isa/isa_cards.h"
#include "bus/pc_kbd/keyboards.h"
#include "bus/pc_kbd/pc_kbdc.h"
#include "cpu/i386/i386.h"
#include "machine/at.h"
#include "machine/bankdev.h"
#include "machine/genpc.h"
#include "machine/ds128x.h"
#include "machine/nvram.h"
#include "machine/ram.h"
namespace {
@ -28,58 +35,57 @@ public:
: driver_device(mconfig, type, tag)
, m_maincpu(*this, "maincpu")
, m_mb(*this, "mb")
, m_ram(*this, "ram")
, m_bank(*this, "bank")
{ }
void champ2(machine_config &config);
void init_at();
protected:
virtual void machine_start() override;
virtual void machine_reset() override;
void init_at_common(int xmsbase);
private:
uint8_t m_port_b_data;
// uint8_t port_a_r();
// uint8_t port_b_r();
// uint8_t port_c_r();
// void port_b_w(uint8_t data);
required_device<cpu_device> m_maincpu;
required_device<pc_noppi_mb_device> m_mb;
required_device<i386_device> m_maincpu;
required_device<at_mb_device> m_mb;
required_device<ram_device> m_ram;
required_device<address_map_bank_device> m_bank;
void bank_map(address_map &map);
void main_io(address_map &map);
void main_map(address_map &map);
bool m_unlock_bank = false;
};
void champ2_state::main_map(address_map &map)
{
map(0x000000, 0x09ffff).bankrw("bank10");
// Selectable thru jumpers (0xc800, 0xd000, 0xd800, 0xe000)
map(0xc8000, 0xcffff).m(m_bank, FUNC(address_map_bank_device::amap8));
// writes to $+2000 then $+0000, same value (0x03)
map(0xca000, 0xca000).lw8(
map(0x0c8000, 0x0cffff).m(m_bank, FUNC(address_map_bank_device::amap8));
// writes to $+2000 then $+0000, same value (0x03) at POST,
// then writes 0 to $+2000 and N to $+0000
map(0x0c8000, 0x0c8000).lw8(
NAME([this] (offs_t offset, u8 data) {
m_bank->set_bank(data & 0x1f);
if (m_unlock_bank)
m_bank->set_bank(data & 0x1f);
})
);
map(0xfe000, 0xfffff).rom().region("bios", 0);
map(0x0ca000, 0x0ca000).lw8(
NAME([this] (offs_t offset, u8 data) {
m_unlock_bank = data == 0;
})
);
map(0x0e0000, 0x0fffff).rom().region("bios", 0);
map(0xfe0000, 0xffffff).rom().region("bios", 0);
}
void champ2_state::main_io(address_map &map)
{
map.global_mask(0x3ff);
map(0x0000, 0x00ff).m(m_mb, FUNC(pc_noppi_mb_device::map));
map(0x0060, 0x0060).lr8(NAME([] (offs_t offset) { return 0xaa; }));
// map(0x0061, 0x0061).rw(FUNC(champ2_state::port_b_r), FUNC(champ2_state::port_b_w));
// map(0x0062, 0x0062).r(FUNC(champ2_state::port_c_r));
// map(0x0201, 0x0201).portr("COIN"); // game port
// map(0x0310, 0x0311).rw(FUNC(champ2_state::disk_iobank_r), FUNC(champ2_state::disk_iobank_w)); //Prototyping card
// map(0x0312, 0x0312).portr("IN0"); // Prototyping card, r/o
// map(0x0313, 0x0313).w(FUNC(champ2_state::voice_start_w));
// map(0x03f2, 0x03f2).w(FUNC(champ2_state::fdc_dor_w));
// map(0x03f4, 0x03f4).r(FUNC(champ2_state::fdc765_status_r)); //765 Floppy Disk Controller (FDC) Status
// map(0x03f5, 0x03f5).rw(FUNC(champ2_state::fdc765_data_r), FUNC(champ2_state::fdc765_data_w));//FDC Data
map(0x0000, 0x00ff).m(m_mb, FUNC(at_mb_device::map));
}
@ -98,38 +104,44 @@ void champ2_state::machine_start()
void champ2_state::machine_reset()
{
m_bank->set_bank(0);
m_unlock_bank = false;
}
void champ2_state::champ2(machine_config &config)
{
I8088(config, m_maincpu, XTAL(14'318'181)/3);
I386SX(config, m_maincpu, 16'000'000);
m_maincpu->set_addrmap(AS_PROGRAM, &champ2_state::main_map);
m_maincpu->set_addrmap(AS_IO, &champ2_state::main_io);
m_maincpu->set_irq_acknowledge_callback("mb:pic8259", FUNC(pic8259_device::inta_cb));
m_maincpu->set_irq_acknowledge_callback("mb:pic8259_master", FUNC(pic8259_device::inta_cb));
// m_maincpu->shutdown_callback().set("mb", FUNC(at_mb_device::shutdown));
PCNOPPI_MOTHERBOARD(config, m_mb, 0).set_cputag(m_maincpu);
m_mb->int_callback().set_inputline(m_maincpu, 0);
m_mb->nmi_callback().set_inputline(m_maincpu, INPUT_LINE_NMI);
AT_MB(config, m_mb).at_softlists(config);
m_mb->kbd_clk().set("kbd", FUNC(pc_kbdc_device::clock_write_from_mb));
m_mb->kbd_data().set("kbd", FUNC(pc_kbdc_device::data_write_from_mb));
pc_kbdc_device &pc_kbdc(PC_KBDC(config, "kbd", pc_at_keyboards, STR_KBD_MICROSOFT_NATURAL));
pc_kbdc.out_clock_cb().set(m_mb, FUNC(at_mb_device::kbd_clk_w));
pc_kbdc.out_data_cb().set(m_mb, FUNC(at_mb_device::kbd_data_w));
// FIXME: determine ISA bus clock
ISA8_SLOT(config, "isa1", 0, "mb:isa", pc_isa8_cards, "vga", false);
// ISA8_SLOT(config, "isa2", 0, "mb:isa", pc_isa8_cards, "com", false);
// ISA8_SLOT(config, "isa3", 0, "mb:isa", pc_isa8_cards, "fdc_xt", false);
// ISA8_SLOT(config, "isa4", 0, "mb:isa", pc_isa8_cards, "hdc", false);
// ISA8_SLOT(config, "isa5", 0, "mb:isa", pc_isa8_cards, "adlib", false);
// ISA8_SLOT(config, "isa6", 0, "mb:isa", pc_isa8_cards, nullptr, false);
ISA16_SLOT(config, "isa1", 0, "mb:isabus", pc_isa16_cards, "vga", false);
ISA16_SLOT(config, "isa2", 0, "mb:isabus", pc_isa16_cards, nullptr, false);
ISA16_SLOT(config, "isa3", 0, "mb:isabus", pc_isa16_cards, nullptr, false);
ISA16_SLOT(config, "isa4", 0, "mb:isabus", pc_isa16_cards, nullptr, false);
ISA16_SLOT(config, "isa5", 0, "mb:isabus", pc_isa16_cards, nullptr, false);
ISA16_SLOT(config, "isa6", 0, "mb:isabus", pc_isa16_cards, nullptr, false);
RAM(config, RAM_TAG).set_default_size("640K");
RAM(config, m_ram).set_default_size("15M").set_extra_options("640K,1024K,1664K,2M,4M,8M,15M");
ADDRESS_MAP_BANK(config, m_bank).set_map(&champ2_state::bank_map).set_options(ENDIANNESS_LITTLE, 8, 20, 0x8000);
}
ROM_START( champ2 )
ROM_REGION( 0x2000, "bios", 0 )
// borrowed from pc/genpc.cpp
ROM_LOAD( "pcxt.rom", 0x0000, 0x02000, BAD_DUMP CRC(031aafad) SHA1(a641b505bbac97b8775f91fe9b83d9afdf4d038f) )
ROM_REGION16_LE(0x20000, "bios", 0)
// borrowed from pc/at.cpp pt319a
ROM_LOAD( "3sam001.bin", 0x10000, 0x10000, BAD_DUMP CRC(cad22030) SHA1(85bb6027579a87bfe7ea0f7df3676fdaa64920ac))
ROM_REGION( 0x100000, "game_prg", 0 )
ROM_LOAD( "champ2.u2", 0x00000, 0x80000, CRC(058bd1a4) SHA1(e4c0db329cda0cdcab7c7b4d130f1c38fa32385f) )
@ -139,11 +151,28 @@ ROM_START( champ2 )
ROM_LOAD( "champ2.u7", 0x00000, 0x1caf, BAD_DUMP CRC(bd70e89b) SHA1(3567d22057e366a439ffce2dd35180f5df80d47c) )
ROM_END
void champ2_state::init_at_common(int xmsbase)
{
address_space& space = m_maincpu->space(AS_PROGRAM);
/* managed RAM */
membank("bank10")->set_base(m_ram->pointer());
if (m_ram->size() > xmsbase)
{
offs_t ram_limit = 0x100000 + m_ram->size() - xmsbase;
space.install_ram(0x100000, ram_limit - 1, m_ram->pointer() + xmsbase);
}
}
void champ2_state::init_at()
{
init_at_common(0xa0000);
}
} // anonymous namespace
//GAME( 1993, champ, 0, champ2, champ2, champ2_state, empty_init, ROT0, "U.S. Games", "Countertop Champion", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND )
// Title assumed by "Champ II" ROM labels
GAME( 1994, champ2, 0, champ2, champ2, champ2_state, empty_init, ROT0, "U.S. Games", "Countertop Champion 2 (ver 2.11)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND )
//GAME( 1993, champ2, 0, champ2, champ2, champ2_state, empty_init, ROT0, "U.S. Games", "Countertop Champion", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND )
GAME( 1994, champ2, 0, champ2, champ2, champ2_state, init_at, ROT0, "U.S. Games", "Countertop Champion 2 (ver 2.11)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND )