Login
Back to forumReply to this topicGo to last reply

Posted By

Waz
on 2024-12-12
17:29:42
 Dark Tower Plus/4 fix for C16 only tape version

Good evening all,

As I picked up an original of Dark Tower in a recent set of games purchased from eBay, I thought I'd take a good look at the code and see if I could get it working natively on a Plus/4.

In the end this didn't turn out to be too difficult. The oiffending code to set $FF13 was at $1EA7 onwards which looked like this:

.C:1ea7  AD 13 FF    LDA $FF13
.C:1eaa 29 F0 AND #$F0
.C:1eac 09 10 ORA #$10
.C:1eae 8D 13 FF STA $FF13


As a result, $FF13 is set to $D1. On the C16 that's fine, as it just reverts back to its first bank and technically is set to $11. But of course that on an expanded C16 or the Plus/4? That doesn't play ball.

Naturally here the easy thing was to change $1EAC like this:

.C:1eac  A9 11       LDA #$11


Because this is initialised early on in the game, the game does need a run stop and reset to go into the monitor and entering that change, followed by G 1E40 (or SYS 7744) to restart the game. And there it is, all proper.

I also noted that when the first small part does a LOAD off tape, it's effectively a BASIC listing to POKE in some machine code values to load the game and then to a JMP $1E40 to start the game, like so when you LIST it:

10 P=1020
20 READ A:IF A=-1 THEN SYS 1020
30 POKE P,A:P=P+1:GOTO 20
100 DATA 169,1,162,1,160,1,32,186,255
110 DATA 169,0,32,189,255
120 DATA 169,0,162,255,160,255,32,213,255
130 DATA 76,64,30,-1


Naturally we could of course add in our own code here, so amending line 130 like this:

130 DATA 169,169,141,172,30,169,17,141,173,30,76,64,30,-1


Makes the code of:

LDA #$A9
STA $1EAC
LDA #$11
STA $1EAD
JMP $1E40


So we can now do RUN and the game loads, sets the correct values needed (which in turn set $FF13 correct on startup of the game) and runs the game. Happy times.

I have of course added the relevant bits into the cheats section for the game too.

Posted By

siz
on 2024-12-16
06:12:46
 Re: Dark Tower Plus/4 fix for C16 only tape version

Nice find! Although you can skip the patch at $1ead as bit 0 is read-only (reads the state of the ROM/RAM switch at $ff3e/$ff3f) so writing $11 is equivalent to writing $10.

Posted By

Csabo
on 2024-12-16
10:39:30
 Re: Dark Tower Plus/4 fix for C16 only tape version

Nice happy There were a few other early games that were "C16 only" due to this exact same behaviour (incorrectly setting $FF13).

Posted By

Waz
on 2024-12-17
04:18:51
 Re: Dark Tower Plus/4 fix for C16 only tape version

Indeed there were, @Csabo - and that's why if I find an easy way to get them fixed I'll share them here. It was notable too when doing the fix for Rockman I had the compatible version to compare against to see what happened.

I'll try and do any of the remainder (think Tower of Evil is one) and naturally put the info here when done.

Posted By

siz
on 2024-12-17
05:40:17
 Re: Dark Tower Plus/4 fix for C16 only tape version

I wonder if it can be an intentional code? Perhaps they wanted to sell a separate plus/4 version? Or in most cases just to spare several bytes by setting $ff12 only and leaving $ff13 at the default $d0?

Posted By

Waz
on 2024-12-17
11:02:35
 Re: Dark Tower Plus/4 fix for C16 only tape version

I would say it was unintentional, more so if the programmer only had a Commodore 16 to hand (and an unexpanded one at that). So what would deem to be fine code for the C16 when setting $FF12/$FF13 (and more likely $FF13 in truth) would not work correctly on an expanded C16 (to 64K) or Plus/4.

Think of it as setting 4 banks of 16K - each reset to bank 0 the C16 (as that's all it sees natively) but expand the RAM or use a Plus/4, and sees all 4 banks separately, hence it doesn't like it.

Going to do a compare later of the two versions of Tower of Evil (original release and Alternative re-release which is Plus/4 compatible) to see what they changed, I'll post that in a separate thread.

Posted By

Ulysses777
on 2024-12-17
16:01:01
 Re: Dark Tower Plus/4 fix for C16 only tape version

I would agree that most of the time it was accidental. Dark Tower is possibly unique in that the publisher actually acknowledged that there was a problem, with an almost apologetic note in C16 Greatest Hits that it will not work on the Plus/4.

On the other hand, early copies of Skramble used a turbo loader which only worked on the C16 because of multiple JSR $4333 and JSR $4370 instructions instead of $0333 and $0370. And it also uses DCP instructions to decode the turbo routine. Which gives me the impression that the programmer was trying to be a smartarse and came unstuck.



Back to topReply to this topic


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