nec/bungo.cpp: moved mini5sx from pc98ha, add PoC readable hiragana/katakana

This commit is contained in:
angelosa 2022-10-18 03:54:07 +02:00
parent bf66c4305c
commit e9e54e3698
7 changed files with 244 additions and 103 deletions

View File

@ -9720,6 +9720,9 @@ buggychlt // A22 (c) 1984 Taito Corporation + Tefri licens
wmbullet //
wmbulletf //
@source:nec/bungo.cpp
mini5sx // 1991
@source:skeleton/busicom.cpp
busicom //
@ -34601,7 +34604,6 @@ pc88va //
pc88va2 //
@source:nec/pc98ha.cpp
mini5sx // 1991
pc98lt // 1989
pc98ha // 1990

View File

@ -524,6 +524,7 @@ ncd/ncd88k.cpp
ncd/ncdmips.cpp
ncd/ncdppc.cpp
nec/apc.cpp
nec/bungo.cpp
nec/ews4800.cpp
nec/pc100.cpp
nec/pc6001.cpp

191
src/mame/nec/bungo.cpp Normal file
View File

@ -0,0 +1,191 @@
// license:BSD-3-Clause
// copyright-holders:Angelo Salese
/**************************************************************************************************
NEC / "Bungo" Word Processors (laptop family)
TODO:
- needs list of components, no documentation available from the net except for bare specs here:
https://museum.ipsj.or.jp/en/computer/word/0058.html
- Needs an actual dump of the kanji ROM;
- Garbled message tells user to reset machine and hold SHIFT+MENU while having the
auxiliary disk in
https://www.leadedsolder.com/2022/10/15/pwp50sx-nec-mini5-psu-repair-pickup.html
NB: MENU key doesn't exist with current PC98 keyboard device, also note that the usual
I/O at $41-$43 is not polled (either expects an irq or perhaps they relocated)
- Verify what exactly the handwritten Function 2 + F2 = Floppy. printed on aux disk
means.
- Verify how much of PC-98 this really uses if anything at all.
**************************************************************************************************/
#include "emu.h"
#include "bungo.h"
void bungo_mini5sx_state::bungo_palette(palette_device &palette) const
{
palette.set_pen_color(0, 160, 168, 160);
palette.set_pen_color(1, 48, 56, 16);
}
uint32_t bungo_mini5sx_state::screen_update( screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect )
{
for (int y = cliprect.min_y; y <= cliprect.max_y; y++)
for (int x = cliprect.min_x; x <= cliprect.max_x; x += 16)
{
u16 pen = bitswap<16>(m_gvram[(y*640+x)/16], 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7);
for (int xi = 0; xi < 16; xi++)
{
u8 dot = (pen >> xi) & 1;
bitmap.pix(y, x+xi) = m_palette->pen(dot);
}
}
return 0;
}
// TODO: PoC offsets
// Reads this area for a pointer to the various alphabets that lives at $c0000 and onward
// The real ROM must have compressed GFX tables to bother like this.
u16 bungo_mini5sx_state::fake_dict_r(offs_t offset)
{
switch(offset * 2)
{
case 0x08:
return 0;
case 0x0a:
return 0x3c20; // hiragana
case 0x0c:
return 0x2000;
case 0x0e:
return 0x0048; // katakana
//default:
// logerror("%04x\n", offset * 2);
}
return 0;
}
void bungo_mini5sx_state::mini5sx_map(address_map &map)
{
map(0x00000, 0x9ffff).ram(); // 640 KB
// same as PC98HA: it doesn't have 7220s but just a b&w framebuffer
map(0xa8000, 0xaffff).ram().share("gvram");
map(0xc0000, 0xcdfff).rom().region("kanji", 0);
map(0xce000, 0xcffff).r(FUNC(bungo_mini5sx_state::fake_dict_r));
map(0xe0000, 0xfffff).rom().region("ipl", 0);
}
void bungo_mini5sx_state::mini5sx_io(address_map &map)
{
// ...
}
static INPUT_PORTS_START( mini5sx )
INPUT_PORTS_END
// debug
static const gfx_layout gfx_16x16x1 =
{
16,16,
RGN_FRAC(1,1),
1,
{ 0 },
{ STEP16(0,1) },
{ STEP16(0,16) },
16*16
};
static GFXDECODE_START( gfx_bungo )
GFXDECODE_ENTRY( "kanji", 0x00000, gfx_8x8x1, 0x000, 0x01 )
GFXDECODE_ENTRY( "kanji", 0x00000, gfx_16x16x1, 0x000, 0x01 )
GFXDECODE_END
void bungo_mini5sx_state::machine_start()
{
}
static void pc9801_floppies(device_slot_interface &device)
{
// device.option_add("525dd", FLOPPY_525_DD);
// device.option_add("525hd", FLOPPY_525_HD);
device.option_add("35hd", FLOPPY_35_HD);
}
void bungo_mini5sx_state::mini5sx_config(machine_config &config)
{
const XTAL xtal = XTAL(16'000'000);
V33(config, m_maincpu, xtal);
m_maincpu->set_addrmap(AS_PROGRAM, &bungo_mini5sx_state::mini5sx_map);
m_maincpu->set_addrmap(AS_IO, &bungo_mini5sx_state::mini5sx_io);
// m_maincpu->set_irq_acknowledge_callback("pic8259_master", FUNC(pic8259_device::inta_cb));
PC9801_KBD(config, m_keyb, 53);
// m_keyb->irq_wr_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ1);
I8255(config, m_ppi_sys, 0);
// m_ppi_sys->in_pa_callback().set(m_ppi_sys, FUNC(i8255_device::pa_r));
// m_ppi_sys->in_pb_callback().set_ioport("SYSB");
// m_ppi_sys->in_pc_callback().set_constant(0xa0); // 0x80 cpu triple fault reset flag?
// m_ppi_sys->out_pc_callback().set(FUNC(pc98lt_state::ppi_sys_beep_portc_w));
I8255(config, m_ppi_prn, 0);
// m_ppi_prn->in_pb_callback().set_ioport("PRNB");
SCREEN(config, m_screen, SCREEN_TYPE_LCD);
// TODO: copied verbatim from base PC98, verify clock et al.
m_screen->set_raw(21.0526_MHz_XTAL, 848, 0, 640, 440, 0, 400);
m_screen->set_screen_update(FUNC(bungo_mini5sx_state::screen_update));
// m_screen->screen_vblank().set(FUNC(pc9801_state::vrtc_irq));
PALETTE(config, m_palette, FUNC(bungo_mini5sx_state::bungo_palette), 2);
GFXDECODE(config, m_gfxdecode, m_palette, gfx_bungo);
UPD765A(config, m_fdc, 8'000'000, false, true);
// m_fdc->intrq_wr_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ6);
// m_fdc->drq_wr_callback().set(m_maincpu, FUNC(v50_device::dreq_w<2>)).invert();
// m_fdc->drq_wr_callback().set(m_maincpu, FUNC(v50_device::dreq_w<3>)).invert(); // 2dd
FLOPPY_CONNECTOR(config, "upd765:0", pc9801_floppies, "35hd", pc9801_state::floppy_formats);
FLOPPY_CONNECTOR(config, "upd765:1", pc9801_floppies, "35hd", pc9801_state::floppy_formats);
SOFTWARE_LIST(config, "disk_list").set_original("bungo_flop");
SPEAKER(config, "mono").front_center();
BEEP(config, m_beeper, 2400).add_route(ALL_OUTPUTS, "mono", 0.05);
}
ROM_START( mini5sx )
ROM_REGION16_LE( 0x100000, "biosrom", ROMREGION_ERASEFF )
ROM_LOAD16_BYTE( "upd23c4001eacz-048.ic16", 0x000000, 0x080000, CRC(c7ce7ad6) SHA1(1f8616c1c5f817030decda539b9561fab2eef327) )
ROM_LOAD16_BYTE( "upd23c4001eacz-049.ic19", 0x000001, 0x080000, CRC(09740f3e) SHA1(18ece5fd79392fe86c85007192ca0702728b004d) )
ROM_REGION16_LE( 0x20000, "ipl", ROMREGION_ERASEFF )
ROM_COPY( "biosrom", 0x60000, 0x00000, 0x20000 )
// TODO: none of these is actually provided in dump, backported from pc98ha for now
ROM_REGION16_LE( 0x40000, "kanji", ROMREGION_ERASEFF )
ROM_LOAD( "kanji.rom", 0x000000, 0x040000, BAD_DUMP CRC(4be5ff2f) SHA1(261d28419a2ddebe3177a282952806d7bb036b40) )
ROM_REGION16_LE( 0x40000, "backup", ROMREGION_ERASEFF )
ROM_LOAD( "backup.bin", 0x000000, 0x040000, BAD_DUMP CRC(3c5b2a99) SHA1(f8e2f5a4c7601d4e81d5e9c83621107ed3f5a29a) )
ROM_REGION( 0x100000, "dict", ROMREGION_ERASEFF )
ROM_LOAD( "dict.rom", 0x000000, 0x0c0000, BAD_DUMP CRC(6dc8493c) SHA1(3e04cdc3403a814969b6590cd78e239e72677fe5) )
ROM_REGION( 0x100000, "romdrv", ROMREGION_ERASEFF )
ROM_COPY( "biosrom", 0x00000, 0x00000, 0x100000 )
// $00 filled with odd size
ROM_REGION( 0x200000, "ramdrv", ROMREGION_ERASEFF )
ROM_LOAD( "ramdrv.bin", 0x000000, 0x160000, BAD_DUMP CRC(f2cec994) SHA1(c986ad6d8f810ac0a9657c1af26b6fec712d56ed) )
ROM_END
COMP( 1991, mini5sx, 0, 0, mini5sx_config, mini5sx, bungo_mini5sx_state, empty_init, "NEC", "Bungo mini 5SX", MACHINE_NOT_WORKING )

