-
Notifications
You must be signed in to change notification settings - Fork 0
/
rc_68k.S
78 lines (67 loc) · 1.19 KB
/
rc_68k.S
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
.68000
.include "68k_inc/jaguar.inc"
.include "68k_inc/blit_eq.inc"
.include "68k_mac/help.mac"
start:
jmp init
.phrase
GPUcode:
.incbin "rc.o"
.phrase
init:
lea start,a0
cmpa.l #$4000,a0
beq.s cof_boot
lea GPUcode,a0
movea.w #$4008,a1
move.l #(init-GPUcode),d0
bsr memcpy
cof_boot:
lea $00F02110,a4
move.w #$4008,a0
moveq #0,d0
move.l d0,4(a4) ; GPU halt
move.l d0,$c(a4) ; divide control
move.l a0,(a4) ; set GPU PC
moveq.l #1,d0
move.l d0,4(a4) ; start GPU
endless:
stop #$2700 ; wait for GPU interrupt
bra.s endless
;;; memcpy with blitter
;;; A0 -> A1, size D0
memcpy:
move.l d0,d2
mcp0:
move.l d2,d0
cmp.l #$20000,d2
bls.s mcp1
move.l #$20000,d0
mcp1:
sub.l d0,d2
lea A1_BASE,a2
move.l a1,(a2)
add.l d0,a1
move.l a0,_BLIT_A2_BASE(a2)
add.l d0,a0
move.l #BLIT_PITCH1|BLIT_PIXEL32|BLIT_WID3584|BLIT_XADDPHR,d1
move.l d1,_BLIT_A1_FLAGS(a2)
move.l d1,_BLIT_A2_FLAGS(a2)
moveq #0,d1
move.l d1,_BLIT_A1_PIXEL(a2)
move.l d1,_BLIT_A2_PIXEL(a2)
lsr.l #2,d0
bset #16,d0
move.l d0,_BLIT_COUNT(a2)
move.l #BLIT_SRCEN|BLIT_LFU_REPLACE,d0
move.l d0,_BLIT_CMD(a2)
mc_wbl1:
move.l _BLIT_CMD(a2),d0
btst #0,d0
beq.s mc_wbl1
tst.l d2
bne.s mcp0
rts
jag_end:
BSS
END