Mercurial > repos > blastem
comparison runtime.S @ 251:4a7ac10ac2d9
Fix target cycle count after 68K interrupt
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Mon, 29 Apr 2013 01:14:24 -0700 |
parents | 28a6697e847b |
children | e5e8b48ad157 |
comparison
equal
deleted
inserted
replaced
250:5f1b68cecfc7 | 251:4a7ac10ac2d9 |
---|---|
16 | 16 |
17 .global handle_cycle_limit_int | 17 .global handle_cycle_limit_int |
18 handle_cycle_limit_int: | 18 handle_cycle_limit_int: |
19 cmp 88(%rsi), %eax | 19 cmp 88(%rsi), %eax |
20 jb skip_int | 20 jb skip_int |
21 mov 84(%rsi), %ebp | |
21 /* swap USP and SSP if not already in supervisor mode */ | 22 /* swap USP and SSP if not already in supervisor mode */ |
22 bt $5, 5(%rsi) | 23 bt $5, 5(%rsi) |
23 jc already_supervisor | 24 jc already_supervisor |
24 mov 72(%rsi), %edi | 25 mov 72(%rsi), %edi |
25 mov %r15d, 72(%rsi) | 26 mov %r15d, 72(%rsi) |
442 pop %rdi | 443 pop %rdi |
443 add $2, %rdi | 444 add $2, %rdi |
444 jmp m68k_write_word | 445 jmp m68k_write_word |
445 | 446 |
446 inccycles: | 447 inccycles: |
447 cmp %rbp, %rax | 448 cmp %ebp, %eax |
448 jnb do_limit | 449 jnb do_limit |
449 add $4, %rax | 450 add $4, %eax |
450 ret | 451 ret |
451 do_limit: | 452 do_limit: |
452 push %rcx | 453 push %rcx |
453 push %rdi | 454 push %rdi |
454 call handle_cycle_limit | 455 call handle_cycle_limit |
455 pop %rdi | 456 pop %rdi |
456 pop %rcx | 457 pop %rcx |
457 add $4, %rax | 458 add $4, %eax |
458 ret | 459 ret |
459 | 460 |
460 .global m68k_read_word_scratch1 | 461 .global m68k_read_word_scratch1 |
461 m68k_read_word_scratch1: | 462 m68k_read_word_scratch1: |
462 call inccycles | 463 call inccycles |