You know what? I just tested a bit further and that doesn't seem to be the problem. It seems that the registers get fucked up at some point (I can't really explain since I haven't done anything with the SNES in a while). Basically what I did was this: I replaced the sta $13BF with
Then I viewed $7E13BF in BSNES' Memory Viewer.
Result: $13BF was still always #$00, even directly after this line. Then I did this:
And now it worked. $13BF became #$01 and the value didn't change. Therefore I assume that somehow some of the SNES' registers somewhere close to my hijack point get modified, which makes the routine work with wrong values. It didn't happen with my old ROMs, so I guess this could be due to a newer version of Lunar Magic (I can't remember which one I worked with back in the old days) or due to another patch.
So I guess all I have to do is somehow set the correct register back to $7E. It's been a while since I worked with the SNES, so... I guess anyone of you knows how to do this? Just tell me how to set the responsible register to the correct value and then back it up later. That should do the job.
Wasn't it "direct page register" or something like that? Memories are blurred...
May also have to do with the FreeRAM address I used. If I remember correctly then $0000 to $2000 in each bank are mirrors of the SNES' RAM. But does that apply to all banks in the ROM? In my patch (according to BSNES) the code is trying to store to $6B13BF. Does that count? Here is a snapshot:
Alright. I guess I'll either try long addresses then or maybe try to find another freespace address within the supported range.
Just came accross a little bug in the base rom. I collected all three SMWC coins in the first level, then went to the oriental map and when I entered a level there it already displayed all three coins filled in. Is this only the coin display that is messed up or the actual data? I just want to know how reliable the data is I work with, so that I won't get confused when testing the finished patch.
Seems like all levels in the base ROM share the same flags for the coins. Is this supposed to happen? 0_o
Not really too useful for testing.
That is because the multiple midway patch hasn't been inserted yet.
However, now that the levels are almost all completed, that should be done soon(it would be bothersome to reapply it every time a new level was inserted, and could potentially crash the rom)
Edit: if you give me two hours, I can have a fully testable copy ready (kinda busy right now, but I'll work on it in a little bit
It seems I've run into some problems with the multiple midway point patch. Most likely a ram conflict somewhere. It doesn't load the levels from midpoints for some reason even though I inserted custom checkpoints and edited the midpoint table...
Either way, I'm busy for the next few hours, so this going to have to be delayed for a bit ^-^l|l
Chances are(if I can't fix it after another half an hour of work), it will have to wait till Monday. I have an Exam that day that I need to study for, and quite frankly it has a higher priority than this =P
Hmmm... how functional are the SMWC coins in the current version actually? I think I've got the code sorted out (for the first coin), and I used the code you sent me in the PM, but it doesn't do anything. This is the code:
lda !timer ; Increase timer
lda $13BF ; Is first coin collected?
lda $13BF ; Is first coin temporary collected?
;[PUT GRAPHICS CODE FOR FIRST FILLED COIN HERE]
;[PUT GRAPHICS CODE FOR FIRST EMPTY COIN HERE]
I'm note sure if I made a mistake here, but I think I did everything right. As you can see I'm using the music register to test the routine. If I put
at the very beginning of this code then the music gets changed which means the register defenitely works. However, in this version the music never changes which means that neither .1filled nor .1empty ever get executed. Neither when I have temporary collected a coin, nor when I have fully collected it, nor when I haven't collected it at all. Is it because the current version of the base ROM doesn't have the correct version of your patch or is it because I'm doing something wrong?
OK... on a few random levels the empty coin test music gets played. But it also seems to be rather random and not related to the actual coin.
And even then it doesn't even always work on those random levels. So yeah, I guess I better wait until you have fixed everything.
Sorry, real life stuff keeping me busy =/
I'll have time to work on it tomorrow, though.
And further more, school is now almost over(only one exam left), so I'll have more time to work on it from now on :3
I have the graphics now as well, so you can expect it all in the next base ROM update. It's been tested several times now, so aside from the final beta testing phase at the end, that particular sprite is good to go.