mirror of
https://git.sr.ht/~rabbits/uxn
synced 2024-12-02 02:27:25 +00:00
(amiga.tal) Use call opcodes
This commit is contained in:
parent
4ab97a6c1f
commit
998c182a44
2 changed files with 30 additions and 21 deletions
BIN
projects/examples/demos/amiga.rom.sym
Normal file
BIN
projects/examples/demos/amiga.rom.sym
Normal file
Binary file not shown.
|
@ -9,14 +9,17 @@
|
||||||
@timer $1
|
@timer $1
|
||||||
@frame $1
|
@frame $1
|
||||||
|
|
||||||
|
(
|
||||||
|
@|vectors )
|
||||||
|
|
||||||
|0100
|
|0100
|
||||||
|
|
||||||
( vectors )
|
( vectors )
|
||||||
;on-frame .Screen/vector DEO2
|
;on-frame .Screen/vector DEO2
|
||||||
( theme )
|
( theme )
|
||||||
#aff0 .System/r DEO2
|
#aff5 .System/r DEO2
|
||||||
#af00 .System/g DEO2
|
#af00 .System/g DEO2
|
||||||
#af00 .System/b DEO2
|
#af05 .System/b DEO2
|
||||||
( screen size )
|
( screen size )
|
||||||
#0140 .Screen/width DEO2
|
#0140 .Screen/width DEO2
|
||||||
#0100 .Screen/height DEO2
|
#0100 .Screen/height DEO2
|
||||||
|
@ -27,8 +30,8 @@
|
||||||
#0008 .ball/vx STZ2
|
#0008 .ball/vx STZ2
|
||||||
#0000 .ball/vy STZ2
|
#0000 .ball/vy STZ2
|
||||||
( once )
|
( once )
|
||||||
;make-shadow JSR2
|
make-shadow
|
||||||
;draw-background JSR2
|
draw-background
|
||||||
|
|
||||||
BRK
|
BRK
|
||||||
|
|
||||||
|
@ -40,14 +43,17 @@ BRK
|
||||||
#00 .timer STZ
|
#00 .timer STZ
|
||||||
( 12 frames animation )
|
( 12 frames animation )
|
||||||
.frame LDZ INC DUP #0c NEQ MUL .frame STZ
|
.frame LDZ INC DUP #0c NEQ MUL .frame STZ
|
||||||
,move-ball JSR
|
move-ball
|
||||||
|
|
||||||
BRK
|
BRK
|
||||||
|
|
||||||
|
(
|
||||||
|
@|core )
|
||||||
|
|
||||||
@check-flip-vx ( x -- x )
|
@check-flip-vx ( x -- x )
|
||||||
|
|
||||||
( left ) DUP2 #0010 LTH2 ,&flip JCN
|
( left ) DUP2 #0010 LTH2 ?&flip
|
||||||
( right ) DUP2 .Screen/width DEI2 #0050 SUB2 GTH2 ,&flip JCN ,&else JMP
|
( right ) DUP2 .Screen/width DEI2 #0050 SUB2 GTH2 ?&flip ,&else JMP
|
||||||
&flip .ball/vx LDZ2k #ffff EOR2 ( INC2 ) ROT STZ2
|
&flip .ball/vx LDZ2k #ffff EOR2 ( INC2 ) ROT STZ2
|
||||||
&else
|
&else
|
||||||
|
|
||||||
|
@ -55,7 +61,7 @@ JMP2r
|
||||||
|
|
||||||
@check-flip-vy ( y -- y )
|
@check-flip-vy ( y -- y )
|
||||||
|
|
||||||
( bottom ) DUP2 .Screen/height DEI2 #0050 SUB2 GTH2 ,&flip JCN ,&else JMP
|
( bottom ) DUP2 .Screen/height DEI2 #0050 SUB2 GTH2 ?&flip ,&else JMP
|
||||||
&flip .ball/vy LDZ2k #ffff EOR2 ( INC2 ) ROT STZ2
|
&flip .ball/vy LDZ2k #ffff EOR2 ( INC2 ) ROT STZ2
|
||||||
&else
|
&else
|
||||||
|
|
||||||
|
@ -70,13 +76,13 @@ JMP2r
|
||||||
#0800
|
#0800
|
||||||
&loop-bg
|
&loop-bg
|
||||||
#40 .Screen/sprite DEO
|
#40 .Screen/sprite DEO
|
||||||
INC GTHk ,&loop-bg JCN
|
INC GTHk ?&loop-bg
|
||||||
POP2
|
POP2
|
||||||
|
|
||||||
.ball/vx LDZ2k STH2k ROT STZ2
|
.ball/vx LDZ2k STH2k ROT STZ2
|
||||||
.ball/x LDZ2k STH2r ADD2 ,check-flip-vx JSR ROT STZ2
|
.ball/x LDZ2k STH2r ADD2 check-flip-vx ROT STZ2
|
||||||
.ball/vy LDZ2k INC2 STH2k ROT STZ2
|
.ball/vy LDZ2k INC2 STH2k ROT STZ2
|
||||||
.ball/y LDZ2k STH2r ADD2 ,check-flip-vy JSR ROT STZ2
|
.ball/y LDZ2k STH2r ADD2 check-flip-vy ROT STZ2
|
||||||
|
|
||||||
@draw-ball ( -- )
|
@draw-ball ( -- )
|
||||||
|
|
||||||
|
@ -88,7 +94,7 @@ JMP2r
|
||||||
#0700
|
#0700
|
||||||
&loop-shadow
|
&loop-shadow
|
||||||
#4f .Screen/sprite DEO
|
#4f .Screen/sprite DEO
|
||||||
INC GTHk ,&loop-shadow JCN
|
INC GTHk ?&loop-shadow
|
||||||
POP2
|
POP2
|
||||||
.frame LDZ
|
.frame LDZ
|
||||||
( bg )
|
( bg )
|
||||||
|
@ -100,7 +106,7 @@ JMP2r
|
||||||
#0700
|
#0700
|
||||||
&loop-bg
|
&loop-bg
|
||||||
STHkr .Screen/sprite DEO
|
STHkr .Screen/sprite DEO
|
||||||
INC GTHk ,&loop-bg JCN
|
INC GTHk ?&loop-bg
|
||||||
POP2
|
POP2
|
||||||
POPr
|
POPr
|
||||||
( fg )
|
( fg )
|
||||||
|
@ -112,7 +118,7 @@ JMP2r
|
||||||
#0700
|
#0700
|
||||||
&loop-fg
|
&loop-fg
|
||||||
STHkr .Screen/sprite DEO
|
STHkr .Screen/sprite DEO
|
||||||
INC GTHk ,&loop-fg JCN
|
INC GTHk ?&loop-fg
|
||||||
POP2
|
POP2
|
||||||
POPr
|
POPr
|
||||||
|
|
||||||
|
@ -130,9 +136,9 @@ JMP2r
|
||||||
.Screen/width DEI2 #03 SFT2 NIP #08 SUB #00
|
.Screen/width DEI2 #03 SFT2 NIP #08 SUB #00
|
||||||
&horhor
|
&horhor
|
||||||
#0f .Screen/sprite DEO
|
#0f .Screen/sprite DEO
|
||||||
INC GTHk ,&horhor JCN
|
INC GTHk ?&horhor
|
||||||
POP2
|
POP2
|
||||||
INC GTHk ,&horver JCN
|
INC GTHk ?&horver
|
||||||
POP2
|
POP2
|
||||||
( ver lines )
|
( ver lines )
|
||||||
#02 .Screen/auto DEO
|
#02 .Screen/auto DEO
|
||||||
|
@ -144,20 +150,20 @@ JMP2r
|
||||||
.Screen/height DEI2 #03 SFT2 NIP #0a SUB #00
|
.Screen/height DEI2 #03 SFT2 NIP #0a SUB #00
|
||||||
&verhor
|
&verhor
|
||||||
#0f .Screen/sprite DEO
|
#0f .Screen/sprite DEO
|
||||||
INC GTHk ,&verhor JCN
|
INC GTHk ?&verhor
|
||||||
POP2
|
POP2
|
||||||
INC GTHk ,&verver JCN
|
INC GTHk ?&verver
|
||||||
POP2
|
POP2
|
||||||
|
|
||||||
JMP2r
|
JMP2r
|
||||||
|
|
||||||
@make-shadow ( -- )
|
@make-shadow ( -- )
|
||||||
|
|
||||||
;bg ;shadow #0188 ;mcpy JSR2
|
;bg ;shadow #0188 mcpy
|
||||||
#0188 #0000
|
#0188 #0000
|
||||||
&loop
|
&loop
|
||||||
DUP2 ;shadow ADD2 LDA2k #aa55 AND2 SWP2 STA2
|
DUP2 ;shadow ADD2 LDA2k #aa55 AND2 SWP2 STA2
|
||||||
INC2 INC2 GTH2k ,&loop JCN
|
INC2 INC2 GTH2k ?&loop
|
||||||
POP2 POP2
|
POP2 POP2
|
||||||
|
|
||||||
JMP2r
|
JMP2r
|
||||||
|
@ -168,12 +174,15 @@ JMP2r
|
||||||
OVR2 ADD2 SWP2
|
OVR2 ADD2 SWP2
|
||||||
&loop
|
&loop
|
||||||
LDAk STH2kr STA INC2r
|
LDAk STH2kr STA INC2r
|
||||||
INC2 GTH2k ,&loop JCN
|
INC2 GTH2k ?&loop
|
||||||
POP2 POP2
|
POP2 POP2
|
||||||
POP2r
|
POP2r
|
||||||
|
|
||||||
JMP2r
|
JMP2r
|
||||||
|
|
||||||
|
(
|
||||||
|
@|assets )
|
||||||
|
|
||||||
@hor-icn
|
@hor-icn
|
||||||
0000 0000 0000 00ff
|
0000 0000 0000 00ff
|
||||||
@ver-icn
|
@ver-icn
|
||||||
|
|
Loading…
Reference in a new issue