-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgame.txt
103 lines (80 loc) · 1.11 KB
/
game.txt
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
push 36
pop ax ; pixels x
push 16
pop bx ; pixels y
push 448
pop cx ; video_mem
call :drawField
push 2
pop [0]
push 3
pop [1]
call :drawPlr
drw
hlt
drawField:
push 0
pop [128]
push 0
pop [129]
call :cls
ret
cls: ; fills screen with 0
push [129] ; y
push ax
mul
push [128] ; x
add
push cx
add
pop tx
push tx
push 1024
jae :clsEnd
push 0x42E
pop [tx]
push [128]
push ax
jb :nonIncCls ; no need to increment y
push [129]
push 1
add
pop [129] ; increment y
push 0
pop [128] ; x to zero
nonIncCls:
push 1
push [128]
add
pop [128]
jmp :cls
clsEnd:
ret
drawPlr:
push [1] ; plr y
push ax
mul
push [0] ; plr x
add
push cx
add
pop tx
push 35
pop [tx]
ret
fillPixel:
push [129] ; pixel y
push ax
mul
push [128] ; pixel x
add
push cx
add
pop tx
push [130] ; fill with this value
push [131] ; color to be filled with
push 0x10
mul ; color index in second byte
add
pop [tx]
ret