2 * This program is free software: you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation, either version 3 of the License, or
5 * (at your option) any later version.
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
12 * You should have received a copy of the GNU General Public License
13 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 deftvar: game_fan_left_v ; have left working fan?
17 deftvar: game_fan_right_v ; have right working fan?
18 deftvar: game_fan_dx_v ; !0: some fan in effect
20 ; used in 'monster death'
24 const: PSPR_STANDING = 0
25 const: PSPR_WALKING_LAST = 9
26 const: PSPR_TURNING = 10
27 const: PSPR_FACING = 11
28 const: PSPR_JUMPING = 12
29 const: PSPR_TAKING0 = 13
30 const: PSPR_TAKING1 = 14
31 const: PSPR_USING = 15
32 const: PSPR_CLOSED_EYES = 16
33 const: PSPR_LYING_DEAD = 19
34 const: PSPR_DRILLING0 = 20
35 const: PSPR_DRILLING1 = 21
36 const: PSPR_HARRY_EATS_PROF_START = 33
37 const: PSPR_HARRY_EATS_PROF_END = 38
42 const: PDIR_FACING = 0
49 set [spr_bank], BANK_PROF
50 set [spr_num], PSPR_FACING
51 set [spr_dir], DIR_LEFT
53 jlt .bad_level, [cur_level], 0
54 jge .bad_level, [cur_level], [max_level]
59 bsr entry_get_level_code, [cur_level]
61 psh avish_level_loader
62 rst FRST_GET_LEVEL_LOADER
63 jlt .no_custom_loader, [rst_result], 0
69 bsr ; call level loader
70 ; call local initializer (if any)
71 rst FRST_GET_LEVEL_INITER
72 jlt .no_custom_init, [rst_result], 0
76 rst FRST_SET_LEVEL_CODE, [level_code_ofs], [level_code_len]
81 entry_game_initialize:
83 set [cur_level], [start_level]
95 rst FRST_STOP_CHANNEL, -1
106 rst FRST_GET_GOOBERS_INITER
107 jlt @@f, [rst_result], 0
113 entry_game_restart_level:
118 rst FRST_STOP_CHANNEL, -1
120 set [game_state], GAME_STATE_STARTED
135 set [key_fall_cheat], 0
136 set [key_walk_cheat], 0
137 set [key_plev_cheat], 0
138 set [key_nlev_cheat], 0
140 ;set [prof_fall_count], 0
144 set [monster_tid], -666
147 set [item_name_ofs], 0
148 set [item_name_len], 0
149 rst FRST_SET_ITEM_NAME, [item_name_ofs], [item_name_len]
153 rst FRST_GET_GOOBERS_ONLOAD
154 jlt @@f, [rst_result], 0
158 set [game_state], GAME_STATE_PLAYING
159 brk ; give all threads a chance to initialize themselves
161 jmp game_facing_loop_w2f
164 include: game/utils.awa
165 include: game/walkcheck.awa
166 include: game/falling.awa
167 include: game/fanchecks.awa
168 include: game/dodie.awa
169 include: game/scrolls.awa
170 include: game/doors.awa
171 include: game/sidemove.awa
172 include: game/loops_main.awa
173 include: game/jumps.awa
174 include: game/nono.awa
175 include: game/check_do_earth.awa
176 include: game/frame_common.awa