From d33647884bf66814606271b1180643330c3579f4 Mon Sep 17 00:00:00 2001 From: ketmar Date: Sat, 17 Mar 2012 14:11:58 +0200 Subject: [PATCH] new level loader is working! --- asm/game/use/apple.awa | 2 +- asm/game/use/dynamite.awa | 2 +- asm/game/use/key.awa | 2 +- asm/game/use/rocket.awa | 2 +- asm/game/use/vial.awa | 2 +- asm/game/utils.awa | 13 +++++++++---- asm/items/items.awa | 2 +- 7 files changed, 15 insertions(+), 10 deletions(-) diff --git a/asm/game/use/apple.awa b/asm/game/use/apple.awa index 3253886..be0b21d 100644 --- a/asm/game/use/apple.awa +++ b/asm/game/use/apple.awa @@ -56,7 +56,7 @@ locals: .dx, .t set frozen, 0, [prof_item] ;set activated, 1, [prof_item] set [prof_item], 0 - bsr set_item_name_vars, [prof_item] + bsr set_item_name_vars, 0 .quit: ret endp: game_use_apple diff --git a/asm/game/use/dynamite.awa b/asm/game/use/dynamite.awa index 2fd3d57..daaf118 100644 --- a/asm/game/use/dynamite.awa +++ b/asm/game/use/dynamite.awa @@ -44,7 +44,7 @@ locals: .dx, .t set activated, 1, [prof_item] set item_id, ITEM_DYNAMITE, [prof_item] set [prof_item], 0 - bsr set_item_name_vars, [prof_item] + bsr set_item_name_vars, 0 ;;;.quit: ret endp: game_use_dynamite diff --git a/asm/game/use/key.awa b/asm/game/use/key.awa index 0952794..3158fd5 100644 --- a/asm/game/use/key.awa +++ b/asm/game/use/key.awa @@ -88,7 +88,7 @@ deflvar: .dx, .t ; don't change to locals! ; key should disappear now kil [prof_item] set [prof_item], 0 - bsr set_item_name_vars, [prof_item] + bsr set_item_name_vars, 0 set [spr_num], PSPR_STANDING ret ; diff --git a/asm/game/use/rocket.awa b/asm/game/use/rocket.awa index 4b82178..520c31f 100644 --- a/asm/game/use/rocket.awa +++ b/asm/game/use/rocket.awa @@ -53,7 +53,7 @@ deflvar: .dx, .t ; don't change to locals set activated, 1, [prof_item] set item_id, ITEM_ROCKET, [prof_item] set [prof_item], 0 - bsr set_item_name_vars, [prof_item] + bsr set_item_name_vars, 0 psh [pos_x] add [prof_dir] psh -666 diff --git a/asm/game/use/vial.awa b/asm/game/use/vial.awa index 13d34d4..ca31b90 100644 --- a/asm/game/use/vial.awa +++ b/asm/game/use/vial.awa @@ -60,7 +60,7 @@ locals: .f .quit: kil [prof_item] set [prof_item], 0 - bsr set_item_name_vars, [prof_item] + bsr set_item_name_vars, 0 /* set spr_dir, DIR_LEFT, [prof_item] set pos_ty, 0, [prof_item] diff --git a/asm/game/utils.awa b/asm/game/utils.awa index 3106848..24edbef 100644 --- a/asm/game/utils.awa +++ b/asm/game/utils.awa @@ -152,10 +152,13 @@ arg: .profdir set [spr_num], PSPR_TAKING1 bsr game_next_frame bsr game_next_frame - ; + ; remove item name + bsr set_item_name_vars, -1 + ; set [rst_result] to new item_tid bsr game_item_at_prof drp ; result - ; + set [item_id], 0 + ; have something to put? jeq .nopitem, [prof_item], 0 ; put prof's item get [prof_item], item_id @@ -175,10 +178,13 @@ arg: .profdir res [prof_item] set [prof_item], 0 .nopitem: - jeq .done, [rst_result], 0 + jeq .done, [rst_result], 0 ; there was no item at prof position ; take item set [prof_item], [rst_result] sus [prof_item] + ; setup name + get [prof_item], item_id + bsr set_item_name_vars .done: set [spr_num], PSPR_TAKING0 bsr game_next_frame @@ -186,7 +192,6 @@ arg: .profdir set [spr_num], PSPR_FACING bsr game_next_frame bsr game_next_frame - bsr set_item_name_vars, [prof_item] ret endp: game_do_pick diff --git a/asm/items/items.awa b/asm/items/items.awa index b65c3af..f07997f 100644 --- a/asm/items/items.awa +++ b/asm/items/items.awa @@ -239,7 +239,7 @@ locals: .addr, .type jne .bad_type, [.type], [.item_id] ; found set [item_name_ofs], [.addr] - set [item_name_len], -1 + set [item_name_len], -1 ; asciiz ret .bad_type: rxc [.addr], [.type] -- 2.11.4.GIT