Mercurial > repos > blastem
comparison runtime.S @ 84:2d1ae596db7a
Fix long reads from IO ports or long reads that trigger sync cycles by saving rdi. Possibly fix word wide IO reads.
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Wed, 26 Dec 2012 17:34:59 -0800 |
parents | 2c7267617d71 |
children | 1db2a0b655d1 |
comparison
equal
deleted
inserted
replaced
83:2c7267617d71 | 84:2d1ae596db7a |
---|---|
152 and $0x3FF, %edi | 152 and $0x3FF, %edi |
153 call m68k_save_context | 153 call m68k_save_context |
154 call io_read_w | 154 call io_read_w |
155 mov %rax, %rsi | 155 mov %rax, %rsi |
156 call m68k_load_context | 156 call m68k_load_context |
157 mov 136(%rsi), %cl | 157 mov 136(%rsi), %cx |
158 ret | 158 ret |
159 | 159 |
160 bad_access_msg: | 160 bad_access_msg: |
161 .asciz "Program tried to access illegal 68K address %X\n" | 161 .asciz "Program tried to access illegal 68K address %X\n" |
162 | 162 |
331 push %rcx | 331 push %rcx |
332 call m68k_read_word_scratch1 | 332 call m68k_read_word_scratch1 |
333 mov %cx, %di | 333 mov %cx, %di |
334 pop %rcx | 334 pop %rcx |
335 add $2, %ecx | 335 add $2, %ecx |
336 push %rdi | |
336 call m68k_read_word_scratch1 | 337 call m68k_read_word_scratch1 |
338 pop %rdi | |
337 and $0xFFFF, %ecx | 339 and $0xFFFF, %ecx |
338 shl $16, %edi | 340 shl $16, %edi |
339 or %edi, %ecx | 341 or %edi, %ecx |
340 ret | 342 ret |
341 | 343 |