diff options
author | 2016-10-22 13:13:17 +0200 | |
---|---|---|
committer | 2016-10-22 13:13:17 +0200 | |
commit | ddb290d5f615019c33c42b8d94e5a5254cabcf33 (patch) | |
tree | a70f688b0df3acd19da7b1151e5902e3c6af3fa5 /src/devices/cpu/mcs96 | |
parent | 333bff8de64dfaeb98134000412796b4fdef970b (diff) |
NOTICE (TYPE NAME CONSOLIDATION)
Use standard uint64_t, uint32_t, uint16_t or uint8_t instead of UINT64, UINT32, UINT16 or UINT8
also use standard int64_t, int32_t, int16_t or int8_t instead of INT64, INT32, INT16 or INT8
Diffstat (limited to 'src/devices/cpu/mcs96')
-rw-r--r-- | src/devices/cpu/mcs96/i8x9x.cpp | 52 | ||||
-rw-r--r-- | src/devices/cpu/mcs96/i8x9x.h | 48 | ||||
-rw-r--r-- | src/devices/cpu/mcs96/i8xc196.cpp | 16 | ||||
-rw-r--r-- | src/devices/cpu/mcs96/i8xc196.h | 12 | ||||
-rw-r--r-- | src/devices/cpu/mcs96/mcs96.cpp | 128 | ||||
-rw-r--r-- | src/devices/cpu/mcs96/mcs96.h | 78 | ||||
-rw-r--r-- | src/devices/cpu/mcs96/mcs96ops.lst | 164 |
7 files changed, 249 insertions, 249 deletions
diff --git a/src/devices/cpu/mcs96/i8x9x.cpp b/src/devices/cpu/mcs96/i8x9x.cpp index a0616c0b223..f75fdec4f8c 100644 --- a/src/devices/cpu/mcs96/i8x9x.cpp +++ b/src/devices/cpu/mcs96/i8x9x.cpp @@ -11,14 +11,14 @@ #include "emu.h" #include "i8x9x.h" -i8x9x_device::i8x9x_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : +i8x9x_device::i8x9x_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source) : mcs96_device(mconfig, type, name, tag, owner, clock, 8, "i8x9x", __FILE__), io_config("io", ENDIANNESS_LITTLE, 16, 16, -1), io(nullptr), base_timer2(0), ad_done(0), hso_command(0), ad_command(0), hso_time(0), ad_result(0), ios0(0), ios1(0), ioc0(0), ioc1(0), sbuf(0), sp_stat(0), serial_send_buf(0), serial_send_timer(0) { } -offs_t i8x9x_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t i8x9x_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { return disasm_generic(buffer, pc, oprom, opram, options, disasm_entries); } @@ -67,14 +67,14 @@ void i8x9x_device::commit_hso_cam() hso_cam_hold.time = hso_time; } -void i8x9x_device::ad_start(UINT64 current_time) +void i8x9x_device::ad_start(uint64_t current_time) { ad_result = (io->read_word(2*((ad_command & 7) + A0)) << 6) | 8 | (ad_command & 7); ad_done = current_time + 88; internal_update(current_time); } -void i8x9x_device::serial_send(UINT8 data) +void i8x9x_device::serial_send(uint8_t data) { serial_send_buf = data; serial_send_timer = total_cycles() + 9600; @@ -89,7 +89,7 @@ void i8x9x_device::serial_send_done() check_irq(); } -void i8x9x_device::io_w8(UINT8 adr, UINT8 data) +void i8x9x_device::io_w8(uint8_t adr, uint8_t data) { switch(adr) { case 0x02: @@ -154,7 +154,7 @@ void i8x9x_device::io_w8(UINT8 adr, UINT8 data) return; } -void i8x9x_device::io_w16(UINT8 adr, UINT16 data) +void i8x9x_device::io_w16(uint8_t adr, uint16_t data) { switch(adr) { case 0: @@ -171,7 +171,7 @@ void i8x9x_device::io_w16(UINT8 adr, UINT16 data) return; } -UINT8 i8x9x_device::io_r8(UINT8 adr) +uint8_t i8x9x_device::io_r8(uint8_t adr) { switch(adr) { case 0x00: @@ -224,7 +224,7 @@ UINT8 i8x9x_device::io_r8(UINT8 adr) case 0x10: return io->read_word(P2*2); case 0x11: { - UINT8 res = sp_stat; + uint8_t res = sp_stat; sp_stat &= 0x80; logerror("%s: read sp stat %02x (%04x)\n", tag(), res, PPC); return res; @@ -233,7 +233,7 @@ UINT8 i8x9x_device::io_r8(UINT8 adr) logerror("%s: read ios 0 %02x (%04x)\n", tag(), ios0, PPC); return ios0; case 0x16: { - UINT8 res = ios1; + uint8_t res = ios1; ios1 = ios1 & 0xc0; return res; } @@ -243,7 +243,7 @@ UINT8 i8x9x_device::io_r8(UINT8 adr) } } -UINT16 i8x9x_device::io_r16(UINT8 adr) +uint16_t i8x9x_device::io_r16(uint8_t adr) { switch(adr) { case 0x00: @@ -267,7 +267,7 @@ void i8x9x_device::do_exec_partial() { } -void i8x9x_device::serial_w(UINT8 val) +void i8x9x_device::serial_w(uint8_t val) { sbuf = val; sp_stat |= 0x40; @@ -275,24 +275,24 @@ void i8x9x_device::serial_w(UINT8 val) check_irq(); } -UINT16 i8x9x_device::timer_value(int timer, UINT64 current_time) const +uint16_t i8x9x_device::timer_value(int timer, uint64_t current_time) const { if(timer == 2) current_time -= base_timer2; return current_time >> 3; } -UINT64 i8x9x_device::timer_time_until(int timer, UINT64 current_time, UINT16 timer_value) const +uint64_t i8x9x_device::timer_time_until(int timer, uint64_t current_time, uint16_t timer_value) const { - UINT64 timer_base = timer == 2 ? base_timer2 : 0; - UINT64 delta = (current_time - timer_base) >> 3; - UINT32 tdelta = UINT16(timer_value - delta); + uint64_t timer_base = timer == 2 ? base_timer2 : 0; + uint64_t delta = (current_time - timer_base) >> 3; + uint32_t tdelta = uint16_t(timer_value - delta); if(!tdelta) tdelta = 0x10000; return timer_base + ((delta + tdelta) << 3); } -void i8x9x_device::trigger_cam(int id, UINT64 current_time) +void i8x9x_device::trigger_cam(int id, uint64_t current_time) { hso_cam_entry &cam = hso_info[id]; cam.active = false; @@ -309,15 +309,15 @@ void i8x9x_device::trigger_cam(int id, UINT64 current_time) } } -void i8x9x_device::internal_update(UINT64 current_time) +void i8x9x_device::internal_update(uint64_t current_time) { - UINT16 current_timer1 = timer_value(1, current_time); - UINT16 current_timer2 = timer_value(2, current_time); + uint16_t current_timer1 = timer_value(1, current_time); + uint16_t current_timer2 = timer_value(2, current_time); for(int i=0; i<8; i++) if(hso_info[i].active) { - UINT8 cmd = hso_info[i].command; - UINT16 t = hso_info[i].time; + uint8_t cmd = hso_info[i].command; + uint16_t t = hso_info[i].time; if(((cmd & 0x40) && t == current_timer2) || (!(cmd & 0x40) && t == current_timer1)) { if(cmd != 0x18 && cmd != 0x19) @@ -335,7 +335,7 @@ void i8x9x_device::internal_update(UINT64 current_time) if(current_time == serial_send_timer) serial_send_done(); - UINT64 event_time = 0; + uint64_t event_time = 0; for(int i=0; i<8; i++) { if(!hso_info[i].active && hso_cam_hold.active) { hso_info[i] = hso_cam_hold; @@ -343,7 +343,7 @@ void i8x9x_device::internal_update(UINT64 current_time) logerror("%s: hso cam %02x %04x in slot %d from hold\n", tag(), hso_cam_hold.command, hso_cam_hold.time, i); } if(hso_info[i].active) { - UINT64 new_time = timer_time_until(hso_info[i].command & 0x40 ? 2 : 1, current_time, hso_info[i].time); + uint64_t new_time = timer_time_until(hso_info[i].command & 0x40 ? 2 : 1, current_time, hso_info[i].time); if(!event_time || new_time < event_time) event_time = new_time; } @@ -358,12 +358,12 @@ void i8x9x_device::internal_update(UINT64 current_time) recompute_bcount(event_time); } -c8095_device::c8095_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +c8095_device::c8095_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : i8x9x_device(mconfig, C8095, "C8095", tag, owner, clock, "c8095", __FILE__) { } -p8098_device::p8098_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +p8098_device::p8098_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : i8x9x_device(mconfig, P8098, "P8098", tag, owner, clock, "p8098", __FILE__) { } diff --git a/src/devices/cpu/mcs96/i8x9x.h b/src/devices/cpu/mcs96/i8x9x.h index f71dc2f6b24..099618e94f1 100644 --- a/src/devices/cpu/mcs96/i8x9x.h +++ b/src/devices/cpu/mcs96/i8x9x.h @@ -21,9 +21,9 @@ public: P0, P1, P2 }; - i8x9x_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + i8x9x_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source); - void serial_w(UINT8 val); + void serial_w(uint8_t val); protected: virtual void device_start() override; @@ -32,14 +32,14 @@ protected: static const disasm_entry disasm_entries[0x100]; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; virtual void do_exec_full() override; virtual void do_exec_partial() override; - virtual void internal_update(UINT64 current_time) override; - virtual void io_w8(UINT8 adr, UINT8 data) override; - virtual void io_w16(UINT8 adr, UINT16 data) override; - virtual UINT8 io_r8(UINT8 adr) override; - virtual UINT16 io_r16(UINT8 adr) override; + virtual void internal_update(uint64_t current_time) override; + virtual void io_w8(uint8_t adr, uint8_t data) override; + virtual void io_w16(uint8_t adr, uint16_t data) override; + virtual uint8_t io_r8(uint8_t adr) override; + virtual uint16_t io_r16(uint8_t adr) override; private: enum { @@ -55,8 +55,8 @@ private: struct hso_cam_entry { bool active; - UINT8 command; - UINT16 time; + uint8_t command; + uint16_t time; }; address_space_config io_config; @@ -65,31 +65,31 @@ private: hso_cam_entry hso_info[8]; hso_cam_entry hso_cam_hold; - UINT64 base_timer2, ad_done; - UINT8 hso_command, ad_command; - UINT16 hso_time, ad_result; - UINT8 ios0, ios1, ioc0, ioc1; - UINT8 sbuf, sp_stat; - UINT8 serial_send_buf; - UINT64 serial_send_timer; + uint64_t base_timer2, ad_done; + uint8_t hso_command, ad_command; + uint16_t hso_time, ad_result; + uint8_t ios0, ios1, ioc0, ioc1; + uint8_t sbuf, sp_stat; + uint8_t serial_send_buf; + uint64_t serial_send_timer; - UINT16 timer_value(int timer, UINT64 current_time) const; - UINT64 timer_time_until(int timer, UINT64 current_time, UINT16 timer_value) const; + uint16_t timer_value(int timer, uint64_t current_time) const; + uint64_t timer_time_until(int timer, uint64_t current_time, uint16_t timer_value) const; void commit_hso_cam(); - void trigger_cam(int id, UINT64 current_time); - void ad_start(UINT64 current_time); - void serial_send(UINT8 data); + void trigger_cam(int id, uint64_t current_time); + void ad_start(uint64_t current_time); + void serial_send(uint8_t data); void serial_send_done(); }; class c8095_device : public i8x9x_device { public: - c8095_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c8095_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class p8098_device : public i8x9x_device { public: - p8098_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + p8098_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; extern const device_type C8095; diff --git a/src/devices/cpu/mcs96/i8xc196.cpp b/src/devices/cpu/mcs96/i8xc196.cpp index ee1bcc229ce..5d814f7e272 100644 --- a/src/devices/cpu/mcs96/i8xc196.cpp +++ b/src/devices/cpu/mcs96/i8xc196.cpp @@ -11,17 +11,17 @@ #include "emu.h" #include "i8xc196.h" -i8xc196_device::i8xc196_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : +i8xc196_device::i8xc196_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source) : mcs96_device(mconfig, type, name, tag, owner, clock, 16, shortname, source) { } -offs_t i8xc196_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t i8xc196_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { return disasm_generic(buffer, pc, oprom, opram, options, disasm_entries); } -void i8xc196_device::io_w8(UINT8 adr, UINT8 data) +void i8xc196_device::io_w8(uint8_t adr, uint8_t data) { switch(adr) { case 0: @@ -34,7 +34,7 @@ void i8xc196_device::io_w8(UINT8 adr, UINT8 data) return; } -void i8xc196_device::io_w16(UINT8 adr, UINT16 data) +void i8xc196_device::io_w16(uint8_t adr, uint16_t data) { switch(adr) { case 0: @@ -47,7 +47,7 @@ void i8xc196_device::io_w16(UINT8 adr, UINT16 data) return; } -UINT8 i8xc196_device::io_r8(UINT8 adr) +uint8_t i8xc196_device::io_r8(uint8_t adr) { switch(adr) { case 0x00: @@ -55,16 +55,16 @@ UINT8 i8xc196_device::io_r8(UINT8 adr) case 0x01: return 0x00; } - UINT8 data = 0x00; + uint8_t data = 0x00; logerror("%s: io_r8 %02x, %02x (%04x)\n", tag(), adr, data, PPC); return data; } -UINT16 i8xc196_device::io_r16(UINT8 adr) +uint16_t i8xc196_device::io_r16(uint8_t adr) { if(adr < 2) return 0x0000; - UINT16 data = 0x0000; + uint16_t data = 0x0000; logerror("%s: io_r16 %02x, %04x (%04x)\n", tag(), adr, data, PPC); return data; } diff --git a/src/devices/cpu/mcs96/i8xc196.h b/src/devices/cpu/mcs96/i8xc196.h index 746224a39f7..eeaf580aa64 100644 --- a/src/devices/cpu/mcs96/i8xc196.h +++ b/src/devices/cpu/mcs96/i8xc196.h @@ -15,18 +15,18 @@ class i8xc196_device : public mcs96_device { public: - i8xc196_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + i8xc196_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source); static const disasm_entry disasm_entries[0x100]; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; virtual void do_exec_full() override; virtual void do_exec_partial() override; - virtual void io_w8(UINT8 adr, UINT8 data) override; - virtual void io_w16(UINT8 adr, UINT16 data) override; - virtual UINT8 io_r8(UINT8 adr) override; - virtual UINT16 io_r16(UINT8 adr) override; + virtual void io_w8(uint8_t adr, uint8_t data) override; + virtual void io_w16(uint8_t adr, uint16_t data) override; + virtual uint8_t io_r8(uint8_t adr) override; + virtual uint16_t io_r16(uint8_t adr) override; #define O(o) void o ## _196_full(); void o ## _196_partial() diff --git a/src/devices/cpu/mcs96/mcs96.cpp b/src/devices/cpu/mcs96/mcs96.cpp index 4e30df62c07..1711caaec32 100644 --- a/src/devices/cpu/mcs96/mcs96.cpp +++ b/src/devices/cpu/mcs96/mcs96.cpp @@ -12,7 +12,7 @@ #include "debugger.h" #include "mcs96.h" -mcs96_device::mcs96_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, int data_width, const char *shortname, const char *source) : +mcs96_device::mcs96_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, int data_width, const char *shortname, const char *source) : cpu_device(mconfig, type, name, tag, owner, clock, shortname, source), program_config("program", ENDIANNESS_LITTLE, data_width, 16), program(nullptr), direct(nullptr), icount(0), bcount(0), inst_state(0), cycles_scaling(0), pending_irq(0), PC(0), PPC(0), PSW(0), OP1(0), OP2(0), OP3(0), OPI(0), TMP(0), irq_requested(false) @@ -51,22 +51,22 @@ void mcs96_device::device_reset() inst_state = STATE_FETCH; } -UINT32 mcs96_device::execute_min_cycles() const +uint32_t mcs96_device::execute_min_cycles() const { return 4; } -UINT32 mcs96_device::execute_max_cycles() const +uint32_t mcs96_device::execute_max_cycles() const { return 33; } -UINT32 mcs96_device::execute_input_lines() const +uint32_t mcs96_device::execute_input_lines() const { return 1; } -void mcs96_device::recompute_bcount(UINT64 event_time) +void mcs96_device::recompute_bcount(uint64_t event_time) { if(!event_time || event_time >= total_cycles() + icount) { bcount = 0; @@ -153,7 +153,7 @@ void mcs96_device::state_string_export(const device_state_entry &entry, std::str } } -std::string mcs96_device::regname(UINT8 reg) +std::string mcs96_device::regname(uint8_t reg) { char res[32]; switch(reg) { @@ -172,7 +172,7 @@ std::string mcs96_device::regname(UINT8 reg) return res; } -offs_t mcs96_device::disasm_generic(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options, const disasm_entry *entries) +offs_t mcs96_device::disasm_generic(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options, const disasm_entry *entries) { bool prefix_fe = false; int off = 0; @@ -183,7 +183,7 @@ offs_t mcs96_device::disasm_generic(char *buffer, offs_t pc, const UINT8 *oprom, oprom++; } const disasm_entry &e = entries[oprom[0]]; - UINT32 flags = e.flags | DASMFLAG_SUPPORTED; + uint32_t flags = e.flags | DASMFLAG_SUPPORTED; buffer += sprintf(buffer, "%s", prefix_fe ? e.opcode_fe : e.opcode); switch(e.mode) { @@ -413,17 +413,17 @@ offs_t mcs96_device::disasm_generic(char *buffer, offs_t pc, const UINT8 *oprom, return flags+off; } -UINT32 mcs96_device::disasm_min_opcode_bytes() const +uint32_t mcs96_device::disasm_min_opcode_bytes() const { return 1; } -UINT32 mcs96_device::disasm_max_opcode_bytes() const +uint32_t mcs96_device::disasm_max_opcode_bytes() const { return 7; } -void mcs96_device::io_w8(UINT8 adr, UINT8 data) +void mcs96_device::io_w8(uint8_t adr, uint8_t data) { switch(adr) { case 0x02: @@ -478,7 +478,7 @@ void mcs96_device::io_w8(UINT8 adr, UINT8 data) return; } -void mcs96_device::io_w16(UINT8 adr, UINT16 data) +void mcs96_device::io_w16(uint8_t adr, uint16_t data) { switch(adr) { case 0: @@ -494,7 +494,7 @@ void mcs96_device::io_w16(UINT8 adr, UINT16 data) return; } -UINT8 mcs96_device::io_r8(UINT8 adr) +uint8_t mcs96_device::io_r8(uint8_t adr) { switch(adr) { case 0x00: @@ -504,26 +504,26 @@ UINT8 mcs96_device::io_r8(UINT8 adr) case 0x08: return PSW; } - UINT8 data = 0x00; + uint8_t data = 0x00; logerror("%s: io_r8 %02x, %02x (%04x)\n", tag(), adr, data, PPC); return data; } -UINT16 mcs96_device::io_r16(UINT8 adr) +uint16_t mcs96_device::io_r16(uint8_t adr) { if(adr < 2) return 0x0000; - UINT16 data = 0x0000; + uint16_t data = 0x0000; logerror("%s: io_r16 %02x, %04x (%04x)\n", tag(), adr, data, PPC); return data; } -void mcs96_device::reg_w8(UINT8 adr, UINT8 data) +void mcs96_device::reg_w8(uint8_t adr, uint8_t data) { if(adr < 0x18) io_w8(adr, data); else { - UINT16 &r = R[(adr - 0x18) >> 1]; + uint16_t &r = R[(adr - 0x18) >> 1]; if(adr & 0x01) r = (r & 0x00ff) | (data << 8); else @@ -531,7 +531,7 @@ void mcs96_device::reg_w8(UINT8 adr, UINT8 data) } } -void mcs96_device::reg_w16(UINT8 adr, UINT16 data) +void mcs96_device::reg_w16(uint8_t adr, uint16_t data) { adr &= 0xfe; if(adr < 0x18) @@ -540,19 +540,19 @@ void mcs96_device::reg_w16(UINT8 adr, UINT16 data) R[(adr-0x18) >> 1] = data; } -UINT8 mcs96_device::reg_r8(UINT8 adr) +uint8_t mcs96_device::reg_r8(uint8_t adr) { if(adr < 0x18) return io_r8(adr); - UINT16 data = R[(adr - 0x18) >> 1]; + uint16_t data = R[(adr - 0x18) >> 1]; if(adr & 0x01) return data >> 8; else return data; } -UINT16 mcs96_device::reg_r16(UINT8 adr) +uint16_t mcs96_device::reg_r16(uint8_t adr) { adr &= 0xfe; if(adr < 0x18) @@ -561,12 +561,12 @@ UINT16 mcs96_device::reg_r16(UINT8 adr) return R[(adr-0x18) >> 1]; } -void mcs96_device::any_w8(UINT16 adr, UINT8 data) +void mcs96_device::any_w8(uint16_t adr, uint8_t data) { if(adr < 0x18) io_w8(adr, data); else if(adr < 0x100) { - UINT16 &r = R[(adr - 0x18) >> 1]; + uint16_t &r = R[(adr - 0x18) >> 1]; if(adr & 0x01) r = (r & 0x00ff) | (data << 8); else @@ -575,7 +575,7 @@ void mcs96_device::any_w8(UINT16 adr, UINT8 data) program->write_byte(adr, data); } -void mcs96_device::any_w16(UINT16 adr, UINT16 data) +void mcs96_device::any_w16(uint16_t adr, uint16_t data) { adr &= 0xfffe; if(adr < 0x18) @@ -586,12 +586,12 @@ void mcs96_device::any_w16(UINT16 adr, UINT16 data) program->write_word(adr, data); } -UINT8 mcs96_device::any_r8(UINT16 adr) +uint8_t mcs96_device::any_r8(uint16_t adr) { if(adr < 0x18) return io_r8(adr); else if(adr < 0x100) { - UINT16 data = R[(adr - 0x18) >> 1]; + uint16_t data = R[(adr - 0x18) >> 1]; if(adr & 0x01) return data >> 8; else @@ -600,7 +600,7 @@ UINT8 mcs96_device::any_r8(UINT16 adr) return program->read_byte(adr); } -UINT16 mcs96_device::any_r16(UINT16 adr) +uint16_t mcs96_device::any_r16(uint16_t adr) { adr &= 0xfffe; if(adr < 0x18) @@ -611,13 +611,13 @@ UINT16 mcs96_device::any_r16(UINT16 adr) return program->read_word(adr); } -UINT8 mcs96_device::do_addb(UINT8 v1, UINT8 v2) +uint8_t mcs96_device::do_addb(uint8_t v1, uint8_t v2) { - UINT16 sum = v1+v2; + uint16_t sum = v1+v2; PSW &= ~(F_Z|F_N|F_C|F_V); - if(!UINT8(sum)) + if(!uint8_t(sum)) PSW |= F_Z; - else if(INT8(sum) < 0) + else if(int8_t(sum) < 0) PSW |= F_N; if(~(v1^v2) & (v1^sum) & 0x80) PSW |= F_V|F_VT; @@ -626,13 +626,13 @@ UINT8 mcs96_device::do_addb(UINT8 v1, UINT8 v2) return sum; } -UINT16 mcs96_device::do_add(UINT16 v1, UINT16 v2) +uint16_t mcs96_device::do_add(uint16_t v1, uint16_t v2) { - UINT32 sum = v1+v2; + uint32_t sum = v1+v2; PSW &= ~(F_Z|F_N|F_C|F_V); - if(!UINT16(sum)) + if(!uint16_t(sum)) PSW |= F_Z; - else if(INT16(sum) < 0) + else if(int16_t(sum) < 0) PSW |= F_N; if(~(v1^v2) & (v1^sum) & 0x8000) PSW |= F_V|F_VT; @@ -641,13 +641,13 @@ UINT16 mcs96_device::do_add(UINT16 v1, UINT16 v2) return sum; } -UINT8 mcs96_device::do_subb(UINT8 v1, UINT8 v2) +uint8_t mcs96_device::do_subb(uint8_t v1, uint8_t v2) { - UINT16 diff = v1 - v2; + uint16_t diff = v1 - v2; PSW &= ~(F_N|F_V|F_Z|F_C); - if(!UINT8(diff)) + if(!uint8_t(diff)) PSW |= F_Z; - else if(INT8(diff) < 0) + else if(int8_t(diff) < 0) PSW |= F_N; if((v1^v2) & (v1^diff) & 0x80) PSW |= F_V; @@ -656,13 +656,13 @@ UINT8 mcs96_device::do_subb(UINT8 v1, UINT8 v2) return diff; } -UINT16 mcs96_device::do_sub(UINT16 v1, UINT16 v2) +uint16_t mcs96_device::do_sub(uint16_t v1, uint16_t v2) { - UINT32 diff = v1 - v2; + uint32_t diff = v1 - v2; PSW &= ~(F_N|F_V|F_Z|F_C); - if(!UINT16(diff)) + if(!uint16_t(diff)) PSW |= F_Z; - else if(INT16(diff) < 0) + else if(int16_t(diff) < 0) PSW |= F_N; if((v1^v2) & (v1^diff) & 0x8000) PSW |= F_V; @@ -671,13 +671,13 @@ UINT16 mcs96_device::do_sub(UINT16 v1, UINT16 v2) return diff; } -UINT8 mcs96_device::do_addcb(UINT8 v1, UINT8 v2) +uint8_t mcs96_device::do_addcb(uint8_t v1, uint8_t v2) { - UINT16 sum = v1+v2+(PSW & F_C ? 1 : 0); + uint16_t sum = v1+v2+(PSW & F_C ? 1 : 0); PSW &= ~(F_Z|F_N|F_C|F_V); - if(!UINT8(sum)) + if(!uint8_t(sum)) PSW |= F_Z; - else if(INT8(sum) < 0) + else if(int8_t(sum) < 0) PSW |= F_N; if(~(v1^v2) & (v1^sum) & 0x80) PSW |= F_V|F_VT; @@ -686,13 +686,13 @@ UINT8 mcs96_device::do_addcb(UINT8 v1, UINT8 v2) return sum; } -UINT16 mcs96_device::do_addc(UINT16 v1, UINT16 v2) +uint16_t mcs96_device::do_addc(uint16_t v1, uint16_t v2) { - UINT32 sum = v1+v2+(PSW & F_C ? 1 : 0); + uint32_t sum = v1+v2+(PSW & F_C ? 1 : 0); PSW &= ~(F_Z|F_N|F_C|F_V); - if(!UINT16(sum)) + if(!uint16_t(sum)) PSW |= F_Z; - else if(INT16(sum) < 0) + else if(int16_t(sum) < 0) PSW |= F_N; if(~(v1^v2) & (v1^sum) & 0x8000) PSW |= F_V|F_VT; @@ -701,13 +701,13 @@ UINT16 mcs96_device::do_addc(UINT16 v1, UINT16 v2) return sum; } -UINT8 mcs96_device::do_subcb(UINT8 v1, UINT8 v2) +uint8_t mcs96_device::do_subcb(uint8_t v1, uint8_t v2) { - UINT16 diff = v1 - v2 - (PSW & F_C ? 0 : 1); + uint16_t diff = v1 - v2 - (PSW & F_C ? 0 : 1); PSW &= ~(F_N|F_V|F_Z|F_C); - if(!UINT8(diff)) + if(!uint8_t(diff)) PSW |= F_Z; - else if(INT8(diff) < 0) + else if(int8_t(diff) < 0) PSW |= F_N; if((v1^v2) & (v1^diff) & 0x80) PSW |= F_V; @@ -716,13 +716,13 @@ UINT8 mcs96_device::do_subcb(UINT8 v1, UINT8 v2) return diff; } -UINT16 mcs96_device::do_subc(UINT16 v1, UINT16 v2) +uint16_t mcs96_device::do_subc(uint16_t v1, uint16_t v2) { - UINT32 diff = v1 - v2 - (PSW & F_C ? 0 : 1); + uint32_t diff = v1 - v2 - (PSW & F_C ? 0 : 1); PSW &= ~(F_N|F_V|F_Z|F_C); - if(!UINT16(diff)) + if(!uint16_t(diff)) PSW |= F_Z; - else if(INT16(diff) < 0) + else if(int16_t(diff) < 0) PSW |= F_N; if((v1^v2) & (v1^diff) & 0x8000) PSW |= F_V; @@ -731,21 +731,21 @@ UINT16 mcs96_device::do_subc(UINT16 v1, UINT16 v2) return diff; } -void mcs96_device::set_nz8(UINT8 v) +void mcs96_device::set_nz8(uint8_t v) { PSW &= ~(F_N|F_V|F_Z|F_C); if(!v) PSW |= F_Z; - else if(INT8(v) < 0) + else if(int8_t(v) < 0) PSW |= F_N; } -void mcs96_device::set_nz16(UINT16 v) +void mcs96_device::set_nz16(uint16_t v) { PSW &= ~(F_N|F_V|F_Z|F_C); if(!v) PSW |= F_Z; - else if(INT16(v) < 0) + else if(int16_t(v) < 0) PSW |= F_N; } diff --git a/src/devices/cpu/mcs96/mcs96.h b/src/devices/cpu/mcs96/mcs96.h index 0111361899c..2f372cdab5b 100644 --- a/src/devices/cpu/mcs96/mcs96.h +++ b/src/devices/cpu/mcs96/mcs96.h @@ -17,7 +17,7 @@ public: EXINT_LINE = 1 }; - mcs96_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, int data_width, const char *shortname, const char *source); + mcs96_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, int data_width, const char *shortname, const char *source); protected: enum { @@ -73,9 +73,9 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override; - virtual UINT32 execute_max_cycles() const override; - virtual UINT32 execute_input_lines() const override; + virtual uint32_t execute_min_cycles() const override; + virtual uint32_t execute_max_cycles() const override; + virtual uint32_t execute_input_lines() const override; virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -88,61 +88,61 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override; - virtual UINT32 disasm_max_opcode_bytes() const override; - virtual offs_t disasm_generic(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options, const disasm_entry *entries); + virtual uint32_t disasm_min_opcode_bytes() const override; + virtual uint32_t disasm_max_opcode_bytes() const override; + virtual offs_t disasm_generic(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options, const disasm_entry *entries); address_space_config program_config; address_space *program; direct_read_data *direct; int icount, bcount, inst_state, cycles_scaling; - UINT8 pending_irq; - UINT16 PC, PPC, PSW; - UINT16 OP1; - UINT8 OP2, OP3, OPI; - UINT32 TMP; - UINT16 R[0x74]; + uint8_t pending_irq; + uint16_t PC, PPC, PSW; + uint16_t OP1; + uint8_t OP2, OP3, OPI; + uint32_t TMP; + uint16_t R[0x74]; bool irq_requested; virtual void do_exec_full() = 0; virtual void do_exec_partial() = 0; - virtual void internal_update(UINT64 current_time) = 0; - virtual void io_w8(UINT8 adr, UINT8 data) = 0; - virtual void io_w16(UINT8 adr, UINT16 data) = 0; - virtual UINT8 io_r8(UINT8 adr) = 0; - virtual UINT16 io_r16(UINT8 adr) = 0; + virtual void internal_update(uint64_t current_time) = 0; + virtual void io_w8(uint8_t adr, uint8_t data) = 0; + virtual void io_w16(uint8_t adr, uint16_t data) = 0; + virtual uint8_t io_r8(uint8_t adr) = 0; + virtual uint16_t io_r16(uint8_t adr) = 0; - void recompute_bcount(UINT64 event_time); - static std::string regname(UINT8 reg); + void recompute_bcount(uint64_t event_time); + static std::string regname(uint8_t reg); inline void next(int cycles) { icount -= cycles_scaling*cycles; inst_state = STATE_FETCH; } inline void next_noirq(int cycles) { icount -= cycles_scaling*cycles; inst_state = STATE_FETCH_NOIRQ; } void check_irq(); - inline UINT8 read_pc() { return direct->read_byte(PC++); } + inline uint8_t read_pc() { return direct->read_byte(PC++); } - void reg_w8(UINT8 adr, UINT8 data); - void reg_w16(UINT8 adr, UINT16 data); - void any_w8(UINT16 adr, UINT8 data); - void any_w16(UINT16 adr, UINT16 data); + void reg_w8(uint8_t adr, uint8_t data); + void reg_w16(uint8_t adr, uint16_t data); + void any_w8(uint16_t adr, uint8_t data); + void any_w16(uint16_t adr, uint16_t data); - UINT8 reg_r8(UINT8 adr); - UINT16 reg_r16(UINT8 adr); - UINT8 any_r8(UINT16 adr); - UINT16 any_r16(UINT16 adr); + uint8_t reg_r8(uint8_t adr); + uint16_t reg_r16(uint8_t adr); + uint8_t any_r8(uint16_t adr); + uint16_t any_r16(uint16_t adr); - UINT8 do_addb(UINT8 v1, UINT8 v2); - UINT16 do_add(UINT16 v1, UINT16 v2); - UINT8 do_subb(UINT8 v1, UINT8 v2); - UINT16 do_sub(UINT16 v1, UINT16 v2); + uint8_t do_addb(uint8_t v1, uint8_t v2); + uint16_t do_add(uint16_t v1, uint16_t v2); + uint8_t do_subb(uint8_t v1, uint8_t v2); + uint16_t do_sub(uint16_t v1, uint16_t v2); - UINT8 do_addcb(UINT8 v1, UINT8 v2); - UINT16 do_addc(UINT16 v1, UINT16 v2); - UINT8 do_subcb(UINT8 v1, UINT8 v2); - UINT16 do_subc(UINT16 v1, UINT16 v2); + uint8_t do_addcb(uint8_t v1, uint8_t v2); + uint16_t do_addc(uint16_t v1, uint16_t v2); + uint8_t do_subcb(uint8_t v1, uint8_t v2); + uint16_t do_subc(uint16_t v1, uint16_t v2); - void set_nz8(UINT8 v); - void set_nz16(UINT16 v); + void set_nz8(uint8_t v); + void set_nz16(uint16_t v); #define O(o) void o ## _full(); void o ## _partial() diff --git a/src/devices/cpu/mcs96/mcs96ops.lst b/src/devices/cpu/mcs96/mcs96ops.lst index 3c2516ae54a..062b70706bf 100644 --- a/src/devices/cpu/mcs96/mcs96ops.lst +++ b/src/devices/cpu/mcs96/mcs96ops.lst @@ -37,7 +37,7 @@ fetch_noirq inst_state = OP1; eadr rel8 - OP1 = INT8(read_pc()); + OP1 = int8_t(read_pc()); eadr rel11 OP1 = read_pc(); @@ -51,11 +51,11 @@ eadr rel16 eadr rrel8 OP2 = read_pc(); - OP1 = INT8(read_pc()); + OP1 = int8_t(read_pc()); eadr brrel8 OP2 = read_pc(); - OP1 = INT8(read_pc()); + OP1 = int8_t(read_pc()); eadr direct_1 OP1 = read_pc(); @@ -134,7 +134,7 @@ eadr indexed_1 OPI &= 0xfe; OP1 |= read_pc() << 8; } else - OP1 = INT8(OP1); + OP1 = int8_t(OP1); if(OPI) { OP1 += reg_r16(OPI); } @@ -196,7 +196,7 @@ macro post_indexed $cycles1 $cycles2 06 ext direct_1 OP1 &= 0xfc; - TMP = INT16(reg_r16(OP1)); + TMP = int16_t(reg_r16(OP1)); set_nz16(TMP); reg_w16(OP1+2, TMP >> 16); next(4); @@ -216,10 +216,10 @@ macro post_indexed $cycles1 $cycles2 PSW |= F_ST; if(OP1 >= 1 && OP1 <= 16 && (TMP & (0x0001 << (OP1-1)))) PSW |= F_C; - TMP = UINT16(TMP) >> OP1; + TMP = uint16_t(TMP) >> OP1; if(!TMP) PSW |= F_Z; - else if(INT16(TMP) < 0) + else if(int16_t(TMP) < 0) PSW |= F_N; reg_w16(OP2, TMP); next(OP1 ? 7+OP1 : 8); @@ -234,10 +234,10 @@ macro post_indexed $cycles1 $cycles2 PSW |= F_ST; if(OP1 >= 1 && OP1 <= 16 && (TMP & (0x8000 >> (OP1-1)))) PSW |= F_C; - TMP = UINT16(TMP << OP1); + TMP = uint16_t(TMP << OP1); if(!TMP) PSW |= F_Z; - else if(INT16(TMP) < 0) + else if(int16_t(TMP) < 0) PSW |= F_N; reg_w16(OP2, TMP); next(OP1 ? 7+OP1 : 8); @@ -252,10 +252,10 @@ macro post_indexed $cycles1 $cycles2 PSW |= F_ST; if(OP1 >= 1 && OP1 <= 16 && (TMP & (0x0001 << (OP1-1)))) PSW |= F_C; - TMP = INT16(TMP) >> OP1; + TMP = int16_t(TMP) >> OP1; if(!TMP) PSW |= F_Z; - else if(INT16(TMP) < 0) + else if(int16_t(TMP) < 0) PSW |= F_N; reg_w16(OP2, TMP); next(OP1 ? 7+OP1 : 8); @@ -275,7 +275,7 @@ macro post_indexed $cycles1 $cycles2 TMP = TMP >> OP1; if(!TMP) PSW |= F_Z; - else if(INT32(TMP) < 0) + else if(int32_t(TMP) < 0) PSW |= F_N; reg_w16(OP2, TMP); reg_w16(OP2+2, TMP >> 16); @@ -296,7 +296,7 @@ macro post_indexed $cycles1 $cycles2 TMP = TMP << OP1; if(!TMP) PSW |= F_Z; - else if(INT32(TMP) < 0) + else if(int32_t(TMP) < 0) PSW |= F_N; reg_w16(OP2, TMP); reg_w16(OP2+2, TMP >> 16); @@ -314,10 +314,10 @@ macro post_indexed $cycles1 $cycles2 PSW |= F_ST; if(OP1 >= 1 && (TMP & (0x00000001 << (OP1-1)))) PSW |= F_C; - TMP = INT32(TMP) >> OP1; + TMP = int32_t(TMP) >> OP1; if(!TMP) PSW |= F_Z; - else if(INT32(TMP) < 0) + else if(int32_t(TMP) < 0) PSW |= F_N; reg_w16(OP2, TMP); reg_w16(OP2+2, TMP >> 16); @@ -327,7 +327,7 @@ macro post_indexed $cycles1 $cycles2 OP2 &= 0xfc; TMP = reg_r16(OP2); TMP |= reg_r16(OP2+2) << 16; - for(OP3 = 0; OP3 < 31 && INT32(TMP) >= 0; OP3++); + for(OP3 = 0; OP3 < 31 && int32_t(TMP) >= 0; OP3++); PSW &= ~(F_Z|F_N|F_C); if(!TMP) PSW |= F_Z; @@ -360,7 +360,7 @@ macro post_indexed $cycles1 $cycles2 16 extb direct_1 OP1 &= 0xfe; - TMP = INT8(reg_r8(OP1)); + TMP = int8_t(reg_r8(OP1)); set_nz8(TMP); reg_w16(OP1, TMP); next(4); @@ -380,10 +380,10 @@ macro post_indexed $cycles1 $cycles2 PSW |= F_ST; if(OP1 >= 1 && OP1 <= 8 && (TMP & (0x01 << (OP1-1)))) PSW |= F_C; - TMP = UINT8(TMP) >> OP1; + TMP = uint8_t(TMP) >> OP1; if(!TMP) PSW |= F_Z; - else if(INT8(TMP) < 0) + else if(int8_t(TMP) < 0) PSW |= F_N; reg_w8(OP2, TMP); next(OP1 ? 7+OP1 : 8); @@ -398,10 +398,10 @@ macro post_indexed $cycles1 $cycles2 PSW |= F_ST; if(OP1 >= 1 && OP1 <= 8 && (TMP & (0x80 >> (OP1-1)))) PSW |= F_C; - TMP = UINT8(TMP << OP1); + TMP = uint8_t(TMP << OP1); if(!TMP) PSW |= F_Z; - else if(INT8(TMP) < 0) + else if(int8_t(TMP) < 0) PSW |= F_N; reg_w8(OP2, TMP); next(OP1 ? 7+OP1 : 8); @@ -416,10 +416,10 @@ macro post_indexed $cycles1 $cycles2 PSW |= F_ST; if(OP1 >= 1 && OP1 <= 8 && (TMP & (0x01 << (OP1-1)))) PSW |= F_C; - TMP = UINT8(INT8(TMP) >> OP1); + TMP = uint8_t(int8_t(TMP) >> OP1); if(!TMP) PSW |= F_Z; - else if(INT8(TMP) < 0) + else if(int8_t(TMP) < 0) PSW |= F_N; reg_w8(OP2, TMP); next(OP1 ? 7+OP1 : 8); @@ -560,14 +560,14 @@ macro post_indexed $cycles1 $cycles2 fe4c mul direct_3 TMP = reg_r16(OP1); - TMP = INT16(reg_r16(OP2)) * INT16(TMP); + TMP = int16_t(reg_r16(OP2)) * int16_t(TMP); OP3 &= 0xfc; reg_w16(OP3, TMP); reg_w16(OP3+2, TMP >> 16); next(30); fe4d mul immed_3w - TMP = INT16(OP1) * INT16(reg_r16(OP2)); + TMP = int16_t(OP1) * int16_t(reg_r16(OP2)); OP3 &= 0xfc; reg_w16(OP3, TMP); reg_w16(OP3+2, TMP >> 16); @@ -575,7 +575,7 @@ fe4d mul immed_3w fe4e mul indirect_3 TMP = any_r16(OP1); - TMP = INT16(reg_r16(OP2)) * INT16(TMP); + TMP = int16_t(reg_r16(OP2)) * int16_t(TMP); OP3 &= 0xfc; reg_w16(OP3, TMP); reg_w16(OP3+2, TMP >> 16); @@ -583,7 +583,7 @@ fe4e mul indirect_3 fe4f mul indexed_3 TMP = any_r16(OP1); - TMP = INT16(reg_r16(OP2)) * INT16(TMP); + TMP = int16_t(reg_r16(OP2)) * int16_t(TMP); OP3 &= 0xfc; reg_w16(OP3, TMP); reg_w16(OP3+2, TMP >> 16); @@ -687,24 +687,24 @@ fe4f mul indexed_3 fe5c mulb direct_3 TMP = reg_r8(OP1); - TMP = INT8(reg_r8(OP2)) * INT8(TMP); + TMP = int8_t(reg_r8(OP2)) * int8_t(TMP); reg_w16(OP3, TMP); next(22); fe5d mulb immed_3b - TMP = INT8(OP1) * INT8(reg_r8(OP2)); + TMP = int8_t(OP1) * int8_t(reg_r8(OP2)); reg_w16(OP3, TMP); next(22); fe5e mulb indirect_3 TMP = any_r8(OP1); - TMP = INT8(reg_r8(OP2)) * INT8(TMP); + TMP = int8_t(reg_r8(OP2)) * int8_t(TMP); reg_w16(OP3, TMP); post_indirect 1 24 25 // +5 when external fe5f mulb indexed_3 TMP = any_r8(OP1); - TMP = INT8(reg_r8(OP2)) * INT8(TMP); + TMP = int8_t(reg_r8(OP2)) * int8_t(TMP); reg_w16(OP3, TMP); post_indexed 24 25 // +5 when external @@ -815,14 +815,14 @@ fe5f mulb indexed_3 fe6c mul direct_2 OP2 &= 0xfc; TMP = reg_r16(OP1); - TMP = INT16(reg_r16(OP2)) * INT16(TMP); + TMP = int16_t(reg_r16(OP2)) * int16_t(TMP); reg_w16(OP2, TMP); reg_w16(OP2+2, TMP >> 16); next(29); fe6d mul immed_2w OP2 &= 0xfc; - TMP = INT16(OP1) * INT16(reg_r16(OP2)); + TMP = int16_t(OP1) * int16_t(reg_r16(OP2)); reg_w16(OP2, TMP); reg_w16(OP2+2, TMP >> 16); next(30); @@ -830,7 +830,7 @@ fe6d mul immed_2w fe6e mul indirect_2 OP2 &= 0xfc; TMP = any_r16(OP1); - TMP = INT16(reg_r16(OP2)) * INT16(TMP); + TMP = int16_t(reg_r16(OP2)) * int16_t(TMP); reg_w16(OP2, TMP); reg_w16(OP2+2, TMP >> 16); post_indirect 2 31 32 // +5 when external @@ -838,7 +838,7 @@ fe6e mul indirect_2 fe6f mul indexed_2 OP2 &= 0xfc; TMP = any_r16(OP1); - TMP = INT16(reg_r16(OP2)) * INT16(TMP); + TMP = int16_t(reg_r16(OP2)) * int16_t(TMP); reg_w16(OP2, TMP); reg_w16(OP2+2, TMP >> 16); post_indexed 31 32 // +5 when external @@ -946,27 +946,27 @@ fe6f mul indexed_2 fe7c mulb direct_2 OP2 &= 0xfe; TMP = reg_r8(OP1); - TMP = INT8(reg_r16(OP2)) * INT8(TMP); + TMP = int8_t(reg_r16(OP2)) * int8_t(TMP); reg_w16(OP2, TMP); next(21); fe7d mulb immed_2b OP2 &= 0xfe; - TMP = INT8(OP1) * INT8(reg_r8(OP2)); + TMP = int8_t(OP1) * int8_t(reg_r8(OP2)); reg_w16(OP2, TMP); next(21); fe7e mulb indirect_2 OP2 &= 0xfe; TMP = any_r8(OP1); - TMP = INT8(reg_r8(OP2)) * INT8(TMP); + TMP = int8_t(reg_r8(OP2)) * int8_t(TMP); reg_w16(OP2, TMP); post_indirect 1 23 24 // +5 when external fe7f mulb indexed_2 OP2 &= 0xfe; TMP = any_r16(OP1); - TMP = INT8(reg_r16(OP2)) * INT8(TMP); + TMP = int8_t(reg_r16(OP2)) * int8_t(TMP); reg_w16(OP2, TMP); post_indexed 23 24 // +5 when external @@ -1050,7 +1050,7 @@ fe7f mulb indexed_2 if(OP1) { TMP = reg_r16(OP2); TMP |= reg_r16(OP2+2); - UINT32 TMP2 = TMP / OP1; + uint32_t TMP2 = TMP / OP1; if(TMP2 > 65535) PSW |= F_V|F_VT; TMP = TMP % OP1; @@ -1066,7 +1066,7 @@ fe7f mulb indexed_2 if(OP1) { TMP = reg_r16(OP2); TMP |= reg_r16(OP2+2); - UINT32 TMP2 = TMP / OP1; + uint32_t TMP2 = TMP / OP1; if(TMP2 > 65535) PSW |= F_V|F_VT; TMP = TMP % OP1; @@ -1079,11 +1079,11 @@ fe7f mulb indexed_2 8e divu indirect_2 OP2 &= 0xfc; PSW &= ~F_V; - UINT32 d = any_r16(OP1); + uint32_t d = any_r16(OP1); if(d) { TMP = reg_r16(OP2); TMP |= reg_r16(OP2+2); - UINT32 TMP2 = TMP / d; + uint32_t TMP2 = TMP / d; if(TMP2 > 65535) PSW |= F_V|F_VT; TMP = TMP % d; @@ -1096,11 +1096,11 @@ fe7f mulb indexed_2 8f divu indexed_2 OP2 &= 0xfc; PSW &= ~F_V; - UINT32 d = any_r16(OP1); + uint32_t d = any_r16(OP1); if(d) { TMP = reg_r16(OP2); TMP |= reg_r16(OP2+2); - UINT32 TMP2 = TMP / d; + uint32_t TMP2 = TMP / d; if(TMP2 > 65535) PSW |= F_V|F_VT; TMP = TMP % d; @@ -1117,10 +1117,10 @@ fe8c div direct_2 if(OP1) { TMP = reg_r16(OP2); TMP |= reg_r16(OP2+2); - INT32 TMP2 = INT32(TMP) / INT16(OP1); + int32_t TMP2 = int32_t(TMP) / int16_t(OP1); if(TMP2 > 32767 || TMP2 < -32768) PSW |= F_V|F_VT; - TMP = TMP % INT16(OP1); + TMP = TMP % int16_t(OP1); TMP = (TMP2 & 0xffff) | ((TMP & 0xffff) << 16); reg_w16(OP2, TMP); reg_w16(OP2+2, TMP >> 16); @@ -1133,10 +1133,10 @@ fe8d div immed_2w if(OP1) { TMP = reg_r16(OP2); TMP |= reg_r16(OP2+2); - INT32 TMP2 = INT32(TMP) / INT16(OP1); + int32_t TMP2 = int32_t(TMP) / int16_t(OP1); if(TMP2 > 32767 || TMP2 < -32768) PSW |= F_V|F_VT; - TMP = TMP % INT16(OP1); + TMP = TMP % int16_t(OP1); TMP = (TMP2 & 0xffff) | ((TMP & 0xffff) << 16); reg_w16(OP2, TMP); reg_w16(OP2+2, TMP >> 16); @@ -1146,11 +1146,11 @@ fe8d div immed_2w fe8e div indirect_2 OP2 &= 0xfc; PSW &= ~F_V; - INT32 d = INT16(any_r16(OP1)); + int32_t d = int16_t(any_r16(OP1)); if(d) { TMP = reg_r16(OP2); TMP |= reg_r16(OP2+2); - INT32 TMP2 = INT32(TMP) / d; + int32_t TMP2 = int32_t(TMP) / d; if(TMP2 > 32767 || TMP2 < -32768) PSW |= F_V|F_VT; TMP = TMP % d; @@ -1163,11 +1163,11 @@ fe8e div indirect_2 fe8f div indexed_2 OP2 &= 0xfc; PSW &= ~F_V; - INT32 d = INT16(any_r16(OP1)); + int32_t d = int16_t(any_r16(OP1)); if(d) { TMP = reg_r16(OP2); TMP |= reg_r16(OP2+2); - INT32 TMP2 = INT32(TMP) / d; + int32_t TMP2 = int32_t(TMP) / d; if(TMP2 > 32767 || TMP2 < -32768) PSW |= F_V|F_VT; TMP = TMP % d; @@ -1255,7 +1255,7 @@ fe8f div indexed_2 OP1 = reg_r8(OP1); if(OP1) { TMP = reg_r16(OP2); - UINT32 TMP2 = TMP / OP1; + uint32_t TMP2 = TMP / OP1; if(TMP2 > 255) PSW |= F_V|F_VT; TMP = TMP % OP1; @@ -1268,7 +1268,7 @@ fe8f div indexed_2 PSW &= ~F_V; if(OP1) { TMP = reg_r16(OP2); - UINT32 TMP2 = TMP / OP1; + uint32_t TMP2 = TMP / OP1; if(TMP2 > 255) PSW |= F_V|F_VT; TMP = TMP % OP1; @@ -1279,10 +1279,10 @@ fe8f div indexed_2 9e divub indirect_2 PSW &= ~F_V; - UINT32 d = any_r8(OP1); + uint32_t d = any_r8(OP1); if(d) { TMP = reg_r16(OP2); - UINT32 TMP2 = TMP / d; + uint32_t TMP2 = TMP / d; if(TMP2 > 255) PSW |= F_V|F_VT; TMP = TMP % d; @@ -1293,10 +1293,10 @@ fe8f div indexed_2 9f divub indexed_2 PSW &= ~F_V; - UINT32 d = any_r8(OP1); + uint32_t d = any_r8(OP1); if(d) { TMP = reg_r16(OP2); - UINT32 TMP2 = TMP / d; + uint32_t TMP2 = TMP / d; if(TMP2 > 255) PSW |= F_V|F_VT; TMP = TMP % d; @@ -1310,10 +1310,10 @@ fe9c divb direct_2 OP1 = reg_r8(OP1); if(OP1) { TMP = reg_r16(OP2); - UINT32 TMP2 = INT16(TMP) / INT8(OP1); - if(INT16(TMP2) > 127 || INT16(TMP2) < -128) + uint32_t TMP2 = int16_t(TMP) / int8_t(OP1); + if(int16_t(TMP2) > 127 || int16_t(TMP2) < -128) PSW |= F_V|F_VT; - TMP = INT16(TMP) % INT8(OP1); + TMP = int16_t(TMP) % int8_t(OP1); TMP = (TMP2 & 0xff) | ((TMP & 0xff) << 8); reg_w16(OP2, TMP); } @@ -1323,10 +1323,10 @@ fe9d divb immed_2b PSW &= ~F_V; if(OP1) { TMP = reg_r16(OP2); - UINT32 TMP2 = INT16(TMP) / INT8(OP1); - if(INT16(TMP2) > 127 || INT16(TMP2) < -128) + uint32_t TMP2 = int16_t(TMP) / int8_t(OP1); + if(int16_t(TMP2) > 127 || int16_t(TMP2) < -128) PSW |= F_V|F_VT; - TMP = INT16(TMP) % INT8(OP1); + TMP = int16_t(TMP) % int8_t(OP1); TMP = (TMP2 & 0xff) | ((TMP & 0xff) << 8); reg_w16(OP2, TMP); } @@ -1334,13 +1334,13 @@ fe9d divb immed_2b fe9e divb indirect_2 PSW &= ~F_V; - INT32 d = INT8(any_r8(OP1)); + int32_t d = int8_t(any_r8(OP1)); if(d) { TMP = reg_r16(OP2); - UINT32 TMP2 = INT16(TMP) / d; - if(INT16(TMP2) > 127 || INT16(TMP2) < -128) + uint32_t TMP2 = int16_t(TMP) / d; + if(int16_t(TMP2) > 127 || int16_t(TMP2) < -128) PSW |= F_V|F_VT; - TMP = INT16(TMP) % d; + TMP = int16_t(TMP) % d; TMP = (TMP2 & 0xff) | ((TMP & 0xff) << 8); reg_w16(OP2, TMP); } @@ -1348,13 +1348,13 @@ fe9e divb indirect_2 fe9f divb indexed_2 PSW &= ~F_V; - INT32 d = INT8(any_r8(OP1)); + int32_t d = int8_t(any_r8(OP1)); if(d) { TMP = reg_r16(OP2); - UINT32 TMP2 = INT16(TMP) / d; - if(INT16(TMP2) > 127 || INT16(TMP2) < -128) + uint32_t TMP2 = int16_t(TMP) / d; + if(int16_t(TMP2) > 127 || int16_t(TMP2) < -128) PSW |= F_V|F_VT; - TMP = INT16(TMP) % d; + TMP = int16_t(TMP) % d; TMP = (TMP2 & 0xff) | ((TMP & 0xff) << 8); reg_w16(OP2, TMP); } @@ -1423,19 +1423,19 @@ ab subc indexed_2 post_indexed 6 7 // +5 when external ac ldbze direct_2 - reg_w16(OP2, UINT8(reg_r8(OP1))); + reg_w16(OP2, uint8_t(reg_r8(OP1))); next(4); ad ldbze immed_2b - reg_w16(OP2, UINT8(OP1)); + reg_w16(OP2, uint8_t(OP1)); next(4); ae ldbze indirect_2 - reg_w16(OP2, UINT8(any_r8(OP1))); + reg_w16(OP2, uint8_t(any_r8(OP1))); post_indirect 1 6 7 // +5 when external af ldbze indexed_2 - reg_w16(OP2, UINT8(any_r8(OP1))); + reg_w16(OP2, uint8_t(any_r8(OP1))); post_indexed 6 7 // +5 when external b0 ldb direct_2 @@ -1501,19 +1501,19 @@ bb subcb indexed_2 post_indexed 6 7 // +5 when external bc ldbse direct_2 - reg_w16(OP2, INT8(reg_r8(OP1))); + reg_w16(OP2, int8_t(reg_r8(OP1))); next(4); bd ldbse immed_2b - reg_w16(OP2, INT8(OP1)); + reg_w16(OP2, int8_t(OP1)); next(4); be ldbse indirect_2 - reg_w16(OP2, INT8(any_r8(OP1))); + reg_w16(OP2, int8_t(any_r8(OP1))); post_indirect 1 6 7 // +5 when external bf ldbse indexed_2 - reg_w16(OP2, INT8(any_r8(OP1))); + reg_w16(OP2, int8_t(any_r8(OP1))); post_indexed 6 7 // +5 when external c0 st direct_2 @@ -1752,7 +1752,7 @@ df je rel8 e0 djnz rrel8 TMP = reg_r8(OP2); - TMP = UINT8(TMP-1); + TMP = uint8_t(TMP-1); reg_w8(OP2, TMP); if(TMP) { PC += OP1; |