awasm, assembler: report unused labels
[awish.git] / asm / game / walkcheck.awa
blob84e0b2120b3956d6f31690b50274df3eddcedcc5
1 /*
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.
6  *
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.
11  *
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/>.
14  */
15 proc: game_can_walk
16 locals: .x, .y
17   jeq .nowc, [key_walk_cheat], 0
18 .can:
19   ret 1
20 .nowc:
21   mgf [pos_x], [pos_y]
22   jeq .cant, 0
23   add [pos_x], [prof_dir], [.x]
24   set [.y], [pos_y]
25   mgf [.x], [.y]
26   jeq .can, FTILE_EMPTY
27   sub [.y], 1
28   mgf [.x], [.y]
29   jeq .can, FTILE_EMPTY
30 .cant:
31   ret 0
32 endp: game_can_walk
35 proc: game_can_jump
36 locals: .x, .y
37   jeq .nowc, [key_walk_cheat], 0
38 .can:
39   ret 1
40 .nowc:
41   add [pos_x], [prof_dir], [.x]
42   sub [pos_y], 1, [.y]
43   mgf [.x], [.y]
44   jeq .can, FTILE_EMPTY
45   sub [.y], 1
46   mgf [.x], [.y]
47   jeq .can, FTILE_EMPTY
48 ;;;.cant:
49   ret 0
50 endp: game_can_jump