Skip to content

Commit

Permalink
nec/pc9801_v.cpp: double height 0 fontsel tiles when LR is 16 and mon…
Browse files Browse the repository at this point in the history
…itor is 24kHz

* fix arcus2 intro and gamepac1:03:valiant gameplay graphics
  • Loading branch information
angelosa committed Nov 2, 2024
1 parent b993760 commit f6dd7ba
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 20 deletions.
32 changes: 16 additions & 16 deletions src/mame/nec/bungo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@
// 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.
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.
**************************************************************************************************/

Expand Down Expand Up @@ -136,8 +136,8 @@ void bungo_mini5sx_state::mini5sx_config(machine_config &config)
// 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));

// TODO: unverified, known to have a serial port
pc9801_serial(config);
// TODO: unverified, known to have a serial port
pc9801_serial(config);

I8255(config, m_ppi_prn, 0);
// m_ppi_prn->in_pb_callback().set_ioport("PRNB");
Expand Down
2 changes: 1 addition & 1 deletion src/mame/nec/bungo.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class bungo_mini5sx_state : public pc98_base_state

u16 fake_dict_r(offs_t offset);

// just suppress for now, TBD
// just suppress for now, TBD
virtual void uart_irq_check() override {};

void bungo_palette(palette_device &palette) const;
Expand Down
3 changes: 3 additions & 0 deletions src/mame/nec/pc9801.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3060,6 +3060,7 @@ COMP( 1986, pc9801vx, 0, 0, pc9801vx, pc9801rs, pc9801vm_state, init_p
// ...

// PC-H98 (Hyper 98, '90-'93 high end line with High-reso, proprietary NESA bus, E²GC)
// PC-H98S cfr. pc_h98.cpp
// PC-H98T (LCD Hyper 98)
// SV-H98 "98SERVER" (i486, later Hyper 98 revision)
// SV-98 (Pentium based, second gen of 98SERVER)
Expand Down Expand Up @@ -3096,6 +3097,8 @@ COMP( 1993, pc9801bx2, 0, 0, pc9801bx2, pc9801rs, pc9801bx_state, init_p
// ...

// PC-98LT / PC-98HA -> cfr. pc98ha.cpp
// PC-9801N "98NOTE" (V30 based, EMS + 3.5" floppy, 8.9" FL blue LCD).
// PC-9801N* (98NOTE upgrades)
// PC-9801T (i386SX, extremely expensive TFT or LCD laptop with C-Bus slots, de-facto a "portable" desktop machine)
// PC-9801LX (i286, belongs to pc98ha.cpp?)
// PC-9801LS (i386SX, Plasma laptop)
Expand Down
16 changes: 13 additions & 3 deletions src/mame/nec/pc9801_v.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,16 @@ void pc9801_state::draw_text(bitmap_rgb32 &bitmap, uint32_t addr, int y, int wd,

// uint8_t interlace_on = m_video_ff[INTERLACE_REG];
uint8_t char_size = m_video_ff[FONTSEL_REG] ? 16 : 8;
uint8_t font_shift = 0;
const uint8_t char_base_mult = char_size;
// arcus2 (intro mask) and gamepac1:03:valiant double height tiles
// with lr = 16 and fontsel off (-> 8x8) in 24 kHz mode
// TODO: verify with LR slightly above or below this threshold
if (!m_video_ff[FONTSEL_REG] && lr >= 16)
{
font_shift = 1;
char_size = 16;
}

uint8_t x_step;
uint8_t lastul = 0;
Expand Down Expand Up @@ -118,6 +128,7 @@ void pc9801_state::draw_text(bitmap_rgb32 &bitmap, uint32_t addr, int y, int wd,
//kanji_lr |= (tile & 0x80) >> 7; // tokisg3
// ... but then ginga and gage expects working LR for PCG depending on the attribute.
// beast3 uses tile bit 7 for the heart shaped char displayed on first screen.
// TODO: rename pcg to gaiji (actual nomenclature)
const u8 pcg_lr = (BIT(knj_tile, 7) || BIT(tile, 7));
tile &= 0x7f;
tile <<= 8;
Expand Down Expand Up @@ -227,16 +238,15 @@ void pc9801_state::draw_text(bitmap_rgb32 &bitmap, uint32_t addr, int y, int wd,

int gfx_bit;
gfx_bit = (xi & 4);
// TODO: unverified for arcus2 case above, may be just base mult
gfx_bit+= (yi & (2 << (char_size == 16 ? 0x01 : 0x00)))>>(1+(char_size == 16));
gfx_bit+= (yi & (4 << (char_size == 16 ? 0x01 : 0x00)))>>(1+(char_size == 16));

tile_data = ((tile >> gfx_bit) & 1) ? 0xff : 0x00;
}
else
{
// TODO: arcus2 pretends to mask during intro via tile 0x87, lr = 16 and fontsel off (-> 8x8) in 24 kHz mode
// is it double heighting tiles?
tile_data = (m_char_rom[tile*char_size+m_video_ff[FONTSEL_REG]*0x800+yi]);
tile_data = (m_char_rom[tile*char_base_mult+m_video_ff[FONTSEL_REG]*0x800+(yi >> font_shift)]);
}
}

Expand Down

0 comments on commit f6dd7ba

Please sign in to comment.