X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=megaed-sv%2Fasmtools.s;h=d1e1316d2af5b16d3c782de44330ef6f3a9589f5;hb=df43aeea93272c120d348dde8226ed52efa74fc1;hp=db939407681240950d38770f91134c6b0f931e48;hpb=51f3a685cdf7a70a9c2c4f35c92609123d741d64;p=megadrive.git diff --git a/megaed-sv/asmtools.s b/megaed-sv/asmtools.s index db93940..d1e1316 100644 --- a/megaed-sv/asmtools.s +++ b/megaed-sv/asmtools.s @@ -6,7 +6,7 @@ .endm -.globl read_joy_responses /* u8 *rbuf */ +.global read_joy_responses /* u8 *rbuf */ read_joy_responses: ldarg 0, 0, a1 movem.l d2-d7, -(sp) @@ -49,4 +49,49 @@ read_joy_responses: rts +.global run_game /* u16 mapper */ +run_game: + move.w #0x2700, sr + ldarg 0, 0, d7 + move.l #0xa10000, a7 + moveq.l #0x00, d1 + move.b #0xff, d2 + move.b d1, (0x0b,a7) /* CtrlB */ + move.b d1, (0x0d,a7) /* CtrlC */ + move.b d2, (0x0f,a7) /* TxDataA */ + move.b d1, (0x13,a7) /* S-CtrlA */ + move.b d2, (0x15,a7) /* TxDataB */ + move.b d1, (0x19,a7) /* S-CtrlB */ + move.b d2, (0x1b,a7) /* TxDataC */ + move.b d1, (0x1f,a7) /* S-CtrlC */ + + move.l #0xff0000, a1 + move.l #0x10000/4/4-1, %d0 +0: + move.l d1, (%a1)+ + move.l d1, (%a1)+ + move.l d1, (%a1)+ + move.l d1, (%a1)+ + dbra d0, 0b + + lea (run_game_code,pc), a0 + move.l #0xfff000, a1 + move.l #(run_game_code_end - run_game_code)/2-1, d0 +0: + move.w (%a0)+, (%a1)+ + dbra d0, 0b + jmp 0xfff000 + +run_game_code: + move.w #0x3210, (0xA13006) + + move.w d7, (0xA13010) + move.w #0, (0xA13000) + + move.l (0x00), a7 + move.l (0x04), a0 + jmp (a0) +run_game_code_end: + + # vim:filetype=asmM68k:ts=4:sw=4:expandtab