Monon / AX208 - load internal AX208 ROM in device [Peter Wilhelmson, David Haywood] (#10131)
This commit is contained in:
parent
3df687298b
commit
424a3a6605
@ -27,16 +27,17 @@
|
|||||||
|
|
||||||
DEFINE_DEVICE_TYPE(AXC51CORE, axc51core_cpu_device, "axc51core", "AppoTech AXC51-CORE")
|
DEFINE_DEVICE_TYPE(AXC51CORE, axc51core_cpu_device, "axc51core", "AppoTech AXC51-CORE")
|
||||||
DEFINE_DEVICE_TYPE(AX208, ax208_cpu_device, "ax208", "AppoTech AX208 (AXC51-CORE)")
|
DEFINE_DEVICE_TYPE(AX208, ax208_cpu_device, "ax208", "AppoTech AX208 (AXC51-CORE)")
|
||||||
|
DEFINE_DEVICE_TYPE(AX208P, ax208p_cpu_device, "ax208p", "AppoTech AX208 (AXC51-CORE) (prototype?)")
|
||||||
|
|
||||||
// AXC51CORE (base device)
|
// AXC51CORE (base device)
|
||||||
|
|
||||||
axc51core_cpu_device::axc51core_cpu_device(const machine_config& mconfig, device_type type, const char* tag, device_t* owner, uint32_t clock, int program_width, int data_width, uint8_t features)
|
axc51core_cpu_device::axc51core_cpu_device(const machine_config& mconfig, device_type type, const char* tag, device_t* owner, uint32_t clock, address_map_constructor program_map, address_map_constructor data_map, int program_width, int data_width, uint8_t features)
|
||||||
: mcs51_cpu_device(mconfig, type, tag, owner, clock, program_width, data_width, features)
|
: mcs51_cpu_device(mconfig, type, tag, owner, clock, program_map, data_map, program_width, data_width, features)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
axc51core_cpu_device::axc51core_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
axc51core_cpu_device::axc51core_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||||
: axc51core_cpu_device(mconfig, AXC51CORE, tag, owner, clock, 0, 7)
|
: axc51core_cpu_device(mconfig, AXC51CORE, tag, owner, clock, address_map_constructor(FUNC(axc51core_cpu_device::program_internal), this), address_map_constructor(FUNC(axc51core_cpu_device::data_internal), this), 0, 8)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -47,22 +48,63 @@ std::unique_ptr<util::disasm_interface> axc51core_cpu_device::create_disassemble
|
|||||||
|
|
||||||
// AX208 (specific CPU)
|
// AX208 (specific CPU)
|
||||||
|
|
||||||
ax208_cpu_device::ax208_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
ax208_cpu_device::ax208_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
|
||||||
: axc51core_cpu_device(mconfig, AX208, tag, owner, clock, 0, 7)
|
: axc51core_cpu_device(mconfig, type, tag, owner, clock, address_map_constructor(FUNC(ax208_cpu_device::ax208_internal_program_mem), this), address_map_constructor(FUNC(ax208_cpu_device::ax208_internal_data_mem), this), 0, 8)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ax208_cpu_device::ax208_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||||
|
: ax208_cpu_device(mconfig, AX208, tag, owner, clock)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
std::unique_ptr<util::disasm_interface> ax208_cpu_device::create_disassembler()
|
std::unique_ptr<util::disasm_interface> ax208_cpu_device::create_disassembler()
|
||||||
{
|
{
|
||||||
return std::make_unique<ax208_disassembler>();
|
return std::make_unique<ax208_disassembler>();
|
||||||
}
|
}
|
||||||
|
|
||||||
ROM_START( ax208 )
|
void ax208_cpu_device::ax208_internal_program_mem(address_map &map)
|
||||||
|
{
|
||||||
|
map(0x8000, 0x9fff).rom().region("rom", 0); // this can only be read from code running within the same region
|
||||||
|
}
|
||||||
|
|
||||||
|
void ax208_cpu_device::ax208_internal_data_mem(address_map &map)
|
||||||
|
{
|
||||||
|
map(0x0000, 0x00ff).ram().share("scratchpad");
|
||||||
|
map(0x0100, 0x01ff).ram().share("sfr_ram"); /* SFR */
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ROM_START( ax208 ) // assume all production ax208 chips use this internal ROM
|
||||||
ROM_REGION( 0x2000, "rom", 0 )
|
ROM_REGION( 0x2000, "rom", 0 )
|
||||||
ROM_LOAD("ax208.rom", 0x0000, 0x2000, NO_DUMP )
|
ROM_LOAD("ax208.bin", 0x0000, 0x2000, CRC(b85f954a) SHA1(0dc7ab9bdaf73231d4d6627fe6308fe8103e1bbc) )
|
||||||
ROM_END
|
ROM_END
|
||||||
|
|
||||||
const tiny_rom_entry *ax208_cpu_device::device_rom_region() const
|
const tiny_rom_entry *ax208_cpu_device::device_rom_region() const
|
||||||
{
|
{
|
||||||
return ROM_NAME( ax208 );
|
return ROM_NAME( ax208 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ax208_cpu_device::device_reset()
|
||||||
|
{
|
||||||
|
axc51core_cpu_device::device_reset();
|
||||||
|
set_state_int(MCS51_PC, 0x8000);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ax208p_cpu_device::ax208p_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||||
|
: ax208_cpu_device(mconfig, AX208P, tag, owner, clock)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
ROM_START( ax208p ) // this is an early revision of the internal AX208 code, some functions are moved around so it isn't entirely compatible
|
||||||
|
ROM_REGION( 0x2000, "rom", 0 )
|
||||||
|
ROM_LOAD("mask208.bin", 0x0000, 0x2000, CRC(52396183) SHA1(b119000f93251894a352ecf675ee42f2e5c347bd) )
|
||||||
|
ROM_END
|
||||||
|
|
||||||
|
const tiny_rom_entry *ax208p_cpu_device::device_rom_region() const
|
||||||
|
{
|
||||||
|
return ROM_NAME( ax208p );
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -19,13 +19,14 @@
|
|||||||
|
|
||||||
DECLARE_DEVICE_TYPE(AXC51CORE, axc51core_cpu_device)
|
DECLARE_DEVICE_TYPE(AXC51CORE, axc51core_cpu_device)
|
||||||
DECLARE_DEVICE_TYPE(AX208, ax208_cpu_device)
|
DECLARE_DEVICE_TYPE(AX208, ax208_cpu_device)
|
||||||
|
DECLARE_DEVICE_TYPE(AX208P, ax208p_cpu_device)
|
||||||
|
|
||||||
class axc51core_cpu_device : public mcs51_cpu_device
|
class axc51core_cpu_device : public mcs51_cpu_device
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// construction/destruction
|
// construction/destruction
|
||||||
axc51core_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
axc51core_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||||
axc51core_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, int program_width, int data_width, uint8_t features = 0);
|
axc51core_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, address_map_constructor program_map, address_map_constructor data_map, int program_width, int data_width, uint8_t features = 0);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual std::unique_ptr<util::disasm_interface> create_disassembler() override;
|
virtual std::unique_ptr<util::disasm_interface> create_disassembler() override;
|
||||||
@ -39,8 +40,26 @@ public:
|
|||||||
ax208_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
ax208_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
ax208_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
|
||||||
|
|
||||||
|
virtual void device_reset() override;
|
||||||
|
|
||||||
virtual std::unique_ptr<util::disasm_interface> create_disassembler() override;
|
virtual std::unique_ptr<util::disasm_interface> create_disassembler() override;
|
||||||
virtual const tiny_rom_entry *device_rom_region() const override;
|
virtual const tiny_rom_entry *device_rom_region() const override;
|
||||||
|
|
||||||
|
void ax208_internal_program_mem(address_map &map);
|
||||||
|
void ax208_internal_data_mem(address_map &map);
|
||||||
|
};
|
||||||
|
|
||||||
|
class ax208p_cpu_device : public ax208_cpu_device
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
// construction/destruction
|
||||||
|
ax208p_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual const tiny_rom_entry *device_rom_region() const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif // MAME_CPU_MCS51_AXC51_CORE_H
|
#endif // MAME_CPU_MCS51_AXC51_CORE_H
|
||||||
|
@ -267,10 +267,10 @@ void mcs51_cpu_device::data_internal(address_map &map)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
mcs51_cpu_device::mcs51_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, int program_width, int data_width, uint8_t features)
|
mcs51_cpu_device::mcs51_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, address_map_constructor program_map, address_map_constructor data_map, int program_width, int data_width, uint8_t features)
|
||||||
: cpu_device(mconfig, type, tag, owner, clock)
|
: cpu_device(mconfig, type, tag, owner, clock)
|
||||||
, m_program_config("program", ENDIANNESS_LITTLE, 8, 16, 0, address_map_constructor(FUNC(mcs51_cpu_device::program_internal), this))
|
, m_program_config("program", ENDIANNESS_LITTLE, 8, 16, 0, program_map)
|
||||||
, m_data_config("data", ENDIANNESS_LITTLE, 8, 9, 0, address_map_constructor(FUNC(mcs51_cpu_device::data_internal), this))
|
, m_data_config("data", ENDIANNESS_LITTLE, 8, 9, 0, data_map)
|
||||||
, m_io_config("io", ENDIANNESS_LITTLE, 8, (features & FEATURE_DS5002FP) ? 17 : 16, 0)
|
, m_io_config("io", ENDIANNESS_LITTLE, 8, (features & FEATURE_DS5002FP) ? 17 : 16, 0)
|
||||||
, m_pc(0)
|
, m_pc(0)
|
||||||
, m_features(features)
|
, m_features(features)
|
||||||
@ -295,6 +295,12 @@ mcs51_cpu_device::mcs51_cpu_device(const machine_config &mconfig, device_type ty
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
mcs51_cpu_device::mcs51_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, int program_width, int data_width, uint8_t features)
|
||||||
|
: mcs51_cpu_device(mconfig, type, tag, owner, clock, address_map_constructor(FUNC(mcs51_cpu_device::program_internal), this), address_map_constructor(FUNC(mcs51_cpu_device::data_internal), this), program_width, data_width, features)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
i8031_device::i8031_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
i8031_device::i8031_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||||
: mcs51_cpu_device(mconfig, I8031, tag, owner, clock, 0, 7)
|
: mcs51_cpu_device(mconfig, I8031, tag, owner, clock, 0, 7)
|
||||||
{
|
{
|
||||||
|
@ -72,6 +72,7 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
// construction/destruction
|
// construction/destruction
|
||||||
mcs51_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, int program_width, int data_width, uint8_t features = 0);
|
mcs51_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, int program_width, int data_width, uint8_t features = 0);
|
||||||
|
mcs51_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, address_map_constructor program_map, address_map_constructor data_map, int program_width, int data_width, uint8_t features = 0);
|
||||||
|
|
||||||
// device-level overrides
|
// device-level overrides
|
||||||
virtual void device_start() override;
|
virtual void device_start() override;
|
||||||
|
@ -31,7 +31,7 @@ public:
|
|||||||
m_screen(*this, "screen"),
|
m_screen(*this, "screen"),
|
||||||
m_palette(*this, "palette"),
|
m_palette(*this, "palette"),
|
||||||
m_mainram(*this, "mainram"),
|
m_mainram(*this, "mainram"),
|
||||||
m_otherram(*this, "otherram"),
|
//m_otherram(*this, "otherram"),
|
||||||
m_bootcopy(0)
|
m_bootcopy(0)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
@ -51,7 +51,7 @@ private:
|
|||||||
required_device<screen_device> m_screen;
|
required_device<screen_device> m_screen;
|
||||||
required_device<palette_device> m_palette;
|
required_device<palette_device> m_palette;
|
||||||
required_shared_ptr<uint8_t> m_mainram;
|
required_shared_ptr<uint8_t> m_mainram;
|
||||||
required_shared_ptr<uint8_t> m_otherram;
|
//required_shared_ptr<uint8_t> m_otherram;
|
||||||
|
|
||||||
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(cart_load);
|
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(cart_load);
|
||||||
|
|
||||||
@ -73,8 +73,6 @@ void monon_color_state::machine_start()
|
|||||||
|
|
||||||
void monon_color_state::machine_reset()
|
void monon_color_state::machine_reset()
|
||||||
{
|
{
|
||||||
m_maincpu->set_state_int(MCS51_PC, 0x4000);
|
|
||||||
|
|
||||||
uint8_t* flash = memregion("flash")->base();
|
uint8_t* flash = memregion("flash")->base();
|
||||||
uint8_t* maincpu = &m_mainram[0];
|
uint8_t* maincpu = &m_mainram[0];
|
||||||
|
|
||||||
@ -130,7 +128,7 @@ INPUT_PORTS_END
|
|||||||
void monon_color_state::monon_color_map(address_map &map)
|
void monon_color_state::monon_color_map(address_map &map)
|
||||||
{
|
{
|
||||||
map(0x4000, 0x6fff).ram().share("mainram");
|
map(0x4000, 0x6fff).ram().share("mainram");
|
||||||
map(0x9000, 0x9fff).ram().share("otherram"); // lots of jumps to here, is there some kind of BIOS? none of the code appears to map here?
|
// map(0x9000, 0x9fff).rom() // internal to CPU
|
||||||
}
|
}
|
||||||
|
|
||||||
void monon_color_state::monon_color(machine_config &config)
|
void monon_color_state::monon_color(machine_config &config)
|
||||||
|
Loading…
Reference in New Issue
Block a user