2 # --register-prefix-optional --bitwise-or
4 .macro ldarg arg, stacksz, reg
5 move.l (4 + \arg * 4 + \stacksz)(%sp), \reg
9 .global read_joy_responses /* u8 *rbuf */
52 .global run_game /* u16 mapper, int tas_sync */
64 move.b d4, (0x09,a6) /* CtrlA */
65 move.b d2, (0x0b,a6) /* CtrlB */
66 move.b d2, (0x0d,a6) /* CtrlC */
67 move.b d2, (0x13,a6) /* S-CtrlA */
68 move.b d3, (0x0f,a6) /* TxDataA */
69 move.b d2, (0x19,a6) /* S-CtrlB */
70 move.b d3, (0x15,a6) /* TxDataB */
71 move.b d2, (0x1f,a6) /* S-CtrlC */
72 move.b d3, (0x1b,a6) /* TxDataC */
74 /* set up for vram write */
75 move.l #0x40000000, (a3)
78 move.l #0x10000/4/4-1, d0
90 lea (run_game_r,pc), a0
91 move.l #(run_game_r_end - run_game_r)/2-1, d0
94 lea (run_game_r_tas,pc), a0
95 move.l #(run_game_r_tas_end - run_game_r_tas)/2-1, d0
103 move.w #0x3210, (0xA13006)
105 move.w d7, (0xA13010)
106 move.w #0, (0xA13000)
114 move.w #0x3210, (0xA13006)
115 move.w d7, (0xA13010)
116 move.w #0, (0xA13000)
121 0: /* wait for special code */
132 0: /* wait for special code to end */
136 /* wait for active display */
139 btst d0, (a4) /* 8 */
145 /* flood the VDP FIFO */
155 move.l #0x93049400, (a3) /* DMALEN LO/HI = 0x0008 */
156 move.l #0x95009601, (a3) /* DMA SRC LO/MID */
157 move.l #0x977f8114, (a3) /* DMA SRC HI/MODE, Turn off Display */
158 move.l #0xc0000080, (a3) /* start DMA */
161 move.b d2, (0x09,a6) /* CtrlA */
166 # vim:filetype=asmM68k:ts=4:sw=4:expandtab