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.
|