Skip to content

Commit

Permalink
video/upd7220.cpp: horizontal multiplier is x16 if in gfx mode, x8 ot…
Browse files Browse the repository at this point in the history
…herwise

* fix microbx2 and pc9801:diremono
  • Loading branch information
angelosa committed Nov 2, 2024
1 parent e46068b commit 7149fab
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
16 changes: 5 additions & 11 deletions src/devices/video/upd7220.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -383,17 +383,11 @@ inline void upd7220_device::update_blank_timer(int state)

inline void upd7220_device::recompute_parameters()
{
int horiz_mult = 16, vert_mult = 1;
/* TODO: assume that the pitch also controls number of horizontal pixels in a single cell */
// horiz_mult = 4 if both mixed and interlace?
if((m_mode & UPD7220_MODE_DISPLAY_MASK) == UPD7220_MODE_DISPLAY_MIXED)
horiz_mult = 8;
else if((m_mode & UPD7220_MODE_INTERLACE_MASK) == UPD7220_MODE_INTERLACE_ON)
{
// in interlaced mode every line contains both fields
horiz_mult = 8; // TODO this breaks microbx2, compis uhrg video, characters are 16 pixels wide in interlaced mode too
vert_mult = 2;
}
// microbx2 wants horizontal multiplier of x16
// pc9801:diremono sets up m_mode to be specifically in character mode, wanting x8 here
// TODO: verify compis uhrg video & high reso Hyper 98
const int horiz_mult = (m_mode & UPD7220_MODE_DISPLAY_MASK) == UPD7220_MODE_DISPLAY_GRAPHICS ? 16 : 8;
const int vert_mult = (m_mode & UPD7220_MODE_INTERLACE_MASK) == UPD7220_MODE_INTERLACE_ON ? 2 : 1;

int horiz_pix_total = (m_hs + m_hbp + m_hfp + m_aw) * horiz_mult;
int vert_pix_total = (m_vs + m_vbp + m_al + m_vfp) * vert_mult;
Expand Down
4 changes: 2 additions & 2 deletions src/mame/misc/microbox2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,10 +302,10 @@ void microbx2_state::microbx2(machine_config &config)
m_maincpu->set_addrmap(AS_PROGRAM, &microbx2_state::mem_map);

screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
screen.set_raw(16_MHz_XTAL, 1024, 0, 768, 674, 31, 607);
screen.set_raw(16_MHz_XTAL / 3, 1024, 0, 768, 674, 31, 607);
screen.set_screen_update("gdc", FUNC(upd7220a_device::screen_update));

upd7220a_device &gdc(UPD7220A(config, "gdc", 16_MHz_XTAL / 8));
upd7220a_device &gdc(UPD7220A(config, "gdc", 16_MHz_XTAL / 3)); // unverified clock, hand tuned for ~60 Hz
gdc.set_addrmap(0, &microbx2_state::upd7220_map);
gdc.set_display_pixels(FUNC(microbx2_state::display_pixels));
gdc.set_screen("screen");
Expand Down

0 comments on commit 7149fab

Please sign in to comment.