-
Notifications
You must be signed in to change notification settings - Fork 2
/
loop.cfg
40 lines (30 loc) · 1.68 KB
/
loop.cfg
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
exec blubvm/vmx86.cfg
exec blubvm/vmutil.cfg
// Okay... this is my personal freakshow
// Many people have been trying to add some logic operations/aliases
// to the console, and this is my attempt...
// Have fun --blub
alias pong_init "mov pos_x 5; mov pos_y 5; mov dir_x 1; mov dir_y 0.5"
alias pong_prpong "set pong_pr \"${pong_pr}O\""
alias pong_prspace "set pong_pr \"${pong_pr} \""
alias pong_prcreate "set pong_pr \"\"; forinc ix 0 $rpos_x pong_prspace; pong_prpong; forinc ix $rpos_x 19 pong_prspace"
alias pong_drawe "echo \"+--------------------+\""
alias pong_drawc "echo \"| |\""
alias pong_drawp "echo \"|${pong_pr}|\""
alias pong_draw3 "pong_prcreate; pong_drawp"
alias pong_draw2 "for iy 0 $rpos_y pong_drawc; pong_draw3; inc rpos_y; for iy $rpos_y 9 pong_drawc"
alias pong_draw "mov rpos_x $pos_x; mov rpos_y $pos_y; floor rpos_x; floor rpos_y; pong_drawe; pong_draw2; pong_drawe"
alias pong_bounce "mul dir_$1 -1"
alias pong_colx_pos "cmp $pos_x 19; jge \"pong_bounce x\""
alias pong_colx_neg "cmp $pos_x 0; jle \"pong_bounce x\""
alias pong_coly_pos "cmp $pos_y 9; jge \"pong_bounce y\""
alias pong_coly_neg "cmp $pos_y 0; jle \"pong_bounce y\""
alias pong_colx_do "$pong_colx"
alias pong_coly_do "$pong_coly"
alias pong_collision_x "cmp $dir_x 0; mov pong_colx pong_colx_pos; cmovl pong_colx pong_colx_neg; pong_colx_do"
alias pong_collision_y "cmp $dir_y 0; mov pong_coly pong_coly_pos; cmovl pong_coly pong_coly_neg; pong_coly_do"
alias pong_collision "pong_collision_x; pong_collision_y"
alias pong_step "add pos_x dir_x; add pos_y dir_y"
alias pong_frame "pong_step; pong_collision; pong_draw; for i 0 5 wait"
pong_init
for frame 0 44 pong_frame