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]
90 rst FRST_STOP_CHANNEL, -1
101 entry_game_restart_level:
106 rst FRST_STOP_CHANNEL, -1
107 rst FRST_PLAY_SOUND, SND_HARRY_EATS_APPLE
109 set [game_state], GAME_STATE_STARTED
124 set [key_fall_cheat], 0
125 set [key_walk_cheat], 0
126 set [key_plev_cheat], 0
127 set [key_nlev_cheat], 0
129 ;set [prof_fall_count], 0
133 set [monster_tid], -666
136 set [item_name_ofs], 0
137 set [item_name_len], 0
138 rst FRST_SET_ITEM_NAME, [item_name_ofs], [item_name_len]
141 set [game_state], GAME_STATE_PLAYING
142 brk ; give all threads a chance to initialize themselves
144 jmp game_facing_loop_w2f
147 include: game/utils.awa
148 include: game/walkcheck.awa
149 include: game/falling.awa
150 include: game/fanchecks.awa
151 include: game/dodie.awa
152 include: game/scrolls.awa
153 include: game/doors.awa
154 include: game/sidemove.awa
155 include: game/loops_main.awa
156 include: game/jumps.awa
157 include: game/nono.awa
158 include: game/check_do_earth.awa
159 include: game/frame_common.awa