Added placeholder TGPx4 CPU core for Model 2C, nw

This commit is contained in:
Angelo Salese 2014-06-05 15:25:55 +00:00
parent e9b70d0e93
commit 31bc08932e
10 changed files with 387 additions and 5 deletions

3
.gitattributes vendored
View File

@ -1918,6 +1918,9 @@ src/emu/cpu/m6809/m6809make.py svneol=native#text/plain
src/emu/cpu/mb86233/mb86233.c svneol=native#text/plain
src/emu/cpu/mb86233/mb86233.h svneol=native#text/plain
src/emu/cpu/mb86233/mb86233d.c svneol=native#text/plain
src/emu/cpu/mb86235/mb86235.c -text svneol=native#test/plain
src/emu/cpu/mb86235/mb86235.h -text svneol=native#test/plain
src/emu/cpu/mb86235/mb86235d.c -text svneol=native#test/plain
src/emu/cpu/mb88xx/mb88dasm.c svneol=native#text/plain
src/emu/cpu/mb88xx/mb88xx.c svneol=native#text/plain
src/emu/cpu/mb88xx/mb88xx.h svneol=native#text/plain

View File

@ -1085,6 +1085,19 @@ endif
$(CPUOBJ)/mb86233/mb86233.o: $(CPUSRC)/mb86233/mb86233.c \
$(CPUSRC)/mb86233/mb86233.h
#-------------------------------------------------
# Fujitsu MB86235
#@src/emu/cpu/mb86233/mb86235.h,CPUS += MB86235
#-------------------------------------------------
ifneq ($(filter MB86235,$(CPUS)),)
OBJDIRS += $(CPUOBJ)/mb86235
CPUOBJS += $(CPUOBJ)/mb86235/mb86235.o
DASMOBJS += $(CPUOBJ)/mb86235/mb86235d.o
endif
$(CPUOBJ)/mb86233/mb86235.o: $(CPUSRC)/mb86233/mb86235.c \
$(CPUSRC)/mb86235/mb86235.h
#-------------------------------------------------

View File

@ -0,0 +1,130 @@
// license: ?
// copyright-holders: Angelo Salese, ElSemi
/*****************************************************************************
*
* MB86235 "TGPx4" (c) Fujitsu
*
* Written by Angelo Salese & ElSemi
*
* TODO:
* - Everything!
*
*****************************************************************************/
#include "emu.h"
#include "debugger.h"
#include "mb86235.h"
const device_type MB86235 = &device_creator<mb86235_cpu_device>;
#define mb86235_readop(A) m_program->read_dword(A)
#define mb86235_readmem(A) m_program->read_dword(A)
#define mb86235_writemem(A,B) m_program->write_dword((A),B)
/***********************************
* illegal opcodes
***********************************/
void mb86235_cpu_device::mb86235_illegal()
{
//logerror("mb86235 illegal opcode at 0x%04x\n", m_pc);
m_icount -= 1;
}
/* Execute cycles */
void mb86235_cpu_device::execute_run()
{
UINT32 opcode;
do
{
debugger_instruction_hook(this, m_pc);
opcode = mb86235_readop(m_pc);
//m_pc++;
switch( opcode )
{
default:
mb86235_illegal();
break;
}
} while( m_icount > 0 );
}
void mb86235_cpu_device::device_start()
{
m_program = &space(AS_PROGRAM);
save_item(NAME(m_pc));
save_item(NAME(m_flags));
// Register state for debugger
//state_add( CP1610_R0, "PC", m_pc ).formatstr("%02X");
state_add( STATE_GENPC, "curpc", m_pc ).noshow();
state_add( STATE_GENFLAGS, "GENFLAGS", m_flags ).noshow();
m_icountptr = &m_icount;
}
void mb86235_cpu_device::device_reset()
{
}
#if 0
void mb86235_cpu_device::execute_set_input(int irqline, int state)
{
switch(irqline)
{
case MB86235_INT_INTRM:
m_intrm_pending = (state == ASSERT_LINE);
m_intrm_state = state;
break;
case MB86235_RESET:
if (state == ASSERT_LINE)
m_reset_pending = 1;
m_reset_state = state;
break;
case MB86235_INT_INTR:
if (state == ASSERT_LINE)
m_intr_pending = 1;
m_intr_state = state;
break;
}
}
#endif
mb86235_cpu_device::mb86235_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: cpu_device(mconfig, MB86235, "MB86235", tag, owner, clock, "mb86235", __FILE__)
, m_program_config("program", ENDIANNESS_LITTLE, 32, 32, -2)
{
}
void mb86235_cpu_device::state_string_export(const device_state_entry &entry, astring &string)
{
switch (entry.index())
{
case STATE_GENFLAGS:
string.printf("%c%c%c%c",
m_flags & 0x80 ? 'S':'.',
m_flags & 0x40 ? 'Z':'.',
m_flags & 0x20 ? 'V':'.',
m_flags & 0x10 ? 'C':'.');
break;
}
}
offs_t mb86235_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options)
{
extern CPU_DISASSEMBLE( mb86235 );
return CPU_DISASSEMBLE_NAME(mb86235)(this, buffer, pc, oprom, opram, options);
}

