mirror of
https://github.com/holub/mame
synced 2025-04-16 05:24:54 +03:00
shuffle a few things around re: the BBL ST2302U based handhelds, give bbl338 its own map due to internal ROM etc. (#7584)
* shuffle a few things around re: the BBL ST2302U based handhelds, give bbl338 its own map due to internal ROM etc. * fake some interrupts on bbl338 * better document test draw command, so that we can verify we're in test mode
This commit is contained in:
parent
cfd2932c2d
commit
531eedcc7f
@ -4106,8 +4106,8 @@ files {
|
||||
MAME_DIR .. "src/mame/machine/xavix2002_io.h",
|
||||
MAME_DIR .. "src/mame/drivers/xavix2.cpp",
|
||||
MAME_DIR .. "src/mame/drivers/titan_soc.cpp",
|
||||
MAME_DIR .. "src/mame/drivers/st22xx_bbl338.cpp",
|
||||
MAME_DIR .. "src/mame/drivers/unk6502_st2xxx.cpp",
|
||||
MAME_DIR .. "src/mame/drivers/st2302u_bbl_rom.cpp",
|
||||
MAME_DIR .. "src/mame/drivers/st2302u_bbl_spi.cpp",
|
||||
MAME_DIR .. "src/mame/video/bl_handhelds_lcdc.cpp",
|
||||
MAME_DIR .. "src/mame/video/bl_handhelds_lcdc.h",
|
||||
MAME_DIR .. "src/mame/drivers/actions_atj2279b.cpp",
|
||||
|
@ -20,6 +20,7 @@ public:
|
||||
}
|
||||
|
||||
void st22xx_bbl338(machine_config &config);
|
||||
void st22xx_dphh8213(machine_config &config);
|
||||
|
||||
protected:
|
||||
virtual void machine_start() override;
|
||||
@ -31,6 +32,7 @@ private:
|
||||
void portb_w(u8 data);
|
||||
|
||||
void st22xx_bbl338_map(address_map &map);
|
||||
void st22xx_dphh8213_map(address_map &map);
|
||||
|
||||
required_device<screen_device> m_screen;
|
||||
required_device<bl_handhelds_lcdc_device> m_lcdc;
|
||||
@ -94,7 +96,7 @@ u8 st22xx_bbl338_sim_state::sim152_r()
|
||||
case 0x0e: break; // important for king boxing to show anything outside of char select
|
||||
case 0x10: break; // command 0x10 = clear out some line buffer for rendering?
|
||||
case 0x12: break; // command 0x12 = clear background in angry pigs?
|
||||
case 0x14: break; // command 0x14 = draw basic text
|
||||
case 0x14: break; // command 0x14 = draw basic text (dphh8213 test mode, see 0x28 for bbl338)
|
||||
case 0x16: break; // important for collisions in risker?
|
||||
// 0x18 not seen
|
||||
case 0x1a: break; // when pause is pressed? maybe music related?
|
||||
@ -105,6 +107,22 @@ u8 st22xx_bbl338_sim_state::sim152_r()
|
||||
case 0x24: break; // command 0x24 = play sound
|
||||
case 0x26: break; // command 0x26 = force stop sound(s)?
|
||||
|
||||
case 0x28:
|
||||
{
|
||||
// on bbl338 this is used for the 'draw text' functionality in test mode instead of 0x14, see 0x4866 which is
|
||||
// the 'draw letter stored in A at position' function, calling this command.
|
||||
// The equivalent code in dphh8213 is at 0x43e4 instead and calls 0x14
|
||||
address_space& mainspace = m_maincpu->space(AS_PROGRAM);
|
||||
u8 param0 = mainspace.read_byte(0x100);
|
||||
u8 param1 = mainspace.read_byte(0x101);
|
||||
u8 param2 = mainspace.read_byte(0x102);
|
||||
u8 param3 = mainspace.read_byte(0x103);
|
||||
|
||||
logerror("command 0x28 (draw text direct) using params Xpos: %02x Ypos: %02x char '%c' unk %02x\n", param0, param1, param2, param3);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
logerror("%04x: reached 0x152, need to execute BIOS simulation for command %02x\n", pc, command);
|
||||
@ -130,7 +148,7 @@ void st22xx_bbl338_sim_state::machine_reset()
|
||||
|
||||
mainspace.install_readwrite_handler(0x0152, 0x0152, read8smo_delegate(*this, FUNC(st22xx_bbl338_sim_state::sim152_r)), write8smo_delegate(*this, FUNC(st22xx_bbl338_sim_state::sim152_w)));
|
||||
|
||||
// The code that needs to be in RAM doesn't seem to be in the ROM, missing internal area?
|
||||
// The code that needs to be in RAM doesn't seem to be in the ROM
|
||||
const uint8_t ramcode[40] = {
|
||||
|
||||
// this is the 'execute BIOS function' call
|
||||
@ -166,6 +184,22 @@ void st22xx_bbl338_sim_state::machine_reset()
|
||||
for (int i = 0; i < 40; i++)
|
||||
mainspace.write_byte(0x150+i, ramcode[i]);
|
||||
|
||||
// force it to boot from external space (missing internal code to copy above segment to RAM however)
|
||||
mainspace.write_byte(0x32, 0x00);
|
||||
mainspace.write_byte(0x33, 0x04);
|
||||
|
||||
// force interrupts to be fetched from external space (complete?)
|
||||
mainspace.write_byte(0x30, 0x00);
|
||||
mainspace.write_byte(0x31, 0x04);
|
||||
|
||||
// timers / timer interrupt init sequence
|
||||
mainspace.write_byte(0x28, 0x08);
|
||||
mainspace.write_byte(0x29, 0xc0);
|
||||
mainspace.write_byte(0x26, 0xff);
|
||||
mainspace.write_byte(0x27, 0xdf);
|
||||
mainspace.write_byte(0x3e, 0x10);
|
||||
mainspace.write_byte(0x3c, 0x00);
|
||||
mainspace.write_byte(0x39, 0x12);
|
||||
}
|
||||
|
||||
void st22xx_bbl338_sim_state::machine_start()
|
||||
@ -179,10 +213,18 @@ void st22xx_bbl338_state::machine_start()
|
||||
save_item(NAME(m_portb));
|
||||
}
|
||||
|
||||
void st22xx_bbl338_state::st22xx_bbl338_map(address_map &map)
|
||||
void st22xx_bbl338_state::st22xx_dphh8213_map(address_map &map)
|
||||
{
|
||||
map(0x0000000, 0x01fffff).rom().region("maincpu", 0);
|
||||
map(0x1000000, 0x11fffff).rom().region("maincpu", 0); // bbl338 (because internal ROM would map at 0?)
|
||||
|
||||
map(0x0600000, 0x0600000).w(m_lcdc, FUNC(bl_handhelds_lcdc_device::lcdc_command_w));
|
||||
map(0x0604000, 0x0604000).rw(m_lcdc, FUNC(bl_handhelds_lcdc_device::lcdc_data_r), FUNC(bl_handhelds_lcdc_device::lcdc_data_w));
|
||||
}
|
||||
|
||||
void st22xx_bbl338_state::st22xx_bbl338_map(address_map &map)
|
||||
{
|
||||
//map(0x0000000, 0x0003fff).rom().region("internal", 0); // not dumped, so ensure any accesses here are logged
|
||||
map(0x1000000, 0x11fffff).rom().region("maincpu", 0);
|
||||
|
||||
map(0x0600000, 0x0600000).w(m_lcdc, FUNC(bl_handhelds_lcdc_device::lcdc_command_w));
|
||||
map(0x0604000, 0x0604000).rw(m_lcdc, FUNC(bl_handhelds_lcdc_device::lcdc_data_r), FUNC(bl_handhelds_lcdc_device::lcdc_data_w));
|
||||
@ -214,7 +256,8 @@ void st22xx_bbl338_state::portb_w(u8 data)
|
||||
m_portb = data;
|
||||
}
|
||||
|
||||
static INPUT_PORTS_START(st22xx_bbl338)
|
||||
// input multiplexing not verified for bbl338
|
||||
static INPUT_PORTS_START(dphh8213)
|
||||
// P2 controls work with some of the games, but there was no obvious way to connect a 2nd pad?
|
||||
// document them for now, but maybe comment them out later for accuracy.
|
||||
PORT_START("IN1")
|
||||
@ -222,15 +265,15 @@ static INPUT_PORTS_START(st22xx_bbl338)
|
||||
PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_NAME("P1 A")
|
||||
PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT)
|
||||
PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP)
|
||||
PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
|
||||
PORT_START("IN2")
|
||||
PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_BUTTON2) PORT_NAME("P2 B")
|
||||
PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_UNUSED ) // bbl338 - must be IP_ACTIVE_HIGH to avoid system hanging with 'wai' opcode after code turns on port interrupt if not in test mode (power off?)
|
||||
PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT)
|
||||
PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN)
|
||||
PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
|
||||
PORT_START("IN3")
|
||||
@ -257,6 +300,25 @@ static INPUT_PORTS_START(st22xx_bbl338)
|
||||
PORT_BIT(0xf6, IP_ACTIVE_LOW, IPT_UNUSED) // probably unused
|
||||
INPUT_PORTS_END
|
||||
|
||||
|
||||
void st22xx_bbl338_state::st22xx_dphh8213(machine_config &config)
|
||||
{
|
||||
ST2302U(config, m_maincpu, 24000000);
|
||||
m_maincpu->set_addrmap(AS_DATA, &st22xx_bbl338_state::st22xx_dphh8213_map);
|
||||
m_maincpu->in_pa_callback().set(FUNC(st22xx_bbl338_state::porta_r));
|
||||
m_maincpu->out_pb_callback().set(FUNC(st22xx_bbl338_state::portb_w));
|
||||
m_maincpu->in_pc_callback().set_ioport("PORTC");
|
||||
|
||||
SCREEN(config, m_screen, SCREEN_TYPE_LCD);
|
||||
m_screen->set_refresh_hz(60);
|
||||
m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0));
|
||||
m_screen->set_size(160, 128);
|
||||
m_screen->set_visarea(0, 160 - 1, 0, 128 - 1);
|
||||
m_screen->set_screen_update(FUNC(st22xx_bbl338_state::screen_update));
|
||||
|
||||
BL_HANDHELDS_LCDC(config, m_lcdc, 0);
|
||||
}
|
||||
|
||||
void st22xx_bbl338_state::st22xx_bbl338(machine_config &config)
|
||||
{
|
||||
ST2302U(config, m_maincpu, 24000000);
|
||||
@ -277,23 +339,25 @@ void st22xx_bbl338_state::st22xx_bbl338(machine_config &config)
|
||||
BL_HANDHELDS_LCDC(config, m_lcdc, 0);
|
||||
}
|
||||
|
||||
|
||||
ROM_START( bbl338 )
|
||||
// is internal ROM used? the code in the external ROM contains a bank for 4000-6fff including vectors at least.
|
||||
// it sets stack to 14f, but quickly jumps to 150 in RAM where there is no code? was something meant to have copied
|
||||
// code there earlier?
|
||||
ROM_REGION( 0x4000, "internal", ROMREGION_ERASEFF )
|
||||
ROM_LOAD( "internal.rom", 0x000000, 0x4000, NO_DUMP ) // unsure of exact size for this model
|
||||
|
||||
ROM_REGION( 0x200000, "maincpu", 0 )
|
||||
ROM_LOAD( "en29lv160ab.u1", 0x000000, 0x200000, CRC(2c73e16c) SHA1(e2c69b3534e32ef384c0c2f5618118a419326e3a) )
|
||||
ROM_END
|
||||
|
||||
ROM_START( dphh8213 )
|
||||
// internal area not used
|
||||
|
||||
ROM_REGION( 0x200000, "maincpu", 0 )
|
||||
ROM_LOAD( "mx29lv160cb.u1", 0x000000, 0x200000, CRC(c8e7e355) SHA1(726f28c2c9ab012a6842f9f30a0a71538741ba14) )
|
||||
ROM_FILL( 0x00009f, 2, 0xea ) // NOP out SPI check
|
||||
ROM_END
|
||||
|
||||
// this is uses a higher resolution display than the common units, but not as high as the SunPlus based ones
|
||||
COMP( 201?, bbl338, 0, 0, st22xx_bbl338, st22xx_bbl338, st22xx_bbl338_sim_state, empty_init, "BaoBaoLong", "Portable Game Player BBL-338 (BaoBaoLong, 48-in-1)", MACHINE_IS_SKELETON )
|
||||
COMP( 201?, bbl338, 0, 0, st22xx_bbl338, dphh8213, st22xx_bbl338_sim_state, empty_init, "BaoBaoLong", "Portable Game Player BBL-338 (BaoBaoLong, 48-in-1)", MACHINE_IS_SKELETON )
|
||||
|
||||
// Language controlled by port bit, set at factory, low resolution
|
||||
COMP( 201?, dphh8213, 0, 0, st22xx_bbl338, st22xx_bbl338, st22xx_bbl338_state, empty_init, "<unknown>", "Digital Pocket Hand Held System 20-in-1 - Model 8213", MACHINE_IS_SKELETON )
|
||||
COMP( 201?, dphh8213, 0, 0, st22xx_dphh8213, dphh8213, st22xx_bbl338_state, empty_init, "<unknown>", "Digital Pocket Hand Held System 20-in-1 - Model 8213", MACHINE_IS_SKELETON )
|
@ -38158,10 +38158,19 @@ sorcerera // Sorcerer with Dreamdisk fdc
|
||||
sorcererb // Sorcerer with Digitrio fdc
|
||||
sorcererd // Sorcerer with Micropolis fdc
|
||||
|
||||
@source:st22xx_bbl338.cpp
|
||||
@source:st2302u_bbl_rom.cpp
|
||||
bbl338
|
||||
dphh8213
|
||||
|
||||
@source:st2302u_bbl_spi.cpp
|
||||
bbl380
|
||||
rhhc152
|
||||
ragc153
|
||||
dphh8630
|
||||
dgun2953
|
||||
supreme
|
||||
arcade10
|
||||
|
||||
@source:storio.cpp
|
||||
innotab2 // (c) 2011 V.Tech
|
||||
storio // (c) 2011 V.Tech
|
||||
@ -41124,15 +41133,6 @@ uts20 //
|
||||
@source:unixpc.cpp
|
||||
3b1 // 3B1 "Unix PC"
|
||||
|
||||
@source:unk6502_st2xxx.cpp
|
||||
bbl380
|
||||
rhhc152
|
||||
ragc153
|
||||
dphh8630
|
||||
dgun2953
|
||||
supreme
|
||||
arcade10
|
||||
|
||||
@source:unkhorse.cpp
|
||||
unkhorse //
|
||||
|
||||
|
@ -951,7 +951,8 @@ spg2xx_zone.cpp
|
||||
squale.cpp
|
||||
ssem.cpp
|
||||
st17xx.cpp
|
||||
st22xx_bbl338.cpp
|
||||
st2302u_bbl_rom.cpp
|
||||
st2302u_bbl_spi.cpp
|
||||
storio.cpp
|
||||
studio2.cpp
|
||||
sun1.cpp
|
||||
@ -1069,7 +1070,6 @@ unior.cpp
|
||||
unistar.cpp
|
||||
univac.cpp
|
||||
unixpc.cpp
|
||||
unk6502_st2xxx.cpp
|
||||
ut88.cpp
|
||||
uzebox.cpp
|
||||
v100.cpp
|
||||
|
Loading…
Reference in New Issue
Block a user