Skip to content

Commit d32a2df

Browse files
committedAug 17, 2021
IceDrakeScene Tech demo
IceDrakeScene Tech demo
1 parent 722ab6d commit d32a2df

19 files changed

+1285
-0
lines changed
 
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

‎DEMOS/IceDrakeSceneR4/Assets/BackgroundSky.data

+1
Large diffs are not rendered by default.
Binary file not shown.
Binary file not shown.
39.8 KB
Binary file not shown.
351 KB
Binary file not shown.
739 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
249 KB
Binary file not shown.
Binary file not shown.
10.3 MB
Binary file not shown.

‎DEMOS/IceDrakeSceneR4/IceDrakeScene.s

+891
Large diffs are not rendered by default.
+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
IFND SAGA_CUSTOM_I
2+
SAGA_CUSTOM_I SET 1
3+
4+
CALLSAGA MACRO
5+
jsr _SAGALIB_\1
6+
ENDM
7+
8+
SAGA_DMACONR EQU $DFF002 ; (R ) (16-bit)
9+
SAGA_DMACON EQU $DFF096 ; ( W) (16-bit)
10+
SAGA_INTENAR EQU $DFF01C ; (R ) (16-bit)
11+
SAGA_INTENA EQU $DFF09A ; ( W) (16-bit)
12+
13+
SAGA_DMACON2R EQU $DFF202 ; (R ) (16-bit)
14+
SAGA_DMACON2 EQU $DFF296 ; ( W) (16-bit)
15+
SAGA_INTENA2R EQU $DFF21C ; (R ) (16-bit)
16+
SAGA_INTENA2 EQU $DFF29A ; ( W) (16-bit)
17+
18+
SAGA_MOUSEX EQU $DFF1D0 ; ( W) (16-bit)
19+
SAGA_MOUSEY EQU $DFF1D2 ; ( W) (16-bit)
20+
SAGA_GFXADDR EQU $DFF1EC ; (R W) (32-bit)
21+
SAGA_GFXMODE EQU $DFF1F4 ; (R W) (16-bit)
22+
SAGA_GFXMODULO EQU $DFF1E6 ; ( W) (16-bit)
23+
24+
SAGA_JOYP1 EQU $DFF220 ; (R ) (16-bit)
25+
SAGA_JOYP2 EQU $DFF222 ; (R ) (16-bit)
26+
SAGA_JOYP3 EQU $DFF224 ; (R ) (16-bit)
27+
SAGA_JOYP4 EQU $DFF226 ; (R ) (16-bit)
28+
29+
SAGA_AUD0LC EQU $DFF400 ; ( W) (32-bit)
30+
SAGA_AUD0LEN EQU $DFF404 ; ( W) (32-bit)
31+
SAGA_AUD0VOL EQU $DFF408 ; ( W) (16-bit)
32+
SAGA_AUD0CTL EQU $DFF40A ; ( W) (16-bit)
33+
SAGA_AUD0PER EQU $DFF40C ; ( W) (16-bit)
34+
35+
SAGA_JOYB_PLUGGED EQU (0) ; PLUG
36+
SAGA_JOYB_A EQU (1) ; FIRE1
37+
SAGA_JOYB_B EQU (2) ; FIRE2
38+
SAGA_JOYB_X EQU (3) ; FIRE3
39+
SAGA_JOYB_Y EQU (4) ; FIRE4
40+
SAGA_JOYB_LB EQU (5) ; FIRE5
41+
SAGA_JOYB_RB EQU (6) ; FIRE6
42+
SAGA_JOYB_LT EQU (7) ; FIRE7
43+
SAGA_JOYB_RT EQU (8) ; FIRE8
44+
SAGA_JOYB_BACK EQU (9) ; BACK
45+
SAGA_JOYB_START EQU (10) ; START
46+
SAGA_JOYB_FREE EQU (11) ; RESERVED
47+
SAGA_JOYB_UP EQU (12) ; UP
48+
SAGA_JOYB_DOWN EQU (13) ; DOWN
49+
SAGA_JOYB_LEFT EQU (14) ; LEFT
50+
SAGA_JOYB_RIGHT EQU (15) ; RIGHT
51+
52+
SAGA_JOYF_PLUGGED EQU (1<<SAGA_JOYB_PLUGGED) ; PLUG
53+
SAGA_JOYF_A EQU (1<<SAGA_JOYB_A) ; FIRE1
54+
SAGA_JOYF_B EQU (1<<SAGA_JOYB_B) ; FIRE2
55+
SAGA_JOYF_X EQU (1<<SAGA_JOYB_X) ; FIRE3
56+
SAGA_JOYF_Y EQU (1<<SAGA_JOYB_Y) ; FIRE4
57+
SAGA_JOYF_LB EQU (1<<SAGA_JOYB_LB) ; FIRE5
58+
SAGA_JOYF_RB EQU (1<<SAGA_JOYB_RB) ; FIRE6
59+
SAGA_JOYF_LT EQU (1<<SAGA_JOYB_LT) ; FIRE7
60+
SAGA_JOYF_RT EQU (1<<SAGA_JOYB_RT) ; FIRE8
61+
SAGA_JOYF_BACK EQU (1<<SAGA_JOYB_BACK) ; BACK
62+
SAGA_JOYF_START EQU (1<<SAGA_JOYB_START) ; START
63+
SAGA_JOYF_FREE EQU (1<<SAGA_JOYB_FREE) ; RESERVED
64+
SAGA_JOYF_UP EQU (1<<SAGA_JOYB_UP) ; UP
65+
SAGA_JOYF_DOWN EQU (1<<SAGA_JOYB_DOWN) ; DOWN
66+
SAGA_JOYF_LEFT EQU (1<<SAGA_JOYB_LEFT) ; LEFT
67+
SAGA_JOYF_RIGHT EQU (1<<SAGA_JOYB_RIGHT) ; RIGHT
68+
69+
ENDC ; SAGA_CUSTOM_I
+309
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,309 @@
1+
*********************************************************************
2+
* Library: SAGALIB routines
3+
* Short: Some SAGA routines (Beware: Only 32-bits A8R8G8B8)
4+
* Date: 2021-08-14
5+
* Author: flype
6+
*********************************************************************
7+
8+
XDEF _SAGALIB_Is68080
9+
XDEF _SAGALIB_BlitSprite
10+
XDEF _SAGALIB_BlitSpriteXY
11+
XDEF _SAGALIB_BlitTransparentSprite
12+
XDEF _SAGALIB_BlitTransparentSpriteXY
13+
XDEF _SAGALIB_BlitRectangle
14+
XDEF _SAGALIB_ClearPixels
15+
XDEF _SAGALIB_ConvertPixels
16+
XDEF _SAGALIB_PlaySound
17+
XDEF _SAGALIB_WaitVBL
18+
19+
*********************************************************************
20+
* _SAGALIB_START
21+
*********************************************************************
22+
23+
CNOP 0,4
24+
25+
_SAGALIB_START:
26+
JMP _SAGALIB_END ; Jump at bottom
27+
28+
*********************************************************************
29+
* _SAGALIB_Is68080(void)
30+
*********************************************************************
31+
32+
CNOP 0,4
33+
34+
_SAGALIB_Is68080:
35+
move.l a0,-(sp) ; Push
36+
move.l 4.w,a0 ; AmigaOS ExecBase
37+
btst #10,296(a0) ; ExecBase->AttnFlags[BIT10]
38+
move.l (sp)+,a0 ; Pop
39+
rts ; Return
40+
41+
*********************************************************************
42+
* _SAGALIB_BlitRectangle(
43+
* Pixels, Left, Top, Width, Height, PixelPerRow, Color)
44+
* A0 D0 D1 D2 D3 D4 D5
45+
*********************************************************************
46+
47+
CNOP 0,4
48+
49+
_SAGALIB_BlitRectangle:
50+
movem.l d0-d3/a0,-(sp) ; Push
51+
lsl.l #2,d0 ; Left
52+
add.l d0,a0 ; Left
53+
mulu.l d4,d1 ; Top
54+
lsl.l #2,d1 ; Top
55+
add.l d1,a0 ; Top
56+
move.l d4,d0 ; Modulo
57+
sub.l d2,d0 ; Modulo
58+
lsl.l #2,d0 ; Modulo
59+
move.l d2,d1 ; Width
60+
lsr.l #1,d1 ; Width
61+
.y move.l d1,d2 ; Width
62+
.x move.l d5,(a0)+ ; PutPixel
63+
move.l d5,(a0)+ ; PutPixel
64+
subq.l #1,d2 ; Next X
65+
bne.s .x ; Continue
66+
add.l d0,a0 ; Modulo
67+
subq.l #1,d3 ; Next Y
68+
bne.s .y ; Continue
69+
movem.l (sp)+,d0-d3/a0 ; Pop
70+
rts ; Return
71+
72+
*********************************************************************
73+
* _SAGALIB_BlitSprite(
74+
* Src, SrcW, SrcH, Dst, DstX, DstY, PixelPerRow)
75+
* A0 D0 D1 A1 D2 D3 D4
76+
*********************************************************************
77+
78+
CNOP 0,4
79+
80+
_SAGALIB_BlitSprite:
81+
movem.l d0-d4/a0-a1,-(sp) ; Push
82+
lsl.l #2,d2 ; Left
83+
add.l d2,a1 ; Left
84+
mulu.l d4,d3 ; Top
85+
lsl.l #2,d3 ; Top
86+
add.l d3,a1 ; Top
87+
move.l d4,d3 ; Modulo
88+
sub.l d0,d3 ; Modulo
89+
lsl.l #2,d3 ; Modulo
90+
move.l d0,d4 ; Width
91+
lsr.l #1,d4 ; Width
92+
.y move.l d4,d0 ; Width
93+
.x move.l (a0)+,(a1)+ ; Copy 1 pixel
94+
move.l (a0)+,(a1)+ ; Copy 1 pixel
95+
subq.l #1,d0 ; Next X
96+
bne.s .x ; Continue
97+
add.l d3,a1 ; Modulo
98+
subq.l #1,d1 ; Next Y
99+
bne.s .y ; Continue
100+
movem.l (sp)+,d0-d4/a0-a1 ; Pop
101+
rts ; Return
102+
103+
*********************************************************************
104+
* _SAGALIB_BlitSpriteXY(
105+
* Src, SrcW, SrcH, Dst, DstX, DstY, PixelPerRow)
106+
* A0 D0 D1 A1 D2 D3 D4
107+
*********************************************************************
108+
109+
CNOP 0,4
110+
111+
_SAGALIB_BlitSpriteXY:
112+
movem.l d0-d4/a0-a1,-(sp) ; Push
113+
lsl.l #2,d2 ; Left
114+
add.l d2,a1 ; Left
115+
mulu.l d4,d3 ; Top
116+
lsl.l #2,d3 ; Top
117+
add.l d3,a1 ; Top
118+
move.l d4,d3 ; Modulo
119+
sub.l d0,d3 ; Modulo
120+
lsl.l #2,d3 ; Modulo
121+
move.l d0,d4 ; Width
122+
lsr.l #1,d4 ; Width
123+
.y move.l d4,d0 ; Width
124+
.x move.l (a0)+,(a1)+ ; Copy 1 pixel
125+
move.l (a0)+,(a1)+ ; Copy 1 pixel
126+
subq.l #1,d0 ; Next X
127+
bne.s .x ; Continue
128+
add.l d3,a1 ; Modulo
129+
subq.l #1,d1 ; Next Y
130+
bne.s .y ; Continue
131+
movem.l (sp)+,d0-d4/a0-a1 ; Pop
132+
rts ; Return
133+
134+
*********************************************************************
135+
* _SAGALIB_BlitTransparentSprite(
136+
* Src, SrcW, SrcH, Dst, DstX, DstY, PixelPerRow)
137+
* A0 D0 D1 A1 D2 D3 D4
138+
*********************************************************************
139+
140+
CNOP 0,4
141+
142+
_SAGALIB_BlitTransparentSprite:
143+
movem.l d0-d4/a0-a1,-(sp) ; Push
144+
lsl.l #2,d2 ; Left
145+
add.l d2,a1 ; Left
146+
mulu.l d4,d3 ; Top
147+
lsl.l #2,d3 ; Top
148+
add.l d3,a1 ; Top
149+
move.l d4,d3 ; Modulo
150+
sub.l d0,d3 ; Modulo
151+
lsl.l #2,d3 ; Modulo
152+
move.l d0,d4 ; Width
153+
lsr.l #1,d4 ; Width
154+
.y move.l d4,d0 ; Width
155+
.x load (a0)+,d2 ; Load 2 pixels (8 bytes)
156+
storem3 d2,d4,(a1)+ ; Write 2 pixels (8 bytes)
157+
subq.l #1,d0 ; Next X
158+
bne.s .x ; Continue
159+
add.l d3,a1 ; Modulo
160+
subq.l #1,d1 ; Next Y
161+
bne.s .y ; Continue
162+
movem.l (sp)+,d0-d4/a0-a1 ; Pop
163+
rts ; Return
164+
165+
*********************************************************************
166+
* _SAGALIB_BlitTransparentSpriteXY(
167+
* Src, SrcX, SrcY, SrcW, SrcH, Dst, DstX, DstY, PixelPerRow)
168+
* A0 D0 D1 D2 D3 A1 D4 D5 D6
169+
*********************************************************************
170+
171+
CNOP 0,4
172+
173+
_SAGALIB_BlitTransparentSpriteXY:
174+
movem.l d0-d7/a0-a1,-(sp) ; Push
175+
lsl.l #2,d0 ; SrcX
176+
adda.l d0,a0 ; SrcX
177+
mulu.l d2,d1 ; SrcY
178+
lsl.l #2,d1 ; SrcY
179+
adda.l d1,a0 ; SrcY
180+
lsl.l #2,d4 ; DstX
181+
adda.l d4,a1 ; DstX
182+
mulu.l d6,d5 ; DstY
183+
lsl.l #2,d5 ; DstY
184+
adda.l d5,a1 ; DstY
185+
move.l d2,d5 ; Modulo
186+
sub.l d6,d5 ; Modulo
187+
lsl.l #2,d5 ; Modulo
188+
lsr.l #1,d6 ; Width
189+
.y move.l d6,d2 ; Width
190+
.x load (a0)+,d1 ; Load 2 pixels (8 bytes)
191+
storem3 d1,d4,(a1)+ ; Write 2 pixels (8 bytes)
192+
subq.l #1,d2 ; Next X
193+
bne.s .x ; Continue
194+
adda.l d5,a0 ; Modulo
195+
subq.l #1,d3 ; Next Y
196+
bne.s .y ; Continue
197+
movem.l (sp)+,d0-d7/a0-a1 ; Pop
198+
rts ; Return
199+
200+
*********************************************************************
201+
* _SAGALIB_BlitTransparentSpriteXY2(
202+
* Src, SrcX, SrcY, SrcW, SrcH, SrcRowSize, Dst, DstX, DstY, DstRowSize)
203+
* A0 D0 D1 D2 D3 D4 A1 D5 D6 D7
204+
*********************************************************************
205+
206+
_SAGALIB_BlitTransparentSpriteXY2:
207+
movem.l d0-d7/a0-a1,-(sp) ; Push
208+
lsl.l #2,d0 ; SrcX
209+
adda.l d0,a0 ; SrcX
210+
mulu.l d4,d1 ; SrcY
211+
adda.l d1,a0 ; SrcY
212+
lsl.l #2,d5 ; DstX
213+
adda.l d5,a1 ; DstX
214+
mulu.l d7,d6 ; DstY
215+
adda.l d6,a1 ; DstY
216+
lsl.l #2,d2 ; SrcModulo
217+
sub.l d2,d4 ; SrcModulo
218+
sub.l d2,d7 ; DstModulo
219+
move.l d2,d5 ; Width
220+
lsr.l #3,d5 ; Width
221+
.y move.l d5,d2 ; Width = (106*4)/8
222+
.x load (a0)+,d1 ; Load 2 pixels (8 bytes)
223+
storem3 d1,d4,(a1)+ ; Write 2 pixels (8 bytes)
224+
subq.l #1,d2 ; Next X
225+
bne.s .x ; Continue
226+
adda.l d4,a0 ; SrcModulo = (320-106)*4
227+
adda.l d7,a1 ; DstModulo = (640-106)*4
228+
subq.l #1,d3 ; Next Y
229+
bne.s .y ; Continue
230+
movem.l (sp)+,d0-d7/a0-a1 ; Pop
231+
rts ; Return
232+
233+
*********************************************************************
234+
* _SAGALIB_ClearPixels(
235+
* Pixels, PixelCount, Color)
236+
* A0 D0 D1
237+
*********************************************************************
238+
239+
CNOP 0,4
240+
241+
_SAGALIB_ClearPixels:
242+
movem.l d0/a0,-(sp) ; Push
243+
lsr.l #1,d0 ; PixelCount * 4 / 8
244+
.l1 move.l d1,(a0)+ ; Write pixel
245+
move.l d1,(a0)+ ; Write pixel
246+
subq.l #1,d0 ; Next iteration
247+
bne.s .l1 ; Continue
248+
movem.l (sp)+,d0/a0 ; Pop
249+
rts ; Return
250+
251+
*********************************************************************
252+
* _SAGALIB_ConvertPixels(
253+
* Pixels, PixelCount)
254+
* A0 D0
255+
*********************************************************************
256+
257+
CNOP 0,4
258+
259+
_SAGALIB_ConvertPixels:
260+
movem.l d0/d1/a0,-(sp) ; Push
261+
.l1 move.l (a0),d1 ; Read pixel
262+
ror.l #8,d1 ; RRGGBBAA -> AARRGGBB
263+
move.l d1,(a0)+ ; Write pixel
264+
subq.l #1,d0 ; Next pixel
265+
bne.s .l1 ; Continue
266+
movem.l (sp)+,d0/d1/a0 ; Pop
267+
rts ; Return
268+
269+
*********************************************************************
270+
* _SAGALIB_PlaySound(
271+
* WaveData, WaveDataEnd)
272+
* A0 A1
273+
*********************************************************************
274+
275+
CNOP 0,4
276+
277+
_SAGALIB_PlaySound:
278+
movem.l d0/a0-a1,-(sp) ; Push
279+
move.l a1,d0 ; AUD Length
280+
sub.l a0,d0 ; AUD Length
281+
divu.l #8,d0 ; AUD Length (16-bits, Stereo)
282+
move.l a0,$DFF400 ; AUD Data
283+
move.l d0,$DFF404 ; AUD Length
284+
move.w #$FFFF,$DFF408 ; AUD Volume
285+
move.w #80,$DFF40C ; AUD Period
286+
move.w #$0004,$DFF40A ; AUD Control
287+
move.w #$8201,$DFF096 ; AUD DMA
288+
movem.l (sp)+,d0/a0-a1 ; Pop
289+
rts ; Return
290+
291+
*********************************************************************
292+
* _SAGALIB_WaitVBL(void)
293+
*********************************************************************
294+
295+
CNOP 0,4
296+
297+
_SAGALIB_WaitVBL:
298+
btst.b #5,$DFF01F ; Check VBL interrupt
299+
beq.s _SAGALIB_WaitVBL ; Continue if False
300+
move.w #(1<<5),$DFF09C ; Clear VBL interrupt
301+
rts ; Return
302+
303+
*********************************************************************
304+
* End of file
305+
*********************************************************************
306+
307+
CNOP 0,4
308+
309+
_SAGALIB_END:

‎DEMOS/IceDrakeSceneR4/make.run

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
; Add DOS "Script" property :
3+
; PROTECT make.run ADD S
4+
5+
IF NOT EXISTS RAM:Assets
6+
C:MakeDir RAM:Assets
7+
C:Copy Data:Sources/IceDrakeScene/Assets/#?.dds RAM:Assets
8+
C:Copy Data:Sources/IceDrakeScene/Assets/#?.data RAM:Assets
9+
ENDIF
10+
11+
CD Data:Sources/IceDrakeScene/
12+
13+
C:vasmm68k_mot_os3 -m68080 -Fhunkexe IceDrakeScene.s -o RAM:IceDrakeScene
14+
15+
RAM:IceDrakeScene

0 commit comments

Comments
 (0)
Please sign in to comment.