View File

@ -0,0 +1,70 @@
// license: ?
// copyright-holders: Angelo Salese
/*****************************************************************************
*
* template for CPU cores
*
*****************************************************************************/
#pragma once
#ifndef __MB86235_H__
#define __MB86235_H__
enum
{
#if 0
MB86235_R0=1, MB86235_R1, MB86235_R2, MB86235_R3,
MB86235_R4, MB86235_R5, MB86235_R6, MB86235_R7
#endif
};
class mb86235_cpu_device : public cpu_device
{
public:
// construction/destruction
mb86235_cpu_device(const machine_config &mconfig, const char *_tag, device_t *_owner, UINT32 _clock);
protected:
// device-level overrides
virtual void device_start();
virtual void device_reset();
// device_execute_interface overrides
virtual UINT32 execute_min_cycles() const { return 1; }
virtual UINT32 execute_max_cycles() const { return 7; }
virtual UINT32 execute_input_lines() const { return 0; }
virtual void execute_run();
//virtual void execute_set_input(int inputnum, int state);
// device_memory_interface overrides
virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const { return (spacenum == AS_PROGRAM) ? &m_program_config : NULL; }
// device_state_interface overrides
void state_string_export(const device_state_entry &entry, astring &string);
// device_disasm_interface overrides
virtual UINT32 disasm_min_opcode_bytes() const { return 8; }
virtual UINT32 disasm_max_opcode_bytes() const { return 8; }
virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options);
private:
address_space_config m_program_config;
UINT8 m_pc; /* registers */
UINT8 m_flags; /* flags */
address_space *m_program;
int m_icount;
void mb86235_illegal();
};
extern const device_type MB86235;
CPU_DISASSEMBLE( mb86235 );
#endif /* __MB86235_H__ */

View File

