From bbb49e299e3c5d800cc4f0c12b841b1f2bf9649f Mon Sep 17 00:00:00 2001 From: hap Date: Wed, 13 May 2015 19:17:24 +0200 Subject: [PATCH] notes --- src/emu/cpu/e0c6200/e0c6s46.c | 37 ++++++++++++++++++++-- src/emu/cpu/hmcs40/hmcs40op.inc | 1 + src/emu/cpu/m37710/m37710.c | 2 +- src/emu/cpu/m37710/m37710.h | 2 +- src/emu/cpu/m37710/m37710cm.h | 2 +- src/emu/cpu/m37710/m37710il.h | 2 +- src/emu/cpu/m37710/m37710o0.c | 2 +- src/emu/cpu/m37710/m37710o1.c | 2 +- src/emu/cpu/m37710/m37710o2.c | 2 +- src/emu/cpu/m37710/m37710o3.c | 2 +- src/emu/cpu/m37710/m37710op.h | 2 +- src/emu/cpu/mc68hc11/hc11ops.h | 2 +- src/emu/cpu/mc68hc11/hc11ops.inc | 3 ++ src/emu/cpu/mc68hc11/mc68hc11.c | 2 +- src/emu/cpu/mc68hc11/mc68hc11.h | 2 +- src/emu/cpu/tms32025/32025dsm.c | 2 +- src/emu/cpu/tms32025/dis32025.c | 2 +- src/emu/cpu/tms32025/tms32025.c | 2 +- src/emu/cpu/tms32025/tms32025.h | 2 +- src/emu/cpu/ucom4/ucom4op.inc | 1 + src/mess/drivers/tamag1.c | 54 ++++++++++++++++++++++---------- 21 files changed, 93 insertions(+), 35 deletions(-) diff --git a/src/emu/cpu/e0c6200/e0c6s46.c b/src/emu/cpu/e0c6200/e0c6s46.c index 03a53d4aee8..5980f4eea85 100644 --- a/src/emu/cpu/e0c6200/e0c6s46.c +++ b/src/emu/cpu/e0c6200/e0c6s46.c @@ -3,6 +3,11 @@ /* Seiko Epson E0C6S46 MCU + + TODO: + - K input interrupts + - serial interface + - output ports */ @@ -45,8 +50,6 @@ e0c6s46_device::e0c6s46_device(const machine_config &mconfig, const char *tag, d - - //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- @@ -154,6 +157,7 @@ void e0c6s46_device::device_reset() } + //------------------------------------------------- // execute //------------------------------------------------- @@ -169,6 +173,10 @@ void e0c6s46_device::execute_one() +//------------------------------------------------- +// interrupts +//------------------------------------------------- + bool e0c6s46_device::check_interrupt() { // priority order is not the same as register order @@ -218,6 +226,13 @@ void e0c6s46_device::execute_set_input(int line, int state) } + +//------------------------------------------------- +// timers +//------------------------------------------------- + +// clock timer + void e0c6s46_device::clock_watchdog() { // initial reset after 3 to 4 seconds @@ -256,6 +271,9 @@ TIMER_CALLBACK_MEMBER(e0c6s46_device::clktimer_cb) clock_watchdog(); } + +// stopwatch timer + void e0c6s46_device::clock_stopwatch() { m_swl_slice++; @@ -300,6 +318,9 @@ TIMER_CALLBACK_MEMBER(e0c6s46_device::stopwatch_cb) m_stopwatch_handle->adjust(attotime::from_ticks(64, unscaled_clock())); } + +// programmable timer + void e0c6s46_device::clock_prgtimer() { // irq and reload when it reaches zero @@ -340,8 +361,14 @@ TIMER_CALLBACK_MEMBER(e0c6s46_device::prgtimer_cb) } + +//------------------------------------------------- +// LCD Driver +//------------------------------------------------- + UINT32 e0c6s46_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { + // call this 32 times per second (osc1/1024: 32hz at default clock of 32768hz) for (int bank = 0; bank < 2; bank++) { const UINT8* vram = bank ? m_vram2 : m_vram1; @@ -379,6 +406,12 @@ UINT32 e0c6s46_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap return 0; } + + +//------------------------------------------------- +// internal I/O +//------------------------------------------------- + READ8_MEMBER(e0c6s46_device::io_r) { switch (offset) diff --git a/src/emu/cpu/hmcs40/hmcs40op.inc b/src/emu/cpu/hmcs40/hmcs40op.inc index 5d9bfcfc8ea..6e905c71796 100644 --- a/src/emu/cpu/hmcs40/hmcs40op.inc +++ b/src/emu/cpu/hmcs40/hmcs40op.inc @@ -1,5 +1,6 @@ // license:BSD-3-Clause // copyright-holders:hap + // HMCS40 opcode handlers // internal helpers diff --git a/src/emu/cpu/m37710/m37710.c b/src/emu/cpu/m37710/m37710.c index 485bfbea87e..26a2accfe76 100644 --- a/src/emu/cpu/m37710/m37710.c +++ b/src/emu/cpu/m37710/m37710.c @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:R. Belmont, Karl Stenerud +// copyright-holders:R. Belmont, Karl Stenerud, hap /* Mitsubishi M37702/37710 CPU Emulator diff --git a/src/emu/cpu/m37710/m37710.h b/src/emu/cpu/m37710/m37710.h index 154198f5421..3bcc57ae68d 100644 --- a/src/emu/cpu/m37710/m37710.h +++ b/src/emu/cpu/m37710/m37710.h @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:R. Belmont, Karl Stenerud +// copyright-holders:R. Belmont, Karl Stenerud, hap #ifndef __M37710_H__ #define __M37710_H__ diff --git a/src/emu/cpu/m37710/m37710cm.h b/src/emu/cpu/m37710/m37710cm.h index 5f2b3d39ca9..8c784b9ca05 100644 --- a/src/emu/cpu/m37710/m37710cm.h +++ b/src/emu/cpu/m37710/m37710cm.h @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:R. Belmont, Karl Stenerud +// copyright-holders:R. Belmont, Karl Stenerud, hap #pragma once #ifndef __M37710CM_H__ diff --git a/src/emu/cpu/m37710/m37710il.h b/src/emu/cpu/m37710/m37710il.h index 59bc4d21d33..ffc1aed0a7a 100644 --- a/src/emu/cpu/m37710/m37710il.h +++ b/src/emu/cpu/m37710/m37710il.h @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:R. Belmont, Karl Stenerud +// copyright-holders:R. Belmont, Karl Stenerud, hap #pragma once #ifndef __M37710IL_H__ diff --git a/src/emu/cpu/m37710/m37710o0.c b/src/emu/cpu/m37710/m37710o0.c index 31fd6bb042e..6fdd9b2a01f 100644 --- a/src/emu/cpu/m37710/m37710o0.c +++ b/src/emu/cpu/m37710/m37710o0.c @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:R. Belmont, Karl Stenerud +// copyright-holders:R. Belmont, Karl Stenerud, hap #include "emu.h" #include "debugger.h" #include "m37710cm.h" diff --git a/src/emu/cpu/m37710/m37710o1.c b/src/emu/cpu/m37710/m37710o1.c index 5f1c159b556..d8de494a6ce 100644 --- a/src/emu/cpu/m37710/m37710o1.c +++ b/src/emu/cpu/m37710/m37710o1.c @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:R. Belmont, Karl Stenerud +// copyright-holders:R. Belmont, Karl Stenerud, hap #include "emu.h" #include "debugger.h" #include "m37710cm.h" diff --git a/src/emu/cpu/m37710/m37710o2.c b/src/emu/cpu/m37710/m37710o2.c index 9223c8c8e25..d92556b3207 100644 --- a/src/emu/cpu/m37710/m37710o2.c +++ b/src/emu/cpu/m37710/m37710o2.c @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:R. Belmont, Karl Stenerud +// copyright-holders:R. Belmont, Karl Stenerud, hap #include "emu.h" #include "debugger.h" #include "m37710cm.h" diff --git a/src/emu/cpu/m37710/m37710o3.c b/src/emu/cpu/m37710/m37710o3.c index 8cc19a108a4..16e2084ec4a 100644 --- a/src/emu/cpu/m37710/m37710o3.c +++ b/src/emu/cpu/m37710/m37710o3.c @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:R. Belmont, Karl Stenerud +// copyright-holders:R. Belmont, Karl Stenerud, hap #include "emu.h" #include "debugger.h" #include "m37710cm.h" diff --git a/src/emu/cpu/m37710/m37710op.h b/src/emu/cpu/m37710/m37710op.h index 15dc6361469..03e29580323 100644 --- a/src/emu/cpu/m37710/m37710op.h +++ b/src/emu/cpu/m37710/m37710op.h @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:R. Belmont, Karl Stenerud +// copyright-holders:R. Belmont, Karl Stenerud, hap /* ======================================================================== */ /* ============================= CONFIGURATION ============================ */ /* ======================================================================== */ diff --git a/src/emu/cpu/mc68hc11/hc11ops.h b/src/emu/cpu/mc68hc11/hc11ops.h index ad368c9485e..2eafc2850a2 100644 --- a/src/emu/cpu/mc68hc11/hc11ops.h +++ b/src/emu/cpu/mc68hc11/hc11ops.h @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:Ville Linde +// copyright-holders:Ville Linde, Angelo Salese, hap const mc68hc11_cpu_device::hc11_opcode_list_struct mc68hc11_cpu_device::hc11_opcode_list[] = { diff --git a/src/emu/cpu/mc68hc11/hc11ops.inc b/src/emu/cpu/mc68hc11/hc11ops.inc index 21e96a1fe8f..cb71a839c2f 100644 --- a/src/emu/cpu/mc68hc11/hc11ops.inc +++ b/src/emu/cpu/mc68hc11/hc11ops.inc @@ -1,3 +1,6 @@ +// license:BSD-3-Clause +// copyright-holders:Ville Linde, Angelo Salese, hap + #define SET_Z8(r) (m_ccr |= ((UINT8)r == 0) ? CC_Z : 0) #define SET_Z16(r) (m_ccr |= ((UINT16)r == 0) ? CC_Z : 0) #define SET_N8(r) (m_ccr |= (r & 0x80) ? CC_N : 0) diff --git a/src/emu/cpu/mc68hc11/mc68hc11.c b/src/emu/cpu/mc68hc11/mc68hc11.c index 7918ca5d322..1ead2b94fdf 100644 --- a/src/emu/cpu/mc68hc11/mc68hc11.c +++ b/src/emu/cpu/mc68hc11/mc68hc11.c @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:Ville Linde, Angelo Salese +// copyright-holders:Ville Linde, Angelo Salese, hap /* Motorola MC68HC11 emulator diff --git a/src/emu/cpu/mc68hc11/mc68hc11.h b/src/emu/cpu/mc68hc11/mc68hc11.h index 98511347f99..6098cebdfe4 100644 --- a/src/emu/cpu/mc68hc11/mc68hc11.h +++ b/src/emu/cpu/mc68hc11/mc68hc11.h @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:Ville Linde, Angelo Salese +// copyright-holders:Ville Linde, Angelo Salese, hap #pragma once #ifndef __MC68HC11_H__ diff --git a/src/emu/cpu/tms32025/32025dsm.c b/src/emu/cpu/tms32025/32025dsm.c index 054c54846f1..416f0aeb5ab 100644 --- a/src/emu/cpu/tms32025/32025dsm.c +++ b/src/emu/cpu/tms32025/32025dsm.c @@ -1,5 +1,5 @@ // license:??? -// copyright-holders:Tony La Porta +// copyright-holders:Tony La Porta, hap /**************************************************************************\ * Texas Instruments TMS320x25 DSP Disassembler * * * diff --git a/src/emu/cpu/tms32025/dis32025.c b/src/emu/cpu/tms32025/dis32025.c index d4f191fc67e..8a4280b3bf7 100644 --- a/src/emu/cpu/tms32025/dis32025.c +++ b/src/emu/cpu/tms32025/dis32025.c @@ -1,5 +1,5 @@ // license:??? -// copyright-holders:Tony La Porta +// copyright-holders:Tony La Porta, hap /**************************************************************************\ * Texas Instruments TMS320x25 DSP Disassembler * * * diff --git a/src/emu/cpu/tms32025/tms32025.c b/src/emu/cpu/tms32025/tms32025.c index 29089665037..718ced81e39 100644 --- a/src/emu/cpu/tms32025/tms32025.c +++ b/src/emu/cpu/tms32025/tms32025.c @@ -1,5 +1,5 @@ // license:??? -// copyright-holders:Tony La Porta +// copyright-holders:Tony La Porta, hap /**************************************************************************\ * Texas Instruments TMS320x25 DSP Emulator * * * diff --git a/src/emu/cpu/tms32025/tms32025.h b/src/emu/cpu/tms32025/tms32025.h index 6f8ecfbe0d6..82139bf2ef3 100644 --- a/src/emu/cpu/tms32025/tms32025.h +++ b/src/emu/cpu/tms32025/tms32025.h @@ -1,5 +1,5 @@ // license:??? -// copyright-holders:Tony La Porta +// copyright-holders:Tony La Porta, hap /**************************************************************************\ * Texas Instruments TMS320x25 DSP Emulator * * * diff --git a/src/emu/cpu/ucom4/ucom4op.inc b/src/emu/cpu/ucom4/ucom4op.inc index 42b52af8258..0f7aaa7902e 100644 --- a/src/emu/cpu/ucom4/ucom4op.inc +++ b/src/emu/cpu/ucom4/ucom4op.inc @@ -1,5 +1,6 @@ // license:BSD-3-Clause // copyright-holders:hap + // uCOM-4 opcode handlers // internal helpers diff --git a/src/mess/drivers/tamag1.c b/src/mess/drivers/tamag1.c index f881758ae70..569eb4caed5 100644 --- a/src/mess/drivers/tamag1.c +++ b/src/mess/drivers/tamag1.c @@ -30,16 +30,16 @@ public: }; +/*************************************************************************** -PALETTE_INIT_MEMBER(tamag1_state, tama) -{ - palette.set_pen_color(0, rgb_t(0xff, 0xff, 0xff)); - palette.set_pen_color(1, rgb_t(0x00, 0x00, 0x00)); -} + Video +***************************************************************************/ static E0C6S46_PIXEL_UPDATE_CB(tama_pixel_update) { + // 16 COM(common) pins, 40 SEG(segment) pins from MCU, + // 32x16 LCD screen and 2 rows of indicators static const int seg2x[0x28] = { 0, 1, 2, 3, 4, 5, 6, 7, @@ -48,12 +48,35 @@ static E0C6S46_PIXEL_UPDATE_CB(tama_pixel_update) 27,26,25,24,36,23,22,21, 20,19,18,17,16,37,38,39 }; - - bitmap.pix16(com, seg2x[seg]) = state; + + int y = com, x = seg2x[seg]; + if (cliprect.contains(x, y)) + bitmap.pix16(y, x) = state; +} + +PALETTE_INIT_MEMBER(tamag1_state, tama) +{ + palette.set_pen_color(0, rgb_t(138, 146, 148)); + palette.set_pen_color(1, rgb_t(92, 83, 88)); } +/*************************************************************************** + + Inputs + +***************************************************************************/ + +INPUT_CHANGED_MEMBER(tamag1_state::input_changed) +{ + // inputs are hooked up backwards here, because MCU input + // ports are all tied to its interrupt controller + int line = (int)(FPTR)param; + int state = newval ? ASSERT_LINE : CLEAR_LINE; + m_maincpu->set_input_line(line, state); +} + static INPUT_PORTS_START( tama ) PORT_START("K0") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_CHANGED_MEMBER(DEVICE_SELF, tamag1_state, input_changed, (void *)0) @@ -62,16 +85,13 @@ static INPUT_PORTS_START( tama ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) INPUT_PORTS_END -INPUT_CHANGED_MEMBER(tamag1_state::input_changed) -{ - // Inputs are hooked up backwards here, because MCU input - // ports are all tied to its interrupt controller. - int line = (int)(FPTR)param; - int state = newval ? ASSERT_LINE : CLEAR_LINE; - m_maincpu->set_input_line(line, state); -} +/*************************************************************************** + + Machine Config + +***************************************************************************/ static MACHINE_CONFIG_START( tama, tamag1_state ) @@ -84,7 +104,7 @@ static MACHINE_CONFIG_START( tama, tamag1_state ) MCFG_SCREEN_REFRESH_RATE(XTAL_32_768kHz/1024) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(40, 16) - MCFG_SCREEN_VISIBLE_AREA(0, 40-1, 0, 16-1) + MCFG_SCREEN_VISIBLE_AREA(0, 32-1, 0, 16-1) // MCFG_DEFAULT_LAYOUT(layout_tama) MCFG_SCREEN_UPDATE_DEVICE("maincpu", e0c6s46_device, screen_update) MCFG_SCREEN_PALETTE("palette") @@ -108,7 +128,7 @@ MACHINE_CONFIG_END ROM_START( tama ) ROM_REGION( 0x3000, "maincpu", 0 ) - ROM_LOAD( "test.b", 0x0000, 0x3000, CRC(4372220e) SHA1(6e13d015113e16198c0059b9d0c38d7027ae7324) ) + ROM_LOAD( "test.b", 0x0000, 0x3000, CRC(4372220e) SHA1(6e13d015113e16198c0059b9d0c38d7027ae7324) ) // this rom is on the die too, test pin enables it? ROM_LOAD( "tama.b", 0x0000, 0x3000, CRC(5c864cb1) SHA1(4b4979cf92dc9d2fb6d7295a38f209f3da144f72) ) ROM_END