Atari_Ace Posted March 19, 2016 Share Posted March 19, 2016 I've been trying to reconstruct old ANALOG game binaries from the original source code by translating the AMAC or MAC/65 code to MADS format (using a bit of perl) and then assembling them with MADS. I got excellent results until I tried Planetary Defense, which has some lines like: .SBYTE +$40," PLANETARY" Here I replaced .SBYTE with .SB, which then compiles to 187 2030 60 D0 CC C1 CE C5 + .SB +$40, " PLANETARY" All those bytes are incorrect, for instance, the first should be $40. Although I'm nearly thirty years out of practice on Pascal and don't read a word of Polish, I was able to muddle my way through the MADS source code and find the bug. For screen bytes, you apply the offset after converting to screen values. MADS was doing it in the opposite order when the input was string. Interestingly, it did the correct translation when the values are bytes. Anyhow, here's a patch. mads.diff.txt 1 Quote Link to comment Share on other sites More sharing options...
tebe Posted March 20, 2016 Share Posted March 20, 2016 mads v2.0.2 http://mads.atari8.info p.s. procedure save_dta -> CASE 'C','D' 2 Quote Link to comment Share on other sites More sharing options...
Atari_Ace Posted March 20, 2016 Author Share Posted March 20, 2016 Thanks for the quick response! That fixes my case, but it looks like save_dta still has incorrect logic when "if aray or put_used", so perhaps there is a case with .ARRAY or .PUT that will have similar problems. It's hard to tell from the code if they can ever be called with invers non-zero, but I'd still change it to be safe. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.