diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/mame/drivers/novag6502.cpp | 69 | ||||
-rw-r--r-- | src/mame/includes/novagbase.h | 2 | ||||
-rw-r--r-- | src/mame/layout/novag_cforte.lay | 33 |
3 files changed, 81 insertions, 23 deletions
diff --git a/src/mame/drivers/novag6502.cpp b/src/mame/drivers/novag6502.cpp index f7c505dcc43..326c90c9d55 100644 --- a/src/mame/drivers/novag6502.cpp +++ b/src/mame/drivers/novag6502.cpp @@ -94,6 +94,9 @@ public: DECLARE_READ8_MEMBER(supercon_input2_r); // Constellation Forte + void cforte_prepare_display(); + DECLARE_WRITE64_MEMBER(cforte_lcd_output_w); + DECLARE_WRITE8_MEMBER(cforte_mux_w); DECLARE_WRITE8_MEMBER(cforte_control_w); // Super Expert @@ -339,22 +342,63 @@ READ8_MEMBER(novag6502_state::supercon_input2_r) Constellation Forte ******************************************************************************/ -// TTL +// TTL/generic + +void novag6502_state::cforte_prepare_display() +{ + // 3 led rows + display_matrix(8, 3, m_led_data, m_led_select, false); + + // lcd panel (mostly handled in cforte_lcd_output_w) + set_display_segmask(0x3ff0, 0xff); + set_display_size(8, 3+13); + display_update(); +} + +WRITE64_MEMBER(novag6502_state::cforte_lcd_output_w) +{ + // 4 rows used + u32 rowdata[4]; + for (int i = 0; i < 4; i++) + rowdata[i] = (data >> i & 1) ? u32(data >> 8) : 0; + + // 2 segments per row + for (int dig = 0; dig < 13; dig++) + { + m_display_state[dig+3] = 0; + for (int i = 0; i < 4; i++) + m_display_state[dig+3] |= ((rowdata[i] >> (2*dig) & 3) << (2*i)); + + m_display_state[dig+3] = BITSWAP8(m_display_state[dig+3],7,2,0,4,6,5,3,1); + } + + cforte_prepare_display(); +} + +WRITE8_MEMBER(novag6502_state::cforte_mux_w) +{ + // d0-d7: input mux, led data + m_inp_mux = m_led_data = data; + cforte_prepare_display(); +} WRITE8_MEMBER(novag6502_state::cforte_control_w) { // d0: lcd data - // d1: lcd clk + // d1: lcd clock // d2: lcd interrupt + m_hlcd0538->write_data(data & 1); + m_hlcd0538->write_clk(data >> 1 & 1); + m_hlcd0538->write_int(data >> 2 & 1); + // d3: unused? - m_lcd_control = data; - - // here's a hacky workaround for now - for (int i = 0; i < 10; i++) - output().set_digit_value(i, BITSWAP8(m_nvram[i + 0xc2d],3,5,4,6,7,2,1,0)); - - // other: same as supercon - supercon_control_w(space, offset, data); + + // d4-d6: select led row + m_led_select = data >> 4 & 7; + cforte_prepare_display(); + + // d7: enable beeper + m_beeper->set_state(data >> 7 & 1); } @@ -485,6 +529,7 @@ static ADDRESS_MAP_START( supercon_map, AS_PROGRAM, 8, novag6502_state ) ADDRESS_MAP_END static ADDRESS_MAP_START( cforte_map, AS_PROGRAM, 8, novag6502_state ) + AM_RANGE(0x1e00, 0x1e00) AM_READWRITE(supercon_input2_r, cforte_mux_w) AM_RANGE(0x1f00, 0x1f00) AM_READWRITE(supercon_input1_r, cforte_control_w) AM_IMPORT_FROM( supercon_map ) ADDRESS_MAP_END @@ -853,6 +898,10 @@ static MACHINE_CONFIG_START( cforte, novag6502_state ) MCFG_NVRAM_ADD_1FILL("nvram") + /* video hardware */ + MCFG_DEVICE_ADD("hlcd0538", HLCD0538, 0) + MCFG_HLCD0538_WRITE_COLS_CB(WRITE64(novag6502_state, cforte_lcd_output_w)) + MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", novagbase_state, display_decay_tick, attotime::from_msec(1)) MCFG_DEFAULT_LAYOUT(layout_novag_cforte) diff --git a/src/mame/includes/novagbase.h b/src/mame/includes/novagbase.h index 1acf9c51005..9bbefb01c45 100644 --- a/src/mame/includes/novagbase.h +++ b/src/mame/includes/novagbase.h @@ -17,7 +17,6 @@ public: m_maincpu(*this, "maincpu"), m_beeper(*this, "beeper"), m_lcd(*this, "hd44780"), - m_nvram(*this, "nvram"), m_inp_matrix(*this, "IN.%u", 0), m_display_wait(33), m_display_maxy(1), @@ -28,7 +27,6 @@ public: required_device<cpu_device> m_maincpu; optional_device<beep_device> m_beeper; optional_device<hd44780_device> m_lcd; - optional_shared_ptr<uint8_t> m_nvram; optional_ioport_array<8> m_inp_matrix; // max 8 // misc common diff --git a/src/mame/layout/novag_cforte.lay b/src/mame/layout/novag_cforte.lay index 2c8fe89ed0d..57926b35213 100644 --- a/src/mame/layout/novag_cforte.lay +++ b/src/mame/layout/novag_cforte.lay @@ -10,6 +10,14 @@ <element name="digit" defstate="0"> <led7seg><color red="1.0" green="1.0" blue="1.0" /></led7seg> </element> + <element name="seg_m" defstate="0"> + <text state="1" string="M"><color red="1.0" green="1.0" blue="1.0" /></text> + <text state="0" string="M"><color red="0.12" green="0.12" blue="0.12" /></text> + </element> + <element name="seg_ap" defstate="0"> + <text state="1" string="'"><color red="1.0" green="1.0" blue="1.0" /></text> + <text state="0" string="'"><color red="0.12" green="0.12" blue="0.12" /></text> + </element> <element name="ledr" defstate="0"> <rect state="1"><color red="1.0" green="0.1" blue="0.15" /></rect> @@ -161,7 +169,7 @@ <!-- build screen --> <view name="Internal Layout"> - <bounds left="-3" right="110" top="-2" bottom="89" /> + <bounds left="-3" right="111" top="-2" bottom="89" /> <!-- chessboard coords --> @@ -324,16 +332,19 @@ <!-- right side lcd panel/leds --> - <bezel name="digit0" element="digit"><bounds x="87.125" y="9" width="2" height="3" /></bezel> - <bezel name="digit1" element="digit"><bounds x="89.125" y="9" width="2" height="3" /></bezel> - <bezel name="digit2" element="digit"><bounds x="91.125" y="9" width="2" height="3" /></bezel> - <bezel name="digit3" element="digit"><bounds x="93.125" y="9" width="2" height="3" /></bezel> - <bezel name="digit4" element="digit"><bounds x="95.125" y="9" width="2" height="3" /></bezel> - <bezel name="digit5" element="digit"><bounds x="97.125" y="9" width="2" height="3" /></bezel> - <bezel name="digit6" element="digit"><bounds x="99.125" y="9" width="2" height="3" /></bezel> - <bezel name="digit7" element="digit"><bounds x="101.125" y="9" width="2" height="3" /></bezel> - <bezel name="digit8" element="digit"><bounds x="103.125" y="9" width="2" height="3" /></bezel> - <bezel name="digit9" element="digit"><bounds x="105.125" y="9" width="2" height="3" /></bezel> + <bezel name="digit4" element="digit"><bounds x="88.125" y="9" width="2" height="3" /></bezel> + <bezel name="digit5" element="digit"><bounds x="90.125" y="9" width="2" height="3" /></bezel> + <bezel name="digit6" element="digit"><bounds x="92.125" y="9" width="2" height="3" /></bezel> + <bezel name="digit7" element="digit"><bounds x="94.125" y="9" width="2" height="3" /></bezel> + <bezel name="digit8" element="digit"><bounds x="96.125" y="9" width="2" height="3" /></bezel> + <bezel name="digit9" element="digit"><bounds x="98.125" y="9" width="2" height="3" /></bezel> + <bezel name="digit10" element="digit"><bounds x="100.125" y="9" width="2" height="3" /></bezel> + <bezel name="digit11" element="digit"><bounds x="102.125" y="9" width="2" height="3" /></bezel> + <bezel name="digit12" element="digit"><bounds x="104.125" y="9" width="2" height="3" /></bezel> + <bezel name="digit13" element="digit"><bounds x="106.125" y="9" width="2" height="3" /></bezel> + + <bezel name="3.6" element="seg_m"><bounds x="86" y="8.75" width="2" height="1.5" /></bezel> + <bezel name="14.0" element="seg_ap"><bounds x="97.75" y="8.25" width="1" height="1.5" /></bezel> <bezel element="text_l7"><bounds x="87" y="68.64" width="14" height="1.4" /></bezel> <bezel element="text_l8"><bounds x="87" y="76.35" width="14" height="1.4" /></bezel> |