From 925b244ced98f82e66cbf94903f172878567be1d Mon Sep 17 00:00:00 2001 From: Joakim Larsson Edstrom Date: Tue, 30 May 2017 09:57:43 +0200 Subject: dbox: New driver NOT_WORKING, Nokia Dbox 1 satellite digital receiver --- scripts/target/mame/mess.lua | 1 + src/devices/video/sda5708.cpp | 453 ++++++++++++++++++++++++++++++++++++++++++ src/devices/video/sda5708.h | 67 +++++++ src/mame/drivers/dbox.cpp | 347 ++++++++++++++++++++++++++++++++ src/mame/mame.lst | 3 + 5 files changed, 871 insertions(+) create mode 100644 src/devices/video/sda5708.cpp create mode 100644 src/devices/video/sda5708.h create mode 100644 src/mame/drivers/dbox.cpp diff --git a/scripts/target/mame/mess.lua b/scripts/target/mame/mess.lua index f5ac2765d6f..54d277adba1 100644 --- a/scripts/target/mame/mess.lua +++ b/scripts/target/mame/mess.lua @@ -2434,6 +2434,7 @@ files { createMESSProjects(_target, _subtarget, "nokia") files { + MAME_DIR .. "src/mame/drivers/dbox.cpp", MAME_DIR .. "src/mame/drivers/mikromik.cpp", MAME_DIR .. "src/mame/includes/mikromik.h", MAME_DIR .. "src/mame/machine/mm1kb.cpp", diff --git a/src/devices/video/sda5708.cpp b/src/devices/video/sda5708.cpp new file mode 100644 index 00000000000..79f98a82000 --- /dev/null +++ b/src/devices/video/sda5708.cpp @@ -0,0 +1,453 @@ +// license:BSD-3-Clause +// copyright-holders:Joakim Larsson Edstrom +/********************************************************************** + + Siemens SDA5708 8 character 7x5 dot matrix LED display + +**********************************************************************/ + +#include "sda5708.h" + +/* Misc info + * --------- + * http://www.sbprojects.com/knowledge/footprints/sda5708/index.php + * http://arduinotehniq.blogspot.se/2015/07/sda5708-display-8-character-7x5-dot.html + * + * Display front - LEDs + * -------------------- + * xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx + * xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx + * xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx + * xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx + * xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx + * xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx + * xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx + * Dig0 Dig1 Dig2 Dig3 Dig4 Dig5 Dig6 Dig7 + * + * Display rear - Pinout + * --------------------- + * +--------------------------------------------------------+ + * | O O | + * | +----------------------------------------------+ | + * | | o o o o o o | | + * | | Pin:6 5 4 3 2 1 | | + * | | | | + * | +----------------------------------------------+ | + * +--------------------------------------------------------+ + * 6:GND 5:_RESET 4:SDCLK 3:Data 2:_Load 1:Vcc + * + */ +//************************************************************************** +// MACROS / CONSTANTS +//************************************************************************** + +#define LOG 0 + +#define SDA5708_REG_MASK 0xE0 + +#define SDA5708_CNTR_COMMAND 0xE0 +#define SDA5708_CNTR_BRIGHT_MASK 0x1F +#define SDA5708_CNTR_BRIGHT_100 0x00 +#define SDA5708_CNTR_BRIGHT_53 0x01 +#define SDA5708_CNTR_BRIGHT_40 0x02 +#define SDA5708_CNTR_BRIGHT_27 0x03 +#define SDA5708_CNTR_BRIGHT_20 0x04 +#define SDA5708_CNTR_BRIGHT_13 0x05 +#define SDA5708_CNTR_BRIGHT_6_6 0x06 +#define SDA5708_CNTR_BRIGHT_0 0x07 +#define SDA5708_CNTR_PKCUR_12_5 0x08 + +#define SDA5708_CLEAR_COMMAND 0xC0 + +#define SDA5708_ADDR_COMMAND 0xA0 +#define SDA5708_ADDR_LED_MASK 0x07 +#define SDA5708_ADDR_LED0 0x00 +#define SDA5708_ADDR_LED1 0x01 +#define SDA5708_ADDR_LED2 0x02 +#define SDA5708_ADDR_LED3 0x03 +#define SDA5708_ADDR_LED4 0x04 +#define SDA5708_ADDR_LED5 0x05 +#define SDA5708_ADDR_LED6 0x06 +#define SDA5708_ADDR_LED7 0x07 + +#define SDA5708_DATA_COMMAND 0x00 + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +// device type definition +const device_type SDA5708 = &device_creator; + +#if 0 +// I/O map +DEVICE_ADDRESS_MAP_START( map, 8, sda5708_device ) + AM_RANGE(0x00, 0x00) AM_READWRITE(dr_r, dr_w) + AM_RANGE(0x01, 0x01) AM_READWRITE(ir_r, ir_w) +ADDRESS_MAP_END + +// default address map +static ADDRESS_MAP_START( sda5708, AS_0, 8, sda5708_device ) + AM_RANGE(0x00000, 0xfffff) AM_RAM +ADDRESS_MAP_END +#endif + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// sda5708_device - constructor +//------------------------------------------------- + +sda5708_device::sda5708_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : + device_t(mconfig, SDA5708, "SDA5708", tag, owner, clock, "sda5708", __FILE__), + device_memory_interface(mconfig, *this), + device_video_interface(mconfig, *this), + m_space_config("videoram", ENDIANNESS_LITTLE, 8, 20, 0, NULL, *ADDRESS_MAP_NAME(sda5708)), + m_cursor(0) +{ +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void sda5708_device::device_start() +{ + // register for state saving + save_item(NAME(m_frame)); +} + + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void sda5708_device::device_reset() +{ + m_frame = 0; +} + + +//------------------------------------------------- +// memory_space_config - return a description of +// any address spaces owned by this device +//------------------------------------------------- + +const address_space_config *sda5708_device::memory_space_config(address_spacenum spacenum) const +{ + return (spacenum == AS_0) ? &m_space_config : NULL; +} + + +//------------------------------------------------- +// ir_r - +//------------------------------------------------- + +READ8_MEMBER( sda5708_device::ir_r ) +{ + return m_ir; +} + + +//------------------------------------------------- +// ir_w - +//------------------------------------------------- + +WRITE8_MEMBER( sda5708_device::ir_w ) +{ + m_ir = data & 0x0f; +} + + +//------------------------------------------------- +// dr_r - +//------------------------------------------------- + +READ8_MEMBER( sda5708_device::dr_r ) +{ + UINT8 data = 0; + + switch (m_ir) + { + case REGISTER_MOR: + break; // write-only + + case REGISTER_PR: + data = m_pr; + break; + + case REGISTER_HNR: + data = m_hnr; + break; + + case REGISTER_DVR: + break; // write-only + + case REGISTER_CPR: + data = m_cpr; + break; + + case REGISTER_SLR: + data = m_slr; + break; + + case REGISTER_SUR: + data = m_sur; + break; + + case REGISTER_CLR: + data = m_clr; + break; + + case REGISTER_CUR: + data = m_cur; + break; + } + + return data; +} + + +//------------------------------------------------- +// dr_w - +//------------------------------------------------- + +WRITE8_MEMBER( sda5708_device::dr_w ) +{ + switch (m_ir) + { + case REGISTER_MOR: + m_mor = data & 0x7f; + break; + + case REGISTER_PR: + m_pr = data & 0xf7; + break; + + case REGISTER_HNR: + m_hnr = data & 0x7f; + break; + + case REGISTER_DVR: + m_dvr = data; + break; + + case REGISTER_CPR: + m_cpr = data; + break; + + case REGISTER_SLR: + m_slr = data; + break; + + case REGISTER_SUR: + m_sur = data; + break; + + case REGISTER_CLR: + m_clr = data; + break; + + case REGISTER_CUR: + m_cur = data; + break; + } +} + + +//------------------------------------------------- +// read_byte - +//------------------------------------------------- + +UINT8 sda5708_device::read_byte(UINT16 ma, UINT8 ra) +{ + offs_t offset; + + if (m_mor & MOR_GRAPHICS) + { + offset = ma; + } + else + { + offset = ((offs_t)ma << 4) | ra; + } + + return space().read_byte(offset); +} + + +//------------------------------------------------- +// update_cursor - +//------------------------------------------------- + +void sda5708_device::update_cursor() +{ + if (m_mor & MOR_CURSOR_ON) + { + if (m_mor & MOR_CURSOR_BLINK) + { + if (m_mor & MOR_BLINK_TIME_16) + { + if (m_frame == 16) + { + m_cursor = !m_cursor; + m_frame = 0; + } + else + { + m_frame++; + } + } + else + { + if (m_frame == 32) + { + m_cursor = !m_cursor; + m_frame = 0; + } + else + { + m_frame++; + } + } + } + else + { + m_cursor = 1; + } + } + else + { + m_cursor = 0; + } +} + + +//------------------------------------------------- +// draw_scanline - +//------------------------------------------------- + +void sda5708_device::draw_scanline(bitmap_ind16 &bitmap, const rectangle &cliprect, int y, UINT16 ma, UINT8 ra) +{ + UINT8 hp = (m_pr & PR_HP_MASK) + 1; + UINT8 hn = (m_hnr & HNR_HN_MASK) + 1; + UINT8 cpu = m_cpr & CPR_CPU_MASK; + UINT8 cpd = m_cpr & CPR_CPD_MASK; + UINT16 car = (m_cur << 8) | m_clr; + + int sx, x; + + for (sx = 0; sx < hn; sx++) + { + UINT8 data = read_byte(ma, ra); + + if (m_cursor) + { + if (ma == car) + { + if (ra >= cpu && ra <= cpd) + { + data ^= 0xff; + } + } + } + + for (x = 0; x < hp; x++) + { + bitmap.pix16(y, (sx * hp) + x) = BIT(data, 7); + + data <<= 1; + } + + ma++; + } +} + + +//------------------------------------------------- +// update_graphics - +//------------------------------------------------- + +void sda5708_device::update_graphics(bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + UINT8 hn = (m_hnr & HNR_HN_MASK) + 1; + UINT8 nx = (m_dvr & DVR_DN_MASK) + 1; + UINT16 sar = (m_sur << 8) | m_slr; + + int y; + + m_cursor = 0; + m_frame = 0; + + for (y = 0; y < nx; y++) + { + // draw upper half scanline + UINT16 ma = sar + (y * hn); + draw_scanline(bitmap, cliprect, y, ma); + + // draw lower half scanline + ma = sar + ((y + nx) * hn); + draw_scanline(bitmap, cliprect, y + nx, ma); + } +} + + +//------------------------------------------------- +// update_text - +//------------------------------------------------- + +void sda5708_device::update_text(bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + UINT8 hn = (m_hnr & HNR_HN_MASK) + 1; + UINT8 vp = (m_pr & PR_VP_MASK) + 1; + UINT8 nx = (m_dvr & DVR_DN_MASK) + 1; + UINT16 sar = (m_sur << 8) | m_slr; + + int sy, y; + + update_cursor(); + + for (sy = 0; sy < nx; sy++) + { + for (y = 0; y < vp; y++) + { + // draw upper half scanline + UINT16 ma = sar + ((sy * vp) + y) * hn; + draw_scanline(bitmap, cliprect, (sy * vp) + y, ma, y); + + // draw lower half scanline + ma = sar + (((sy + nx) * vp) + y) * hn; + draw_scanline(bitmap, cliprect, (sy * vp) + y, ma, y); + } + } +} + + +//------------------------------------------------- +// update_screen - update screen +//------------------------------------------------- + +UINT32 sda5708_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + if (m_mor & MOR_DISPLAY_ON) + { + if (m_mor & MOR_GRAPHICS) + { + update_graphics(bitmap, cliprect); + } + else + { + update_text(bitmap, cliprect); + } + } + else + { + bitmap.fill(0, cliprect); + } + + return 0; +} diff --git a/src/devices/video/sda5708.h b/src/devices/video/sda5708.h new file mode 100644 index 00000000000..2f2f5a99106 --- /dev/null +++ b/src/devices/video/sda5708.h @@ -0,0 +1,67 @@ +// license:BSD-3-Clause +// copyright-holders:Joakim Larsson Edstrom +/********************************************************************** + + Siemens SDA5708 8 character 7x5 dot matrix LED display + +**********************************************************************/ + +#pragma once + +#ifndef __SDA5708__ +#define __SDA5708__ + +#include "emu.h" + + + +///************************************************************************* +// TYPE DEFINITIONS +///************************************************************************* + +// ======================> sda5708_device + +class sda5708_device : public device_t, + public device_memory_interface, + public device_video_interface +{ +public: + // construction/destruction + sda5708_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + virtual DECLARE_ADDRESS_MAP(map, 8); + + DECLARE_READ8_MEMBER( ir_r ); + DECLARE_WRITE8_MEMBER( ir_w ); + + DECLARE_READ8_MEMBER( dr_r ); + DECLARE_WRITE8_MEMBER( dr_w ); + + UINT32 screen_update(screen_device &device, bitmap_ind16 &bitmap, const rectangle &cliprect); + +protected: + // device-level overrides + virtual void device_start(); + virtual void device_reset(); + + // device_memory_interface overrides + virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const; + +private: + void update_cursor(); + void draw_scanline(bitmap_ind16 &bitmap, const rectangle &cliprect, int y, UINT16 ma, UINT8 ra = 0); + void update_graphics(bitmap_ind16 &bitmap, const rectangle &cliprect); + void update_text(bitmap_ind16 &bitmap, const rectangle &cliprect); + + const address_space_config m_space_config; + + int m_frame; // frame counter +}; + + +// device type definition +extern const device_type SDA5708; + + + +#endif diff --git a/src/mame/drivers/dbox.cpp b/src/mame/drivers/dbox.cpp new file mode 100644 index 00000000000..779cc9d952b --- /dev/null +++ b/src/mame/drivers/dbox.cpp @@ -0,0 +1,347 @@ +/* + * The Dbox-1 CPU board. + *__________________________________________________________________________________________________________ + * | + * | + * _______________ | + * ___ | | ________ ________ | + * | | |_______________| | | | | | + * | | | FLASH | | FLASH | | + * | | | 29F800 | | 29F800 | | + * | | | | | | | + * | | ____________ | 1Mb | | 1Mb | | + * | | | | | | | | | + * |___| | CPU32 | | | | | | + * | 68340PV16E | |________| |________| | + * | | | + * | | | + * _______________ |____________| _____ | + * | | | | | + * | SCSI | |_____| _____ _____ | + * | CONTROLLER | +-+ _____ | | | | | + * | LSI 53CF54-2 | |X| | | |DRAM | |DRAM | | + * | | |T| |_____| |42460| |42460| | + * | | |A| | | | | | + * | | |L| ---------------- |512Kb| |512Kb| | + * |_______________| +-+ | | | | | | | + * 3.6864 ---------------- |_____| |_____| | + * | + *__________________________________________________________________________________________________________| + * + * History of Nokia Multimedia Division + *------------------------------------- + * Luxor AB was a swedish home electronics and computer manufacturer located in Motala from 1923 and aquired + * by Nokia 1985. Luxor designed among other things TV setsm Radios and the famous ABC-80. The Nokia Multimedia + * Division was formed in Linköping as a result of the Luxor aquesition. Their main design was a satellite + * receiver, the first satellite in Europee was launched in 1988 and market was growing fast however it took + * a long time, almost 10 years before the breakthrough came for Nokia, a deal with the Kirsch Gruppe was struck and + * in 1996 the 68340 based Dbox-1 was released in Germany. The original design was expensive, so soon a cost reduced + * version based on PPC, the Dbox-2, was released. The boxes sold in millions but the margins were negative or very + * low at best and the Kirsch Gruppe went bankrupt in 2002 and Nokia decided to shutdown the facility in Linköping. + * + * The heavily subsidiced Dbox was very popular in Holland since Kirsch Gruppe didn't lock use to themselfs. This was + * corrected in a forced firmware upgrade leaving the "customers" in Holland without a working box. Pretty soon a + * shareware software developed by Uli Hermann appeared called DVB98 and later DVB2000 reenabling the boxes in Holland + * and blocking upgrades. Uli's software was by many considered better than the original software. + * + * Misc links about Nokia Multimedia Division and this board: + * http://www.siliconinvestor.com/readmsg.aspx?msgid=5097482 + * http://www.telecompaper.com/news/beta-research-publishes-dbox-specifications--163443 + * https://de.wikipedia.org/wiki/D-box + * http://dvb2000.org/dvb2000/ + * + * Misc findings + *-------------- + * - Serial port on the back runs at 19200 at issues modem commands when attached to terminal + * - It is possible to attach a BDM emulator and retrieve the ROM through it. + * - It is possible to flash new firmware by adding jumper XP06 (under the modem board) + * - The bootstrap is based on RTXC 3.2g RTOS + * - The bootstrap jumps to firmware from 0xb82 to RAM at 0x800000 + * + * Identified chips/devices + *----------------- + * Motorola 68340 CPU + * Philips SAA7124 Digital Video Encoder + * LSI 53CF54-2 SCSI controller + * Crystal CL4922-CL Mpeg Audio Decoder System + * Rockwell R6653-16 Single Device Data/Fax Modem Data Pump + * Philips 8020401TM100 + * C-cube CL9100 MPEG2 decoder + * Lucent AV6220A MPEG2 demultiplexer w. crypto interface + * CI Common Interface module + * LSI L2A0371 Tuner + * 2 x 29F800-90 (2Mb FLASH) + * 2 x 42260-60 (1Mb DRAM) + * Siemens SDA5708 dot matrix display, SPI like connection + * - http://arduinotehniq.blogspot.se/2015/07/sda5708-display-8-character-7x5-dot.html + * - charset stored at 0x808404 to 0x808780, 7 bytes per character + * + * + * Address Map + * -------------------------------------------------------------------------- + * Address Range Memory Space (physical) Notes + * -------------------------------------------------------------------------- + * 0xffffffff (top of memory) + * 0x00FFF780-0x00FFF7BF DMA offset to SIM40 + * 0x00FFF700-0x00FFF721 Serial devices offset to SIM40 + * 0x00FFF600-0x00FFF67F Timers offset to SIM40 + * 0x00FFF000-0x00FFF07F SIM40 programmed base adress (MCR) + * 0x00700000-0x008fffff RAM + * 0x00000000-0x0001ffff bootstrap + * -------------------------------------------------------------------------- + * + * Init sequence + * ------------- + * MCR : 0x6301 Timer/wd disabled, show cycles, ext arbit, + * user access to SIM40, IARB = 1 + * MBAR : 0x00FFF101 SIM40 base = 0x00fff000 + * VBR : 0x008096F8 VBR - Vector Base Register + * SIM40 + 0x0006: 0xE8 AVR - Auto Vector Register + * SIM40 + 0x0021: 0x0C SWIV_SYPCR + * SIM40 + 0x001F: 0x00 PPARB - Port B pin assignment + * SIM40 + 0x0011: 0xFF PORTA - Port A Data + * SIM40 + 0x0013: 0x16 DDRA - Port A Data direction + * SIM40 + 0x0700: 0x00 Serial port + * SIM40 + 0x071F: 0xFF Serial port + * SIM40 + 0x0004: 0x7F03 SYNCR + * SIM40 + 0x0040: 0x003FFFF5 CS0 mask 1 + * SIM40 + 0x0044: 0x00000003 CS0 base 1 + * SIM40 + 0x0048: 0x003FFFF5 CS1 mask 1 + * SIM40 + 0x004C: 0x00800003 CS1 base 1 + * SIM40 + 0x0050: 0x00007FFF CS2 mask 1 + * SIM40 + 0x0054: 0x00700003 CS2 base 1 + * SIM40 + 0x0058: 0x000007F2 CS3 mask 1 + * SIM40 + 0x005C: 0x00700003 CS3 base 1 + * SIM40 + 0x001F: 0x40 PBARB Port B Pin Assignment + * + * ------------------------------------------------------------- + * The bootstrap copies the firmware to RAM and jumps to it + * ------------------------------------------------------------- + * + * --- PC > 0x700000 so probably init of the RTXC tick timer setup?! + * SIM40 + 0x0022: 0x0140 PICR Periodic Interrupt Control Register + * SIM40 + 0x0024: 0x0029 PICR Periodic Interrupt Timer Register + * + * Serial port setup + * ------------------ + * --- PC < 0x1FFFF so bootstrap code + * SIM40 + 0x0700: 0x00 Serial Module - MCR High Byte + * - The serial module is enabled + * - ignore FREEZE + * - The crystal clock is the clear-to-send input capture clock for both channels + * SIM40 + 0x071F: 0xFF Serial Module - OUTPUT PORT (OP)4 BIT RESET - all cleared + * SIM40 + 0x0700: 0x00 Serial Module - MCR High Byte + * - The serial module is enabled + * - ignore FREEZE + * - The crystal clock is the clear-to-send input capture clock for both channels + * SIM40 + 0x0701: 0x8A Serial Module - MCR Low Byte + * - The serial control regosters are only accessable from supervisor mode + * - IARB = 0x0A - serial module has priority level 10d + * SIM40 + 0x0704: 0x01 Serial Module - ILR Interrupt Level + * SIM40 + 0x0705: 0x44 Serial Module - IVR Interrupt Vector + * SIM40 + 0x0714: 0x80 Serial Module - ACR Auxiliary Control + * - Set 2 of the available baud rates is selected. + * - CTS state change has no effect + * --- setup Channel A + * SIM40 + 0x0712: 0x20 Serial Module - CRA Command Register A + * - Reset the receiver + * SIM40 + 0x0712: 0x30 Serial Module - CRA Command Register A + * - Reset the transmitter + * SIM40 + 0x0710: 0x93 Serial Module - MR1A Mode Register 1A + * - Upon receipt of a valid start bit, RTS≈ is negated if the channel's FIFO is full. + * RTS≈ is reasserted when the FIFO has an empty position available. + * - No Parity + * - Eight bits + * SIM40 + 0x0720: 0x07 Serial Module - MR2A Mode Register 2A + * - No CTS or RTS controll + * - 1 STOP bit + * SIM40 + 0x0711: 0xCC Serial Module - CSRA Clock Select Register A + * - 19200 baud TXc + * - 19200 baud Rxc + * SIM40 + 0x0712: 0x41 Serial Module - CRA Command Register A + * - Reset Error status + * - Enable Receiver + * - Check for charcters in channel A + * SIM40 + 0x0711: btst #0 Serial Module - SRA Status Register A + * --- if there is + * store all characters in buffer at (A6) 0x88FFD0 + * --- setup Channel B (See details as for channel A above) + * SIM40 + 0x071A: 0x20 Serial Module - CRB Command Register B + * SIM40 + 0x071A: 0x30 Serial Module - CRB Command Register B + * SIM40 + 0x0718: 0x93 Serial Module - MR1B Mode Register 1B + * SIM40 + 0x0721: 0x07 Serial Module - MR2B Mode Register 2B + * SIM40 + 0x0719: 0xCC Serial Module - CSRB Clock Select Register B + * SIM40 + 0x071A: 0x41 Serial Module - CRB Command Register B + * - Check for characters in channel B + * SIM40 + 0x0719: btst #0 Serial Module - SRB Status Register B + * --- if there is + * store all characters in buffer at (A6) 0x88FFD0 + * --- + * - Check bit 0 set on Input Port + * SIM40 + 0x071D: btst #0 Input Port - IP + * --- if bit 0 is set + * 0x00801208: 0x80 + * SIM40 + 0x071A: 0x81 Serial Module - CRB Command Register B + * --- + * SIM40 + 0x0720: 0x41 Serial Module - MR2A Mode register 2A + * SIM40 + 0x071D: 0x03 OPCR Output Port Control Register + * SIM40 + 0x0715: 0x03 IER Interrupt Enable Register + * + * Timer setup + * ------------ + * SIM40 + 0x0640: 0x03 MCR Timer 2 + * tbc... + * + * ------------------------------------------------------------- + * The bootstrap copies the firmware to RAM and jumps to it + * ------------------------------------------------------------- + * + * --- PC > 0x700000 so probably init of the RTXC tick timer setup?! + * SIM40 + 0x0022: 0x0140 PICR Periodic Interrupt Control Register + * SIM40 + 0x0024: 0x0029 PICR Periodic Interrupt Timer Register + * + * Serial port setup + * ------------------ + * --- PC < 0x1FFFF so bootstrap code + * SIM40 + 0x0700: 0x00 Serial Module - MCR High Byte + * - The serial module is enabled + * - ignore FREEZE + * - The crystal clock is the clear-to-send input capture clock for both channels + * SIM40 + 0x071F: 0xFF Serial Module - OUTPUT PORT (OP)4 BIT RESET - all cleared + * SIM40 + 0x0700: 0x00 Serial Module - MCR High Byte + * - The serial module is enabled + * - ignore FREEZE + * - The crystal clock is the clear-to-send input capture clock for both channels + * SIM40 + 0x0701: 0x8A Serial Module - MCR Low Byte + * - The serial control regosters are only accessable from supervisor mode + * - IARB = 0x0A - serial module has priority level 10d + * SIM40 + 0x0704: 0x01 Serial Module - ILR Interrupt Level + * SIM40 + 0x0705: 0x44 Serial Module - IVR Interrupt Vector + * SIM40 + 0x0714: 0x80 Serial Module - ACR Auxiliary Control + * - Set 2 of the available baud rates is selected. + * - CTS state change has no effect + * --- setup Channel A + * SIM40 + 0x0712: 0x20 Serial Module - CRA Command Register A + * - Reset the receiver + * SIM40 + 0x0712: 0x30 Serial Module - CRA Command Register A + * - Reset the transmitter + * SIM40 + 0x0710: 0x93 Serial Module - MR1A Mode Register 1A + * - Upon receipt of a valid start bit, RTS≈ is negated if the channel's FIFO is full. + * RTS≈ is reasserted when the FIFO has an empty position available. + * - No Parity + * - Eight bits + * SIM40 + 0x0720: 0x07 Serial Module - MR2A Mode Register 2A + * - No CTS or RTS controll + * - 1 STOP bit + * SIM40 + 0x0711: 0xCC Serial Module - CSRA Clock Select Register A + * - 19200 baud TXc + * - 19200 baud Rxc + * SIM40 + 0x0712: 0x41 Serial Module - CRA Command Register A + * - Reset Error status + * - Enable Receiver + * - Check for charcters in channel A + * SIM40 + 0x0711: btst #0 Serial Module - SRA Status Register A + * --- if there is + * store all characters in buffer at (A6) 0x88FFD0 + * --- setup Channel B (See details as for channel A above) + * SIM40 + 0x071A: 0x20 Serial Module - CRB Command Register B + * SIM40 + 0x071A: 0x30 Serial Module - CRB Command Register B + * SIM40 + 0x0718: 0x93 Serial Module - MR1B Mode Register 1B + * SIM40 + 0x0721: 0x07 Serial Module - MR2B Mode Register 2B + * SIM40 + 0x0719: 0xCC Serial Module - CSRB Clock Select Register B + * SIM40 + 0x071A: 0x41 Serial Module - CRB Command Register B + * - Check for characters in channel B + * SIM40 + 0x0719: btst #0 Serial Module - SRB Status Register B + * --- if there is + * store all characters in buffer at (A6) 0x88FFD0 + * --- + * - Check bit 0 set on Input Port + * SIM40 + 0x071D: btst #0 Input Port - IP + * --- if bit 0 is set + * 0x00801208: 0x80 + * SIM40 + 0x071A: 0x81 Serial Module - CRB Command Register B + * --- + * SIM40 + 0x0720: 0x41 Serial Module - MR2A Mode register 2A + * SIM40 + 0x071D: 0x03 OPCR Output Port Control Register + * SIM40 + 0x0715: 0x03 IER Interrupt Enable Register + * + * Timer setup + * ------------ + * SIM40 + 0x0640: 0x03 MCR Timer 2 + * tbc... + * + * Identified low level drivers in firmware + * ---------------------------------------- + * 800420..80046C : Some PORT A serialisation routine for the + * Siemens SDA5708 dot matrix display + * + * Interrupt sources + * ---------------------------------------------------------- + * Description Device Lvl IRQ + * /Board Vector + * ---------------------------------------------------------- + * On board Sources + * + * Off board Sources (other boards) + * ---------------------------------------------------------- + * + * DMAC Channel Assignments + * ---------------------------------------------------------- + * Channel Device + * ---------------------------------------------------------- + * ---------------------------------------------------------- + * + * TODO: + * - Dump the ROMs + * - Dump/Find bootable software + * - Setup a working address map + * - Fix debug terminal + * - TBC + * + ****************************************************************************/ + +#include "emu.h" +#include "machine/68340.h" + +class dbox_state : public driver_device +{ + public: + dbox_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"){ } + required_device m_maincpu; + + virtual void machine_reset(); + DECLARE_DRIVER_INIT(dbox); +}; + +void dbox_state::machine_reset() +{ +} + + +static ADDRESS_MAP_START( dbox_map, AS_PROGRAM, 32, dbox_state ) + AM_RANGE(0x000000, 0x01ffff) AM_ROM AM_REGION("maincpu", 0) + AM_RANGE(0x700000, 0x8fffff) AM_RAM +ADDRESS_MAP_END + +/* Input ports */ +static INPUT_PORTS_START( dbox ) +INPUT_PORTS_END + +static MACHINE_CONFIG_START( dbox ) + MCFG_CPU_ADD("maincpu", M68340, XTAL_16MHz) + MCFG_CPU_PROGRAM_MAP(dbox_map) +MACHINE_CONFIG_END + +DRIVER_INIT_MEMBER(dbox_state, dbox) +{ +} + +ROM_START( dbox ) + ROM_REGION(0x1000000, "maincpu", 0) +// ROM_LOAD16_WORD( "dvb2000.bin", 0x000000, 0x8b742, CRC(5b21c455) SHA1(1e7654c37dfa65d1b8ac2469cdda82f91b47b3c7) ) + ROM_LOAD16_WORD( "nokboot.bin", 0x000000, 0x20000, CRC(0ff53e1f) SHA1(52002ee22c032775dac383d408c44abe9244724f) ) +ROM_END + +COMP( 1996, dbox, 0, 0, dbox, dbox, dbox_state, dbox, "Nokia Multimedia", "D-box 1, Kirsch gruppe", MACHINE_IS_SKELETON ) diff --git a/src/mame/mame.lst b/src/mame/mame.lst index bcdc1862a09..59300051a26 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -10691,6 +10691,9 @@ dblcrown // (c) 1994 Excellent System @source:dblewing.cpp dblewing // MBE (c) 1993 Mitchell +@source:dbox.cpp +dbox // (c) 1996 Nokia Multimedia + @source:dbz.cpp dbz // (c) 1993 Banpresto dbz2 // (c) 1994 Banpresto -- cgit v1.2.3 From 116dfb9b356096fba84ce7ec0b91f36c87965366 Mon Sep 17 00:00:00 2001 From: Joakim Larsson Edstrom Date: Wed, 31 May 2017 17:32:47 +0200 Subject: dbox: separated skeleton driver from unfinished display device --- src/devices/video/sda5708.cpp | 453 ------------------------------------------ src/devices/video/sda5708.h | 67 ------- src/mame/drivers/dbox.cpp | 2 +- 3 files changed, 1 insertion(+), 521 deletions(-) delete mode 100644 src/devices/video/sda5708.cpp delete mode 100644 src/devices/video/sda5708.h diff --git a/src/devices/video/sda5708.cpp b/src/devices/video/sda5708.cpp deleted file mode 100644 index 79f98a82000..00000000000 --- a/src/devices/video/sda5708.cpp +++ /dev/null @@ -1,453 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Joakim Larsson Edstrom -/********************************************************************** - - Siemens SDA5708 8 character 7x5 dot matrix LED display - -**********************************************************************/ - -#include "sda5708.h" - -/* Misc info - * --------- - * http://www.sbprojects.com/knowledge/footprints/sda5708/index.php - * http://arduinotehniq.blogspot.se/2015/07/sda5708-display-8-character-7x5-dot.html - * - * Display front - LEDs - * -------------------- - * xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx - * xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx - * xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx - * xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx - * xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx - * xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx - * xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx - * Dig0 Dig1 Dig2 Dig3 Dig4 Dig5 Dig6 Dig7 - * - * Display rear - Pinout - * --------------------- - * +--------------------------------------------------------+ - * | O O | - * | +----------------------------------------------+ | - * | | o o o o o o | | - * | | Pin:6 5 4 3 2 1 | | - * | | | | - * | +----------------------------------------------+ | - * +--------------------------------------------------------+ - * 6:GND 5:_RESET 4:SDCLK 3:Data 2:_Load 1:Vcc - * - */ -//************************************************************************** -// MACROS / CONSTANTS -//************************************************************************** - -#define LOG 0 - -#define SDA5708_REG_MASK 0xE0 - -#define SDA5708_CNTR_COMMAND 0xE0 -#define SDA5708_CNTR_BRIGHT_MASK 0x1F -#define SDA5708_CNTR_BRIGHT_100 0x00 -#define SDA5708_CNTR_BRIGHT_53 0x01 -#define SDA5708_CNTR_BRIGHT_40 0x02 -#define SDA5708_CNTR_BRIGHT_27 0x03 -#define SDA5708_CNTR_BRIGHT_20 0x04 -#define SDA5708_CNTR_BRIGHT_13 0x05 -#define SDA5708_CNTR_BRIGHT_6_6 0x06 -#define SDA5708_CNTR_BRIGHT_0 0x07 -#define SDA5708_CNTR_PKCUR_12_5 0x08 - -#define SDA5708_CLEAR_COMMAND 0xC0 - -#define SDA5708_ADDR_COMMAND 0xA0 -#define SDA5708_ADDR_LED_MASK 0x07 -#define SDA5708_ADDR_LED0 0x00 -#define SDA5708_ADDR_LED1 0x01 -#define SDA5708_ADDR_LED2 0x02 -#define SDA5708_ADDR_LED3 0x03 -#define SDA5708_ADDR_LED4 0x04 -#define SDA5708_ADDR_LED5 0x05 -#define SDA5708_ADDR_LED6 0x06 -#define SDA5708_ADDR_LED7 0x07 - -#define SDA5708_DATA_COMMAND 0x00 - -//************************************************************************** -// DEVICE DEFINITIONS -//************************************************************************** - -// device type definition -const device_type SDA5708 = &device_creator; - -#if 0 -// I/O map -DEVICE_ADDRESS_MAP_START( map, 8, sda5708_device ) - AM_RANGE(0x00, 0x00) AM_READWRITE(dr_r, dr_w) - AM_RANGE(0x01, 0x01) AM_READWRITE(ir_r, ir_w) -ADDRESS_MAP_END - -// default address map -static ADDRESS_MAP_START( sda5708, AS_0, 8, sda5708_device ) - AM_RANGE(0x00000, 0xfffff) AM_RAM -ADDRESS_MAP_END -#endif - - -//************************************************************************** -// LIVE DEVICE -//************************************************************************** - -//------------------------------------------------- -// sda5708_device - constructor -//------------------------------------------------- - -sda5708_device::sda5708_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : - device_t(mconfig, SDA5708, "SDA5708", tag, owner, clock, "sda5708", __FILE__), - device_memory_interface(mconfig, *this), - device_video_interface(mconfig, *this), - m_space_config("videoram", ENDIANNESS_LITTLE, 8, 20, 0, NULL, *ADDRESS_MAP_NAME(sda5708)), - m_cursor(0) -{ -} - - -//------------------------------------------------- -// device_start - device-specific startup -//------------------------------------------------- - -void sda5708_device::device_start() -{ - // register for state saving - save_item(NAME(m_frame)); -} - - -//------------------------------------------------- -// device_reset - device-specific reset -//------------------------------------------------- - -void sda5708_device::device_reset() -{ - m_frame = 0; -} - - -//------------------------------------------------- -// memory_space_config - return a description of -// any address spaces owned by this device -//------------------------------------------------- - -const address_space_config *sda5708_device::memory_space_config(address_spacenum spacenum) const -{ - return (spacenum == AS_0) ? &m_space_config : NULL; -} - - -//------------------------------------------------- -// ir_r - -//------------------------------------------------- - -READ8_MEMBER( sda5708_device::ir_r ) -{ - return m_ir; -} - - -//------------------------------------------------- -// ir_w - -//------------------------------------------------- - -WRITE8_MEMBER( sda5708_device::ir_w ) -{ - m_ir = data & 0x0f; -} - - -//------------------------------------------------- -// dr_r - -//------------------------------------------------- - -READ8_MEMBER( sda5708_device::dr_r ) -{ - UINT8 data = 0; - - switch (m_ir) - { - case REGISTER_MOR: - break; // write-only - - case REGISTER_PR: - data = m_pr; - break; - - case REGISTER_HNR: - data = m_hnr; - break; - - case REGISTER_DVR: - break; // write-only - - case REGISTER_CPR: - data = m_cpr; - break; - - case REGISTER_SLR: - data = m_slr; - break; - - case REGISTER_SUR: - data = m_sur; - break; - - case REGISTER_CLR: - data = m_clr; - break; - - case REGISTER_CUR: - data = m_cur; - break; - } - - return data; -} - - -//------------------------------------------------- -// dr_w - -//------------------------------------------------- - -WRITE8_MEMBER( sda5708_device::dr_w ) -{ - switch (m_ir) - { - case REGISTER_MOR: - m_mor = data & 0x7f; - break; - - case REGISTER_PR: - m_pr = data & 0xf7; - break; - - case REGISTER_HNR: - m_hnr = data & 0x7f; - break; - - case REGISTER_DVR: - m_dvr = data; - break; - - case REGISTER_CPR: - m_cpr = data; - break; - - case REGISTER_SLR: - m_slr = data; - break; - - case REGISTER_SUR: - m_sur = data; - break; - - case REGISTER_CLR: - m_clr = data; - break; - - case REGISTER_CUR: - m_cur = data; - break; - } -} - - -//------------------------------------------------- -// read_byte - -//------------------------------------------------- - -UINT8 sda5708_device::read_byte(UINT16 ma, UINT8 ra) -{ - offs_t offset; - - if (m_mor & MOR_GRAPHICS) - { - offset = ma; - } - else - { - offset = ((offs_t)ma << 4) | ra; - } - - return space().read_byte(offset); -} - - -//------------------------------------------------- -// update_cursor - -//------------------------------------------------- - -void sda5708_device::update_cursor() -{ - if (m_mor & MOR_CURSOR_ON) - { - if (m_mor & MOR_CURSOR_BLINK) - { - if (m_mor & MOR_BLINK_TIME_16) - { - if (m_frame == 16) - { - m_cursor = !m_cursor; - m_frame = 0; - } - else - { - m_frame++; - } - } - else - { - if (m_frame == 32) - { - m_cursor = !m_cursor; - m_frame = 0; - } - else - { - m_frame++; - } - } - } - else - { - m_cursor = 1; - } - } - else - { - m_cursor = 0; - } -} - - -//------------------------------------------------- -// draw_scanline - -//------------------------------------------------- - -void sda5708_device::draw_scanline(bitmap_ind16 &bitmap, const rectangle &cliprect, int y, UINT16 ma, UINT8 ra) -{ - UINT8 hp = (m_pr & PR_HP_MASK) + 1; - UINT8 hn = (m_hnr & HNR_HN_MASK) + 1; - UINT8 cpu = m_cpr & CPR_CPU_MASK; - UINT8 cpd = m_cpr & CPR_CPD_MASK; - UINT16 car = (m_cur << 8) | m_clr; - - int sx, x; - - for (sx = 0; sx < hn; sx++) - { - UINT8 data = read_byte(ma, ra); - - if (m_cursor) - { - if (ma == car) - { - if (ra >= cpu && ra <= cpd) - { - data ^= 0xff; - } - } - } - - for (x = 0; x < hp; x++) - { - bitmap.pix16(y, (sx * hp) + x) = BIT(data, 7); - - data <<= 1; - } - - ma++; - } -} - - -//------------------------------------------------- -// update_graphics - -//------------------------------------------------- - -void sda5708_device::update_graphics(bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - UINT8 hn = (m_hnr & HNR_HN_MASK) + 1; - UINT8 nx = (m_dvr & DVR_DN_MASK) + 1; - UINT16 sar = (m_sur << 8) | m_slr; - - int y; - - m_cursor = 0; - m_frame = 0; - - for (y = 0; y < nx; y++) - { - // draw upper half scanline - UINT16 ma = sar + (y * hn); - draw_scanline(bitmap, cliprect, y, ma); - - // draw lower half scanline - ma = sar + ((y + nx) * hn); - draw_scanline(bitmap, cliprect, y + nx, ma); - } -} - - -//------------------------------------------------- -// update_text - -//------------------------------------------------- - -void sda5708_device::update_text(bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - UINT8 hn = (m_hnr & HNR_HN_MASK) + 1; - UINT8 vp = (m_pr & PR_VP_MASK) + 1; - UINT8 nx = (m_dvr & DVR_DN_MASK) + 1; - UINT16 sar = (m_sur << 8) | m_slr; - - int sy, y; - - update_cursor(); - - for (sy = 0; sy < nx; sy++) - { - for (y = 0; y < vp; y++) - { - // draw upper half scanline - UINT16 ma = sar + ((sy * vp) + y) * hn; - draw_scanline(bitmap, cliprect, (sy * vp) + y, ma, y); - - // draw lower half scanline - ma = sar + (((sy + nx) * vp) + y) * hn; - draw_scanline(bitmap, cliprect, (sy * vp) + y, ma, y); - } - } -} - - -//------------------------------------------------- -// update_screen - update screen -//------------------------------------------------- - -UINT32 sda5708_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - if (m_mor & MOR_DISPLAY_ON) - { - if (m_mor & MOR_GRAPHICS) - { - update_graphics(bitmap, cliprect); - } - else - { - update_text(bitmap, cliprect); - } - } - else - { - bitmap.fill(0, cliprect); - } - - return 0; -} diff --git a/src/devices/video/sda5708.h b/src/devices/video/sda5708.h deleted file mode 100644 index 2f2f5a99106..00000000000 --- a/src/devices/video/sda5708.h +++ /dev/null @@ -1,67 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Joakim Larsson Edstrom -/********************************************************************** - - Siemens SDA5708 8 character 7x5 dot matrix LED display - -**********************************************************************/ - -#pragma once - -#ifndef __SDA5708__ -#define __SDA5708__ - -#include "emu.h" - - - -///************************************************************************* -// TYPE DEFINITIONS -///************************************************************************* - -// ======================> sda5708_device - -class sda5708_device : public device_t, - public device_memory_interface, - public device_video_interface -{ -public: - // construction/destruction - sda5708_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - - virtual DECLARE_ADDRESS_MAP(map, 8); - - DECLARE_READ8_MEMBER( ir_r ); - DECLARE_WRITE8_MEMBER( ir_w ); - - DECLARE_READ8_MEMBER( dr_r ); - DECLARE_WRITE8_MEMBER( dr_w ); - - UINT32 screen_update(screen_device &device, bitmap_ind16 &bitmap, const rectangle &cliprect); - -protected: - // device-level overrides - virtual void device_start(); - virtual void device_reset(); - - // device_memory_interface overrides - virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const; - -private: - void update_cursor(); - void draw_scanline(bitmap_ind16 &bitmap, const rectangle &cliprect, int y, UINT16 ma, UINT8 ra = 0); - void update_graphics(bitmap_ind16 &bitmap, const rectangle &cliprect); - void update_text(bitmap_ind16 &bitmap, const rectangle &cliprect); - - const address_space_config m_space_config; - - int m_frame; // frame counter -}; - - -// device type definition -extern const device_type SDA5708; - - - -#endif diff --git a/src/mame/drivers/dbox.cpp b/src/mame/drivers/dbox.cpp index 779cc9d952b..bb686cfb251 100644 --- a/src/mame/drivers/dbox.cpp +++ b/src/mame/drivers/dbox.cpp @@ -311,7 +311,7 @@ class dbox_state : public driver_device m_maincpu(*this, "maincpu"){ } required_device m_maincpu; - virtual void machine_reset(); + virtual void machine_reset() override; DECLARE_DRIVER_INIT(dbox); }; -- cgit v1.2.3