sm500 file placeholders

This commit is contained in:
hap 2016-04-05 11:32:35 +02:00
parent 2becb82ad1
commit 10cadefbe2
7 changed files with 139 additions and 33 deletions

View File

@ -1716,6 +1716,11 @@ if (CPUS["SM510"]~=null) then
MAME_DIR .. "src/devices/cpu/sm510/sm510op.cpp",
MAME_DIR .. "src/devices/cpu/sm510/sm510core.cpp",
MAME_DIR .. "src/devices/cpu/sm510/sm511core.cpp",
MAME_DIR .. "src/devices/cpu/sm510/sm500.cpp",
MAME_DIR .. "src/devices/cpu/sm510/sm500.h",
MAME_DIR .. "src/devices/cpu/sm510/sm500op.cpp",
MAME_DIR .. "src/devices/cpu/sm510/sm500core.cpp",
MAME_DIR .. "src/devices/cpu/sm510/kb1013vk1-2core.cpp",
}
end

View File

@ -0,0 +1,11 @@
// license:BSD-3-Clause
// copyright-holders:hap, Igor
/*
KB1013VK1-2 MCU core implementation
*/
#include "sm500.h"
#include "debugger.h"

View File

@ -0,0 +1,8 @@
// license:BSD-3-Clause
// copyright-holders:hap, Igor
/*
*/
#include "sm500.h"
#include "debugger.h"

View File

@ -0,0 +1,60 @@
// license:BSD-3-Clause
// copyright-holders:hap, Igor
/*
Sharp SM500 MCU family cores
*/
#ifndef _SM500_H_
#define _SM500_H_
#include "sm510.h"
// I/O ports setup
// ..
// pinout reference
/*
O33 O43 O12 O22 O32 GND O42 O11 O21 O31 O41 OS1
36 35 34 33 32 31 30 29 28 27 26 25
________________________________________________
| |
O23 37 | | 24 OS2
O13 38 | | 23 OS3
O44 39 | | 22 OS4
O34 40 | | 21 H1
O24 41 | | 20 H2
O14 42 | SM500 | 19 VM
O45 43 | | 18 OSCin
O35 44 | | 17 OSCout
O25 45 | | 16 VDD
O15 46 | | 15 K4
O46 47 | | 14 K3
O36 48 | * | 13 K2
|________________________________________________/
1 2 3 4 5 6 7 8 9 10 11 12
O26 O16 R4 R3 R2 R1 GND _T bt al ACL K1 note: bt = beta symbol, al = alpha symbol
*/
class sm500_device : public sm510_base_device
{
public:
sm500_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
protected:
virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override;
};
extern const device_type SM500;
#endif /* _SM500_H_ */

View File

@ -0,0 +1,38 @@
// license:BSD-3-Clause
// copyright-holders:hap, Igor
/*
Sharp SM500 MCU core implementation
*/
#include "sm500.h"
#include "debugger.h"
// MCU types
const device_type SM500 = &device_creator<sm500_device>;
// internal memory maps
static ADDRESS_MAP_START(program_2_7k, AS_PROGRAM, 8, sm510_base_device)
AM_RANGE(0x0000, 0x00ff) AM_ROM
ADDRESS_MAP_END
static ADDRESS_MAP_START(data_96_32x4, AS_DATA, 8, sm510_base_device)
AM_RANGE(0x00, 0x1f) AM_RAM
ADDRESS_MAP_END
// device definitions
sm500_device::sm500_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: sm510_base_device(mconfig, SM500, "SM500", tag, owner, clock, 2 /* stack levels */, 12 /* prg width */, ADDRESS_MAP_NAME(program_2_7k), 7 /* data width */, ADDRESS_MAP_NAME(data_96_32x4), "sm500", __FILE__)
{ }
// disasm
offs_t sm500_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options)
{
extern CPU_DISASSEMBLE(sm510);
return CPU_DISASSEMBLE_NAME(sm510)(this, buffer, pc, oprom, opram, options);
}

View File

@ -0,0 +1,6 @@
// license:BSD-3-Clause
// copyright-holders:hap, Igor
// SM500 opcode handlers
#include "sm500.h"

View File

@ -2,17 +2,24 @@
// copyright-holders:hap
/*
Sharp SM510 MCU family - known chips:
Known chips: (* means not emulated yet)
Sharp SM510 MCU family:
- SM510: 2.7Kx8 ROM, 128x4 RAM(32x4 for LCD)
- SM511: 4Kx8 ROM, 128x4 RAM(32x4 for LCD), melody controller
- SM512: 4Kx8 ROM, 128x4 RAM(48x4 for LCD), melody controller
- *KB1013VK4-2: Soviet-era clone of SM510, minor differences
Other chips that may be in the same family, investigate more when one of
them needs to get emulated: SM500, SM530/31, SM4A, SM3903, ..
Sharp SM500 MCU family:
- *SM500: x
- *SM530: x
- *SM531: x
- *KB1013VK1-2: Soviet-era clone of SM500, minor differences
References:
- 1990 Sharp Microcomputers Data Book
- 1996 Sharp Microcomputer Databook
- KB1013VK1-2/KB1013VK4-2 manual
TODO:
- proper support for LFSR program counter in debugger
@ -59,35 +66,6 @@ void sm510_base_device::device_start()
m_write_segbs.resolve_safe();
m_write_segc.resolve_safe();
// zerofill
memset(m_stack, 0, sizeof(m_stack));
m_pc = 0;
m_prev_pc = 0;
m_op = 0;
m_prev_op = 0;
m_param = 0;
m_acc = 0;
m_bl = 0;
m_bm = 0;
m_c = 0;
m_skip = false;
m_w = 0;
m_r = 0;
m_div = 0;
m_1s = false;
m_k_active = false;
m_l = 0;
m_x = 0;
m_y = 0;
m_bp = false;
m_bc = false;
m_halt = false;
m_melody_rd = 0;
m_melody_step_count = 0;
m_melody_duty_count = 0;
m_melody_duty_index = 0;
m_melody_address = 0;
// register for savestates
save_item(NAME(m_stack));
save_item(NAME(m_pc));