Login
Back to forumReply to this topicGo to last reply

Posted By

Waz
on 2024-02-23
08:32:52
 Rockman C16 Only Versions - Plus 4 Fix (Deep Dive)

As you may have spotted, I added some POKEs for Rockman so that the C16 only versions will now work on the Plus/4. It is recommended to reset (don't do a RUNSTOP and reset) when entering them, and indeed any other Rockman POKEs, to ensure all is well due to stack overflowing issues spotted in the game code.

So how did I find out what went on? By comparing the game code and utilising the previous knowledge gained during checking the C16 only Vegas Jackpot (kudos to those that found it initially of course). So, here's what happens.

Initialisation and Title Screen:

The machine code initialises a subroutine which sets the TED chip register $FF13 (used for character data base address) as well as $FF12. Straight away, on the C16 only version, you can see what the issue is:

C:1b90 AD 12 FF LDA $FF12
C:1b93 29 FB AND #$FB
C:1b95 8D 12 FF STA $FF12
C:1b98 AD 13 FF LDA $FF13
C:1b9b 09 28 ORA #$28
C:1b9d 8D 13 FF STA $FF13
C:1ba0 60 RTS

The ORA command based on the power on setting of $FF13 would mean that the character base address is set to $F8. This would be mirrored by multiples of $40 (based on the 16K blocks of RAM addressing) to be $38 on the C16, but the Plus/4 sets this to $F8 (hence the blocks of nothingness)

In the Plus/4 compatible version, the code has been amended:

C:1b90 AD 12 FF LDA $FF12
C:1b93 A9 C3 LDA #$C3
C:1b95 8D 12 FF STA $FF12
C:1b98 AD 13 FF LDA $FF13
C:1b9b A9 38 LDA #$38
C:1b9d 8D 13 FF STA $FF13
C:1ba0 60 RTS

Here, $FF12 *and* $FF13 are explicitly set to what you'd expect, so the character base address at $3800 works on both.

Instructions Page:
There's also something in the C16 only code which does another setting of those same TED registers. This time around, it's to go back to the basic character default address page ($D000) for the selection of joystick and keyboard controls. Again, the AND means that it sets itself back. On both versions, this page does display correctly on the Plus/4.

C:26c7 AD 12 FF LDA $FF12
C:26ca 09 04 ORA #$04
C:26cc 8D 12 FF STA $FF12
C:26cf AD 13 FF LDA $FF13
C:26d2 29 D0 AND #$D0
C:26d4 8D 13 FF STA $FF13
C:26d7 60 RTS

However, because these were originally ORA and ANDed from the bad values, fixing the title page values would mean these commands would also fail to work if the title screen values are fixed. Hence in the Plus/4 compatible version, we see this:

C:26c7 AD 12 FF LDA $FF12
C:26ca A9 C7 LDA #$C7
C:26cc 8D 12 FF STA $FF12
C:26cf AD 13 FF LDA $FF13
C:26d2 A9 D0 LDA #$D0
C:26d4 8D 13 FF STA $FF13
C:26d7 60 RTS

For the remainder of the game (the ROCK MAN screen, in-game, character death) the game switches back using the first subroutine to the character map. Again, when ANDed or ORAed from the original C16 code, this is fine, but the Plus/4 would again be looking for a non-existent character RAM.

In fact, you can easily also replicate this behaviour on the C16 only version by, in theory, copying the data from $3800-$3BFF to $F800 (title screen) - ensuring you're in RAM instead of ROM when doing that. I did that in the monitor in YAPE (if using XPlus4 in WinVICE, bank ram before copying does the same) when the game was running and straight away the graphics were visible on that title screen, proving that the bank addressing for $FF12/$FF13 was the root cause.

You could also try to copy $3C00-$3FFF (game data) to $FC00, but that as you can imagine would cause issues with $FF00 onwards (although this does work on xPlus4 oddly) and again you would see similar results.

So in effect, all the POKEs I created would be doing would be to do this:

* Set the statements at $1B93 and $1B9B to be the LDA # values instead of ORA
* Set the statements at $26CA and $26D2 to be the LDA # values instead of ORA and AND.

As the byte $D0 at $26D3 is the same in both versions, we don't need to set that, so 7 POKEs in all. And boom! It works.

So for those of you who only have a C16 only oriignal version of Rockman, you can now play this on a Plus/4. Which has to be a good thing to find, I hope.

Posted By

MIK
on 2024-02-23
10:45:20
 Re: Rockman C16 Only Versions - Plus 4 Fix (Deep Dive)

Wow your having a crazy Rockman week lol. Hope you beat your best score! grin


Back in the day when all there was were C16 Only copies of Rockman, (very early 1985)....

I long forget what pokes I used.... I used to interrupt the loading, the poke or pokes I use, (and that was all it was) would change the graphics mode so all the characters looked all messed up.
I would then continue loading and the game would then display correct on my Plus/4.

It was here "in my own little world" I said Rockman was C16 Only without actually ever owning a C16 lol. Dark Tower was another and the original Tower of Evil. But yeah another kid at school about a year later said his Rockman works on Plus/4 so I bought another and bingo! I never looked back. As a kid I didn't write stuff down as you remembered silly things like a couple of pokes but as the years past I have long forgot. I've never forgot there were C16 Only games though. wink

Posted By

C64Mark
on 2024-02-25
15:02:30
 Re: Rockman C16 Only Versions - Plus 4 Fix (Deep Dive)

Nice work, Waz. I have been 'poking' around in the code (hence how I found the cheat), and it is a pretty neatly coded game in the main - but there are a few issues like the ones you've highlighted.

Much easier to spot these things with modern tools of course.



Back to topReply to this topic


Copyright © Plus/4 World Team, 2001-2024. Support Plus/4 World on Patreon