Hi there, bisqwit!
Just a quick question: is it possible to load a sram savegame without resetting the console, i.e. loading from sram while playing? Just curious...
Useful answer: No, it is not. From the in-game savegame engine you can only save games.
Literally true answer: Technically the save engine actually loads
a game every time you move a cursor, in order to render the information about the save. And it does a full and complete loading, too, loading the whole save, extracting it over the current game status and all. But when you exit the screen, the savegame engine actually loads an invisible backup save that it made without you knowing, when you entered the screen in the first place.
Progress report: I found the reason to the clue-overwriting bug I explained earlier. It was caused by optimizations I made some game code used by the palette fader. I failed to consider that the map-restoring engine actually referred to the old code with hardcoded offsets.
Oddly enough, there is
actually code in my patch that attempts to make sure Simon is not invisible when Dracula is killed. Seems that I need to test it in detail.
// When Dracula is killed, ensure that Simon is not invisible
// ObjectAI_object4D_DraculasDeath at $B69F in bank 1: Unblink Simon
$b = new Blob("SimonUnblinkCall");
$b->AppendCallPointerTo("SimonUnblinker"); // 3-byte JSR replaces 3-byte "LDA abs,X"
$linker->AddBlob($b, 0x769F, true);
$b = new Blob("SimonUnblinker",
"\xBD\xD8\x03\x60"); // the same 3-byte LDA, and RTS
$linker->AddBlob($b, Array(0x4000,0x1C000)); // will be placed somewhere in one of these two banks
EDIT: Bug fixed. This code rather ensured
that Simon will be invisible during the ending. Replacing lda #2 with lda #1 fixes the problem.
EDIT: Map-screen crash bugs completely resolved. Turned out to be missing parenthesis in delay_n call, and then foiled by a macro. In case you are wondering how can this possibly result in a crash, it goes as follows: My delay engine uses partial instructions sometimes to reduce the size of delay loops. It does so only if the partial instruction is harmless in the context. Mismatched operator priority caused "n = 40" to evaluate into something completely other, enabling partial instruction execution when the instruction was in fact unsafe (plp). The following is an example of a harmless partial-instruction delay loop, where the first two instructions are "ldx #imm" and "lda zp,x" for the first loop only, but "ora #imm" and "nop" respectively for all consecutive loops. It is the smallest possible code that produces exactly 82 (or 1729 or 1810 or 2017 or 2098) cycles of delay, with 7 bytes of code, given that all registers can be clobbered except Y.
.if(n = 82 || n = 1729 || n = 1810 || n = 2017 || n = 2098)
; 7 bytes
@d = * - 1
; (^hides 'ora #imm' (2-byte))
lda $EA,x ; hides a 'nop'
You can find my delay macro modules at: http://bisqwit.iki.fi/src/6502-inline_delay.7z
. There's a file for every thinkable combination of registers to not clobber, and each file contains the smallest possible macro for any number of cycles to delay from 2 to 5000.
EDIT: Additional bug found: Daggers and knives crash the game. Found reason: Making a certain piece of code relocatable made the BNE at its end miss its target. Replacing with JMP fixes the problem.NEW VERSION RELEASED
Version 18.104.22.168 is available for download.
Changes since 22.214.171.124:
-- Fixed aforementioned crash & data corruption bugs, and the ending invisibility bug.
Additionally, the Tagalog version broken ROMs in some combinations (involving VRAM) have been fixed by an earlier release (most likely 126.96.36.199).
EDIT: Found that it still crashes when exiting map screen in mapper 1. Also found what causes it. The bug was fixed in the same release (by updating it). Also: Incredibly nobody seems to have reported it yet, but when you enter and exit map, all NPCs (including monsters) are respawned in their initial positions.