Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
put in a skeleton execution core so you can see the code with -debug
- Loading branch information
David Haywood
committed
Nov 1, 2023
1 parent
c0aa575
commit f6c933d
Showing
4 changed files
with
147 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
// license:BSD-3-Clause | ||
// copyright-holders:David Haywood | ||
|
||
#include "emu.h" | ||
#include "evo.h" | ||
#include "evod.h" | ||
|
||
DEFINE_DEVICE_TYPE(EVOLUTION_CPU, evo_cpu_device, "evo_cpu", "Evolution CPU") | ||
|
||
evo_cpu_device::evo_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) | ||
: cpu_device(mconfig, EVOLUTION_CPU, tag, owner, clock) | ||
, m_program_config("program", ENDIANNESS_LITTLE, 16, 24, -1) | ||
, m_pc(0), m_program(nullptr), m_icount(0), m_debugger_temp(0) | ||
{ | ||
} | ||
|
||
std::unique_ptr<util::disasm_interface> evo_cpu_device::create_disassembler() | ||
{ | ||
return std::make_unique<evolution_disassembler>(); | ||
} | ||
|
||
device_memory_interface::space_config_vector evo_cpu_device::memory_space_config() const | ||
{ | ||
return space_config_vector { | ||
std::make_pair(AS_PROGRAM, &m_program_config) | ||
}; | ||
} | ||
|
||
void evo_cpu_device::device_start() | ||
{ | ||
m_pc = 0; | ||
m_debugger_temp = 0; | ||
m_program = &space(AS_PROGRAM); | ||
state_add(EVO_PC, "PC", m_debugger_temp).callimport().callexport().formatstr("%08X"); | ||
state_add(STATE_GENPCBASE, "CURPC", m_debugger_temp).callimport().callexport().noshow(); | ||
set_icountptr(m_icount); | ||
} | ||
|
||
void evo_cpu_device::state_export(const device_state_entry &entry) | ||
{ | ||
switch (entry.index()) | ||
{ | ||
case EVO_PC: | ||
case STATE_GENPCBASE: | ||
m_debugger_temp = m_pc; | ||
break; | ||
} | ||
} | ||
|
||
void evo_cpu_device::state_import(const device_state_entry &entry) | ||
{ | ||
switch (entry.index()) | ||
{ | ||
case EVO_PC: | ||
case STATE_GENPCBASE: | ||
m_pc = (m_debugger_temp & 0xffffffff); | ||
break; | ||
} | ||
} | ||
|
||
void evo_cpu_device::device_reset() | ||
{ | ||
m_pc = 0x400000; | ||
} | ||
|
||
void evo_cpu_device::execute_set_input(int irqline, int state) | ||
{ | ||
} | ||
|
||
void evo_cpu_device::execute_run() | ||
{ | ||
while (m_icount > 0) | ||
{ | ||
debugger_instruction_hook(m_pc); | ||
m_pc++; | ||
m_icount--; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// license:BSD-3-Clause | ||
// copyright-holders:David Haywood | ||
|
||
#ifndef MAME_CPU_EVO_EVO_H | ||
#define MAME_CPU_EVO_EVO_H | ||
|
||
#pragma once | ||
|
||
enum | ||
{ | ||
EVO_PC = STATE_GENPC | ||
}; | ||
|
||
class evo_cpu_device : public cpu_device | ||
{ | ||
public: | ||
evo_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); | ||
|
||
protected: | ||
virtual void device_start() override; | ||
virtual void device_reset() override; | ||
|
||
virtual uint32_t execute_min_cycles() const noexcept override { return 5; } | ||
virtual uint32_t execute_max_cycles() const noexcept override { return 5; } | ||
virtual uint32_t execute_input_lines() const noexcept override { return 0; } | ||
virtual void execute_run() override; | ||
virtual void execute_set_input(int inputnum, int state) override; | ||
|
||
virtual space_config_vector memory_space_config() const override; | ||
|
||
virtual void state_import(const device_state_entry &entry) override; | ||
virtual void state_export(const device_state_entry &entry) override; | ||
|
||
virtual std::unique_ptr<util::disasm_interface> create_disassembler() override; | ||
|
||
private: | ||
address_space_config m_program_config; | ||
|
||
uint32_t m_pc; | ||
|
||
address_space *m_program; | ||
int m_icount; | ||
|
||
uint32_t m_debugger_temp; | ||
}; | ||
|
||
|
||
DECLARE_DEVICE_TYPE(EVOLUTION_CPU, evo_cpu_device) | ||
|
||
#endif // MAME_CPU_EVO_EVO_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
No, these two are not disasm files, you're probably breaking unidasm there.