45
src/mame/nec/bungo.h Normal file
View File

@ -0,0 +1,45 @@
// license:BSD-3-Clause
// copyright-holders:Angelo Salese
/************************************************
*
* NEC / "Bungo" Word Processors (laptop)
*
***********************************************/
#ifndef MAME_INCLUDES_BUNGO_H
#define MAME_INCLUDES_BUNGO_H
#pragma once
#include "pc9801.h"
class bungo_mini5sx_state : public pc98_base_state
{
public:
bungo_mini5sx_state(const machine_config &mconfig, device_type type, const char *tag)
: pc98_base_state(mconfig, type, tag)
, m_maincpu(*this, "maincpu")
, m_fdc(*this, "upd765")
, m_gvram(*this, "gvram")
{
}
void mini5sx_config(machine_config &config);
protected:
void mini5sx_map(address_map &map);
void mini5sx_io(address_map &map);
virtual void machine_start() override;
private:
required_device<v33_device> m_maincpu;
required_device<upd765a_device> m_fdc;
required_shared_ptr<uint16_t> m_gvram;
u16 fake_dict_r(offs_t offset);
void bungo_palette(palette_device &palette) const;
uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
};
#endif // MAME_INCLUDES_BUNGO_H

View File

@ -2946,7 +2946,7 @@ COMP( 1983, pc9801f, pc9801, 0, pc9801, pc9801, pc9801_state, init_pc9
// DP "DP NOTE" ("Document Processor", based off various flavours of N5820 & 9821NOTE combo)
// DP-70F (based off N5820-70FA & 9821ap2)
// DP-70S (Document Filing Server)
// Mini 5
// Mini 5 -> cfr. bungo.cpp
// Mini 7
// JX series
// ...

View File

@ -24,18 +24,6 @@
- JEIDA memory card interface (68pin cfr. "Super Daisenryaku HA",
most likely same as NeoGeo JEIDA 3.0 memory cards);
- optional docking station (for floppy device only or can mount other stuff too?);
- mini5sx specifics:
- almost likely don't really belong here, will be split at a later date;
- needs list of components, no documentation available from the net except for specs here:
https://museum.ipsj.or.jp/en/computer/word/0058.html
- GFX ROM handling all wrong;
- Garbled message tells user to reset machine and hold SHIFT+MENU while having the
auxiliary disk in
https://www.leadedsolder.com/2022/10/15/pwp50sx-nec-mini5-psu-repair-pickup.html
NB: MENU key doesn't exist with current PC98 keyboard device, also note that the usual
I/O at $41-$43 is not polled (either expects an irq or perhaps they relocated)
- Verify what exactly the handwritten Function 2 + F2 = Floppy. printed on aux disk
means.
**************************************************************************************************/
@ -274,29 +262,6 @@ void pc98ha_state::ha_io(address_map &map)
map(0x5f8e, 0x5f8e).r(FUNC(pc98ha_state::memcard_status_2_r));
}
/************************************
*
* / "Bungo"
*
***********************************/
void bungo_mini5sx_state::mini5sx_map(address_map &map)
{
ha_map(map);
// TODO: not right, checks 0xce000 first (dictionary?) then draws with 0xc0000-0xc0fff
// bank numbers definitely don't come from the same I/O addresses
map(0xc0000, 0xc3fff).bankr("kanji_bank");
map(0xcc000, 0xcffff).bankr("dict_bank");
// not accessed at current stage, enable log for now
map(0xd0000, 0xeffff).unmaprw();
}
void bungo_mini5sx_state::mini5sx_io(address_map &map)
{
ha_io(map);
}
static INPUT_PORTS_START( pc98lt )
PORT_START("SYSB")
@ -449,7 +414,7 @@ static void pc9801_floppies(device_slot_interface &device)
{
// device.option_add("525dd", FLOPPY_525_DD);
device.option_add("525hd", FLOPPY_525_HD);
device.option_add("35hd", FLOPPY_35_HD);
// device.option_add("35hd", FLOPPY_35_HD);
}
void pc98lt_state::lt_config(machine_config &config)
@ -518,22 +483,6 @@ void pc98ha_state::ha_config(machine_config &config)
UPD4991A(config, m_rtc_pio, 32'768);
}
void bungo_mini5sx_state::mini5sx_config(machine_config &config)
{
ha_config(config);
const XTAL xtal = XTAL(16'000'000);
V50(config.replace(), m_maincpu, xtal); // TODO: V33
m_maincpu->set_addrmap(AS_PROGRAM, &bungo_mini5sx_state::mini5sx_map);
m_maincpu->set_addrmap(AS_IO, &bungo_mini5sx_state::mini5sx_io);
m_maincpu->set_tclk(xtal / 4);
// m_maincpu->set_irq_acknowledge_callback("pic8259_master", FUNC(pic8259_device::inta_cb));
SOFTWARE_LIST(config, "disk_list").set_original("bungo_flop");
FLOPPY_CONNECTOR(config.replace(), "upd765:0", pc9801_floppies, "35hd", pc9801_state::floppy_formats);
FLOPPY_CONNECTOR(config.replace(), "upd765:1", pc9801_floppies, "35hd", pc9801_state::floppy_formats);
}
// all ROMs in both sets needs at least chip renaming, and I haven't seen a single PCB pic from the net.
// dict.rom and ramdrv.bin definitely won't fit an even ROM size regardless,
// also backup.bin may not be factory default.
@ -576,35 +525,6 @@ ROM_START( pc98ha )
ROM_LOAD( "ramdrv.bin", 0x000000, 0x160000, BAD_DUMP CRC(f2cec994) SHA1(c986ad6d8f810ac0a9657c1af26b6fec712d56ed) )
ROM_END
ROM_START( mini5sx )
ROM_REGION16_LE( 0x100000, "biosrom", ROMREGION_ERASEFF )
ROM_LOAD16_BYTE( "upd23c4001eacz-048.ic16", 0x000000, 0x080000, CRC(c7ce7ad6) SHA1(1f8616c1c5f817030decda539b9561fab2eef327) )
ROM_LOAD16_BYTE( "upd23c4001eacz-049.ic19", 0x000001, 0x080000, CRC(09740f3e) SHA1(18ece5fd79392fe86c85007192ca0702728b004d) )
ROM_REGION16_LE( 0x10000, "ipl", ROMREGION_ERASEFF )
ROM_COPY( "biosrom", 0x70000, 0x00000, 0x10000 )
// TODO: none of these is actually provided in dump, verify
ROM_REGION( 0x40000, "kanji", ROMREGION_ERASEFF )
ROM_LOAD( "kanji.rom", 0x000000, 0x040000, BAD_DUMP CRC(4be5ff2f) SHA1(261d28419a2ddebe3177a282952806d7bb036b40) )
ROM_REGION16_LE( 0x40000, "backup", ROMREGION_ERASEFF )
ROM_LOAD( "backup.bin", 0x000000, 0x040000, BAD_DUMP CRC(3c5b2a99) SHA1(f8e2f5a4c7601d4e81d5e9c83621107ed3f5a29a) )
ROM_REGION( 0x100000, "dict", ROMREGION_ERASEFF )
ROM_LOAD( "dict.rom", 0x000000, 0x0c0000, BAD_DUMP CRC(6dc8493c) SHA1(3e04cdc3403a814969b6590cd78e239e72677fe5) )
ROM_REGION( 0x100000, "romdrv", ROMREGION_ERASEFF )
ROM_COPY( "biosrom", 0x00000, 0x00000, 0x100000 )
// $00 filled with odd size
ROM_REGION( 0x200000, "ramdrv", ROMREGION_ERASEFF )
ROM_LOAD( "ramdrv.bin", 0x000000, 0x160000, BAD_DUMP CRC(f2cec994) SHA1(c986ad6d8f810ac0a9657c1af26b6fec712d56ed) )
ROM_END
COMP( 1989, pc98lt, 0, 0, lt_config, pc98lt, pc98lt_state, empty_init, "NEC", "PC-98LT", MACHINE_NOT_WORKING )
COMP( 1990, pc98ha, 0, 0, ha_config, pc98ha, pc98ha_state, empty_init, "NEC", "PC-98HA (Handy98)", MACHINE_NOT_WORKING )
// 文豪 / "Bungo" laptop section
// NB: may eventually require own driver instead
COMP( 1991, mini5sx, 0, 0, mini5sx_config, pc98ha, bungo_mini5sx_state, empty_init, "NEC", "Bungo mini 5SX", MACHINE_NOT_WORKING )

View File

@ -86,7 +86,7 @@ protected:
virtual void machine_start() override;
private:
optional_memory_bank_array<4> m_ems_banks;
required_memory_bank_array<4> m_ems_banks;
memory_view m_ext_view;
required_memory_bank m_ramdrv_bank;
required_device<upd4991a_device> m_rtc_pio;
@ -101,22 +101,4 @@ private:
u8 m_ext_view_sel = 0;
};
class bungo_mini5sx_state : public pc98ha_state
{
public:
bungo_mini5sx_state(const machine_config &mconfig, device_type type, const char *tag)
: pc98ha_state(mconfig, type, tag)
{
}
void mini5sx_config(machine_config &config);
protected:
void mini5sx_map(address_map &map);
void mini5sx_io(address_map &map);
// virtual void machine_start() override;
private:
};
#endif // MAME_INCLUDES_PC9801_EPSON_H
#endif // MAME_INCLUDES_PC98HA_H