-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.z80
More file actions
136 lines (118 loc) · 1.93 KB
/
main.z80
File metadata and controls
136 lines (118 loc) · 1.93 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
DEVICE ZXSPECTRUM48
SLDOPT COMMENT WPMEM, LOGPOINT, ASSERT
ORG #8000
start:
ld sp, 0
; paper 0: ink 7: border 0
ld hl, 0x5800
ld de, 0x5801
ld bc, 0x2ff
ld (hl), 7
ldir
xor a
out (254), a
call res.init
call set_im2
; call map.draw_debug_markup
ld de, 0x202
ld hl, game.level_1
ld bc, 0
xor a
call game.activate_level
ld hl, res.vdoor
ld de, vdoor_color
ld b, 4
call sprite.paint_spritesheet
jr 1F
vdoor_color
db 0xc7, 0, 0xc7, 0
1
; halt
; ld a, 1
; out (254), a
ld a, 1
ld (dirty_screen), a
ld hl, res.font
call console.set_font
ld ix, console.default_console
ld a, 0b01000100
ld h, 19
ld l, 0
ld d, 22
ld e, 4
call console.init
call status.init_panel
call status.display_status
read:
halt
call read_key
.key
and 0b01111111
cp 'Q'
jr nz, .notup
call game.move_hero_up
jr .next
.notup
cp 'A'
jr nz, .notdown
call game.move_hero_down
jr .next
.notdown
cp 'O'
jr nz, .notleft
call game.move_hero_left
jr .next
.notleft
cp 'P'
jr nz, .notright
call game.move_hero_right
jr .next
.notright
cp '0'
jr nz, .notzero
ld ix, console.default_console
call console.clear
jr .next
.notzero
cp 'M'
jr z, .interact
cp ' '
jr nz, .stop
.interact
call game.stop_hero
call game.interact
jr .next
.stop
call game.stop_hero
.next
halt
jr read
modules
include "globals.z80"
include "screen.z80"
include "keyboard.z80"
include "beeper.z80"
include "map.z80"
include "bullet.z80"
include "sprite.z80"
include "tiles.z80"
include "interrupts.z80"
include "memory.z80"
include "objects.z80"
include "inventory.z80"
include "console.z80"
include "dialog.z80"
include "game.z80"
include "status.z80"
include "random.z80"
include "dzx0_standard.z80"
display "modules size: ", /D, $-modules
module i18n
;; TODO: move to the 4th page (with resources)
include I18N
endmodule
end_of_code
include "resources.z80"
end:
SAVETAP TAPNAME,CODE,"angel5",start,end-start
SAVESNA SNANAME,start