@abw sorry I had quite some busy days, and a little health issue yesterday, but I managed to get back to this today.
Just checked the updated code you sent, and damn you really did a lot of work on this.
I don't even know how to thank you for my bothersome nature of me being unable to do a thing on my own in terms of assembly :/
This time I made sure to check everything was in the proper place, checked each opcode in Hex to its corresponding writing, and it seems to be fine.
I also went ahead and tracked down the exact place where the Automap code would be placed, removed some code and added it back, and it seems to work properly with Automap now! First hint was that upon loading, the Automap tiles that I have walked into are still the same as the one I had before the new code, and second hint that it worked properly was that upon discovering a new area, the Automap filled in only the proper square for the current screen Link is in, and not any adjacent ones.
For reference, this is what I modified to make Automap work with your code:
// Indirect control flow target
jsr setup_copy_range // Set up copy destination start ($02) and end ($04) variables
jsr L06_80D7 // Read data from ($00) and write it to ($02) through to ($04); exits with Y == #$00
nop // Maintain original code alignment
jmp $FFC0 // JMP $FFC0 required by Automap!
I replaced the INC and RTS for the JMP $FFC0, and that did the trick.
So I think this is now properly implemented!
I will make the push into the GitHub, and will credit you for this work in its entirety.
I am even kinda shy to ask this, but I want to ask you @abw, if you are okay with it and are willing to, if I could please ask for your help on the very last thing I want to do for Zelda Redux?
Given how your optimizations on ASM are outstanding, I'm certain that will help to make and close up the very last feature I want to make for it.
Please, let me know if you are interested, and if so, how would you want me to contact you about it.