Resource centre for ZX Spectrum games
using Manic Miner and Jet Set Willy game engines
Archive of the
Manic Miner & Jet Set Willy Yahoo! Group
messages
|
|
||
|
|
Message: 691
Author: john_elliott_uk
Date: 08/09/2000
Subject: Re: dynamic poke switching
<
[Note: In
this post I'm going to be using hexadecimal numbers
throughout. If you need decimal, KCalc or the Win95
calculator can convert to and fro.]
Okay, here's the
crib. The first part that mentions superjumps
goes:
R85C2:
;
;(v0.02HL5) This patch was added to support...
[comments
removed]
;It now reads:
LD HL,T80DE ;Border colour
LD
DE,T8E34 ;Poke address
The first line "R85C2:"
means that this
patch is applied at 85C2h. A couple
of lines further down is the LD DE, line; this
contains the address of the POKE, as I pointed out in the
comment on the right. If you look at memory starting from
85C2h, you find the following values (expressed in
Hex):
21 DE 80 11 34 8E C3 15 89 ...
The ones to
watch are the 34 8E; they correspond to the "T8E34" in
my listing above. 8E34h is the address of the
superjump poke. For the fall-any-height poke, that wants to
become 8E7Dh. So poke in the correct bytes, and you end
up with:
21 DE 80 11 7D 8E C3 15 89
...
That was the address - what about the values?
Well, the next line (JP L8915; in BASIC it would read
GOTO 8915) tells us that the code continues at the
line starting "L8915:". So, let's search for
it:
L8915: LD A,0BCh ;Turn it off
LD (DE),A
BIT
7,(HL) ;Bit 7 of border = flag
JR Z,R891F
LD
A,2Ch ;Turn it on
LD (DE),A
And we now find
the values listed on Arsen's POKEs page - 0BCh (off)
and 2Ch (on). Those want to become 32h and 01h
respectively. So, looking at the sequence of bytes at 8915h we
see:
3E BC 12 CB 7E 28 03 3E 2C 12 ...
So you
replace the BC and the 2C, to get:
3E 2C 12 CB 7E
28 03 3E 01 12 ...
Now, I could just have
told you the addresses to change (POKE address at
85C6h, "off" value at 8916h, "on" value at 891Dh), but
wasn't it more fun this way?