@ -0,0 +1,142 @@
#include "emu.h"
#include "debugger.h"
#include "mb86235.h"
static const char *const alu_opcode_string[] =
{
"FADD",
"FADDZ",
"FSUB",
"FSUBZ",
"FCMP",
"FABS",
"FABC",
"ALUNOP",
"FEA",
"FES",
"FRCP",
"FRSQ",
"FLOG",
"CIF",
"CFI",
"CFIB",
"ADD",
"ADDZ",
"SUB",
"SUBZ",
"CMP",
"ABS",
"ATR",
"ATRZ",
"AND",
"OR",
"XOR",
"NOT",
"LSR",
"LSL",
"ASR",
"ASL"
};
static const char *const ctrl_opcode_string[] =
{
"NOP",
"REP",
"SETL",
"CLRF",
"PUSH",
"POP",
"???",
"???",
"SETM",
"SETMCBSA",
"SETMCBSB",
"SETMRF",
"SETMRDY",
"SETMWAIT",
"???",
"???",
"DBcc", /* TODO */
"DBNcc", /* TODO */
"DJMP",
"DBLP",
"DBBC",
"DBBS",
"???",
"???",
"DCcc", /* TODO */
"DCNcc", /* TODO */
"DCALL",
"DRET",
"???",
"???",
"???",
"???"
};
static unsigned dasm_mb86235(char *buffer, UINT32 opcode, UINT32 opcode2)
{
char *p = buffer;
UINT32 grp = ( opcode2 >> 29 ) & 0x7;
UINT32 aluop = (opcode2 >> (24)) & 0x1f;
switch(grp)
{
case 0: // ALU2
p += sprintf(p,"%s TRANS2_1",alu_opcode_string[aluop]);
break;
case 1: // ALU2
p += sprintf(p,"%s TRANS1_1",alu_opcode_string[aluop]);
break;
case 2: // ALU2 + CTRL
{
UINT32 ctrlop = (opcode >> (22)) & 0x1f;
//UINT32 ef1 = (opcode >> 16) & 0x3f;
//UINT32 ef2 = (opcode >> 0) & 0xffff;
p += sprintf(p,"%s %s",alu_opcode_string[aluop],ctrl_opcode_string[ctrlop]);
}
break;
case 4: // ALU1
p += sprintf(p,"%s TRANS2_2",alu_opcode_string[aluop]);
break;
case 5: // ALU1
p += sprintf(p,"%s TRANS1_2",alu_opcode_string[aluop]);
break;
case 6: // ALU1
{
UINT32 ctrlop = (opcode >> (22)) & 0x1f;
//UINT32 ef1 = (opcode >> 16) & 0x3f;
//UINT32 ef2 = (opcode >> 0) & 0xffff;
p += sprintf(p,"%s %s",alu_opcode_string[aluop],ctrl_opcode_string[ctrlop]);
break;
}
case 7:
p += sprintf(p,"TRANS1_3");
break;
default:
p += sprintf(p,"UNK ???");
break;
}
return (2 | DASMFLAG_SUPPORTED);
}
CPU_DISASSEMBLE( mb86235 )
{
UINT32 op = *(UINT32 *)oprom;
UINT32 op2 = *(UINT32 *)(oprom + 4);
op = LITTLE_ENDIANIZE_INT32(op);
op2 = LITTLE_ENDIANIZE_INT32(op2);
return dasm_mb86235(buffer, op, op2);
}

View File

