X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=testpico%2Fasmtools.S;h=c240b6a6477c3611e1a4a243a1009ed67ea99624;hb=5073ab5adb8157c35014505385575473284788df;hp=dd2236851e28266246207d9069d4822fc9b44e4e;hpb=be6b619d40e776f814ea8fd8b25c5a178ee5d7fc;p=megadrive.git diff --git a/testpico/asmtools.S b/testpico/asmtools.S index dd22368..c240b6a 100644 --- a/testpico/asmtools.S +++ b/testpico/asmtools.S @@ -6,6 +6,7 @@ move.l (4 + \arg * 4 + \stacksz)(%sp), \reg .endm +# args are always 4 bytes in stack, caller restores sp .macro ldargw arg, stacksz, reg move.w (4 + \arg * 4 + 2 + \stacksz)(%sp), \reg .endm @@ -44,6 +45,8 @@ write16_x16: # destroys d1 .global get_input get_input: +.global get_input_s +get_input_s: move.b #0x40,(0xa10003) moveq.l #0,d0 nop @@ -66,6 +69,8 @@ get_input: and.w d0,d1 /* what changed now */ .endif rts +.global get_input_end +get_input_end: .global get_line get_line: @@ -546,4 +551,23 @@ test_ym_ab_sync2: move.b #0x3c, (a1) /* 12 clear, disable */ rts +.global x32x_switch_rv +x32x_switch_rv: + ldargw 0, 0, d0 + move.l (sp)+, d1 + movea.l #0xa15106, a0 + btst #0, d0 + bne 0f + move.w #0, (a0) + or.l #0x880000, d1 + bra 1f +0: + move.w #1, (a0) + and.l #0x07ffff, d1 +1: + movea.l d1, a1 + jmp (a1) +.global x32x_switch_rv_end +x32x_switch_rv_end: + # vim:filetype=asmM68k:ts=4:sw=4:expandtab