summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2020-03-12 23:13:47 -0400
committer AJR <ajrhacker@users.noreply.github.com>2020-03-12 23:13:47 -0400
commitedd08a30a4b09ae435efa8f4553319280754b7e4 (patch)
treeeea38eb34688699a49fdfa2b21a83b2e1e77f347
parent4499f5f6bc4238b9199233d27150859348097794 (diff)
canons80: Hook up LCDC and some RAM; work around undumped internal ROM this most likely boots from (nw)
-rw-r--r--src/mame/drivers/canon_s80.cpp47
1 files changed, 40 insertions, 7 deletions
diff --git a/src/mame/drivers/canon_s80.cpp b/src/mame/drivers/canon_s80.cpp
index 50ba5881c03..7e2aa68a4dc 100644
--- a/src/mame/drivers/canon_s80.cpp
+++ b/src/mame/drivers/canon_s80.cpp
@@ -11,14 +11,15 @@
* known issues:
* - memory-map is uncertain
* - maincpu clock is guessed
- * - still need to hookup the Hitachi HD44780 LCD Controller
* - still lacks description of the keyboard inputs
* - as well as a "paper" device to plot the output of the dot matrix print head
*/
#include "emu.h"
#include "cpu/m6800/m6801.h"
-//#include "video/hd44780.h"
+#include "video/hd44780.h"
+#include "emupal.h"
+#include "screen.h"
class canons80_state : public driver_device
{
@@ -27,16 +28,30 @@ public:
: driver_device(mconfig, type, tag)
{ }
- void init_canons80();
void canons80(machine_config &config);
+ void init_canons80();
+
+private:
+ HD44780_PIXEL_UPDATE(pixel_update);
+
void canons80_map(address_map &map);
};
+HD44780_PIXEL_UPDATE(canons80_state::pixel_update)
+{
+ if (pos < 16)
+ bitmap.pix16(line * 8 + y, pos * 6 + x) = state;
+}
+
void canons80_state::canons80_map(address_map &map)
{
- map(0x0000, 0x7fff).ram();
- map(0x8000, 0xffff).rom();
+ map(0x0000, 0x001f).m("maincpu", FUNC(hd6301x0_cpu_device::m6801_io));
+ map(0x0040, 0x00ff).ram();
+ map(0x0100, 0x07ff).ram();
+ map(0x2000, 0x2001).rw("lcdc", FUNC(hd44780_device::read), FUNC(hd44780_device::write));
+ map(0x4000, 0x7fff).rom().region("external", 0x4000);
+ map(0xf000, 0xffff).rom().region("maincpu", 0);
}
void canons80_state::canons80(machine_config &config)
@@ -44,6 +59,19 @@ void canons80_state::canons80(machine_config &config)
/* basic machine hardware */
hd6301x0_cpu_device &maincpu(HD6301X0(config, "maincpu", 5000000)); /* hd63a01xop 5 MHz guessed: TODO: check on PCB */
maincpu.set_addrmap(AS_PROGRAM, &canons80_state::canons80_map);
+
+ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_LCD));
+ screen.set_refresh_hz(50);
+ screen.set_screen_update("lcdc", FUNC(hd44780_device::screen_update));
+ screen.set_size(16*6, 16);
+ screen.set_visarea(0, 16*6-1, 0, 16-1);
+ screen.set_palette("palette");
+
+ hd44780_device &hd44780(HD44780(config, "lcdc"));
+ hd44780.set_lcd_size(2, 16);
+ hd44780.set_pixel_update_cb(FUNC(canons80_state::pixel_update));
+
+ PALETTE(config, "palette").set_entries(2);
}
void canons80_state::init_canons80()
@@ -51,8 +79,13 @@ void canons80_state::init_canons80()
}
ROM_START( canons80 )
- ROM_REGION( 0x10000, "maincpu", 0 ) /* 6800 code */
- ROM_LOAD( "canon_8735kx_nh4-0029_064.ic6", 0x8000, 0x8000, CRC(b6cd2ff7) SHA1(e47a136300c826e480fac1be7fc090523078a2a6) )
+ ROM_REGION( 0x1000, "maincpu", 0 )
+ ROM_LOAD( "hd63a1x0p.bin", 0x0000, 0x1000, NO_DUMP )
+ ROM_FILL( 0xffe, 1, 0x40 )
+ ROM_FILL( 0xfff, 1, 0x00 )
+
+ ROM_REGION( 0x8000, "external", 0 )
+ ROM_LOAD( "canon_8735kx_nh4-0029_064.ic6", 0x0000, 0x8000, CRC(b6cd2ff7) SHA1(e47a136300c826e480fac1be7fc090523078a2a6) )
ROM_END
/* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */