Skip to content

Commit

Permalink
Disable set bit by rand()%20 and initRand() on GDC status read. It wa…
Browse files Browse the repository at this point in the history
…s the primary cause of severe emulator lag in some PC-98 game cases, especially when palette fades are involved
  • Loading branch information
joncampbell123 committed Nov 18, 2022
1 parent ecd4eee commit 16f23fd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
Unreleased
- Disabled code to randomly return GDC drawing
status active. The implementation was causing
severe performance issues. The code has not
been removed because it could be optimized and
fixed and could even follow the state of GDC
drawing. (joncampbell123)
- VGA 6-bit DAC mode expand to full 8-bit range,
instead of simple shifting (joncampbell123).
- Fix 8254 PIT emulation (joncampbell123)
Expand Down
8 changes: 8 additions & 0 deletions src/hardware/vga_pc98_gdc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -649,8 +649,16 @@ uint8_t PC98_GDC_state::read_status(void) {
if (rfifo_has_content())
ret |= 0x01; // data ready
else if (fifo_read == fifo_write) {
#if 0 // THIS IS CAUSING SEVERE PERFORMANCE ISSUES, DISABLED!
// According to
// [http://hackipedia.org/browse.cgi/Computer/Platform/PC%2c%20NEC%20PC%2d98/Collections/Undocumented%209801%2c%209821%20Volume%202%20%28webtech.co.jp%29/io%5fdisp%2etxt]
// bit 3 (0x08) is supposed to indicate when the GDC is drawing. Perhaps the contributer who's
// pull request added this found a PC-98 game that failed to run without it. Re-enable when a
// higher performance implementation is possible. Also, recent commits in 2022 added actual
// GDC drawing functionality, so perhaps this should mirror that too?
initRand();
if (rand()%20<1) ret |= 0x08;
#endif
}

return ret;
Expand Down

0 comments on commit 16f23fd

Please sign in to comment.