summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author jbu <pullmoll@t-online.de>2016-08-03 15:38:18 +0200
committer jbu <pullmoll@t-online.de>2016-08-03 15:38:18 +0200
commit8b32480113a2620bc2482ea6aee8fc6bcfcb4f7c (patch)
tree1c90f932ccde8509664faab5ab3815220cafa912
parent4b5b14829ce7bc4633bde384d4f297e98c785e1c (diff)
alto2: further cleanup + remove cruft
Get rid of the fake status display. Refactor mouse positioning code.
-rw-r--r--src/devices/cpu/alto2/a2curt.cpp18
-rw-r--r--src/devices/cpu/alto2/a2disk.cpp42
-rw-r--r--src/devices/cpu/alto2/a2disp.cpp285
-rw-r--r--src/devices/cpu/alto2/a2disp.h3
-rw-r--r--src/devices/cpu/alto2/a2mem.cpp258
-rw-r--r--src/devices/cpu/alto2/a2mem.h4
-rw-r--r--src/devices/cpu/alto2/a2mouse.cpp22
-rw-r--r--src/devices/cpu/alto2/a2mrt.cpp2
-rw-r--r--src/devices/cpu/alto2/alto2cpu.h3
-rw-r--r--src/devices/cpu/alto2/alto2dsm.cpp6
-rw-r--r--src/mame/drivers/alto2.cpp9
11 files changed, 153 insertions, 499 deletions
diff --git a/src/devices/cpu/alto2/a2curt.cpp b/src/devices/cpu/alto2/a2curt.cpp
index bc934afef45..3d23ba2ef44 100644
--- a/src/devices/cpu/alto2/a2curt.cpp
+++ b/src/devices/cpu/alto2/a2curt.cpp
@@ -28,6 +28,15 @@ void alto2_cpu_device::f2_late_load_xpreg()
/**
* @brief f2_load_csr late: load the cursor shift register from BUS[0-15]
+ */
+void alto2_cpu_device::f2_late_load_csr()
+{
+ m_dsp.csr = m_bus;
+ LOG((this,LOG_CURT, m_dsp.csr ? 2 : 9," CSR<- BUS (%#o)\n", m_dsp.csr));
+}
+
+/**
+ * @brief curt_activate: called by the CPU when the cursor task becomes active
*
* Shift CSR to xpreg % 16 position to make it easier to
* to handle the word xor in unload_word().
@@ -43,15 +52,6 @@ void alto2_cpu_device::f2_late_load_xpreg()
* 15 000000000000000xxxxxxxxxxxxxxxx0
* </PRE>
*/
-void alto2_cpu_device::f2_late_load_csr()
-{
- m_dsp.csr = m_bus;
- LOG((this,LOG_CURT, m_dsp.csr ? 2 : 9," CSR<- BUS (%#o)\n", m_dsp.csr));
-}
-
-/**
- * @brief curt_activate: called by the CPU when the cursor task becomes active
- */
void alto2_cpu_device::activate_curt()
{
m_task_wakeup &= ~(1 << m_task);
diff --git a/src/devices/cpu/alto2/a2disk.cpp b/src/devices/cpu/alto2/a2disk.cpp
index 4ad6be9ab74..c5088872e15 100644
--- a/src/devices/cpu/alto2/a2disk.cpp
+++ b/src/devices/cpu/alto2/a2disk.cpp
@@ -61,22 +61,6 @@
#define GET_KCOM_SENDADR(kcom) X_RDBITS(kcom,16,5,5) //!< get send address flag from controller command (hardware command register)
#define PUT_KCOM_SENDADR(kcom,val) X_WRBITS(kcom,16,5,5,val) //!< put send address flag into controller command (hardware command register)
-#if defined(ALTO2_FAKE_STATUS_H) && (ALTO2_FAKE_STATUS_H > 0)
-#define STATUS_DP0 28
-#define STATUS_DP1 58
-#define STATUS_RGATE 0, "%c"
-#define STATUS_WGATE 1, "%c"
-#define STATUS_KWRC 2, "%c"
-#define STATUS_CYL 4, "C%03d"
-#define STATUS_HEAD 9, "H%d"
-#define STATUS_SECT 12, "S%02d"
-#define STATUS_PAGE 16, "[%04d]"
-#define FAKE_STATUS(_unit,_which,...) do { \
- int x = (_unit) ? STATUS_DP1 : STATUS_DP0; \
- fake_status_printf(x + _which, __VA_ARGS__); \
-} while (0)
-#endif
-
/** @brief completion codes (only for documentation, since this is microcode defined) */
enum {
STATUS_COMPLETION_GOOD,
@@ -769,8 +753,6 @@ void alto2_cpu_device::kwd_timing(int bitclk, int datin, int block)
dhd->set_egate(m_dsk.egate = 1);
dhd->set_wrgate(m_dsk.wrgate = 1);
dhd->set_rdgate(m_dsk.rdgate = 1);
- FAKE_STATUS(m_dsk.drive, STATUS_WGATE, '-');
- FAKE_STATUS(m_dsk.drive, STATUS_RGATE, '-');
} else {
if (m_dsk.krwc & RWC_WRITE) {
if (m_dsk.ok_to_run) {
@@ -789,7 +771,6 @@ void alto2_cpu_device::kwd_timing(int bitclk, int datin, int block)
// assert erase and write gates
dhd->set_egate(m_dsk.egate = 0);
dhd->set_wrgate(m_dsk.wrgate = 0);
- FAKE_STATUS(m_dsk.drive, STATUS_WGATE, 'W');
}
} else {
#if ALTO2_DEBUG
@@ -799,7 +780,6 @@ void alto2_cpu_device::kwd_timing(int bitclk, int datin, int block)
#endif
// assert read gate
dhd->set_rdgate(m_dsk.rdgate = 0);
- FAKE_STATUS(m_dsk.drive, STATUS_RGATE, 'R');
}
}
@@ -920,8 +900,6 @@ void alto2_cpu_device::disk_strobon(void* ptr, INT32 arg)
} else {
m_dsk.strobon_timer->reset();
}
- FAKE_STATUS(unit, STATUS_CYL, dhd->get_cylinder());
- FAKE_STATUS(unit, STATUS_HEAD, dhd->get_head());
}
/** @brief timer callback to change the READY monoflop 31a */
@@ -1182,7 +1160,6 @@ void alto2_cpu_device::f1_late_increcno()
break;
}
// TODO: show disk indicator
- FAKE_STATUS(m_dsk.drive, STATUS_KWRC, "HPLD"[m_dsk.krecno]);
}
/**
@@ -1707,13 +1684,6 @@ void alto2_cpu_device::next_sector(int unit)
m_bitclk_index = 0;
}
#endif
-#if defined(ALTO2_FAKE_STATUS_H) && (ALTO2_FAKE_STATUS_H > 0)
- if (debug_read_mem(0521) && unit == GET_KADDR_DRIVE(debug_read_mem(0523)))
- {
- FAKE_STATUS(unit, STATUS_SECT, dhd->get_sector());
- FAKE_STATUS(unit, STATUS_PAGE, dhd->get_page());
- }
-#endif
}
/**
@@ -1880,16 +1850,4 @@ void alto2_cpu_device::reset_disk()
m_dsk.ff_44b = JKFF_0;
m_dsk.ff_45a = JKFF_0;
m_dsk.ff_45b = JKFF_0;
-
-#if defined(ALTO2_FAKE_STATUS_H) && (ALTO2_FAKE_STATUS_H > 0)
- for (int unit = 0; unit < 2; unit++) {
- FAKE_STATUS(unit, STATUS_RGATE, '-');
- FAKE_STATUS(unit, STATUS_WGATE, '-');
- FAKE_STATUS(unit, STATUS_KWRC, '-');
- FAKE_STATUS(unit, STATUS_CYL, 0);
- FAKE_STATUS(unit, STATUS_HEAD, 0);
- FAKE_STATUS(unit, STATUS_SECT, 0);
- FAKE_STATUS(unit, STATUS_PAGE, 0);
- }
-#endif
}
diff --git a/src/devices/cpu/alto2/a2disp.cpp b/src/devices/cpu/alto2/a2disp.cpp
index 6ec42384dcb..cf3b5aa8bc6 100644
--- a/src/devices/cpu/alto2/a2disp.cpp
+++ b/src/devices/cpu/alto2/a2disp.cpp
@@ -521,11 +521,11 @@ void alto2_cpu_device::init_disp()
for (int x = 0; x < 16; x++)
*dst++ = (y >> (15 - x)) & 1;
}
- m_dsp.scanline = auto_alloc_array(machine(), UINT8*, ALTO2_DISPLAY_HEIGHT + ALTO2_FAKE_STATUS_H);
- for (int y = 0; y < ALTO2_DISPLAY_HEIGHT + ALTO2_FAKE_STATUS_H; y++)
+ m_dsp.scanline = auto_alloc_array(machine(), UINT8*, ALTO2_DISPLAY_HEIGHT);
+ for (int y = 0; y < ALTO2_DISPLAY_HEIGHT; y++)
m_dsp.scanline[y] = auto_alloc_array(machine(), UINT8, ALTO2_DISPLAY_TOTAL_WIDTH);
- m_dsp.bitmap = std::make_unique<bitmap_ind16>(ALTO2_DISPLAY_WIDTH, ALTO2_DISPLAY_HEIGHT + ALTO2_FAKE_STATUS_H);
+ m_dsp.bitmap = std::make_unique<bitmap_ind16>(ALTO2_DISPLAY_WIDTH, ALTO2_DISPLAY_HEIGHT);
m_dsp.state = 0;
}
@@ -559,10 +559,6 @@ void alto2_cpu_device::reset_disp()
for (int y = 0; y < ALTO2_DISPLAY_HEIGHT; y++)
memset(m_dsp.scanline[y], 0, sizeof(UINT8) * ALTO2_DISPLAY_TOTAL_WIDTH);
m_dsp.odd_frame = false;
-
- for (int y = ALTO2_DISPLAY_HEIGHT; y < ALTO2_DISPLAY_HEIGHT + ALTO2_FAKE_STATUS_H; y++)
- memset(m_dsp.scanline[y], 1, sizeof(UINT8) * ALTO2_DISPLAY_TOTAL_WIDTH);
- fake_status_printf(1, "Disk status info");
}
/* Video update */
@@ -573,8 +569,6 @@ UINT32 alto2_cpu_device::screen_update(screen_device &screen, bitmap_ind16 &bitm
palette_bw[1] = screen.palette().black_pen();
for (int y = m_dsp.odd_frame ? 1 : 0; y < ALTO2_DISPLAY_HEIGHT; y += 2)
draw_scanline8(*m_dsp.bitmap, 0, y, ALTO2_DISPLAY_WIDTH, m_dsp.scanline[y], palette_bw);
- for (int y = ALTO2_DISPLAY_HEIGHT; y < ALTO2_DISPLAY_HEIGHT + ALTO2_FAKE_STATUS_H; y++)
- draw_scanline8(*m_dsp.bitmap, 0, y, ALTO2_DISPLAY_WIDTH, m_dsp.scanline[y], palette_bw);
copybitmap(bitmap, *m_dsp.bitmap, 0, 0, 0, 0, cliprect);
return 0;
}
@@ -584,276 +578,3 @@ void alto2_cpu_device::screen_eof(screen_device &screen, bool state)
if (state)
m_dsp.odd_frame = !m_dsp.odd_frame;
}
-
-/*****************************************************************************
- *
- * FAKE STATUS LINE
- *
- *****************************************************************************/
-
-typedef struct {
- UINT8 code;
- UINT8 bits[10];
-} bdf_6x10_t;
-
-/**
- * STARTFONT 2.1
- * COMMENT "$ucs-fonts: 6x10.bdf,v 1.34 2002-11-10 19:12:30+00 mgk25 Rel $"
- * COMMENT "Send bug reports to Markus Kuhn <http://www.cl.cam.ac.uk/~mgk25/>"
- * FONT -Misc-Fixed-Medium-R-Normal--10-100-75-75-C-60-ISO10646-1
- * SIZE 10 75 75
- * FONTBOUNDINGBOX 6 10 0 -2
- * STARTPROPERTIES 22
- * FONTNAME_REGISTRY ""
- * FOUNDRY "Misc"
- * FAMILY_NAME "Fixed"
- * WEIGHT_NAME "Medium"
- * SLANT "R"
- * SETWIDTH_NAME "Normal"
- * ADD_STYLE_NAME ""
- * PIXEL_SIZE 10
- * POINT_SIZE 100
- * RESOLUTION_X 75
- * RESOLUTION_Y 75
- * SPACING "C"
- * AVERAGE_WIDTH 60
- * CHARSET_REGISTRY "ISO10646"
- * CHARSET_ENCODING "1"
- * FONT_ASCENT 8
- * FONT_DESCENT 2
- * DEFAULT_CHAR 0
- * COPYRIGHT "Public domain terminal emulator font. Share and enjoy."
- * _XMBDFED_INFO "Edited with xmbdfed 4.5."
- * CAP_HEIGHT 7
- * X_HEIGHT 5
- * ENDPROPERTIES
- * CHARS 1597
- */
-static const bdf_6x10_t bdf_6x10[] = {
-/* space */ { 32, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }},
-/* exclam */ { 33, {0x00, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x20, 0x00, 0x00 }},
-/* quotedbl */ { 34, {0x00, 0x50, 0x50, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }},
-/* numbersign */ { 35, {0x00, 0x50, 0x50, 0xF8, 0x50, 0xF8, 0x50, 0x50, 0x00, 0x00 }},
-/* dollar */ { 36, {0x00, 0x20, 0x70, 0xA0, 0x70, 0x28, 0x70, 0x20, 0x00, 0x00 }},
-/* percent */ { 37, {0x00, 0x48, 0xA8, 0x50, 0x20, 0x50, 0xA8, 0x90, 0x00, 0x00 }},
-/* ampersand */ { 38, {0x00, 0x40, 0xA0, 0xA0, 0x40, 0xA8, 0x90, 0x68, 0x00, 0x00 }},
-/* quotesingle */ { 39, {0x00, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }},
-/* parenleft */ { 40, {0x00, 0x10, 0x20, 0x40, 0x40, 0x40, 0x20, 0x10, 0x00, 0x00 }},
-/* parenright */ { 41, {0x00, 0x40, 0x20, 0x10, 0x10, 0x10, 0x20, 0x40, 0x00, 0x00 }},
-/* asterisk */ { 42, {0x00, 0x00, 0x88, 0x50, 0xF8, 0x50, 0x88, 0x00, 0x00, 0x00 }},
-/* plus */ { 43, {0x00, 0x00, 0x20, 0x20, 0xF8, 0x20, 0x20, 0x00, 0x00, 0x00 }},
-/* comma */ { 44, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x20, 0x40, 0x00 }},
-/* hyphen */ { 45, {0x00, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00 }},
-/* period */ { 46, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x70, 0x20, 0x00 }},
-/* slash */ { 47, {0x00, 0x08, 0x08, 0x10, 0x20, 0x40, 0x80, 0x80, 0x00, 0x00 }},
-/* zero */ { 48, {0x00, 0x20, 0x50, 0x88, 0x88, 0x88, 0x50, 0x20, 0x00, 0x00 }},
-/* one */ { 49, {0x00, 0x20, 0x60, 0xA0, 0x20, 0x20, 0x20, 0xF8, 0x00, 0x00 }},
-/* two */ { 50, {0x00, 0x70, 0x88, 0x08, 0x30, 0x40, 0x80, 0xF8, 0x00, 0x00 }},
-/* three */ { 51, {0x00, 0xF8, 0x08, 0x10, 0x30, 0x08, 0x88, 0x70, 0x00, 0x00 }},
-/* four */ { 52, {0x00, 0x10, 0x30, 0x50, 0x90, 0xF8, 0x10, 0x10, 0x00, 0x00 }},
-/* five */ { 53, {0x00, 0xF8, 0x80, 0xB0, 0xC8, 0x08, 0x88, 0x70, 0x00, 0x00 }},
-/* six */ { 54, {0x00, 0x30, 0x40, 0x80, 0xB0, 0xC8, 0x88, 0x70, 0x00, 0x00 }},
-/* seven */ { 55, {0x00, 0xF8, 0x08, 0x10, 0x10, 0x20, 0x40, 0x40, 0x00, 0x00 }},
-/* eight */ { 56, {0x00, 0x70, 0x88, 0x88, 0x70, 0x88, 0x88, 0x70, 0x00, 0x00 }},
-/* nine */ { 57, {0x00, 0x70, 0x88, 0x98, 0x68, 0x08, 0x10, 0x60, 0x00, 0x00 }},
-/* colon */ { 58, {0x00, 0x00, 0x20, 0x70, 0x20, 0x00, 0x20, 0x70, 0x20, 0x00 }},
-/* semicolon */ { 59, {0x00, 0x00, 0x20, 0x70, 0x20, 0x00, 0x30, 0x20, 0x40, 0x00 }},
-/* less */ { 60, {0x00, 0x08, 0x10, 0x20, 0x40, 0x20, 0x10, 0x08, 0x00, 0x00 }},
-/* equal */ { 61, {0x00, 0x00, 0x00, 0xF8, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x00 }},
-/* greater */ { 62, {0x00, 0x40, 0x20, 0x10, 0x08, 0x10, 0x20, 0x40, 0x00, 0x00 }},
-/* question */ { 63, {0x00, 0x70, 0x88, 0x10, 0x20, 0x20, 0x00, 0x20, 0x00, 0x00 }},
-/* at */ { 64, {0x00, 0x70, 0x88, 0x98, 0xA8, 0xB0, 0x80, 0x70, 0x00, 0x00 }},
-/* A */ { 65, {0x00, 0x20, 0x50, 0x88, 0x88, 0xF8, 0x88, 0x88, 0x00, 0x00 }},
-/* B */ { 66, {0x00, 0xF0, 0x48, 0x48, 0x70, 0x48, 0x48, 0xF0, 0x00, 0x00 }},
-/* C */ { 67, {0x00, 0x70, 0x88, 0x80, 0x80, 0x80, 0x88, 0x70, 0x00, 0x00 }},
-/* D */ { 68, {0x00, 0xF0, 0x48, 0x48, 0x48, 0x48, 0x48, 0xF0, 0x00, 0x00 }},
-/* E */ { 69, {0x00, 0xF8, 0x80, 0x80, 0xF0, 0x80, 0x80, 0xF8, 0x00, 0x00 }},
-/* F */ { 70, {0x00, 0xF8, 0x80, 0x80, 0xF0, 0x80, 0x80, 0x80, 0x00, 0x00 }},
-/* G */ { 71, {0x00, 0x70, 0x88, 0x80, 0x80, 0x98, 0x88, 0x70, 0x00, 0x00 }},
-/* H */ { 72, {0x00, 0x88, 0x88, 0x88, 0xF8, 0x88, 0x88, 0x88, 0x00, 0x00 }},
-/* I */ { 73, {0x00, 0x70, 0x20, 0x20, 0x20, 0x20, 0x20, 0x70, 0x00, 0x00 }},
-/* J */ { 74, {0x00, 0x38, 0x10, 0x10, 0x10, 0x10, 0x90, 0x60, 0x00, 0x00 }},
-/* K */ { 75, {0x00, 0x88, 0x90, 0xA0, 0xC0, 0xA0, 0x90, 0x88, 0x00, 0x00 }},
-/* L */ { 76, {0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xF8, 0x00, 0x00 }},
-/* M */ { 77, {0x00, 0x88, 0x88, 0xD8, 0xA8, 0x88, 0x88, 0x88, 0x00, 0x00 }},
-/* N */ { 78, {0x00, 0x88, 0x88, 0xC8, 0xA8, 0x98, 0x88, 0x88, 0x00, 0x00 }},
-/* O */ { 79, {0x00, 0x70, 0x88, 0x88, 0x88, 0x88, 0x88, 0x70, 0x00, 0x00 }},
-/* P */ { 80, {0x00, 0xF0, 0x88, 0x88, 0xF0, 0x80, 0x80, 0x80, 0x00, 0x00 }},
-/* Q */ { 81, {0x00, 0x70, 0x88, 0x88, 0x88, 0x88, 0xA8, 0x70, 0x08, 0x00 }},
-/* R */ { 82, {0x00, 0xF0, 0x88, 0x88, 0xF0, 0xA0, 0x90, 0x88, 0x00, 0x00 }},
-/* S */ { 83, {0x00, 0x70, 0x88, 0x80, 0x70, 0x08, 0x88, 0x70, 0x00, 0x00 }},
-/* T */ { 84, {0x00, 0xF8, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00 }},
-/* U */ { 85, {0x00, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x70, 0x00, 0x00 }},
-/* V */ { 86, {0x00, 0x88, 0x88, 0x88, 0x50, 0x50, 0x50, 0x20, 0x00, 0x00 }},
-/* W */ { 87, {0x00, 0x88, 0x88, 0x88, 0xA8, 0xA8, 0xD8, 0x88, 0x00, 0x00 }},
-/* X */ { 88, {0x00, 0x88, 0x88, 0x50, 0x20, 0x50, 0x88, 0x88, 0x00, 0x00 }},
-/* Y */ { 89, {0x00, 0x88, 0x88, 0x50, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00 }},
-/* Z */ { 90, {0x00, 0xF8, 0x08, 0x10, 0x20, 0x40, 0x80, 0xF8, 0x00, 0x00 }},
-/* bracketleft */ { 91, {0x00, 0x70, 0x40, 0x40, 0x40, 0x40, 0x40, 0x70, 0x00, 0x00 }},
-/* backslash */ { 92, {0x00, 0x80, 0x80, 0x40, 0x20, 0x10, 0x08, 0x08, 0x00, 0x00 }},
-/* bracketright */ { 93, {0x00, 0x70, 0x10, 0x10, 0x10, 0x10, 0x10, 0x70, 0x00, 0x00 }},
-/* asciicircum */ { 94, {0x00, 0x20, 0x50, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }},
-/* underscore */ { 95, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x00 }},
-/* grave */ { 96, {0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }},
-/* a */ { 97, {0x00, 0x00, 0x00, 0x70, 0x08, 0x78, 0x88, 0x78, 0x00, 0x00 }},
-/* b */ { 98, {0x00, 0x80, 0x80, 0xB0, 0xC8, 0x88, 0xC8, 0xB0, 0x00, 0x00 }},
-/* c */ { 99, {0x00, 0x00, 0x00, 0x70, 0x88, 0x80, 0x88, 0x70, 0x00, 0x00 }},
-/* d */ { 100, {0x00, 0x08, 0x08, 0x68, 0x98, 0x88, 0x98, 0x68, 0x00, 0x00 }},
-/* e */ { 101, {0x00, 0x00, 0x00, 0x70, 0x88, 0xF8, 0x80, 0x70, 0x00, 0x00 }},
-/* f */ { 102, {0x00, 0x30, 0x48, 0x40, 0xF0, 0x40, 0x40, 0x40, 0x00, 0x00 }},
-/* g */ { 103, {0x00, 0x00, 0x00, 0x78, 0x88, 0x88, 0x78, 0x08, 0x88, 0x70 }},
-/* h */ { 104, {0x00, 0x80, 0x80, 0xB0, 0xC8, 0x88, 0x88, 0x88, 0x00, 0x00 }},
-/* i */ { 105, {0x00, 0x20, 0x00, 0x60, 0x20, 0x20, 0x20, 0x70, 0x00, 0x00 }},
-/* j */ { 106, {0x00, 0x08, 0x00, 0x18, 0x08, 0x08, 0x08, 0x48, 0x48, 0x30 }},
-/* k */ { 107, {0x00, 0x80, 0x80, 0x88, 0x90, 0xE0, 0x90, 0x88, 0x00, 0x00 }},
-/* l */ { 108, {0x00, 0x60, 0x20, 0x20, 0x20, 0x20, 0x20, 0x70, 0x00, 0x00 }},
-/* m */ { 109, {0x00, 0x00, 0x00, 0xD0, 0xA8, 0xA8, 0xA8, 0x88, 0x00, 0x00 }},
-/* n */ { 110, {0x00, 0x00, 0x00, 0xB0, 0xC8, 0x88, 0x88, 0x88, 0x00, 0x00 }},
-/* o */ { 111, {0x00, 0x00, 0x00, 0x70, 0x88, 0x88, 0x88, 0x70, 0x00, 0x00 }},
-/* p */ { 112, {0x00, 0x00, 0x00, 0xB0, 0xC8, 0x88, 0xC8, 0xB0, 0x80, 0x80 }},
-/* q */ { 113, {0x00, 0x00, 0x00, 0x68, 0x98, 0x88, 0x98, 0x68, 0x08, 0x08 }},
-/* r */ { 114, {0x00, 0x00, 0x00, 0xB0, 0xC8, 0x80, 0x80, 0x80, 0x00, 0x00 }},
-/* s */ { 115, {0x00, 0x00, 0x00, 0x70, 0x80, 0x70, 0x08, 0xF0, 0x00, 0x00 }},
-/* t */ { 116, {0x00, 0x40, 0x40, 0xF0, 0x40, 0x40, 0x48, 0x30, 0x00, 0x00 }},
-/* u */ { 117, {0x00, 0x00, 0x00, 0x88, 0x88, 0x88, 0x98, 0x68, 0x00, 0x00 }},
-/* v */ { 118, {0x00, 0x00, 0x00, 0x88, 0x88, 0x50, 0x50, 0x20, 0x00, 0x00 }},
-/* w */ { 119, {0x00, 0x00, 0x00, 0x88, 0x88, 0xA8, 0xA8, 0x50, 0x00, 0x00 }},
-/* x */ { 120, {0x00, 0x00, 0x00, 0x88, 0x50, 0x20, 0x50, 0x88, 0x00, 0x00 }},
-/* y */ { 121, {0x00, 0x00, 0x00, 0x88, 0x88, 0x98, 0x68, 0x08, 0x88, 0x70 }},
-/* z */ { 122, {0x00, 0x00, 0x00, 0xF8, 0x10, 0x20, 0x40, 0xF8, 0x00, 0x00 }},
-/* braceleft */ { 123, {0x00, 0x18, 0x20, 0x10, 0x60, 0x10, 0x20, 0x18, 0x00, 0x00 }},
-/* bar */ { 124, {0x00, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00 }},
-/* braceright */ { 125, {0x00, 0x60, 0x10, 0x20, 0x18, 0x20, 0x10, 0x60, 0x00, 0x00 }},
-/* asciitilde */ { 126, {0x00, 0x48, 0xA8, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }},
-/* space */ { 160, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }},
-/* exclamdown */ { 161, {0x00, 0x20, 0x00, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00 }},
-/* cent */ { 162, {0x00, 0x00, 0x20, 0x78, 0xA0, 0xA0, 0xA0, 0x78, 0x20, 0x00 }},
-/* sterling */ { 163, {0x00, 0x30, 0x48, 0x40, 0xE0, 0x40, 0x48, 0xB0, 0x00, 0x00 }},
-/* currency */ { 164, {0x00, 0x00, 0x00, 0x88, 0x70, 0x50, 0x70, 0x88, 0x00, 0x00 }},
-/* yen */ { 165, {0x00, 0x88, 0x88, 0x50, 0x20, 0xF8, 0x20, 0x20, 0x20, 0x00 }},
-/* brokenbar */ { 166, {0x00, 0x20, 0x20, 0x20, 0x00, 0x20, 0x20, 0x20, 0x00, 0x00 }},
-/* section */ { 167, {0x00, 0x70, 0x80, 0xE0, 0x90, 0x48, 0x38, 0x08, 0x70, 0x00 }},
-/* dieresis */ { 168, {0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }},
-/* copyright */ { 169, {0x00, 0x70, 0x88, 0xA8, 0xC8, 0xA8, 0x88, 0x70, 0x00, 0x00 }},
-/* ordfeminine */ { 170, {0x00, 0x38, 0x48, 0x58, 0x28, 0x00, 0x78, 0x00, 0x00, 0x00 }},
-/* guillemotleft */ { 171, {0x00, 0x00, 0x00, 0x24, 0x48, 0x90, 0x48, 0x24, 0x00, 0x00 }},
-/* logicalnot */ { 172, {0x00, 0x00, 0x00, 0x00, 0x78, 0x08, 0x00, 0x00, 0x00, 0x00 }},
-/* hyphen */ { 173, {0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00 }},
-/* registered */ { 174, {0x00, 0x70, 0x88, 0xE8, 0xC8, 0xC8, 0x88, 0x70, 0x00, 0x00 }},
-/* macron */ { 175, {0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }},
-/* degree */ { 176, {0x00, 0x20, 0x50, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }},
-/* plusminus */ { 177, {0x00, 0x00, 0x20, 0x20, 0xF8, 0x20, 0x20, 0xF8, 0x00, 0x00 }},
-/* twosuperior */ { 178, {0x30, 0x48, 0x10, 0x20, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00 }},
-/* threesuperior */ { 179, {0x70, 0x08, 0x30, 0x08, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00 }},
-/* acute */ { 180, {0x10, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }},
-/* mu */ { 181, {0x00, 0x00, 0x00, 0x88, 0x88, 0x88, 0xC8, 0xB0, 0x80, 0x00 }},
-/* paragraph */ { 182, {0x00, 0x78, 0xE8, 0xE8, 0x68, 0x28, 0x28, 0x28, 0x00, 0x00 }},
-/* periodcentered */ { 183, {0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00 }},
-/* cedilla */ { 184, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x20 }},
-/* onesuperior */ { 185, {0x20, 0x60, 0x20, 0x20, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00 }},
-/* ordmasculine */ { 186, {0x00, 0x30, 0x48, 0x48, 0x30, 0x00, 0x78, 0x00, 0x00, 0x00 }},
-/* guillemotright */ { 187, {0x00, 0x00, 0x00, 0x90, 0x48, 0x24, 0x48, 0x90, 0x00, 0x00 }},
-/* onequarter */ { 188, {0x40, 0xC0, 0x40, 0x40, 0xE4, 0x0C, 0x14, 0x3C, 0x04, 0x00 }},
-/* onehalf */ { 189, {0x40, 0xC0, 0x40, 0x40, 0xE8, 0x14, 0x04, 0x08, 0x1C, 0x00 }},
-/* threequarters */ { 190, {0xC0, 0x20, 0x40, 0x20, 0xC8, 0x18, 0x28, 0x78, 0x08, 0x00 }},
-/* questiondown */ { 191, {0x00, 0x20, 0x00, 0x20, 0x20, 0x40, 0x88, 0x70, 0x00, 0x00 }},
-/* Agrave */ { 192, {0x40, 0x20, 0x70, 0x88, 0x88, 0xF8, 0x88, 0x88, 0x00, 0x00 }},
-/* Aacute */ { 193, {0x10, 0x20, 0x70, 0x88, 0x88, 0xF8, 0x88, 0x88, 0x00, 0x00 }},
-/* Acircumflex */ { 194, {0x20, 0x50, 0x70, 0x88, 0x88, 0xF8, 0x88, 0x88, 0x00, 0x00 }},
-/* Atilde */ { 195, {0x48, 0xB0, 0x70, 0x88, 0x88, 0xF8, 0x88, 0x88, 0x00, 0x00 }},
-/* Adieresis */ { 196, {0x50, 0x00, 0x70, 0x88, 0x88, 0xF8, 0x88, 0x88, 0x00, 0x00 }},
-/* Aring */ { 197, {0x20, 0x50, 0x70, 0x88, 0x88, 0xF8, 0x88, 0x88, 0x00, 0x00 }},
-/* AE */ { 198, {0x00, 0x3C, 0x50, 0x90, 0x9C, 0xF0, 0x90, 0x9C, 0x00, 0x00 }},
-/* Ccedilla */ { 199, {0x00, 0x70, 0x88, 0x80, 0x80, 0x80, 0x88, 0x70, 0x20, 0x40 }},
-/* Egrave */ { 200, {0x40, 0xF8, 0x80, 0x80, 0xF0, 0x80, 0x80, 0xF8, 0x00, 0x00 }},
-/* Eacute */ { 201, {0x10, 0xF8, 0x80, 0x80, 0xF0, 0x80, 0x80, 0xF8, 0x00, 0x00 }},
-/* Ecircumflex */ { 202, {0x20, 0xF8, 0x80, 0x80, 0xF0, 0x80, 0x80, 0xF8, 0x00, 0x00 }},
-/* Edieresis */ { 203, {0x50, 0xF8, 0x80, 0x80, 0xF0, 0x80, 0x80, 0xF8, 0x00, 0x00 }},
-/* Igrave */ { 204, {0x40, 0x20, 0x70, 0x20, 0x20, 0x20, 0x20, 0x70, 0x00, 0x00 }},
-/* Iacute */ { 205, {0x10, 0x20, 0x70, 0x20, 0x20, 0x20, 0x20, 0x70, 0x00, 0x00 }},
-/* Icircumflex */ { 206, {0x20, 0x50, 0x70, 0x20, 0x20, 0x20, 0x20, 0x70, 0x00, 0x00 }},
-/* Idieresis */ { 207, {0x50, 0x00, 0x70, 0x20, 0x20, 0x20, 0x20, 0x70, 0x00, 0x00 }},
-/* Eth */ { 208, {0x00, 0xF0, 0x48, 0x48, 0xE8, 0x48, 0x48, 0xF0, 0x00, 0x00 }},
-/* Ntilde */ { 209, {0x28, 0x50, 0x88, 0xC8, 0xA8, 0x98, 0x88, 0x88, 0x00, 0x00 }},
-/* Ograve */ { 210, {0x40, 0x20, 0x70, 0x88, 0x88, 0x88, 0x88, 0x70, 0x00, 0x00 }},
-/* Oacute */ { 211, {0x10, 0x20, 0x70, 0x88, 0x88, 0x88, 0x88, 0x70, 0x00, 0x00 }},
-/* Ocircumflex */ { 212, {0x20, 0x50, 0x70, 0x88, 0x88, 0x88, 0x88, 0x70, 0x00, 0x00 }},
-/* Otilde */ { 213, {0x28, 0x50, 0x70, 0x88, 0x88, 0x88, 0x88, 0x70, 0x00, 0x00 }},
-/* Odieresis */ { 214, {0x50, 0x00, 0x70, 0x88, 0x88, 0x88, 0x88, 0x70, 0x00, 0x00 }},
-/* multiply */ { 215, {0x00, 0x00, 0x00, 0x88, 0x50, 0x20, 0x50, 0x88, 0x00, 0x00 }},
-/* Oslash */ { 216, {0x00, 0x70, 0x98, 0x98, 0xA8, 0xC8, 0xC8, 0x70, 0x00, 0x00 }},
-/* Ugrave */ { 217, {0x40, 0x20, 0x88, 0x88, 0x88, 0x88, 0x88, 0x70, 0x00, 0x00 }},
-/* Uacute */ { 218, {0x10, 0x20, 0x88, 0x88, 0x88, 0x88, 0x88, 0x70, 0x00, 0x00 }},
-/* Ucircumflex */ { 219, {0x20, 0x50, 0x00, 0x88, 0x88, 0x88, 0x88, 0x70, 0x00, 0x00 }},
-/* Udieresis */ { 220, {0x50, 0x00, 0x88, 0x88, 0x88, 0x88, 0x88, 0x70, 0x00, 0x00 }},
-/* Yacute */ { 221, {0x10, 0x20, 0x88, 0x88, 0x50, 0x20, 0x20, 0x20, 0x00, 0x00 }},
-/* Thorn */ { 222, {0x00, 0x80, 0xF0, 0x88, 0xF0, 0x80, 0x80, 0x80, 0x00, 0x00 }},
-/* germandbls */ { 223, {0x00, 0x70, 0x88, 0x90, 0xA0, 0x90, 0x88, 0xB0, 0x00, 0x00 }},
-/* agrave */ { 224, {0x40, 0x20, 0x00, 0x70, 0x08, 0x78, 0x88, 0x78, 0x00, 0x00 }},
-/* aacute */ { 225, {0x10, 0x20, 0x00, 0x70, 0x08, 0x78, 0x88, 0x78, 0x00, 0x00 }},
-/* acircumflex */ { 226, {0x20, 0x50, 0x00, 0x70, 0x08, 0x78, 0x88, 0x78, 0x00, 0x00 }},
-/* atilde */ { 227, {0x28, 0x50, 0x00, 0x70, 0x08, 0x78, 0x88, 0x78, 0x00, 0x00 }},
-/* adieresis */ { 228, {0x00, 0x50, 0x00, 0x70, 0x08, 0x78, 0x88, 0x78, 0x00, 0x00 }},
-/* aring */ { 229, {0x20, 0x50, 0x20, 0x70, 0x08, 0x78, 0x88, 0x78, 0x00, 0x00 }},
-/* ae */ { 230, {0x00, 0x00, 0x00, 0x78, 0x14, 0x7C, 0x90, 0x7C, 0x00, 0x00 }},
-/* ccedilla */ { 231, {0x00, 0x00, 0x00, 0x70, 0x88, 0x80, 0x88, 0x70, 0x20, 0x40 }},
-/* egrave */ { 232, {0x40, 0x20, 0x00, 0x70, 0x88, 0xF8, 0x80, 0x70, 0x00, 0x00 }},
-/* eacute */ { 233, {0x10, 0x20, 0x00, 0x70, 0x88, 0xF8, 0x80, 0x70, 0x00, 0x00 }},
-/* ecircumflex */ { 234, {0x20, 0x50, 0x00, 0x70, 0x88, 0xF8, 0x80, 0x70, 0x00, 0x00 }},
-/* edieresis */ { 235, {0x00, 0x50, 0x00, 0x70, 0x88, 0xF8, 0x80, 0x70, 0x00, 0x00 }},
-/* igrave */ { 236, {0x40, 0x20, 0x00, 0x60, 0x20, 0x20, 0x20, 0x70, 0x00, 0x00 }},
-/* iacute */ { 237, {0x20, 0x40, 0x00, 0x60, 0x20, 0x20, 0x20, 0x70, 0x00, 0x00 }},
-/* icircumflex */ { 238, {0x20, 0x50, 0x00, 0x60, 0x20, 0x20, 0x20, 0x70, 0x00, 0x00 }},
-/* idieresis */ { 239, {0x00, 0x50, 0x00, 0x60, 0x20, 0x20, 0x20, 0x70, 0x00, 0x00 }},
-/* eth */ { 240, {0x00, 0xC0, 0x30, 0x70, 0x88, 0x88, 0x88, 0x70, 0x00, 0x00 }},
-/* ntilde */ { 241, {0x28, 0x50, 0x00, 0xB0, 0xC8, 0x88, 0x88, 0x88, 0x00, 0x00 }},
-/* ograve */ { 242, {0x40, 0x20, 0x00, 0x70, 0x88, 0x88, 0x88, 0x70, 0x00, 0x00 }},
-/* oacute */ { 243, {0x10, 0x20, 0x00, 0x70, 0x88, 0x88, 0x88, 0x70, 0x00, 0x00 }},
-/* ocircumflex */ { 244, {0x20, 0x50, 0x00, 0x70, 0x88, 0x88, 0x88, 0x70, 0x00, 0x00 }},
-/* otilde */ { 245, {0x28, 0x50, 0x00, 0x70, 0x88, 0x88, 0x88, 0x70, 0x00, 0x00 }},
-/* odieresis */ { 246, {0x00, 0x50, 0x00, 0x70, 0x88, 0x88, 0x88, 0x70, 0x00, 0x00 }},
-/* divide */ { 247, {0x00, 0x00, 0x20, 0x00, 0xF8, 0x00, 0x20, 0x00, 0x00, 0x00 }},
-/* oslash */ { 248, {0x00, 0x00, 0x00, 0x78, 0x98, 0xA8, 0xC8, 0xF0, 0x00, 0x00 }},
-/* ugrave */ { 249, {0x40, 0x20, 0x00, 0x88, 0x88, 0x88, 0x98, 0x68, 0x00, 0x00 }},
-/* uacute */ { 250, {0x10, 0x20, 0x00, 0x88, 0x88, 0x88, 0x98, 0x68, 0x00, 0x00 }},
-/* ucircumflex */ { 251, {0x20, 0x50, 0x00, 0x88, 0x88, 0x88, 0x98, 0x68, 0x00, 0x00 }},
-/* udieresis */ { 252, {0x00, 0x50, 0x00, 0x88, 0x88, 0x88, 0x98, 0x68, 0x00, 0x00 }},
-/* yacute */ { 253, {0x00, 0x10, 0x20, 0x88, 0x88, 0x98, 0x68, 0x08, 0x88, 0x70 }},
-/* thorn */ { 254, {0x00, 0x00, 0x80, 0xF0, 0x88, 0x88, 0x88, 0xF0, 0x80, 0x80 }},
-/* ydieresis */ { 255, {0x00, 0x50, 0x00, 0x88, 0x88, 0x98, 0x68, 0x08, 0x88, 0x70 }},
-/* char0 */ { 0, {0x00, 0xA8, 0x00, 0x88, 0x00, 0x88, 0x00, 0xA8, 0x00, 0x00 }}
-};
-
-void alto2_cpu_device::fake_status_putch(int x, UINT8 ch)
-{
- const bdf_6x10_t* pf = bdf_6x10;
- while (pf->code != ch && pf->code != 0)
- pf++;
- int dx = 6 * x;
- if (dx >= ALTO2_DISPLAY_WIDTH)
- return;
- for (int dy = 0; dy < 10; dy++)
- {
- UINT8* pix = m_dsp.scanline[ALTO2_DISPLAY_HEIGHT + 1 + dy] + dx;
- UINT8 bits = ~pf->bits[dy];
- pix[0] = (bits >> 7) & 1;
- pix[1] = (bits >> 6) & 1;
- pix[2] = (bits >> 5) & 1;
- pix[3] = (bits >> 4) & 1;
- pix[4] = (bits >> 3) & 1;
- pix[5] = (bits >> 2) & 1;
- }
-
-}
-
-void alto2_cpu_device::fake_status_printf(int x, const char* format, ...)
-{
- static char buff[256];
- va_list ap;
- va_start(ap, format);
- vsnprintf(buff, sizeof(buff), format, ap);
- va_end(ap);
- char* src = buff;
- while (*src)
- fake_status_putch(x++, *src++);
-}
diff --git a/src/devices/cpu/alto2/a2disp.h b/src/devices/cpu/alto2/a2disp.h
index ceb55a2a100..07815ea1a65 100644
--- a/src/devices/cpu/alto2/a2disp.h
+++ b/src/devices/cpu/alto2/a2disp.h
@@ -295,8 +295,5 @@ void init_disp(); //!< initialize the display context
void exit_disp(); //!< deinitialize the display context
void reset_disp(); //!< reset the display context
-void fake_status_putch(int x, UINT8 ch);
-void fake_status_printf(int x, const char* format, ...);
-
#endif // _A2DISP_H_
#endif // ALTO2_DEFINE_CONSTANTS
diff --git a/src/devices/cpu/alto2/a2mem.cpp b/src/devices/cpu/alto2/a2mem.cpp
index e64dd4a0a28..1b562db944e 100644
--- a/src/devices/cpu/alto2/a2mem.cpp
+++ b/src/devices/cpu/alto2/a2mem.cpp
@@ -201,11 +201,11 @@
*
* chip A B C D E F G H I even odd
* ---------------------------------------------------------------------------------
- * a75: WD01 WD04 WD08 WD11 WD15 WD19 WD23 WD26 WD30 --- HC(0)A
- * a76: WD00 WD03 WD06 WD10 WD13 WD17 WD21 WD25 WD28 HC(0B1) ---
- * a86: WD02 WD05 WD09 WD12 WD16 WD20 WD24 WD27 WD31 HC(1)A ---
- * a64: WD01 WD02 WD03 WD07 WD08 WD09 WD10 WD14 WD15 --- HC(2)A
- * a85: WD16 WD17 WD22 WD23 WD24 WD25 WD29 WD30 WD31 HC(2)B ---
+ * A75: WD01 WD04 WD08 WD11 WD15 WD19 WD23 WD26 WD30 --- HC(0)A
+ * A76: WD00 WD03 WD06 WD10 WD13 WD17 WD21 WD25 WD28 HC(0B1) ---
+ * A86: WD02 WD05 WD09 WD12 WD16 WD20 WD24 WD27 WD31 HC(1)A ---
+ * A64: WD01 WD02 WD03 WD07 WD08 WD09 WD10 WD14 WD15 --- HC(2)A
+ * A85: WD16 WD17 WD22 WD23 WD24 WD25 WD29 WD30 WD31 HC(2)B ---
*
* H(0) ^ HC(0)A ^ HC(0B1) -> HC(0)
* H(1) ^ HC(1)A ^ HC(0B1) -> HC(1)
@@ -214,10 +214,10 @@
*
* chip A B C D E F G H I even odd
* ---------------------------------------------------------------------------------
- * a66: WD04 WD05 WD06 WD07 WD08 WD09 WD10 H(3) 0 --- HC(3)A
- * a84: WD18 WD19 WD20 WD21 WD22 WD23 WD24 WD25 0 HC(3/4) HCPA
- * a63: WD11 WD12 WD13 WD14 WD15 WD16 WD17 H(4) 0 --- HC(4)A
- * a87: WD26 WD27 WD28 WD29 WD30 WD31 H(5) 0 0 HC(5) HCPB
+ * A66: WD04 WD05 WD06 WD07 WD08 WD09 WD10 H(3) 0 --- HC(3)A
+ * A84: WD18 WD19 WD20 WD21 WD22 WD23 WD24 WD25 0 HC(3/4) HCPA
+ * A63: WD11 WD12 WD13 WD14 WD15 WD16 WD17 H(4) 0 --- HC(4)A
+ * A87: WD26 WD27 WD28 WD29 WD30 WD31 H(5) 0 0 HC(5) HCPB
*
* HC(3)A ^ HC(3/4) -> HC(3)
* HC(4)A ^ HC(3/4) -> HC(4)
@@ -226,53 +226,52 @@
*
* chip A B C D E F G H I even odd
* ---------------------------------------------------------------------------------
- * a54: HC(3)A HC(4)A HCPA HCPB H(0/2) XX01 WD02 WD03 RP PERR ---
- * a65: WD00 WD01 WD02 WD04 WD05 WD07 WD10 WD11 WD12 --- PCA
- * a74: WD14 WD17 WD18 WD21 WD23 WD24 WD26 WD27 WD29 PCB ---
+ * A54: HC(3)A HC(4)A HCPA HCPB H(0/2) XX01 WD02 WD03 RP PERR ---
+ * A65: WD00 WD01 WD02 WD04 WD05 WD07 WD10 WD11 WD12 --- PCA
+ * A74: WD14 WD17 WD18 WD21 WD23 WD24 WD26 WD27 WD29 PCB ---
*
* PCA ^ PCB -> PC
+ * </PRE>
*
* Whoa ;-)
- * </PRE>
*/
-#if USE_HAMMING_CHECK
#define WD(x) (1ul<<(31-x))
-/* a75: WD01 WD04 WD08 WD11 WD15 WD19 WD23 WD26 WD30 --- HC(0)A */
+//! Data double word mask for chip A75.
#define A75 (WD( 1)|WD( 4)|WD( 8)|WD(11)|WD(15)|WD(19)|WD(23)|WD(26)|WD(30))
-/* a76: WD00 WD03 WD06 WD10 WD13 WD17 WD21 WD25 WD29 HC(0B1) --- */
+//! Data double word mask for chip A76.
#define A76 (WD( 0)|WD( 3)|WD( 6)|WD(10)|WD(13)|WD(17)|WD(21)|WD(25)|WD(28))
-/* a86: WD02 WD05 WD09 WD12 WD16 WD20 WD24 WD27 WD31 HC(1)A --- */
+//! Data double word mask for chip A86.
#define A86 (WD( 2)|WD( 5)|WD( 9)|WD(12)|WD(16)|WD(20)|WD(24)|WD(27)|WD(31))
-/* a64: WD01 WD02 WD03 WD07 WD08 WD09 WD10 WD14 WD15 --- HC(2)A */
+//! Data double word mask for chip A64.
#define A64 (WD( 1)|WD( 2)|WD( 3)|WD( 7)|WD( 8)|WD( 9)|WD(10)|WD(14)|WD(15))
-/* a85: WD16 WD17 WD22 WD23 WD24 WD25 WD29 WD30 WD31 HC(2)B --- */
+//! Data double word mask for chip A85.
#define A85 (WD(16)|WD(17)|WD(22)|WD(23)|WD(24)|WD(25)|WD(29)|WD(30)|WD(31))
-/* a66: WD04 WD05 WD06 WD07 WD08 WD09 WD10 H(3) 0 --- HC(3)A */
+//! Data double word mask for chip A66.
#define A66 (WD( 4)|WD( 5)|WD( 6)|WD( 7)|WD( 8)|WD( 9)|WD(10))
-/* a84: WD18 WD19 WD20 WD21 WD22 WD23 WD24 WD25 0 HC(3/4) HCPA */
+//! Data double word mask for chip A84.
#define A84 (WD(18)|WD(19)|WD(20)|WD(21)|WD(22)|WD(23)|WD(24)|WD(25))
-/* a63: WD11 WD12 WD13 WD14 WD15 WD16 WD17 H(4) 0 --- HC(4)A */
+//! Data double word mask for chip A63.
#define A63 (WD(11)|WD(12)|WD(13)|WD(14)|WD(15)|WD(16)|WD(17))
-/* a87: WD26 WD27 WD28 WD29 WD30 WD31 H(5) 0 0 HC(5) HCPB */
+//! Data double word mask for chip A87.
#define A87 (WD(26)|WD(27)|WD(28)|WD(29)|WD(30)|WD(31))
-/* a54: HC(3)A HC(4)A HCPA HCPB H(0/2) XX01 WD02 WD03 P PERR --- */
+//! Data double word mask for chip A54.
#define A54 (WD( 2)|WD( 3))
-/* a65: WD00 WD01 WD02 WD04 WD05 WD07 WD10 WD11 WD12 --- PCA */
+//! Data double word mask for chip A65.
#define A65 (WD( 0)|WD( 1)|WD( 2)|WD( 4)|WD( 5)|WD( 7)|WD(10)|WD(11)|WD(12))
-/* a74: WD14 WD17 WD18 WD21 WD23 WD24 WD26 WD27 WD29 PCB --- */
+//! Data double word mask for chip A74.
#define A74 (WD(14)|WD(17)|WD(18)|WD(21)|WD(23)|WD(24)|WD(26)|WD(27)|WD(29))
#define H0(hpb) X_BIT(hpb,8,0) //!< get Hamming code bit 0 from hpb data (really bit 32)
@@ -283,23 +282,29 @@
#define H5(hpb) X_BIT(hpb,8,5) //!< get Hamming code bit 5 from hpb data (really bit 37)
#define RH(hpb) X_RDBITS(hpb,8,0,5) //!< get Hamming code from hpb data (bits 32 to 37)
#define RP(hpb) X_BIT(hpb,8,6) //!< get parity bit from hpb data (really bit 38)
+#define RU(hpb) X_BIT(hpb,8,7) //!< get unused bit from hpb data (really bit 39) [unused]
-/** @brief return even parity of a (masked) 32 bit value */
+/**
+ * @brief Return even parity of a (masked) 32 bit value.
+ * @param val 32 bits
+ * @return 1 for even parity, 0 for odd parity
+ */
static __inline UINT8 parity_even(UINT32 val)
{
- val -= ((val >> 1) & 0x55555555);
- val = (((val >> 2) & 0x33333333) + (val & 0x33333333));
- val = (((val >> 4) + val) & 0x0f0f0f0f);
- val += (val >> 8);
- val += (val >> 16);
- return (val & 1);
+ val -= ((val >> 1) & 0x55555555);
+ val = (((val >> 2) & 0x33333333) + (val & 0x33333333));
+ val = (((val >> 4) + val) & 0x0f0f0f0f);
+ val += (val >> 8);
+ val += (val >> 16);
+ // val now has number of 1 bits
+ return val & 1;
}
-/** @brief return odd parity of a (masked) 32 bit value */
+/** @brief Return odd parity of a (masked) 32 bit value. */
#define parity_odd(val) (parity_even(val)^1)
/**
- * @brief lookup table to convert a Hamming syndrome into a bit number to correct
+ * @brief Lookup table to convert a Hamming syndrome into a bit number to correct.
*/
static const int hamming_lut[64] = {
-1, -1, -1, 0, -1, 1, 2, 3, /* A69: HR(5):0 HR(4):0 HR(3):0 */
@@ -313,100 +318,88 @@ static const int hamming_lut[64] = {
};
/**
- * @brief read or write a memory double-word and caluclate its Hamming code
+ * @brief Caluclate a Hamming code after reading or before writing a memory double-word.
*
- * Hamming code generation according to the schematics described above.
+ * Hamming code generation is according to the schematics described above.
+ *
* It's certainly overkill to do this on a modern PC, but I think we'll
- * need it for perfect emulation anyways (Hamming code hardware checking).
+ * need it for perfect emulation anyways, e.g. Hamming code hardware checking.
*
- * @param write non-zero if this is a memory write (don't check for error)
+ * @param write true, if this is a memory write (don't check for error)
* @param dw_addr the double-word address
- * @param dw_data the double-word data to write
- * @return dw_data
+ * @param dw_data the double-word data
+ * @return dw_data, possibly with 1 bit error corrected
*/
-UINT32 alto2_cpu_device::hamming_code(int write, UINT32 dw_addr, UINT32 dw_data)
+UINT32 alto2_cpu_device::hamming_code(bool write, UINT32 dw_addr, UINT32 dw_data)
{
- UINT8 hpb = write ? 0 : m_mem.hpb[dw_addr];
- UINT8 hc_0_a;
- UINT8 hc_0b1;
- UINT8 hc_1_a;
- UINT8 hc_2_a;
- UINT8 hc_2_b;
- UINT8 hc_0;
- UINT8 hc_1;
- UINT8 hc_2;
- UINT8 h_0_2;
- UINT8 hc_3_a;
- UINT8 hc_3_4;
- UINT8 hcpa;
- UINT8 hc_4_a;
- UINT8 hc_3;
- UINT8 hc_4;
- UINT8 hc_5;
- UINT8 hcpb;
- UINT8 perr;
- UINT8 pca;
- UINT8 pcb;
- UINT8 pc;
- int syndrome;
+ const UINT8 hpb = write ? 0 : m_mem.hpb[dw_addr];
/* a75: WD01 WD04 WD08 WD11 WD15 WD19 WD23 WD26 WD30 --- HC(0)A */
- hc_0_a = parity_odd (dw_data & A75);
+ const UINT8 hc_0_a = parity_odd (dw_data & A75);
+
/* a76: WD00 WD03 WD06 WD10 WD13 WD17 WD21 WD25 WD29 HC(0B1) --- */
- hc_0b1 = parity_even(dw_data & A76);
+ const UINT8 hc_0b1 = parity_even(dw_data & A76);
+
/* a86: WD02 WD05 WD09 WD12 WD16 WD20 WD24 WD27 WD31 HC(1)A --- */
- hc_1_a = parity_even(dw_data & A86);
+ const UINT8 hc_1_a = parity_even(dw_data & A86);
+
/* a64: WD01 WD02 WD03 WD07 WD08 WD09 WD10 WD14 WD15 --- HC(2)A */
- hc_2_a = parity_odd (dw_data & A64);
+ const UINT8 hc_2_a = parity_odd (dw_data & A64);
+
/* a85: WD16 WD17 WD22 WD23 WD24 WD25 WD29 WD30 WD31 HC(2)B --- */
- hc_2_b = parity_even(dw_data & A85);
+ const UINT8 hc_2_b = parity_even(dw_data & A85);
- hc_0 = H0(hpb) ^ hc_0_a ^ hc_0b1;
- hc_1 = H1(hpb) ^ hc_1_a ^ hc_0b1;
- hc_2 = hc_2_a ^ hc_2_b ^ H2(hpb);
- h_0_2 = H0(hpb) ^ H1(hpb) ^ H2(hpb);
+ const UINT8 hc_0 = H0(hpb) ^ hc_0_a ^ hc_0b1;
+ const UINT8 hc_1 = H1(hpb) ^ hc_1_a ^ hc_0b1;
+ const UINT8 hc_2 = hc_2_a ^ hc_2_b ^ H2(hpb);
+ const UINT8 h_0_2 = H0(hpb) ^ H1(hpb) ^ H2(hpb);
/* a66: WD04 WD05 WD06 WD07 WD08 WD09 WD10 H(3) 0 --- HC(3)A */
- hc_3_a = parity_odd ((dw_data & A66) ^ H3(hpb));
+ const UINT8 hc_3_a = parity_odd ((dw_data & A66) ^ H3(hpb));
+
/* a84: WD18 WD19 WD20 WD21 WD22 WD23 WD24 WD25 0 HC(3/4) HCPA */
- hcpa = parity_odd (dw_data & A84);
- hc_3_4 = hcpa ^ 1;
+ const UINT8 hcpa = parity_odd (dw_data & A84);
+ const UINT8 hc_3_4 = hcpa ^ 1;
+
/* a63: WD11 WD12 WD13 WD14 WD15 WD16 WD17 H(4) 0 --- HC(4)A */
- hc_4_a = parity_odd ((dw_data & A63) ^ H4(hpb));
+ const UINT8 hc_4_a = parity_odd ((dw_data & A63) ^ H4(hpb));
/* a87: WD26 WD27 WD28 WD29 WD30 WD31 H(5) 0 0 HC(5) HCPB */
- hcpb = parity_odd ((dw_data & A87) ^ H5(hpb));
- hc_3 = hc_3_a ^ hc_3_4;
- hc_4 = hc_4_a ^ hc_3_4;
- hc_5 = hcpb ^ 1;
+ const UINT8 hcpb = parity_odd ((dw_data & A87) ^ H5(hpb));
+ const UINT8 hc_3 = hc_3_a ^ hc_3_4;
+ const UINT8 hc_4 = hc_4_a ^ hc_3_4;
+ const UINT8 hc_5 = hcpb ^ 1;
- syndrome = (hc_0<<5)|(hc_1<<4)|(hc_2<<3)|(hc_3<<2)|(hc_4<<1)|(hc_5);
+ const UINT8 syndrome = 32*hc_0 + 16*hc_1 + 8*hc_2 + 4*hc_3 + 2*hc_4 + hc_5;
- /*
+
+ /* a54: HC(3)A HC(4)A HCPA HCPB H(0/2) XX01 WD02 WD03 P PERR ---
+ *
* Note: Here I XOR all the non dw_data inputs into bit 0,
* which has the same effect as spreading them over some bits
* and then counting them... I hope ;-)
*/
- /* a54: HC(3)A HC(4)A HCPA HCPB H(0/2) XX01 WD02 WD03 P PERR --- */
- perr = parity_even(
+ const UINT8 perr = parity_even(
hc_3_a ^
hc_4_a ^
hcpa ^
hcpb ^
h_0_2 ^
- (X_RDBITS(dw_data,32,0,0) ^ X_RDBITS(dw_data,32,1,1)) ^
+ X_RDBITS(dw_data,32,0,0) ^
+ X_RDBITS(dw_data,32,1,1) ^
(dw_data & A54) ^
RP(hpb) ^
1);
/* a65: WD00 WD01 WD02 WD04 WD05 WD07 WD10 WD11 WD12 --- PCA */
- pca = parity_odd (dw_data & A65);
+ const UINT8 pca = parity_odd (dw_data & A65);
+
/* a74: WD14 WD17 WD18 WD21 WD23 WD24 WD26 WD27 WD29 PCB --- */
- pcb = parity_even(dw_data & A74);
- pc = pca ^ pcb;
+ const UINT8 pcb = parity_even(dw_data & A74);
+ const UINT8 pc = pca ^ pcb;
if (write) {
- /* update the hamming code and parity bit store */
+ /* Update the hamming code and parity bit store */
m_mem.hpb[dw_addr] = (syndrome << 2) | (pc << 1);
return dw_data;
@@ -429,11 +422,11 @@ UINT32 alto2_cpu_device::hamming_code(int write, UINT32 dw_addr, UINT32 dw_data)
* output signal
* -------------------------
* 8 ERROR
+ * </PRE>
*
- * Remembering De Morgan this can be simplified:
+ * Using De Morgan this can be simplified:
* ERROR is 0, whenever all of PERR and HC(0) to HC(5) are 0.
* Or the other way round: any of perr or syndrome non-zero means ERROR=1.
- * </PRE>
*/
if (perr || syndrome) {
/* latch data on the first error */
@@ -478,7 +471,6 @@ UINT32 alto2_cpu_device::hamming_code(int write, UINT32 dw_addr, UINT32 dw_data)
}
return dw_data;
}
-#endif /* USE_HAMMING_CHECK */
/**
* @brief memory error address register read
@@ -522,11 +514,7 @@ READ16_MEMBER( alto2_cpu_device::mesr_r )
LOG((this,LOG_MEM,6," Hamming code read : %#o\n", GET_MESR_HAMMING(data)));
LOG((this,LOG_MEM,6," Parity error : %o\n", GET_MESR_PERR(data)));
LOG((this,LOG_MEM,6," Memory parity bit : %o\n", GET_MESR_PARITY(data)));
-#if USE_HAMMING_CHECK
LOG((this,LOG_MEM,6," Hamming syndrome : %#o (bit #%d)\n", GET_MESR_SYNDROME(data), hamming_lut[GET_MESR_SYNDROME(data)]));
-#else
- LOG((this,LOG_MEM,6," Hamming syndrome : %#o\n", GET_MESR_SYNDROME(data)));
-#endif
LOG((this,LOG_MEM,6," Memory bank : %#o\n", GET_MESR_BANK(data)));
}
return data;
@@ -536,10 +524,10 @@ WRITE16_MEMBER( alto2_cpu_device::mesr_w )
{
if (!space.debugger_access()) {
LOG((this,LOG_MEM,2," MESR write %07o (clear MESR; was %07o)\n", data, m_mem.mesr));
+ m_mem.mesr = 0; // set all bits to 0
+ m_mem.error = 0; // reset the error flag
+ m_task_wakeup &= ~(1 << task_part); // clear the task wakeup for the parity error task
}
- m_mem.mesr = 0; // set all bits to 0
- m_mem.error = 0; // reset the error flag
- m_task_wakeup &= ~(1 << task_part); // clear the task wakeup for the parity error task
}
/**
@@ -566,6 +554,7 @@ WRITE16_MEMBER( alto2_cpu_device::mesr_w )
WRITE16_MEMBER( alto2_cpu_device::mecr_w )
{
m_mem.mecr = data ^ 0177777;
+ // clear spare bits
X_WRBITS(m_mem.mecr,16, 0, 3,0);
X_WRBITS(m_mem.mecr,16,15,15,0);
if (!space.debugger_access()) {
@@ -584,7 +573,7 @@ WRITE16_MEMBER( alto2_cpu_device::mecr_w )
READ16_MEMBER( alto2_cpu_device::mecr_r )
{
UINT16 data = m_mem.mecr ^ 0177777;
- /* set all spare bits */
+ // all spare bits are set
if (!space.debugger_access()) {
LOG((this,LOG_MEM,2," MECR read %07o\n", data));
LOG((this,LOG_MEM,6," Test Hamming code : %#o\n", GET_MECR_TEST_CODE(data)));
@@ -599,18 +588,18 @@ READ16_MEMBER( alto2_cpu_device::mecr_r )
//! read i/o space RAM
READ16_MEMBER ( alto2_cpu_device::ioram_r )
{
- offs_t dword_addr = offset / 2;
- return static_cast<UINT16>(offset & 1 ? GET_ODD(m_mem.ram[dword_addr]) : GET_EVEN(m_mem.ram[dword_addr]));
+ offs_t dw_addr = offset / 2;
+ return static_cast<UINT16>(offset & 1 ? GET_ODD(m_mem.ram[dw_addr]) : GET_EVEN(m_mem.ram[dw_addr]));
}
//! write i/o space RAM
WRITE16_MEMBER( alto2_cpu_device::ioram_w )
{
- offs_t dword_addr = offset / 2;
+ offs_t dw_addr = offset / 2;
if (offset & 1)
- PUT_ODD(m_mem.ram[dword_addr], data);
+ PUT_ODD(m_mem.ram[dw_addr], data);
else
- PUT_EVEN(m_mem.ram[dword_addr], data);
+ PUT_EVEN(m_mem.ram[dw_addr], data);
}
/**
@@ -627,7 +616,7 @@ void alto2_cpu_device::load_mar(UINT8 rsel, UINT32 addr)
* currently we don't do anything special
*/
LOG((this,LOG_MEM,5, " MAR<-; refresh cycle @ %#o\n", addr));
- m_mem.mar = addr;
+ m_mem.mar = addr & ~3;
m_mem.access = ALTO2_MEM_REFRESH;
m_mem.cycle = cycle();
return;
@@ -639,8 +628,7 @@ void alto2_cpu_device::load_mar(UINT8 rsel, UINT32 addr)
m_mem.access = ALTO2_MEM_RAM;
// fetch the memory double-word to the read/write latches
m_mem.rmdd = m_mem.wmdd = m_mem.ram[m_mem.mar/2];
- // keep track of the current CPU cycle
- m_mem.cycle = cycle();
+ m_mem.cycle = cycle(); // keep track of the current CPU cycle
} else {
m_mem.access = ALTO2_MEM_INVALID;
m_mem.rmdd = m_mem.wmdd = ~0;
@@ -678,11 +666,10 @@ UINT16 alto2_cpu_device::read_mem()
return m_mem.md;
}
-#if USE_HAMMING_CHECK
- /* check for errors on the first access */
+ /* check for errors on the first access (even address) */
if (!(m_mem.access & ALTO2_MEM_ODD))
- m_mem.rmdd = hamming_code(0, m_mem.mar/2, m_mem.rmdd);
-#endif
+ m_mem.rmdd = hamming_code(false, m_mem.mar/2, m_mem.rmdd);
+
m_mem.md = (m_mem.mar & ALTO2_MEM_ODD) ? GET_ODD(m_mem.rmdd) : GET_EVEN(m_mem.rmdd);
LOG((this,LOG_MEM,6," MD = RAM[%#o] (%#o)\n", m_mem.mar, m_mem.md));
@@ -741,21 +728,18 @@ void alto2_cpu_device::write_mem(UINT16 data)
else
PUT_EVEN(m_mem.wmdd, m_mem.md);
-#if USE_HAMMING_CHECK
- if (m_mem.access & ALTO2_MEM_RAM)
- m_mem.ram[m_mem.mar/2] = hamming_code(1, m_mem.mar/2, m_mem.wmdd);
-#else
if (m_mem.access & ALTO2_MEM_RAM)
- m_mem.ram[m_mem.mar/2] = m_mem.wmdd;
-#endif
+ m_mem.ram[m_mem.mar/2] = hamming_code(true, m_mem.mar/2, m_mem.wmdd);
#if ALTO2_DEBUG
watch_write(m_mem.mar, m_mem.md);
#endif
+
// Toggle the odd/even word access flag
// NB: don't reset mem.access to permit double word exchange
- m_mem.mar ^= ALTO2_MEM_ODD;
+ m_mem.mar ^= 1;
m_mem.access ^= ALTO2_MEM_ODD;
+
// extend the write succeeds window by one cycle
m_mem.cycle++;
}
@@ -768,15 +752,15 @@ void alto2_cpu_device::write_mem(UINT16 data)
*/
UINT16 alto2_cpu_device::debug_read_mem(UINT32 addr)
{
- space(AS_2).set_debugger_access(true);
int base_addr = addr & 0177777;
int data;
- if (base_addr >= ALTO2_IO_PAGE_BASE && addr < ALTO2_RAM_SIZE) {
+ if (addr >= ALTO2_IO_PAGE_BASE && addr < ALTO2_RAM_SIZE) {
+ space(AS_2).set_debugger_access(true);
data = m_iomem->read_word(m_iomem->address_to_byte(base_addr));
+ space(AS_2).set_debugger_access(false);
} else {
data = (addr & ALTO2_MEM_ODD) ? GET_ODD(m_mem.ram[addr/2]) : GET_EVEN(m_mem.ram[addr/2]);
}
- space(AS_2).set_debugger_access(false);
return data;
}
@@ -788,16 +772,16 @@ UINT16 alto2_cpu_device::debug_read_mem(UINT32 addr)
*/
void alto2_cpu_device::debug_write_mem(UINT32 addr, UINT16 data)
{
- space(AS_2).set_debugger_access(true);
int base_addr = addr & 0177777;
- if (base_addr >= ALTO2_IO_PAGE_BASE && addr < ALTO2_RAM_SIZE) {
+ if (addr >= ALTO2_IO_PAGE_BASE && addr < ALTO2_RAM_SIZE) {
+ space(AS_2).set_debugger_access(true);
m_iomem->write_word(m_iomem->address_to_byte(base_addr), data);
+ space(AS_2).set_debugger_access(false);
} else if (addr & ALTO2_MEM_ODD) {
PUT_ODD(m_mem.ram[addr/2], data);
} else {
PUT_EVEN(m_mem.ram[addr/2], data);
}
- space(AS_2).set_debugger_access(false);
}
/**
@@ -837,23 +821,19 @@ void alto2_cpu_device::reset_memory()
}
// allocate 64K or 128K words of main memory
ioport_port* config = ioport(":CONFIG");
+ m_mem.size = ALTO2_RAM_SIZE;
// config should be valid, unless the driver doesn't define it
- if (config)
- m_mem.size = config->read() & 1 ? ALTO2_RAM_SIZE : 2 * ALTO2_RAM_SIZE;
- else
- m_mem.size = ALTO2_RAM_SIZE;
+ if (config && 0 == config->read())
+ m_mem.size *= 2;
logerror("Main memory %u KiB\n", static_cast<UINT32>(sizeof(UINT16) * m_mem.size / 1024));
m_mem.ram = make_unique_clear<UINT32[]>(sizeof(UINT16) * m_mem.size);
- m_mem.hpb = make_unique_clear<UINT8[]>( sizeof(UINT16) * m_mem.size);
+ m_mem.hpb = make_unique_clear<UINT8[]> (sizeof(UINT16) * m_mem.size);
+
+ // Initialize the hamming codes and parity bits
+ for (UINT32 addr = 0; addr < m_mem.size; addr++)
+ hamming_code(true, addr, 0);
-#if USE_HAMMING_CHECK
- // Initialize the hamming codes and parity bit
- for (UINT32 addr = 0; addr < ALTO2_IO_PAGE_BASE; addr++) {
- hamming_code(1, addr, 0);
- hamming_code(1, 0200000 + addr, 0);
- }
-#endif
m_mem.mar = 0;
m_mem.rmdd = 0;
m_mem.wmdd = 0;
diff --git a/src/devices/cpu/alto2/a2mem.h b/src/devices/cpu/alto2/a2mem.h
index 50b2b53d345..cc44f09d152 100644
--- a/src/devices/cpu/alto2/a2mem.h
+++ b/src/devices/cpu/alto2/a2mem.h
@@ -108,8 +108,8 @@ DECLARE_WRITE16_MEMBER( mesr_w ); //!< memory error status register write
DECLARE_READ16_MEMBER ( mecr_r ); //!< memory error control register read
DECLARE_WRITE16_MEMBER( mecr_w ); //!< memory error control register write
-//! Read or write a memory double-word and caluclate its Hamming code.
-UINT32 hamming_code(int write, UINT32 dw_addr, UINT32 dw_data);
+//! Read or write a memory double-word and caluclate or compare its Hamming code.
+UINT32 hamming_code(bool write, UINT32 dw_addr, UINT32 dw_data);
//! Load the memory address register with some value.
void load_mar(UINT8 rsel, UINT32 addr);
diff --git a/src/devices/cpu/alto2/a2mouse.cpp b/src/devices/cpu/alto2/a2mouse.cpp
index 6bf0760285c..411e9135b21 100644
--- a/src/devices/cpu/alto2/a2mouse.cpp
+++ b/src/devices/cpu/alto2/a2mouse.cpp
@@ -120,8 +120,8 @@ UINT16 alto2_cpu_device::mouse_read()
break;
case 1:
m_mouse.latch |= MACTIVE;
- m_mouse.x -= SIGN(m_mouse.x - m_mouse.dx);
- m_mouse.y -= SIGN(m_mouse.y - m_mouse.dy);
+ m_mouse.x += SIGN(m_mouse.dx - m_mouse.x);
+ m_mouse.y += SIGN(m_mouse.dy - m_mouse.y);
break;
case 2:
m_mouse.latch ^= MOVEX(m_mouse.dx - m_mouse.x);
@@ -129,8 +129,8 @@ UINT16 alto2_cpu_device::mouse_read()
break;
case 3:
m_mouse.latch |= MACTIVE;
- m_mouse.x -= SIGN(m_mouse.x - m_mouse.dx);
- m_mouse.y -= SIGN(m_mouse.y - m_mouse.dy);
+ m_mouse.x += SIGN(m_mouse.dx - m_mouse.x);
+ m_mouse.y += SIGN(m_mouse.dy - m_mouse.y);
}
m_mouse.phase = (m_mouse.phase + 1) % 4;
return data;
@@ -145,10 +145,9 @@ UINT16 alto2_cpu_device::mouse_read()
*/
INPUT_CHANGED_MEMBER( alto2_cpu_device::mouse_motion_x )
{
- // set new destination (absolute) mouse x coordinate
- INT32 x = m_mouse.dx + newval - oldval;
- x = x < 0 ? 0 : x > 605 ? 605 : x;
- m_mouse.dx = x;
+ INT16 ox = static_cast<INT16>(oldval);
+ INT16 nx = static_cast<INT16>(newval);
+ m_mouse.dx = std::min(std::max(0, m_mouse.dx + (nx - ox)), 639);
}
/**
@@ -160,10 +159,9 @@ INPUT_CHANGED_MEMBER( alto2_cpu_device::mouse_motion_x )
*/
INPUT_CHANGED_MEMBER( alto2_cpu_device::mouse_motion_y )
{
- // set new destination (absolute) mouse y coordinate
- INT32 y = m_mouse.dy + newval - oldval;
- y = y < 0 ? 0 : y > 807 ? 807 : y;
- m_mouse.dy = y;
+ INT16 oy = static_cast<INT16>(oldval);
+ INT16 ny = static_cast<INT16>(newval);
+ m_mouse.dy = std::min(std::max(0, m_mouse.dy + (ny - oy)), 824);
}
/**
diff --git a/src/devices/cpu/alto2/a2mrt.cpp b/src/devices/cpu/alto2/a2mrt.cpp
index 92a7aa6333a..93fedbdbf6a 100644
--- a/src/devices/cpu/alto2/a2mrt.cpp
+++ b/src/devices/cpu/alto2/a2mrt.cpp
@@ -26,7 +26,7 @@ void alto2_cpu_device::activate_mrt()
}
}
- //! memory refresh task slots initialization
+//! memory refresh task slots initialization
void alto2_cpu_device::init_mrt(int task)
{
set_f1(task, f1_block, &alto2_cpu_device::f1_early_mrt_block, nullptr);
diff --git a/src/devices/cpu/alto2/alto2cpu.h b/src/devices/cpu/alto2/alto2cpu.h
index a0b7af2442a..92a737c403a 100644
--- a/src/devices/cpu/alto2/alto2cpu.h
+++ b/src/devices/cpu/alto2/alto2cpu.h
@@ -49,11 +49,8 @@ enum {
#define ALTO2_CRAM_CONFIG 2 //!< use default CROM/CRAM configuration 2
#endif
-#define ALTO2_FAKE_STATUS_H 12 //!< number of extra scanlines to display some status info
-
#define USE_PRIO_F9318 0 //!< define to 1 to use the F9318 priority encoder code (broken)
#define USE_BITCLK_TIMER 0 //!< define to 1 to use a very high rate timer for the disk bit clock
-#define USE_HAMMING_CHECK 1 //!< define to 1 to use the Hamming code and Parity check in a2mem
#define ALTO2_TASKS 16 //!< 16 task slots
#define ALTO2_REGS 32 //!< 32 16-bit words in the R register file
diff --git a/src/devices/cpu/alto2/alto2dsm.cpp b/src/devices/cpu/alto2/alto2dsm.cpp
index 121ab50b398..7139243d0ba 100644
--- a/src/devices/cpu/alto2/alto2dsm.cpp
+++ b/src/devices/cpu/alto2/alto2dsm.cpp
@@ -386,5 +386,11 @@ offs_t alto2_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8
dst += snprintf(dst, len - (size_t)(dst - buffer), "BUS<-F2_%02o ", f2);
break;
}
+
+ // Simplify output based on text
+ // ALUF(BUS) is a no-op if followed by BUS<-
+ while (NULL != (dst = strstr(buffer, "ALUF(BUS) BUS<-")))
+ strcpy(dst, dst + 15);
+
return result;
}
diff --git a/src/mame/drivers/alto2.cpp b/src/mame/drivers/alto2.cpp
index 4b9e7542b65..2064a3fb6f1 100644
--- a/src/mame/drivers/alto2.cpp
+++ b/src/mame/drivers/alto2.cpp
@@ -153,13 +153,10 @@ static INPUT_PORTS_START( alto2 )
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3) PORT_NAME("Mouse YELLOW (middle)") PORT_PLAYER(1) PORT_CODE(MOUSECODE_BUTTON3) PORT_CHANGED_MEMBER( ":maincpu", alto2_cpu_device, mouse_button_2, nullptr )
PORT_START("mousex") // Mouse - X AXIS
- PORT_BIT( 0xffff, 0x00, IPT_MOUSE_X) PORT_SENSITIVITY(100) PORT_KEYDELTA(1) PORT_CHANGED_MEMBER( ":maincpu", alto2_cpu_device, mouse_motion_x, nullptr )
+ PORT_BIT( 0xffff, 0, IPT_MOUSE_X) PORT_SENSITIVITY(100) PORT_KEYDELTA(1) PORT_CHANGED_MEMBER( ":maincpu", alto2_cpu_device, mouse_motion_x, nullptr )
PORT_START("mousey") // Mouse - Y AXIS
- PORT_BIT( 0xffff, 0x00, IPT_MOUSE_Y) PORT_SENSITIVITY(100) PORT_KEYDELTA(1) PORT_CHANGED_MEMBER( ":maincpu", alto2_cpu_device, mouse_motion_y, nullptr )
-
- PORT_START("utilout") // Speaker connected to UTILOUT
- PORT_BIT( 0xff, 0x00, IPT_PORT ) PORT_WRITE_LINE_DEVICE_MEMBER(":speaker", speaker_sound_device, level_w)
+ PORT_BIT( 0xffff, 0, IPT_MOUSE_Y) PORT_SENSITIVITY(100) PORT_KEYDELTA(1) PORT_CHANGED_MEMBER( ":maincpu", alto2_cpu_device, mouse_motion_y, nullptr )
PORT_START("CONFIG") /* Memory switch on AIM board */
PORT_CONFNAME( 0x01, 0x01, "Memory switch")
@@ -279,7 +276,7 @@ static MACHINE_CONFIG_START( alto2, alto2_state )
MCFG_SCREEN_ADD_MONOCHROME("screen", RASTER, rgb_t::white)
MCFG_SCREEN_RAW_PARAMS(XTAL_20_16MHz,
ALTO2_DISPLAY_TOTAL_WIDTH, 0, ALTO2_DISPLAY_WIDTH,
- ALTO2_DISPLAY_TOTAL_HEIGHT, 0, ALTO2_DISPLAY_HEIGHT + ALTO2_FAKE_STATUS_H)
+ ALTO2_DISPLAY_TOTAL_HEIGHT, 0, ALTO2_DISPLAY_HEIGHT)
MCFG_SCREEN_REFRESH_RATE(60) // two interlaced fields
MCFG_SCREEN_VBLANK_TIME(ALTO2_DISPLAY_VBLANK_TIME)
MCFG_SCREEN_UPDATE_DEVICE("maincpu", alto2_cpu_device, screen_update)