Name: | Item Box Time Cost |
Author: | Maarfy |
Added: | |
Tool: | Asar |
Requires Free Space: | Yes |
Bug Fix: | No |
Featured: | No |
Description: | This patch deducts a configurable amount of time from the timer when dropping the item box item with Select. There are three possible outcomes depending on the time cost and how much time remains on the timer (all three outcomes will drop the item box item): - If the timer is greater than twice the time cost, the cost will be deducted from the timer - If the timer is between the cost and twice the cost, the timer will be set to the cost value itself - If the timer is less than the cost, the item will be dropped with no time deduction This patch also allows enabling a nearby debug function that is otherwise overwritten. All code is fully commented. Requested by Ondore's Lies. |
Tags: | item item box items lorom sa-1 time timer |
Comments: | 2 (jump to comments) |
Download
2.07 KiB | 169 downloads
Comments (2)
The routine which converts the timer to hexadecimal is very unoptimized. The dependency on $00, which is read and written during each iteration of the three loops, can be very easily removed because the accumulator is not used at all during the conversion. The positioning of the Item_Box_Time_Cost_SetAtCost label is also a little odd as it's in the middle of Item_Box_Time_Cost_ConvertTens but I assume that's due to branch distance. Finally, the hijacked routine returns to $00C592; $00C58F would be a better return address as it wouldn't skip an STZ instruction unrelated to the item box. I didn't manage to break anything because of the missed STZ and the new code isn't called often, so I didn't consider any of these rejection reasons.