From e8b144d7a9dd572ea9ef55539f0299a190b1d8fa Mon Sep 17 00:00:00 2001 From: hap Date: Mon, 11 Mar 2024 22:16:03 +0100 Subject: rendfont: set minimum width of scaled bitmap for font chars used in .lay files to 1 if it's larger than 0.5, this prevents lowercase l and i not showing while the text label is still readable (I also tried rounding up everything but that's uglier overall), misc: small cleanup --- src/devices/video/i8244.cpp | 7 ++++--- src/devices/video/i8244.h | 2 +- src/emu/rendfont.cpp | 3 ++- src/emu/rendlay.cpp | 8 ++++---- src/mame/fidelity/chesster.cpp | 28 +++++++++++----------------- src/mame/layout/novag_scorpio68k.lay | 8 ++++++-- src/mame/layout/novag_sdiamond.lay | 2 +- src/mame/novag/sdiamond.cpp | 2 +- src/mame/saitek/chessac.cpp | 6 +++--- src/mame/saitek/prisma.cpp | 2 +- 10 files changed, 34 insertions(+), 34 deletions(-) diff --git a/src/devices/video/i8244.cpp b/src/devices/video/i8244.cpp index 6df1f3b9142..1734d83677d 100644 --- a/src/devices/video/i8244.cpp +++ b/src/devices/video/i8244.cpp @@ -448,6 +448,7 @@ void i8244_device::write_cx(int x, bool cx) if (colx & m_vdc.s.collision) m_collision_status |= 0x40; } + // check if an already drawn object would collide with us if (m_vdc.s.collision & 0x40) { @@ -553,7 +554,7 @@ void i8244_device::draw_grid(int scanline, bitmap_ind16 &bitmap, const rectangle } -void i8244_device::char_pixel(u8 index, int x, int y, u8 pixel, u16 color, bitmap_ind16 &bitmap, const rectangle &cliprect) +void i8244_device::major_pixel(u8 index, int x, int y, u8 pixel, u16 color, bitmap_ind16 &bitmap, const rectangle &cliprect) { for (int px = x; px < x + 2; px++) { @@ -614,7 +615,7 @@ void i8244_device::draw_major(int scanline, bitmap_ind16 &bitmap, const rectangl u16 color = 8 + ((m_vdc.s.quad[i].single[j].color >> 1) & 0x07); for (int cx = 0; cx < 8; cx++, x += 2) - char_pixel(4 * j + 16 * i + 0x40, x, scanline, BIT(m_charset[offset & 0x1ff], cx ^ 7), color, bitmap, cliprect); + major_pixel(4 * j + 16 * i + 0x40, x, scanline, BIT(m_charset[offset & 0x1ff], cx ^ 7), color, bitmap, cliprect); } } } @@ -636,7 +637,7 @@ void i8244_device::draw_major(int scanline, bitmap_ind16 &bitmap, const rectangl int x = (m_vdc.s.foreground[i].x + 5) * 2; u16 color = 8 + ((m_vdc.s.foreground[i].color >> 1) & 0x07); for (int cx = 0; cx < 8; cx++, x += 2) - char_pixel(4 * i + 0x10, x, scanline, BIT(m_charset[offset & 0x1ff], cx ^ 7), color, bitmap, cliprect); + major_pixel(4 * i + 0x10, x, scanline, BIT(m_charset[offset & 0x1ff], cx ^ 7), color, bitmap, cliprect); } } } diff --git a/src/devices/video/i8244.h b/src/devices/video/i8244.h index 9514f36deb5..680eb97033c 100644 --- a/src/devices/video/i8244.h +++ b/src/devices/video/i8244.h @@ -129,7 +129,7 @@ protected: void draw_grid(int scanline, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_major(int scanline, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_minor(int scanline, bitmap_ind16 &bitmap, const rectangle &cliprect); - void char_pixel(u8 index, int x, int y, u8 pixel, u16 color, bitmap_ind16 &bitmap, const rectangle &cliprect); + void major_pixel(u8 index, int x, int y, u8 pixel, u16 color, bitmap_ind16 &bitmap, const rectangle &cliprect); // callbacks devcb_write_line m_irq_func; diff --git a/src/emu/rendfont.cpp b/src/emu/rendfont.cpp index 60ea12f9400..259d7731fe5 100644 --- a/src/emu/rendfont.cpp +++ b/src/emu/rendfont.cpp @@ -758,7 +758,8 @@ void render_font::get_scaled_bitmap_and_bounds(bitmap_argb32 &dest, float height bounds.min_y = 0; // compute x1,y1 from there based on the bitmap size - bounds.set_width(float(gl.bmwidth) * scale * aspect); + float width = float(gl.bmwidth) * scale * aspect; + bounds.set_width(width < 0.5f ? 0 : std::max(int(width), 1)); bounds.set_height(float(m_height) * scale); // if the bitmap isn't big enough, bail diff --git a/src/emu/rendlay.cpp b/src/emu/rendlay.cpp index 76d13250bfa..7dc75efb130 100644 --- a/src/emu/rendlay.cpp +++ b/src/emu/rendlay.cpp @@ -1790,10 +1790,10 @@ private: { u8 const *const src(reinterpret_cast(dst)); rgb_t const d( - u8((float(src[3]) * c.a) + 0.5), - u8((float(src[0]) * c.r) + 0.5), - u8((float(src[1]) * c.g) + 0.5), - u8((float(src[2]) * c.b) + 0.5)); + u8((float(src[3]) * c.a) + 0.5F), + u8((float(src[0]) * c.r) + 0.5F), + u8((float(src[1]) * c.g) + 0.5F), + u8((float(src[2]) * c.b) + 0.5F)); *dst = d; havealpha = havealpha || (d.a() < 255U); } diff --git a/src/mame/fidelity/chesster.cpp b/src/mame/fidelity/chesster.cpp index 4ace69306bb..43f5e36539e 100644 --- a/src/mame/fidelity/chesster.cpp +++ b/src/mame/fidelity/chesster.cpp @@ -54,12 +54,9 @@ public: m_inputs(*this, "IN.0") { } - // machine configs void chesster(machine_config &config); void kishon(machine_config &config); - void init_chesster(); - protected: virtual void machine_start() override; @@ -75,7 +72,6 @@ private: u8 m_speech_bank = 0; u8 m_select = 0; - // address maps void main_map(address_map &map); // I/O handlers @@ -83,14 +79,12 @@ private: u8 input_r(offs_t offset); }; -void chesster_state::init_chesster() +void chesster_state::machine_start() { + // set up ROM banks (kishon's is 4 times larger) m_numbanks = memregion("rombank")->bytes() / 0x4000; m_rombank->configure_entries(0, m_numbanks, memregion("rombank")->base(), 0x4000); -} -void chesster_state::machine_start() -{ // register for savestates save_item(NAME(m_speech_bank)); save_item(NAME(m_select)); @@ -220,7 +214,7 @@ ROM_START( chesster ) // model 6120, PCB label 510.1141C01 ROM_LOAD("ch_1.3.ic9", 0x8000, 0x8000, CRC(8b42d1ad) SHA1(2161fc5ab2476fe7ca4ffc226e3cb329b8a57a01) ) // 27256, CH 1.3 on sticker ROM_REGION( 0x20000, "rombank", 0 ) - ROM_LOAD("101-1091b02.ic10", 0x0000, 0x20000, CRC(fa370e88) SHA1(a937c8f1ec295cf9539d12466993974e40771493) ) // AMI, 27C010 or equivalent + ROM_LOAD("101-1091b02.ic10", 0x00000, 0x20000, CRC(fa370e88) SHA1(a937c8f1ec295cf9539d12466993974e40771493) ) // AMI, 27C010 or equivalent ROM_END ROM_START( chesstera ) // model 6120, PCB label 510.1141C01 @@ -228,7 +222,7 @@ ROM_START( chesstera ) // model 6120, PCB label 510.1141C01 ROM_LOAD("chesster.ic9", 0x8000, 0x8000, CRC(29f9a698) SHA1(4c83ca46fd5fc9c40302e9c7f16b4ae2c18b06e6) ) // M27C256B, sticker but no label ROM_REGION( 0x20000, "rombank", 0 ) - ROM_LOAD("101-1091a02.ic10", 0x0000, 0x20000, CRC(2b4d243c) SHA1(921e51978facb502b207b4f64a73b1e74127e826) ) // AMI, 27C010 or equivalent + ROM_LOAD("101-1091a02.ic10", 0x00000, 0x20000, CRC(2b4d243c) SHA1(921e51978facb502b207b4f64a73b1e74127e826) ) // AMI, 27C010 or equivalent ROM_END ROM_START( kishon ) // model 6120G or 6127(same), PCB label 510.1141C01 @@ -236,7 +230,7 @@ ROM_START( kishon ) // model 6120G or 6127(same), PCB label 510.1141C01 ROM_LOAD("gc_2.3.ic9", 0x8000, 0x8000, CRC(121c007f) SHA1(652e9ea47b6bb1632d10eb0fcd7f98cdba22fce7) ) // 27C256, GC 2.3 on sticker, also seen without label ROM_REGION( 0x80000, "rombank", 0 ) - ROM_LOAD("kishon_chesster_v2.6.ic10", 0x0000, 0x80000, CRC(50598869) SHA1(2087e0c2f40a2408fe217a6502c8c3a247bdd063) ) // Toshiba TC544000P-12, 1-14-91, aka 101-1094A01 on 6127 + ROM_LOAD("kishon_chesster_v2.6.ic10", 0x00000, 0x80000, CRC(50598869) SHA1(2087e0c2f40a2408fe217a6502c8c3a247bdd063) ) // Toshiba TC544000P-12, 1-14-91, aka 101-1094A01 on 6127 ROM_END ROM_START( kishona ) // possibly Mephisto brand?, PCB label 510.1141C01 @@ -244,7 +238,7 @@ ROM_START( kishona ) // possibly Mephisto brand?, PCB label 510.1141C01 ROM_LOAD("german_chesster_v2.2.ic9", 0x8000, 0x8000, CRC(43e0cfcd) SHA1(961c7335f562b19fa96324c429ab70e8ab4d7647) ) // 27C256, 15.1.91 ROM_REGION( 0x80000, "rombank", 0 ) - ROM_LOAD("kishon_chesster_v2.6.ic10", 0x0000, 0x80000, CRC(50598869) SHA1(2087e0c2f40a2408fe217a6502c8c3a247bdd063) ) // Toshiba TC544000P-12 + ROM_LOAD("kishon_chesster_v2.6.ic10", 0x00000, 0x80000, CRC(50598869) SHA1(2087e0c2f40a2408fe217a6502c8c3a247bdd063) ) // Toshiba TC544000P-12 ROM_END } // anonymous namespace @@ -255,8 +249,8 @@ ROM_END Drivers *******************************************************************************/ -// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS -SYST( 1990, chesster, 0, 0, chesster, chesster, chesster_state, init_chesster, "Fidelity Electronics", "Chesster Challenger (v1.3)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) -SYST( 1990, chesstera, chesster, 0, chesster, chesster, chesster_state, init_chesster, "Fidelity Electronics", "Chesster Challenger", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) -SYST( 1991, kishon, chesster, 0, kishon, chesster, chesster_state, init_chesster, "Fidelity Electronics", "Kishon Chesster (v2.3)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) -SYST( 1991, kishona, chesster, 0, kishon, chesster, chesster_state, init_chesster, "Fidelity Electronics", "Kishon Chesster (v2.2)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) +// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS +SYST( 1990, chesster, 0, 0, chesster, chesster, chesster_state, empty_init, "Fidelity Electronics", "Chesster Challenger (v1.3)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) +SYST( 1990, chesstera, chesster, 0, chesster, chesster, chesster_state, empty_init, "Fidelity Electronics", "Chesster Challenger", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) +SYST( 1991, kishon, chesster, 0, kishon, chesster, chesster_state, empty_init, "Fidelity Electronics", "Kishon Chesster (v2.3)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) +SYST( 1991, kishona, chesster, 0, kishon, chesster, chesster_state, empty_init, "Fidelity Electronics", "Kishon Chesster (v2.2)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) diff --git a/src/mame/layout/novag_scorpio68k.lay b/src/mame/layout/novag_scorpio68k.lay index 3daec4d3ba4..c2a90565ecf 100644 --- a/src/mame/layout/novag_scorpio68k.lay +++ b/src/mame/layout/novag_scorpio68k.lay @@ -374,7 +374,7 @@ authors:hap - + @@ -383,13 +383,15 @@ authors:hap + + - + @@ -431,6 +433,8 @@ authors:hap + + diff --git a/src/mame/layout/novag_sdiamond.lay b/src/mame/layout/novag_sdiamond.lay index f86cc449ba6..f0db10b620f 100644 --- a/src/mame/layout/novag_sdiamond.lay +++ b/src/mame/layout/novag_sdiamond.lay @@ -374,7 +374,7 @@ authors:hap - + diff --git a/src/mame/novag/sdiamond.cpp b/src/mame/novag/sdiamond.cpp index 7b73db825f9..89bc8d01cef 100644 --- a/src/mame/novag/sdiamond.cpp +++ b/src/mame/novag/sdiamond.cpp @@ -156,7 +156,7 @@ void sdiamond_state::update_lcd() for (int i = 0; i < 4; i++) { // LCD common is 0/1/Hi-Z - const u32 data = BIT(m_lcd_com, i + 4) ? (BIT(m_lcd_com, i) ? ~m_lcd_segs : m_lcd_segs) : 0; + const u16 data = BIT(m_lcd_com, i + 4) ? (BIT(m_lcd_com, i) ? ~m_lcd_segs : m_lcd_segs) : 0; m_lcd_pwm->write_row(i, data); } } diff --git a/src/mame/saitek/chessac.cpp b/src/mame/saitek/chessac.cpp index f2ba1b38c20..57d883b26e2 100644 --- a/src/mame/saitek/chessac.cpp +++ b/src/mame/saitek/chessac.cpp @@ -291,8 +291,8 @@ void chessac_state::p7_w(u8 data) static INPUT_PORTS_START( chessac ) PORT_START("IN.0") - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Y) PORT_NAME("Yes") PORT_CODE(KEYCODE_F1) // combine for NEW GAME - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_N) PORT_NAME("No") PORT_CODE(KEYCODE_F1) // " + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Y) PORT_CODE(KEYCODE_F1) PORT_NAME("Yes") // combine for NEW GAME + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_N) PORT_CODE(KEYCODE_F1) PORT_NAME("No") // " PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_P) PORT_NAME("Position") PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_H) PORT_NAME("Hint / Info") PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_RIGHT) PORT_CODE(KEYCODE_B) PORT_NAME("Fwd / Black") @@ -373,7 +373,7 @@ void chessac_state::chessac(machine_config &config) *******************************************************************************/ ROM_START( chessac ) - ROM_REGION( 0x8000, "maincpu", 0 ) + ROM_REGION16_BE( 0x8000, "maincpu", 0 ) ROM_LOAD("97_saitek_86165400831_hd6433214a08f.u1", 0x0000, 0x8000, CRC(29d06d6a) SHA1(08b6f4093b240b0a34d9da67c9acffc576ba1d2d) ) ROM_REGION( 0x400000, "adpcm", 0 ) diff --git a/src/mame/saitek/prisma.cpp b/src/mame/saitek/prisma.cpp index 71c286da2b8..b26b6101029 100644 --- a/src/mame/saitek/prisma.cpp +++ b/src/mame/saitek/prisma.cpp @@ -354,7 +354,7 @@ void prisma_state::prisma(machine_config &config) *******************************************************************************/ ROM_START( prisma ) - ROM_REGION( 0x8000, "maincpu", 0 ) + ROM_REGION16_BE( 0x8000, "maincpu", 0 ) ROM_LOAD("90_saitek_86051150st9_3258l02p.u1", 0x0000, 0x8000, CRC(b6f8384f) SHA1(a4e8a4a45009c15bda1778512a87dea756aae6d8) ) ROM_REGION( 795951, "screen", 0 ) -- cgit v1.2.3