-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdefines.s
118 lines (96 loc) · 2.98 KB
/
defines.s
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
; macman by mausimus (c) 2023
; mausimus.github.io
; MIT license
;
_custom equ $dff000
_ciaa equ $bfe001
; screen is 4 interlaved bitplanes, meaning they are arranged in memory line-per-line
; (1st line of 1st bitplane, 1st line of 2nd bitplane, etc.)
SCREEN_WIDTH = 320
SCREEN_HEIGHT = 256
SCREEN_BPL = 4
SCREEN_BROW = SCREEN_WIDTH/8
SCREEN_LINE = SCREEN_BROW*SCREEN_BPL
; background tiles are 8x8
MAP_W = 28
MAP_H = 31
MAP_TILE_SIZE = 8
MAP_COL_STEP = MAP_TILE_SIZE/8
MAP_ROW_SIZE = SCREEN_WIDTH*2*SCREEN_BPL/(16/MAP_TILE_SIZE)
MAP_ROW_STEP = MAP_ROW_SIZE-(MAP_W*MAP_COL_STEP)
HERO_SIZE = 16
FONT_SIZE = 8
SPRITE_SIZE = 18*4
SCREEN_MODULO = (SCREEN_BPL-1)*SCREEN_BROW
SCREEN_MEMSIZE = SCREEN_LINE*SCREEN_HEIGHT
COPPER_MEMSIZE = (SCREEN_BPL*2+1)*4+(8*2*4) ; sprites
CHIPDATA_MEMSIZE = SCREEN_MEMSIZE+COPPER_MEMSIZE
NUM_SPRITES = 4
SPRITE_FRAMES = 16
DEATH_TIME = 50
PELLET_TIME = (50*10)
PELLET_ALERT = (50*2)
GHOST_POINTS = 200
BASE_POINTS = 10
PELLET_POINTS = 40
; object struct offsets
OBJ_X = 0
OBJ_Y = 2
OBJ_D = 4 ; direction
OBJ_F = 6 ; frame no
OBJ_S = 8 ; state
OBJ_SIZE = 10
;----------------------------------------------------------------------------- vars
RSRESET
screen: rs.l 1
copperList: rs.l 1
oldStack: rs.l 1
oldView: rs.l 1
oldIntena: rs.w 1
oldDma: rs.w 1
gfxBase: rs.l 1
tileData: rs.l 1
spriteData: rs.l 1
heroData: rs.l 1
fontData: rs.l 1
logoData: rs.l 1
copperSprites: rs.l 1
dead: rs.w 1
; objects (XYDF)
hero: rs.w (OBJ_SIZE/2)
ghosts: rs.w (NUM_SPRITES*OBJ_SIZE/2)
; frame counter
frameNo: rs.w 1
; score
score: rs.w 1
highScore: rs.w 1
dotsEaten: rs.w 1
; pellet frames remaining
pellet: rs.w 1
varsSize: rs.b 0
;----------------------------------------------------------------------------- macros
GET_HERO: MACRO
move.l a6,a0
add.l #hero,a0
ENDM
;-----------------------------------------------------------------------------
GET_GHOSTS: MACRO
move.l a6,a0
add.l #ghosts,a0
ENDM
;-----------------------------------------------------------------------------
WAIT_BEAM: MACRO
lea vposr(a5),a0
.1\@ moveq #1,d0
and.w (a0),d0
bne.b .1\@
.2\@ moveq #1,d0
and.w (a0),d0
beq.b .2\@
ENDM
;-----------------------------------------------------------------------------
WAIT_BLITTER: MACRO
tst.b dmaconr(a5)
.1\@ btst #6,dmaconr(a5)
bne .1\@
ENDM