g65816: add preliminary w65c802 (nw)

This commit is contained in:
hap 2020-06-02 18:32:25 +02:00
parent 1db9218eff
commit a4d6f210ae
5 changed files with 37 additions and 17 deletions

View File

@ -88,6 +88,10 @@ TODO general:
- Add 1 cycle in Emulation mode (E=1) for (dir),y; abs,x; and abs,y
addressing modes.
- Rename g65* to w65*? (including filenames)
- Any difference between W65C8* and G65SC8*?
*/
/* ======================================================================== */
/* ================================= DATA ================================= */
@ -97,27 +101,34 @@ TODO general:
#include "g65816.h"
DEFINE_DEVICE_TYPE(G65816, g65816_device, "g65c816", "Western Design Center G65C816")
DEFINE_DEVICE_TYPE(G65816, g65816_device, "w65c816", "WDC W65C816")
DEFINE_DEVICE_TYPE(G65802, g65802_device, "w65c802", "WDC W65C802")
DEFINE_DEVICE_TYPE(_5A22, _5a22_device, "5a22", "Ricoh 5A22")
enum
{
CPU_TYPE_G65816 = 0,
CPU_TYPE_5A22 = 1
CPU_TYPE_W65C816 = 0,
CPU_TYPE_W65C802 = 1,
CPU_TYPE_5A22 = 2
};
g65816_device::g65816_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: g65816_device(mconfig, G65816, tag, owner, clock, CPU_TYPE_G65816, address_map_constructor())
: g65816_device(mconfig, G65816, tag, owner, clock, CPU_TYPE_W65C816, address_map_constructor())
{
}
g65802_device::g65802_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: g65816_device(mconfig, G65802, tag, owner, clock, CPU_TYPE_W65C802, address_map_constructor())
{
}
g65816_device::g65816_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, int cpu_type, address_map_constructor internal)
: cpu_device(mconfig, type, tag, owner, clock)
, m_program_config("program", ENDIANNESS_LITTLE, 8, 24, 0, internal)
, m_data_config("data", ENDIANNESS_LITTLE, 8, 24, 0, internal)
, m_opcode_config("opcodes", ENDIANNESS_LITTLE, 8, 24, 0, internal)
, m_program_config("program", ENDIANNESS_LITTLE, 8, (cpu_type == CPU_TYPE_W65C802) ? 16 : 24, 0, internal)
, m_data_config("data", ENDIANNESS_LITTLE, 8, (cpu_type == CPU_TYPE_W65C802) ? 16 : 24, 0, internal)
, m_opcode_config("opcodes", ENDIANNESS_LITTLE, 8, (cpu_type == CPU_TYPE_W65C802) ? 16 : 24, 0, internal)
, m_vector_config("vectors", ENDIANNESS_LITTLE, 8, 5, 0)
, m_wdm_w(*this)
, m_cpu_type(cpu_type)
@ -1023,7 +1034,7 @@ SNES specific, used to handle master cycles, based off byuu's BSNES code
int g65816_device::bus_5A22_cycle_burst(unsigned addr)
{
if(m_cpu_type == CPU_TYPE_G65816)
if(m_cpu_type != CPU_TYPE_5A22)
return 0;
if(addr & 0x408000) {

View File

@ -1540,6 +1540,13 @@ protected:
};
class g65802_device : public g65816_device
{
public:
g65802_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
};
class _5a22_device : public g65816_device
{
public:
@ -1571,6 +1578,7 @@ protected:
DECLARE_DEVICE_TYPE(G65816, g65816_device)
DECLARE_DEVICE_TYPE(G65802, g65802_device)
DECLARE_DEVICE_TYPE(_5A22, _5a22_device)

View File

@ -1854,7 +1854,7 @@ TABLE_FUNCTION(void, set_line, (int line, int state))
return;
}
LINE_IRQ=1;
LINE_IRQ=1; // FIXME: this can't be right
}

View File

@ -81,16 +81,12 @@ private:
u8 input1_r();
u8 input2_r();
u8 m_inp_mux;
u8 m_led_select;
u8 m_inp_mux = 0;
u8 m_led_select = 0;
};
void cforte_state::machine_start()
{
// zerofill
m_inp_mux = 0;
m_led_select = 0;
// register for savestates
save_item(NAME(m_inp_mux));
save_item(NAME(m_led_select));

View File

@ -6,7 +6,7 @@
Novag Super Expert (model 878/886/887/902) / Novag Super Forte
Hardware notes (Super Expert)
- 65C02 @ 5MHz or 6MHz (10MHz or 12MHz XTAL)
- R65C02P4 or W65C802P-6 @ 5MHz/6MHz (10MHz/12MHz XTAL)
- 8KB RAM battery-backed, 3*32KB ROM
- HD44780 LCD controller (16x1)
- beeper(32KHz/32), IRQ(32KHz/128) via MC14060
@ -26,6 +26,11 @@ To distinguish between versions, press the Set Level button.
Note that the H8 option doesn't appear to work with sexperta1, but when doing a
hex compare with sexperta, the program differences are minor.
TODO:
- use W65C802 device for version B/C? it works ok but this cpu core emulation is
not as accurate, and the program doesn't enable extended mode (in other words,
it always runs in W65C02 emulation mode)
******************************************************************************/
#include "emu.h"
@ -568,7 +573,7 @@ ROM_END
CONS( 1988, sexperta, 0, 0, sexpert, sexpert, sexpert_state, init_sexpert, "Novag", "Super Expert (version A, set 1)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) // 886
CONS( 1987, sexperta1, sexperta, 0, sexpert, sexpert, sexpert_state, init_sexpert, "Novag", "Super Expert (version A, set 2)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) // 878
CONS( 1987, sexperta2, sexperta, 0, sexpert, sexpert, sexpert_state, init_sexpert, "Novag", "Super Expert (version A, set 3)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) // 878
CONS( 1988, sexpertb, sexperta, 0, sexpert, sexpert, sexpert_state, init_sexpert, "Novag", "Super Expert (version B)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
CONS( 1988, sexpertb, sexperta, 0, sexpert, sexpert, sexpert_state, init_sexpert, "Novag", "Super Expert (version B)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) // 887
CONS( 1990, sexpertc, sexperta, 0, sexpert, sexpert, sexpert_state, init_sexpert, "Novag", "Super Expert (version C, V3.6)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
CONS( 1990, sexpertc1, sexperta, 0, sexpert, sexpert, sexpert_state, init_sexpert, "Novag", "Super Expert (version C, V3.0)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) // 902