-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMACROS.ASM
More file actions
145 lines (125 loc) · 4.41 KB
/
Copy pathCMACROS.ASM
File metadata and controls
145 lines (125 loc) · 4.41 KB
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
;;Chris Busch
;;;;;;----------------------------------
;;macro section
;;;;;;----------------------------------
#define DEBUG16(REG) push AF \ push BC \ push DE \ push HL \ push IX \ push IY \ push REG \ pop hl \ ld bc,$0000 \ call $8C0F \ .dw printnum \ pop IY \ pop IX \ pop HL \ pop DE \ pop BC \ pop AF
#define DEBUG16a(REG) push AF \ push BC \ push DE \ push HL \ push IX \ push IY \ push REG \ pop hl \ ld bc,$0001 \ call $8C0F \ .dw printnum \ pop IY \ pop IX \ pop HL \ pop DE \ pop BC \ pop AF
#define DEBUG16b(REG) push AF \ push BC \ push DE \ push HL \ push IX \ push IY \ push REG \ pop hl \ ld bc,$0002 \ call $8C0F \ .dw printnum \ pop IY \ pop IX \ pop HL \ pop DE \ pop BC \ pop AF
sprxyoffhl = 0
sprxyoffh = 1 ;sprite video memory location
sprxyoffl = 0 ;sprite video memory location
spridtype = 2 ;sprite picture info
sprempty = 3 ;non used...
sprmonstmv = 3 ;valid for monster ONLY, tells how to move
sprmonsth = 4 ;valid for monsters ONLY, health
sprmondir = 5 ;valid only for monsters!
sprextra1 = 4
sprextra2 = 5
sprsize = 6
hibyte = 1
lobyte = 0
brange = 4 ;;bullet range
typeand = 11100000b
idand = 00011111b
noerasebit = 7
noeraseand = 10000000b
killablebit = 6
killableand = 01000000b
fallingbit = 5
fallingand = 00100000b
;;;;;;ids
blankid =0
playerid =1 | noeraseand
monster1id =2 | noeraseand | killableand
monster2id =3 | noeraseand | killableand
monsters =4 ;<= a bullet will not put blood on it unless monster
coinid =4 | fallingand
scrollid =5 | noeraseand
fireid =6 | noeraseand
bombid =7 | killableand | fallingand
animators =8 ;;must be less than animators to animate!!
bulletid =8 | noeraseand
bloodid =9 | fallingand
treeid =10 | noeraseand | killableand | fallingand
brickid =11 | noeraseand
wallid =11 | noeraseand | killableand
fwallid =11 | noeraseand | fallingand
doorid =12 | noeraseand | fallingand
keyid =13 | noeraseand
;;;monster move types
seekbit =0 ;;else patroller
picnum =14
picsize =8
scrwidth =16
dispwidth =13
border =3
sprlength =8
scrhite =8
scrsize =scrwidth*scrhite
levelwidth =32
levelhite =32
levelsize =(levelwidth*levelhite)/2
leveland =levelsize-1
;;levelnumand =1
;;;;;;--------------------------------
;;text memory
;;;;;;--------------------------------
;;sprite definition
;;struct sprite {
;; void* vidmem //16bits
;; void* pic //16bits
;; byte,byte
;;}
monsternum =20 ;16
levelptr =TEXT_MEM
levelnumand =levelptr+2
picptr =levelnumand+1
passarg =picptr+2 ;;passarg is there in case I may want to pass args??
player =passarg+1
monster1 =player+sprsize
firstlvlmonst =monster1+(sprsize*5) ;5
secondlvlmonst =monster1+(sprsize*10) ;10
bullet =monster1+(sprsize*monsternum)
randvar =bullet+sprsize
score =randvar+1
oldxy =score+2
frame =oldxy+2
delay =frame+1
loop =delay+1 ;loop used by movebullet,movemonster,refresh
hitxy =loop+2
hitxyval =hitxy+2
health =hitxyval+1
pdir =health+2
level =pdir+1
hiscore =level+1
playmode =hiscore+2
jumpptr =playmode+1
blockspot =jumpptr+1
modebits =blockspot+2
lastvar =modebits+1
;;;;;;;;;;;;total=??
endoftext =$8186
#if ( lastvar >= endoftext)
; generate an invalid statement to cause an error
; when we go over the text boundary.
!!! text area bounds exceeded.
#endif
;;;;;;;;;;;;;text memory 2
firstname =TEXT_MEM2
midname =firstname+1
lastname =midname+1
zero =lastname+1
lastvar2 =zero+1
endoftext2 =TEXT_MEM2 + 160
#if ( lastvar2 >= endoftext2)
; generate an invalid statement to cause an error
; when we go over the text boundary.
!!! text2 area bounds exceeded.
#endif
;;;;;;;;;;;end text memory 2
;;;;;;modebits:
newhiscorebit =3 ;;used to indicate a new hi score
;playmode bits
isplayerbit =2 ;;used only in domove kinda a HACK!
haskeybit =1
hasscrollbit =0