summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/hp3478a.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/hp3478a.cpp')
-rw-r--r--src/mame/drivers/hp3478a.cpp86
1 files changed, 43 insertions, 43 deletions
diff --git a/src/mame/drivers/hp3478a.cpp b/src/mame/drivers/hp3478a.cpp
index 7de7253a65e..d77af3c8327 100644
--- a/src/mame/drivers/hp3478a.cpp
+++ b/src/mame/drivers/hp3478a.cpp
@@ -11,7 +11,7 @@
*
* Current status : runs, AD LINK ERROR on stock ROM due to unimplemented AD link
* - patching the AD comms, we get to a mostly functional state (for patch examples,
-* see https://github.com/fenugrec/hp3478a_rompatch )
+* see https://github.com/fenugrec/hp3478a_rompatch )
*
* TODO
* - split out LCD driver code. It seems common to other HP equipment of the
@@ -34,7 +34,7 @@ ROM : 2764 (64kbit, org 8kB)
RAM : 5101 , 256 * 4bit (!), battery-backed calibration data
GPIB: i8291
Display : unknown; similar protocol for HP 3457A documented on
- http://www.eevblog.com/forum/projects/led-display-for-hp-3457a-multimeter-i-did-it-)/25/
+ http://www.eevblog.com/forum/projects/led-display-for-hp-3457a-multimeter-i-did-it-)/25/
@@ -47,7 +47,7 @@ P20 : disp.clk1
P21 : !CS for GPIB, and disp.IWA
P22 : !CS for DIPswitch; disp.ISA (for instructions)
P23 = !OE for RAM ; disp.sync (enable instruction)
-P24 = disp.PWO (enable)
+P24 = disp.PWO (enable)
P25 = disp.clk2
P26 : address bit12 ! (0x1000) => hardware banking
P27 : data out thru isol, to analog CPU
@@ -65,18 +65,18 @@ T1 : data in thru isol, from analog CPU (opcodes jt1 / jnt1)
#define CPU_CLOCK XTAL(5'856'000)
/* port pin/bit defs. Would be nice if mcs48.h had these */
-#define P20 (1 << 0)
-#define P21 (1 << 1)
-#define P22 (1 << 2)
-#define P23 (1 << 3)
-#define P24 (1 << 4)
-#define P25 (1 << 5)
-#define P26 (1 << 6)
-#define P27 (1 << 7)
+#define P20 (1 << 0)
+#define P21 (1 << 1)
+#define P22 (1 << 2)
+#define P23 (1 << 3)
+#define P24 (1 << 4)
+#define P25 (1 << 5)
+#define P26 (1 << 6)
+#define P27 (1 << 7)
-#define A12_PIN P26
+#define A12_PIN P26
#define CALRAM_CS P23
#define DIPSWITCH_CS P22
#define GPIB_CS P21
@@ -87,7 +87,7 @@ T1 : data in thru isol, from analog CPU (opcodes jt1 / jnt1)
#define DISP_IWA P21
#define DISP_CK1 P20
//don't care about CK2 since it's supposed to be a delayed copy of CK1
-#define DISP_MASK (DISP_PWO | DISP_SYNC | DISP_ISA | DISP_IWA | DISP_CK1) //used for edge detection
+#define DISP_MASK (DISP_PWO | DISP_SYNC | DISP_ISA | DISP_IWA | DISP_CK1) //used for edge detection
// IO banking : indexes of m_iobank maps
#define CALRAM_ENTRY 0
@@ -97,13 +97,13 @@ T1 : data in thru isol, from analog CPU (opcodes jt1 / jnt1)
/**** optional debug outputs, must be before #include logmacro.*/
#define DEBUG_PORTS (LOG_GENERAL << 1)
#define DEBUG_BANKING (LOG_GENERAL << 2)
-#define DEBUG_BUS (LOG_GENERAL << 3) //not used after all
+#define DEBUG_BUS (LOG_GENERAL << 3) //not used after all
#define DEBUG_KEYPAD (LOG_GENERAL << 4)
-#define DEBUG_LCD (LOG_GENERAL << 5) //low level
+#define DEBUG_LCD (LOG_GENERAL << 5) //low level
#define DEBUG_LCD2 (LOG_GENERAL << 6)
#define DEBUG_CAL (LOG_GENERAL << 7)
-#define VERBOSE (DEBUG_BUS) //can be combined, like (DEBUG_CAL | DEBUG_KEYPAD)
+#define VERBOSE (DEBUG_BUS) //can be combined, like (DEBUG_CAL | DEBUG_KEYPAD)
#include "logmacro.h"
@@ -130,7 +130,7 @@ public:
protected:
virtual void machine_start() override;
- //virtual void machine_reset() override; //not needed?
+ //virtual void machine_reset() override; //not needed?
DECLARE_READ8_MEMBER(p1read);
DECLARE_WRITE8_MEMBER(p1write);
@@ -176,14 +176,14 @@ protected:
REG_C,
DISCARD
} m_lcdiwa;
- uint8_t m_lcd_chrbuf[12]; //raw digits (not ASCII)
- uint8_t m_lcd_text[13]; //mapped to ASCII, only for debug output
+ uint8_t m_lcd_chrbuf[12]; //raw digits (not ASCII)
+ uint8_t m_lcd_text[13]; //mapped to ASCII, only for debug output
uint32_t m_lcd_segdata[12];
///////////////////////////
- uint8_t m_p2_oldstate; //used to detect edges on Port2 IO pins. Should be saveable ?
- uint8_t m_p1_oldstate; //for P17 edge detection (WDT reset)
+ uint8_t m_p2_oldstate; //used to detect edges on Port2 IO pins. Should be saveable ?
+ uint8_t m_p1_oldstate; //for P17 edge detection (WDT reset)
};
@@ -200,7 +200,7 @@ READ8_MEMBER( hp3478a_state::p1read )
// for each column, set Px=0 for pressed buttons (active low)
for (i = 0; i < 4; i++) {
if (!(data & (0x10 << i))) {
- data &= (0xF0 | m_keypad[i]->read()); //not sure if the undefined upper bits will read as 1 ?
+ data &= (0xF0 | m_keypad[i]->read()); //not sure if the undefined upper bits will read as 1 ?
}
}
LOGMASKED(DEBUG_KEYPAD, "port1 read: 0x%02X\n", data);
@@ -383,8 +383,8 @@ void hp3478a_state::lcd_map_chars()
int i;
LOGMASKED(DEBUG_LCD2, "LCD : map ");
for (i=0; i < 12; i++) {
- bool dp = m_lcd_chrbuf[i] & 0x40; //check decimal point. Needs to be mapped to seg_bit16
- bool comma = m_lcd_chrbuf[i] & 0x80; //check comma, maps to seg17
+ bool dp = m_lcd_chrbuf[i] & 0x40; //check decimal point. Needs to be mapped to seg_bit16
+ bool comma = m_lcd_chrbuf[i] & 0x80; //check comma, maps to seg17
m_lcd_text[i] = (m_lcd_chrbuf[i] & 0x3F) + 0x40;
m_lcd_segdata[i] = hpcharset[m_lcd_chrbuf[i] & 0x3F] | (dp << 16) | (comma << 17);
LOGMASKED(DEBUG_LCD2, "[%02X>%04X] ", m_lcd_chrbuf[i] & 0x3F, m_lcd_segdata[i]);
@@ -399,10 +399,10 @@ uint32_t hp3478a_state::lcd_set_display(uint32_t segin)
}
// ISA command bytes
-#define DISP_ISA_WANNUN 0xBC //annunciators
-#define DISP_ISA_WA 0x0A //low nibbles
-#define DISP_ISA_WB 0x1A //hi nib
-#define DISP_ISA_WC 0x2A // "extended bit" ?
+#define DISP_ISA_WANNUN 0xBC //annunciators
+#define DISP_ISA_WA 0x0A //low nibbles
+#define DISP_ISA_WB 0x1A //hi nib
+#define DISP_ISA_WC 0x2A // "extended bit" ?
/** LCD serial interface state machine. I cheat and don't implement all commands.
* Also, it's not clear when exactly the display should be updated. After each regA/regB write
@@ -413,14 +413,14 @@ void hp3478a_state::lcd_interface(uint8_t p2new)
bool pwo_state, sync_state, isa_state, iwa_state;
pwo_state = p2new & DISP_PWO;
- sync_state = p2new & DISP_SYNC;
+ sync_state = p2new & DISP_SYNC;
isa_state = p2new & DISP_ISA;
iwa_state = p2new & DISP_IWA;
if (!((p2new ^ m_p2_oldstate) & DISP_CK1)) {
// no clock edge : boring.
//LOGMASKED(DEBUG_LCD, "LCD : pwo(%d), sync(%d), isa(%d), iwa(%d)\n",
- // pwo_state, sync_state, isa_state, iwa_state);
+ // pwo_state, sync_state, isa_state, iwa_state);
return;
}
@@ -490,7 +490,7 @@ void hp3478a_state::lcd_interface(uint8_t p2new)
m_lcdiwa = lcd_iwatype::ANNUNS;
break;
case DISP_ISA_WA:
- m_lcd_want = 100; //no, doesn't fit in a uint64, but only the first 36 bits are significant.
+ m_lcd_want = 100; //no, doesn't fit in a uint64, but only the first 36 bits are significant.
m_lcdiwa = lcd_iwatype::REG_A;
break;
case DISP_ISA_WB:
@@ -551,7 +551,7 @@ void hp3478a_state::lcd_interface(uint8_t p2new)
//shouldn't get extra bits, but we have nothing better to do so just reset the shiftreg.
m_lcd_bitcount = 0;
m_lcd_bitbuf = 0;
- break; //case SELECTED_IWA
+ break; //case SELECTED_IWA
}
return;
@@ -578,7 +578,7 @@ void hp3478a_state::machine_start()
void hp3478a_state::i8039_map(address_map &map)
{
- map(0x0000, 0x0fff).bankr("bank0"); // CPU address space (4kB), banked according to P26 pin
+ map(0x0000, 0x0fff).bankr("bank0"); // CPU address space (4kB), banked according to P26 pin
}
void hp3478a_state::i8039_io(address_map &map)
@@ -595,7 +595,7 @@ void hp3478a_state::io_bank(address_map &map)
{
map.unmap_value_high();
map(0x000, 0x0ff).ram().region("nvram", 0).share("nvram").w(FUNC(hp3478a_state::nvwrite));
- map(0x100, 0x107).ram().share("gpibregs"); //XXX TODO : connect to i8291.cpp
+ map(0x100, 0x107).ram().share("gpibregs"); //XXX TODO : connect to i8291.cpp
map(0x200, 0x2ff).portr("DIP");
}
@@ -605,17 +605,17 @@ void hp3478a_state::io_bank(address_map &map)
******************************************************************************/
static INPUT_PORTS_START( hp3478a )
/* keypad bit matrix:
- 0x08|0x04|0x02|0x01
- col.0 : (nc)|shift|ACA|DCA
- col.1 : 4W|2W|ACV|DCV
- col.2 : int|dn|up|auto
- col.3 : (nc)|loc|srq|sgl
+ 0x08|0x04|0x02|0x01
+ col.0 : (nc)|shift|ACA|DCA
+ col.1 : 4W|2W|ACV|DCV
+ col.2 : int|dn|up|auto
+ col.3 : (nc)|loc|srq|sgl
*/
PORT_START("COL.0")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("DCA")
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("ACA")
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("SHIFT")
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) //nothing on 0x08
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) //nothing on 0x08
PORT_START("COL.1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("DCV")
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("ACV")
@@ -630,7 +630,7 @@ static INPUT_PORTS_START( hp3478a )
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON12 ) PORT_NAME("SGL")
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON13 ) PORT_NAME("SRQ")
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON14 ) PORT_NAME("LOC")
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) //nothing on 0x08
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) //nothing on 0x08
PORT_START("CAL_EN")
PORT_CONFNAME(1, 0, "CAL")
@@ -713,9 +713,9 @@ void hp3478a_state::hp3478a(machine_config &config)
******************************************************************************/
ROM_START( hp3478a )
ROM_REGION( 0x2000, "maincpu", 0 )
- ROM_LOAD("rom_dc118.bin", 0, 0x2000, CRC(10097ced) SHA1(bd665cf7e07e63f825b2353c8322ed8a4376b3bd)) //main CPU ROM, can match other datecodes too
+ ROM_LOAD("rom_dc118.bin", 0, 0x2000, CRC(10097ced) SHA1(bd665cf7e07e63f825b2353c8322ed8a4376b3bd)) //main CPU ROM, can match other datecodes too
- ROM_REGION( 0x100, "nvram", 0 ) /* Calibration RAM, battery-backed */
+ ROM_REGION( 0x100, "nvram", 0 ) /* Calibration RAM, battery-backed */
ROM_LOAD( "calram.bin", 0, 0x100, NO_DUMP)
ROM_END