summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/video
diff options
context:
space:
mode:
author Angelo Salese <angelosa@users.noreply.github.com>2022-12-19 17:15:33 +0100
committer GitHub <noreply@github.com>2022-12-19 17:15:33 +0100
commitd75885a76751fb200652e7aa0b9b38c031b11ce4 (patch)
treeab943356de7146a9e70bcee112abc64cc245dfe8 /src/devices/video
parent2e531b9f256599419dbb512c14fbba7705c89397 (diff)
nec/pc8801.cpp: promote machines to working status (#10685)
- video/upd3301.cpp: fix off by one attribute bugs happening for pc8801 N-88 Basic and several other entries; - nec/pc8801.cpp: backported centronics hookup from pc8001, allows supporting Jast Sound thru Covox interface in some Jast entries; - nec/pc8801.cpp: fix 1bpp graphic layer drawing when uPD3301 is not in color mode, fixes byoin regression; Machines promoted to working ---------------------------- nec/pc8801.cpp: PC-8801mkIISR, PC-8801MH, PC-8801MA [Angelo Salese, Oliver Galibert, Carl] Clones promoted to working ---------------------------- nec/pc8801.cpp: PC-8801mkIIFR, PC-8801mkIIMR, PC-8801FA, PC-8801MA2 [Angelo Salese, Oliver Galibert, Carl] New working software list additions ----------------------------------- pc8801_flop.xml: D' (cracked) [Neo Kobe], Donkey Kong 3 - Dai Gyakushuu [Game Preservation Society, Carl, Disk Blitz] New NOT_WORKING software list additions --------------------------------------- pc8801_flop.xml: D' (alt) [Neo Kobe]
Diffstat (limited to 'src/devices/video')
-rw-r--r--src/devices/video/upd3301.cpp53
-rw-r--r--src/devices/video/upd3301.h1
2 files changed, 41 insertions, 13 deletions
diff --git a/src/devices/video/upd3301.cpp b/src/devices/video/upd3301.cpp
index e12f667e4b4..e8a9d676260 100644
--- a/src/devices/video/upd3301.cpp
+++ b/src/devices/video/upd3301.cpp
@@ -10,8 +10,9 @@
TODO:
- - pinpoint how much of pc8001/pc8801 drawing functions should actually be inherited
- here;
+ - pinpoint and expose actual attribute pin meanings;
+ - verify if pc8001 / pc8801 attribute bit 3 extension is internal or
+ external to the chip;
- N interrupt (special control character);
- light pen;
- reset counters;
@@ -22,9 +23,10 @@
- DMA underrun (sorcerml in pc8801?). Should throw a status U irq;
- cleanup: variable namings should be more verbose
(i.e. not be a single letter like m_y, m_z, m_b ...);
- - jettermi (pc8801) expects to colorize its underlying 400 b&w mode by masking with the
- text color attributes here;
- - xak2 (pc8801) throws text garbage on legacy renderer (verify);
+ - escapepr (pc8801_flop): should draw a semigfx mask over gameplay window but all the attribute
+ areas are 0, with only a single 0x50 0x18 setup at the very end of the VRAM,
+ is it expecting to chain from one frame to another or it's simply failing to setup it properly
+ earlier?
*/
@@ -39,6 +41,7 @@
#define LOG_CRTC (1U << 4) // CRTC parameters
#define LOG_INT (1U << 5) // INT, VRTC and DRQ lines
#define LOG_HRTC (1U << 6) // HRTC (verbose)
+#define LOG_STRIPS (1U << 7) // attribute row strips (verbose)
#define VERBOSE (LOG_WARN)
//#define VERBOSE (LOG_WARN|LOG_CMD)
@@ -52,6 +55,7 @@
#define LOGCRTC(...) LOGMASKED(LOG_CRTC, __VA_ARGS__)
#define LOGINT(...) LOGMASKED(LOG_INT, __VA_ARGS__)
#define LOGHRTC(...) LOGMASKED(LOG_HRTC, __VA_ARGS__)
+#define LOGSTRIPS(...) LOGMASKED(LOG_STRIPS, __VA_ARGS__)
//**************************************************************************
@@ -538,8 +542,6 @@ void upd3301_device::dack_w(uint8_t data)
if ((m_data_fifo_pos == m_h) && (m_attr_fifo_pos == (m_attr << 1)))
{
const u8 attr_max_size = 80;
- // first attribute start is always overwritten with a 0
- m_attr_fifo[m_input_fifo][0] = 0;
// last parameter always extends up to the end of the row
// (7narabe (pc8001) fills last row value with white when exausting available slots)
m_attr_fifo[m_input_fifo][40] = attr_max_size;
@@ -601,19 +603,39 @@ UPD3301_FETCH_ATTRIBUTE( upd3301_device::default_attr_fetch )
if (m_gfx_mode == 1)
return attr_extend_info;
- // TODO: may actually fetch in LIFO order
- // Some edge cases in pc8801 N88 Basic (status on bottom), jettermi and play6lim backs up this theory.
- for (int ex = 0; ex < attr_fifo_size; ex+=2)
+ int row_offset = 0;
+
+ // if very first value is not a 0 then use next value as 0-[n] filler
+ // pc8801 examples:
+ // - N88 Basic (status on bottom)
+ // - jettermi
+ // - play6lim
+ // TODO: comsight uses an attr_row of 2 as first param when entering in code edit mode.
+ // Most likely a delay side effect with DMA that *shouldn't* pickup this branch.
+ if (attr_row[0] != 0)
+ {
+ // tdown (pc8801) unintentionally requires to clamp against max size while loading
+ // (fills TVRAM with floppy data)
+ u8 attr_end = std::min(attr_row[0], attr_max_size);
+ u8 attr_value = attr_row[1];
+ for (int i = 0; i < attr_end; i++)
+ attr_extend_info[i] = attr_value;
+ LOGSTRIPS("ex ----| start: 0 | end: %2u [%02x]\n", attr_end, attr_value);
+
+ row_offset = 2;
+ }
+
+ for (int ex = 0; ex < attr_fifo_size - row_offset; ex+=2)
{
u8 attr_start = std::min(attr_row[ex], attr_max_size);
- u8 attr_value = attr_row[ex+1];
- u8 attr_end = std::min(attr_row[ex+2], attr_max_size);
+ u8 attr_value = attr_row[ex + 1 + row_offset];
+ u8 attr_end = std::min(attr_row[ex + 2], attr_max_size);
// if the target is == 0 then just consider max size instead
// (starfire (pc8001) wants this otherwise will black screen on gameplay)
if (attr_end == 0)
attr_end = attr_max_size;
- //printf("%04x %d %d [%02x]\n", ex, attr_start, attr_end, attr_value);
+ LOGSTRIPS("ex %04x| start: %2u | end: %2u [%02x]%s\n", ex, attr_start, attr_end, attr_value, attr_start == attr_end ? " (ignored)" : "");
for (int i = attr_start; i < attr_end; i++)
attr_extend_info[i] = attr_value;
@@ -727,6 +749,11 @@ bool upd3301_device::get_display_status()
return bool(m_status & STATUS_VE);
}
+bool upd3301_device::is_gfx_color_mode()
+{
+ return get_display_status() && (m_gfx_mode == 2);
+}
+
void upd3301_device::set_display(int state)
{
diff --git a/src/devices/video/upd3301.h b/src/devices/video/upd3301.h
index 9343f6275b2..6521bc1d4b8 100644
--- a/src/devices/video/upd3301.h
+++ b/src/devices/video/upd3301.h
@@ -82,6 +82,7 @@ public:
int hrtc_r();
int vrtc_r();
int lines_per_char() { return m_r; }
+ bool is_gfx_color_mode();
bool get_display_status();
uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);