summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu/esrip/esrip.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/cpu/esrip/esrip.cpp')
-rw-r--r--src/devices/cpu/esrip/esrip.cpp202
1 files changed, 101 insertions, 101 deletions
diff --git a/src/devices/cpu/esrip/esrip.cpp b/src/devices/cpu/esrip/esrip.cpp
index def6fbc6a05..dc5e79a18d3 100644
--- a/src/devices/cpu/esrip/esrip.cpp
+++ b/src/devices/cpu/esrip/esrip.cpp
@@ -18,7 +18,7 @@
CONSTANTS
***************************************************************************/
-#define IPT_RAM_SIZE (8192 * sizeof(UINT16))
+#define IPT_RAM_SIZE (8192 * sizeof(uint16_t))
/***************************************************************************
@@ -65,7 +65,7 @@
PUBLIC FUNCTIONS
***************************************************************************/
-UINT8 esrip_device::get_rip_status()
+uint8_t esrip_device::get_rip_status()
{
return m_status_out;
}
@@ -182,7 +182,7 @@ void esrip_device::device_start()
/* Register configuration structure callbacks */
m_fdt_r.resolve_safe(0);
m_fdt_w.resolve_safe();
- m_lbrm = (UINT8*)machine().root_device().memregion(m_lbrm_prom)->base();
+ m_lbrm = (uint8_t*)machine().root_device().memregion(m_lbrm_prom)->base();
m_status_in.resolve_safe(0);
m_draw.bind_relative_to(*owner());
@@ -376,7 +376,7 @@ void esrip_device::state_string_export(const device_state_entry &entry, std::str
// of the shortest instruction, in bytes
//-------------------------------------------------
-UINT32 esrip_device::disasm_min_opcode_bytes() const
+uint32_t esrip_device::disasm_min_opcode_bytes() const
{
return 8;
}
@@ -387,7 +387,7 @@ UINT32 esrip_device::disasm_min_opcode_bytes() const
// of the longest instruction, in bytes
//-------------------------------------------------
-UINT32 esrip_device::disasm_max_opcode_bytes() const
+uint32_t esrip_device::disasm_max_opcode_bytes() const
{
return 8;
}
@@ -398,7 +398,7 @@ UINT32 esrip_device::disasm_max_opcode_bytes() const
// helper function
//-------------------------------------------------
-offs_t esrip_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options)
+offs_t esrip_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options)
{
extern CPU_DISASSEMBLE( esrip );
return CPU_DISASSEMBLE_NAME(esrip)(this, buffer, pc, oprom, opram, options);
@@ -420,12 +420,12 @@ int esrip_device::get_lbrm() const
int addr = ((m_y_scale & 0x3f) << 3) | ((m_line_latch >> 3) & 7);
int sel = (m_line_latch & 7);
- UINT8 val = m_lbrm[addr];
+ uint8_t val = m_lbrm[addr];
return (val >> sel) & 1;
}
-int esrip_device::check_jmp(UINT8 jmp_ctrl) const
+int esrip_device::check_jmp(uint8_t jmp_ctrl) const
{
int ret = 0;
@@ -468,37 +468,37 @@ int esrip_device::check_jmp(UINT8 jmp_ctrl) const
}
-void esrip_device::calc_z_flag(UINT16 res)
+void esrip_device::calc_z_flag(uint16_t res)
{
m_new_status &= ~Z_FLAG;
m_new_status |= (res == 0);
}
-void esrip_device::calc_c_flag_add(UINT16 a, UINT16 b)
+void esrip_device::calc_c_flag_add(uint16_t a, uint16_t b)
{
m_new_status &= ~C_FLAG;
- m_new_status |= ((UINT16)(b) > (UINT16)(~(a))) ? 2 : 0;
+ m_new_status |= ((uint16_t)(b) > (uint16_t)(~(a))) ? 2 : 0;
}
-void esrip_device::calc_c_flag_sub(UINT16 a, UINT16 b)
+void esrip_device::calc_c_flag_sub(uint16_t a, uint16_t b)
{
m_new_status &= ~C_FLAG;
- m_new_status |= ((UINT16)(b) <= (UINT16)(a)) ? 2 : 0;
+ m_new_status |= ((uint16_t)(b) <= (uint16_t)(a)) ? 2 : 0;
}
-void esrip_device::calc_n_flag(UINT16 res)
+void esrip_device::calc_n_flag(uint16_t res)
{
m_new_status &= ~N_FLAG;
m_new_status |= (res & 0x8000) ? 4 : 0;
}
-void esrip_device::calc_v_flag_add(UINT16 a, UINT16 b, UINT32 r)
+void esrip_device::calc_v_flag_add(uint16_t a, uint16_t b, uint32_t r)
{
m_new_status &= ~V_FLAG;
m_new_status |= ((a ^ r) & (b ^ r) & 0x8000) ? 8 : 0;
}
-void esrip_device::calc_v_flag_sub(UINT16 a, UINT16 b, UINT32 r)
+void esrip_device::calc_v_flag_sub(uint16_t a, uint16_t b, uint32_t r)
{
m_new_status &= ~V_FLAG;
m_new_status |= ((a ^ b) & (r ^ b) & 0x8000) ? 8 : 0;
@@ -545,9 +545,9 @@ enum
SORR = 0xb
};
-UINT16 esrip_device::sor_op(UINT16 r, UINT16 opcode)
+uint16_t esrip_device::sor_op(uint16_t r, uint16_t opcode)
{
- UINT32 res = 0;
+ uint32_t res = 0;
switch (opcode)
{
@@ -591,11 +591,11 @@ UINT16 esrip_device::sor_op(UINT16 r, UINT16 opcode)
return res & 0xffff;
}
-void esrip_device::sor(UINT16 inst)
+void esrip_device::sor(uint16_t inst)
{
- UINT16 r = 0;
- UINT16 dst = 0;
- UINT16 res = 0;
+ uint16_t r = 0;
+ uint16_t dst = 0;
+ uint16_t res = 0;
if (BYTE_MODE)
{
@@ -663,10 +663,10 @@ enum
NRAS = 5
};
-void esrip_device::sonr(UINT16 inst)
+void esrip_device::sonr(uint16_t inst)
{
- UINT16 r = 0;
- UINT16 res = 0;
+ uint16_t r = 0;
+ uint16_t res = 0;
switch ((inst >> 5) & 0xf)
{
@@ -727,9 +727,9 @@ enum
EXNOR = 0xb
};
-UINT16 esrip_device::tor_op(UINT16 r, UINT16 s, int opcode)
+uint16_t esrip_device::tor_op(uint16_t r, uint16_t s, int opcode)
{
- UINT32 res = 0;
+ uint32_t res = 0;
switch (opcode)
{
@@ -825,12 +825,12 @@ UINT16 esrip_device::tor_op(UINT16 r, UINT16 s, int opcode)
return res & 0xffff;
}
-void esrip_device::tor1(UINT16 inst)
+void esrip_device::tor1(uint16_t inst)
{
- UINT16 r = 0;
- UINT16 s = 0;
- UINT16 dst = 0;
- UINT16 res = 0;
+ uint16_t r = 0;
+ uint16_t s = 0;
+ uint16_t dst = 0;
+ uint16_t res = 0;
enum
{
@@ -922,11 +922,11 @@ void esrip_device::tor1(UINT16 inst)
m_result = res;
}
-void esrip_device::tor2(UINT16 inst)
+void esrip_device::tor2(uint16_t inst)
{
- UINT16 r = 0;
- UINT16 s = 0;
- UINT32 res = 0;
+ uint16_t r = 0;
+ uint16_t s = 0;
+ uint32_t res = 0;
enum
{
@@ -982,7 +982,7 @@ void esrip_device::tor2(UINT16 inst)
m_result = res;
}
-void esrip_device::tonr(UINT16 inst)
+void esrip_device::tonr(uint16_t inst)
{
enum
{
@@ -991,9 +991,9 @@ void esrip_device::tonr(UINT16 inst)
TODI = 0x5
};
- UINT16 r = 0;
- UINT16 s = 0;
- UINT16 res = 0;
+ uint16_t r = 0;
+ uint16_t s = 0;
+ uint16_t res = 0;
switch (SRC)
{
@@ -1055,7 +1055,7 @@ void esrip_device::tonr(UINT16 inst)
*
*************************************/
-void esrip_device::bonr(UINT16 inst)
+void esrip_device::bonr(uint16_t inst)
{
enum
{
@@ -1075,7 +1075,7 @@ void esrip_device::bonr(UINT16 inst)
LDC2NY = 0x17
};
- UINT16 res = 0;
+ uint16_t res = 0;
switch (inst & 0x1f)
{
@@ -1106,8 +1106,8 @@ void esrip_device::bonr(UINT16 inst)
}
case A2NA:
{
- UINT16 r = m_acc;
- UINT16 s = 1 << N;
+ uint16_t r = m_acc;
+ uint16_t s = 1 << N;
res = r + s;
calc_z_flag(res);
calc_n_flag(res);
@@ -1118,8 +1118,8 @@ void esrip_device::bonr(UINT16 inst)
}
case S2NA:
{
- UINT16 r = m_acc;
- UINT16 s = 1 << N;
+ uint16_t r = m_acc;
+ uint16_t s = 1 << N;
res = r - s;
calc_z_flag(res);
calc_n_flag(res);
@@ -1140,7 +1140,7 @@ void esrip_device::bonr(UINT16 inst)
case SETND:
{
- UINT16 r = m_d_latch;
+ uint16_t r = m_d_latch;
res = r | (1 << N);
m_d_latch = res;
@@ -1165,8 +1165,8 @@ void esrip_device::bonr(UINT16 inst)
case A2NDY:
{
- UINT16 r = m_d_latch;
- UINT16 s = 1 << N;
+ uint16_t r = m_d_latch;
+ uint16_t s = 1 << N;
res = r + s;
calc_z_flag(res);
@@ -1183,7 +1183,7 @@ void esrip_device::bonr(UINT16 inst)
m_result = res;
}
-void esrip_device::bor1(UINT16 inst)
+void esrip_device::bor1(uint16_t inst)
{
enum
{
@@ -1192,7 +1192,7 @@ void esrip_device::bor1(UINT16 inst)
TSTNR = 0xf
};
- UINT16 res = 0;
+ uint16_t res = 0;
switch ((inst >> 5) & 0xf)
{
@@ -1227,7 +1227,7 @@ void esrip_device::bor1(UINT16 inst)
m_result = res;
}
-void esrip_device::bor2(UINT16 inst)
+void esrip_device::bor2(uint16_t inst)
{
enum
{
@@ -1237,7 +1237,7 @@ void esrip_device::bor2(UINT16 inst)
S2NR = 0xf
};
- UINT32 res = 0;
+ uint32_t res = 0;
switch ((inst >> 5) & 0xf)
{
@@ -1257,8 +1257,8 @@ void esrip_device::bor2(UINT16 inst)
}
case A2NR:
{
- UINT16 r = m_ram[RAM_ADDR];
- UINT16 s = 1 << N;
+ uint16_t r = m_ram[RAM_ADDR];
+ uint16_t s = 1 << N;
res = r + s;
calc_v_flag_add(r, s, res);
@@ -1269,8 +1269,8 @@ void esrip_device::bor2(UINT16 inst)
}
case S2NR:
{
- UINT16 r = m_ram[RAM_ADDR];
- UINT16 s = 1 << N;
+ uint16_t r = m_ram[RAM_ADDR];
+ uint16_t s = 1 << N;
res = r - s;
calc_v_flag_sub(r, s, res);
@@ -1294,7 +1294,7 @@ void esrip_device::bor2(UINT16 inst)
*************************************/
/* TODO Combine these */
-void esrip_device::rotr1(UINT16 inst)
+void esrip_device::rotr1(uint16_t inst)
{
enum
{
@@ -1303,9 +1303,9 @@ void esrip_device::rotr1(UINT16 inst)
RTRR = 0xf
};
- UINT16 u = 0;
- UINT16 dst = 0;
- UINT16 res = 0;
+ uint16_t u = 0;
+ uint16_t dst = 0;
+ uint16_t res = 0;
int n = N;
switch ((inst >> 5) & 0xf)
@@ -1330,7 +1330,7 @@ void esrip_device::rotr1(UINT16 inst)
m_result = res;
}
-void esrip_device::rotr2(UINT16 inst)
+void esrip_device::rotr2(uint16_t inst)
{
enum
{
@@ -1338,8 +1338,8 @@ void esrip_device::rotr2(UINT16 inst)
RTDR = 1
};
- UINT16 u = 0;
- UINT16 res = 0;
+ uint16_t u = 0;
+ uint16_t res = 0;
switch ((inst >> 5) & 0xf)
{
@@ -1357,7 +1357,7 @@ void esrip_device::rotr2(UINT16 inst)
m_result = res;
}
-void esrip_device::rotnr(UINT16 inst)
+void esrip_device::rotnr(uint16_t inst)
{
enum
{
@@ -1367,9 +1367,9 @@ void esrip_device::rotnr(UINT16 inst)
RTAA = 0x1d
};
- UINT16 u = 0;
- UINT16 res = 0;
- UINT16 dst = 0;
+ uint16_t u = 0;
+ uint16_t res = 0;
+ uint16_t dst = 0;
switch (inst & 0x1f)
{
@@ -1402,7 +1402,7 @@ void esrip_device::rotnr(UINT16 inst)
*
*************************************/
-void esrip_device::rotc(UINT16 inst)
+void esrip_device::rotc(uint16_t inst)
{
UNHANDLED;
}
@@ -1413,7 +1413,7 @@ void esrip_device::rotc(UINT16 inst)
*
*************************************/
-void esrip_device::rotm(UINT16 inst)
+void esrip_device::rotm(uint16_t inst)
{
UNHANDLED;
}
@@ -1424,12 +1424,12 @@ void esrip_device::rotm(UINT16 inst)
*
*************************************/
-void esrip_device::prt(UINT16 inst)
+void esrip_device::prt(uint16_t inst)
{
UNHANDLED;
}
-void esrip_device::prtnr(UINT16 inst)
+void esrip_device::prtnr(uint16_t inst)
{
UNHANDLED;
}
@@ -1441,12 +1441,12 @@ void esrip_device::prtnr(UINT16 inst)
*
*************************************/
-void esrip_device::crcf(UINT16 inst)
+void esrip_device::crcf(uint16_t inst)
{
UNHANDLED;
}
-void esrip_device::crcr(UINT16 inst)
+void esrip_device::crcr(uint16_t inst)
{
UNHANDLED;
}
@@ -1472,9 +1472,9 @@ enum
#define SET_LINK_flag(x) (m_new_status &= ~L_FLAG); \
(m_new_status |= x ? L_FLAG : 0)
-UINT16 esrip_device::shift_op(UINT16 u, int opcode)
+uint16_t esrip_device::shift_op(uint16_t u, int opcode)
{
- UINT32 res = 0;
+ uint32_t res = 0;
switch (opcode)
{
@@ -1517,7 +1517,7 @@ UINT16 esrip_device::shift_op(UINT16 u, int opcode)
return res;
}
-void esrip_device::shftr(UINT16 inst)
+void esrip_device::shftr(uint16_t inst)
{
enum
{
@@ -1525,8 +1525,8 @@ void esrip_device::shftr(UINT16 inst)
SHDR = 7
};
- UINT16 u = 0;
- UINT16 res = 0;
+ uint16_t u = 0;
+ uint16_t res = 0;
switch ((inst >> 9) & 0xf)
{
@@ -1542,7 +1542,7 @@ void esrip_device::shftr(UINT16 inst)
m_result = res;
}
-void esrip_device::shftnr(UINT16 inst)
+void esrip_device::shftnr(uint16_t inst)
{
enum
{
@@ -1550,8 +1550,8 @@ void esrip_device::shftnr(UINT16 inst)
SHD = 7
};
- UINT16 u = 0;
- UINT16 res = 0;
+ uint16_t u = 0;
+ uint16_t res = 0;
switch ((inst >> 9) & 0xf)
{
@@ -1578,12 +1578,12 @@ void esrip_device::shftnr(UINT16 inst)
*
*************************************/
-void esrip_device::svstr(UINT16 inst)
+void esrip_device::svstr(uint16_t inst)
{
UNHANDLED;
}
-void esrip_device::rstst(UINT16 inst)
+void esrip_device::rstst(uint16_t inst)
{
enum
{
@@ -1606,7 +1606,7 @@ void esrip_device::rstst(UINT16 inst)
m_result = 0;
}
-void esrip_device::setst(UINT16 inst)
+void esrip_device::setst(uint16_t inst)
{
enum
{
@@ -1629,7 +1629,7 @@ void esrip_device::setst(UINT16 inst)
m_result = 0xffff;
}
-void esrip_device::test(UINT16 inst)
+void esrip_device::test(uint16_t inst)
{
enum
{
@@ -1647,7 +1647,7 @@ void esrip_device::test(UINT16 inst)
TF3 = 0x16
};
- UINT32 res = 0;
+ uint32_t res = 0;
switch (inst & 0x1f)
{
@@ -1676,7 +1676,7 @@ void esrip_device::test(UINT16 inst)
*
*************************************/
-void esrip_device::nop(UINT16 inst)
+void esrip_device::nop(uint16_t inst)
{
m_result = 0xff; // Undefined
}
@@ -1691,7 +1691,7 @@ const device_type ESRIP = &device_creator<esrip_device>;
// esrip_device - constructor
//-------------------------------------------------
-esrip_device::esrip_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+esrip_device::esrip_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: cpu_device(mconfig, ESRIP, "ESRIP", tag, owner, clock, "esrip", __FILE__),
m_program_config("program", ENDIANNESS_BIG, 64, 9, -3),
m_fdt_r(*this),
@@ -1720,7 +1720,7 @@ const esrip_device::ophandler esrip_device::s_opcodetable[24] =
};
-void esrip_device::am29116_execute(UINT16 inst, int _sre)
+void esrip_device::am29116_execute(uint16_t inst, int _sre)
{
/* Status register shadow */
m_new_status = m_status;
@@ -1746,7 +1746,7 @@ void esrip_device::am29116_execute(UINT16 inst, int _sre)
// cycles it takes for one instruction to execute
//-------------------------------------------------
-UINT32 esrip_device::execute_min_cycles() const
+uint32_t esrip_device::execute_min_cycles() const
{
return 1;
}
@@ -1757,7 +1757,7 @@ UINT32 esrip_device::execute_min_cycles() const
// cycles it takes for one instruction to execute
//-------------------------------------------------
-UINT32 esrip_device::execute_max_cycles() const
+uint32_t esrip_device::execute_max_cycles() const
{
return 1;
}
@@ -1768,7 +1768,7 @@ UINT32 esrip_device::execute_max_cycles() const
// input/interrupt lines
//-------------------------------------------------
-UINT32 esrip_device::execute_input_lines() const
+uint32_t esrip_device::execute_input_lines() const
{
return 0;
}
@@ -1787,7 +1787,7 @@ void esrip_device::execute_set_input(int inputnum, int state)
void esrip_device::execute_run()
{
int calldebugger = (machine().debug_flags & DEBUG_FLAG_ENABLED) != 0;
- UINT8 status;
+ uint8_t status;
/* I think we can get away with placing this outside of the loop */
status = m_status_in(*m_program, 0);
@@ -1795,18 +1795,18 @@ void esrip_device::execute_run()
/* Core execution loop */
do
{
- UINT64 inst;
- UINT8 next_pc;
- UINT16 x_bus = 0;
- UINT16 ipt_bus = 0;
- UINT16 y_bus = 0;
+ uint64_t inst;
+ uint8_t next_pc;
+ uint16_t x_bus = 0;
+ uint16_t ipt_bus = 0;
+ uint16_t y_bus = 0;
int yoe = _BIT(m_l5, 1);
int bl46 = BIT(m_l4, 6);
int bl44 = BIT(m_l4, 4);
- UINT32 in_h;
- UINT32 in_l;
+ uint32_t in_h;
+ uint32_t in_l;
if (m_fig_cycles)
{