forked from albs-br/msx-wings
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInitVariables.s
More file actions
91 lines (67 loc) · 2.08 KB
/
InitVariables.s
File metadata and controls
91 lines (67 loc) · 2.08 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
PLAYER_INITIAL_X: equ 128 - (PLANE_PLAYER_WIDTH/2)
PLAYER_INITIAL_Y: equ 192 - 32
InitVariables:
ld a, PLAYER_INITIAL_X
ld (Player_X), a
ld a, PLAYER_INITIAL_Y
ld (Player_Y), a
ld (Player_Y_Static), a
ld hl, PlayerShot_0_Struct
call PlayerShot_Reset
ld hl, PlayerShot_1_Struct
call PlayerShot_Reset
ld hl, PlayerShot_2_Struct
call PlayerShot_Reset
; ld hl, PlayerShot_3_Struct
; call PlayerShot_Reset
; ld hl, PlayerShot_4_Struct
; call PlayerShot_Reset
; ld hl, PlayerShot_5_Struct
; call PlayerShot_Reset
ld hl, Enemy_0_Struct
call Enemy_Reset
ld hl, Enemy_1_Struct
call Enemy_Reset
ld hl, Enemy_2_Struct
call Enemy_Reset
ld hl, Enemy_3_Struct
call Enemy_Reset
ld hl, Enemy_4_Struct
call Enemy_Reset
ld hl, Enemy_5_Struct
call Enemy_Reset
ld hl, Enemy_6_Struct
call Enemy_Reset
ld hl, EnemyShot_0_Struct
call EnemyShot_Reset
ld hl, EnemyShot_1_Struct
call EnemyShot_Reset
ld hl, EnemyShot_2_Struct
call EnemyShot_Reset
ld hl, EnemyShot_3_Struct
call EnemyShot_Reset
ld hl, EnemyShot_4_Struct
call EnemyShot_Reset
ld hl, EnemyShot_5_Struct
call EnemyShot_Reset
ld hl, EnemyShot_6_Struct
call EnemyShot_Reset
; load first shot struct addr
ld hl, PlayerShot_0_Struct
ld (NextShot_Struct_Addr), hl
ld a, 255
ld (Player_FramesSinceLastShot), a
xor a
ld (Screen_Y_Origin), a
ld (FramesSkipped), a
ld hl, 0
ld (LevelCounter), hl
; TODO: move this to a "LoadLevel" sub
ld hl, Level_1_Data
ld (LevelData_CurrentAddr), hl
; copy from initial sprite attributes to buffer
ld hl, InitialSpriteAttributes
ld de, SpriteAttrTableBuffer
ld bc, InitialSpriteAttributes.size
ldir
ret