diff options
author | Mike Pavone <pavone@retrodev.com> | 2012-12-27 23:00:11 -0800 |
---|---|---|
committer | Mike Pavone <pavone@retrodev.com> | 2012-12-27 23:00:11 -0800 |
commit | 923af7c3b7caeba2cc319dbec6ef4688849a299a (patch) | |
tree | c394eb4769d509529f00f7511a1173ba64b45a42 | |
parent | 6609f3fd72422469c6bf4ebc6a6630ce25a4796b (diff) |
Use unsigned comparisons for address decoding, exit when we hit an unhandled addressing mode for jmp
-rw-r--r-- | m68k_to_x86.c | 1 | ||||
-rw-r--r-- | runtime.S | 40 |
2 files changed, 21 insertions, 20 deletions
diff --git a/m68k_to_x86.c b/m68k_to_x86.c index 05b65b4..a07bb07 100644 --- a/m68k_to_x86.c +++ b/m68k_to_x86.c @@ -1376,6 +1376,7 @@ uint8_t * translate_m68k_jmp(uint8_t * dst, m68kinst * inst, x86_68k_options * o break; default: printf("address mode %d not yet supported (jmp)\n", inst->src.addr_mode); + exit(1); } return dst; } @@ -178,15 +178,15 @@ m68k_write_word: call inccycles and $0xFFFFFF, %rdi cmp $0x400000, %edi - jle cart_w + jbe cart_w cmp $0xE00000, %edi - jge workram_w + jae workram_w cmp $0xC00000, %edi - jge vdp_psg_w + jae vdp_psg_w cmp $0xA10000, %edi - jl not_io_w + jb not_io_w cmp $0xA12000, %edi - jge not_io_w + jae not_io_w jmp do_io_write_w not_io_w: ret @@ -202,7 +202,7 @@ vdp_psg_w: jnz crash and $0x1F, %edi cmp $4, %edi - jl try_fifo_write + jb try_fifo_write jmp do_vdp_port_write try_fifo_write: push %rdx @@ -245,15 +245,15 @@ m68k_write_byte: call inccycles and $0xFFFFFF, %rdi cmp $0x400000, %edi - jle cart_wb + jbe cart_wb cmp $0xE00000, %edi - jge workram_wb + jae workram_wb cmp $0xC00000, %edi - jge vdp_psg_wb + jae vdp_psg_wb cmp $0xA10000, %edi - jl not_io_wb + jb not_io_wb cmp $0xA12000, %edi - jge not_io_wb + jae not_io_wb jmp do_io_write not_io_wb: ret @@ -318,15 +318,15 @@ m68k_read_word_scratch1: call inccycles and $0xFFFFFF, %rcx cmp $0x400000, %ecx - jle cart + jbe cart cmp $0xE00000, %ecx - jge workram + jae workram cmp $0xC00000, %ecx - jge vdp_psg + jae vdp_psg cmp $0xA10000, %ecx - jl not_io + jb not_io cmp $0xA12000, %ecx - jge not_io + jae not_io call do_io_read_w ret not_io: @@ -366,13 +366,13 @@ m68k_read_byte_scratch1: call inccycles and $0xFFFFFF, %rcx cmp $0x400000, %ecx - jle cart_b + jbe cart_b cmp $0xE00000, %ecx - jge workram_b + jae workram_b cmp $0xA10000, %ecx - jl not_io_b + jb not_io_b cmp $0xA12000, %ecx - jge not_io_b + jae not_io_b jmp do_io_read not_io_b: xor %cl, %cl |