@ -119,6 +119,7 @@
#include "cpu/m68000/m68000.h"
#include "cpu/sharc/sharc.h"
#include "cpu/mb86233/mb86233.h"
#include "cpu/mb86235/mb86235.h"
#include "cpu/z80/z80.h"
#include "sound/2612intf.h"
#include "includes/model2.h"
@ -459,6 +460,8 @@ MACHINE_RESET_MEMBER(model2_state,model2c)
MACHINE_RESET_CALL_MEMBER(model2_common);
MACHINE_RESET_CALL_MEMBER(model2_scsp);
m_tgpx4->set_input_line(INPUT_LINE_HALT, ASSERT_LINE);
m_dsp_type = DSP_TYPE_TGPX4;
}
@ -684,11 +687,13 @@ READ32_MEMBER(model2_state::copro_prg_r)
return 0xffffffff;
}
WRITE32_MEMBER(model2_state::copro_prg_w)
{
if (m_coproctl & 0x80000000)
{
logerror("copro_prg_w: %08X: %08X\n", m_coprocnt, data);
m_tgpx4_program[m_coprocnt] = data;
m_coprocnt++;
}
else
@ -715,12 +720,17 @@ WRITE32_MEMBER(model2_state::copro_ctl1_w)
else
{
logerror("Boot copro, %d dwords\n", m_coprocnt);
if (m_dsp_type != DSP_TYPE_TGPX4)
switch(m_dsp_type)
{
if (m_dsp_type == DSP_TYPE_SHARC)
m_dsp->set_input_line(INPUT_LINE_HALT, CLEAR_LINE);
else
case DSP_TYPE_TGP:
m_tgp->set_input_line(INPUT_LINE_HALT, CLEAR_LINE);
break;
case DSP_TYPE_SHARC:
m_dsp->set_input_line(INPUT_LINE_HALT, CLEAR_LINE);
break;
case DSP_TYPE_TGPX4:
m_tgpx4->set_input_line(INPUT_LINE_HALT, CLEAR_LINE);
break;
}
}
}
@ -2625,12 +2635,19 @@ static MACHINE_CONFIG_START( model2b, model2_state )
MCFG_SOUND_ROUTE(0, "rspeaker", 2.0)
MACHINE_CONFIG_END
static ADDRESS_MAP_START( copro_tgpx4_map, AS_PROGRAM, 32, model2_state )
AM_RANGE(0x00000000, 0x00007fff) AM_RAM AM_SHARE("tgpx4_program")
ADDRESS_MAP_END
/* 2C-CRX */
static MACHINE_CONFIG_START( model2c, model2_state )
MCFG_CPU_ADD("maincpu", I960, 25000000)
MCFG_CPU_PROGRAM_MAP(model2c_crx_mem)
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", model2_state, model2c_interrupt, "screen", 0, 1)
MCFG_CPU_ADD("tgpx4", MB86235, 40000000)
MCFG_CPU_PROGRAM_MAP(copro_tgpx4_map)
MCFG_CPU_ADD("audiocpu", M68000, 12000000)
MCFG_CPU_PROGRAM_MAP(model2_snd)

View File

@ -7,7 +7,7 @@ driver by Ernesto Corvi
Notes:
- Sprite colors are wrong (missing colortable?)
- driver should probably be merged with suprridr.c
- driver should probably be merged with suprridr.c and thepit.c
***************************************************************************/

View File

@ -22,12 +22,14 @@ public:
m_lumaram(*this, "lumaram"),
m_soundram(*this, "soundram"),
m_tgp_program(*this, "tgp_program"),
m_tgpx4_program(*this, "tgpx4_program"),
m_maincpu(*this,"maincpu"),
m_dsbz80(*this, DSBZ80_TAG),
m_m1audio(*this, "m1audio"),
m_audiocpu(*this, "audiocpu"),
m_tgp(*this, "tgp"),
m_dsp(*this, "dsp"),
m_tgpx4(*this, "tgpx4"),
m_drivecpu(*this, "drivecpu"),
m_eeprom(*this, "eeprom"),
m_screen(*this, "screen"),
@ -43,6 +45,7 @@ public:
required_shared_ptr<UINT32> m_lumaram;
optional_shared_ptr<UINT16> m_soundram;
optional_shared_ptr<UINT32> m_tgp_program;
optional_shared_ptr<UINT32> m_tgpx4_program;
required_device<i960_cpu_device> m_maincpu;
optional_device<dsbz80_device> m_dsbz80; // Z80-based MPEG Digital Sound Board
@ -50,6 +53,7 @@ public:
optional_device<cpu_device> m_audiocpu;
optional_device<cpu_device> m_tgp;
optional_device<cpu_device> m_dsp;
optional_device<cpu_device> m_tgpx4;
optional_device<cpu_device> m_drivecpu;
required_device<eeprom_serial_93cxx_device> m_eeprom;
required_device<screen_device> m_screen;

View File

@ -31627,3 +31627,5 @@ fireball
amusco // 1987, Amusco.
cocoloco // 198?, Petaco S.A.
crazybon

View File

@ -112,6 +112,7 @@ CPUS += TLCS90
CPUS += TLCS900
CPUS += MB88XX
CPUS += MB86233
CPUS += MB86235
CPUS += SSP1601
CPUS += APEXC
CPUS += CP1610