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: 4818

Author: andrewbroad

Date: 14/06/2005

Subject: JSW myth: "POKE 35123,0 removes nasties"

 

Here's a little gem I discovered in a personal email that I sent on
24th August 1999; it's about time it became public knowledge:

POKE 35123,0, billed as "remove nasties", appears to work for the
most part, but has nasty side-effects such as the black blob in
"To the Kitchens Main Stairway" (and no doubt some invisible ones
in rooms with black paper background), the way you get killed if you
hang around on the top ledge of "Ballroom East" for a few seconds,
and various seen and unseen arrows. And of course it gets rid of the
ropes, because rope is a type of guardian.

35123 is in the middle of the code that processes the guardian-
instance list for a room (Offsets 240 to 255). It looks up each
guardian-class c in the Guardian-Class Table (40960 + 8*c) and takes
a working copy of the 8 bytes for the class of each guardian in a
buffer at 33024. A slice of the code near 35123 illustrates what's
going on:

LD IX,240 ; offset of first guardian-instance
...
LD L,(IX+0) ; get first byte of guardian-instance
(i.e. index into Guardian-Class Table)
RES 7,L ; knock out the MSB of L (only 128 guardian-classes)
LD H,20 ; HL = 256*20 + L
ADD HL,HL ; HL = 2*(256*20 + L)
ADD HL,HL ; HL = 4*(256*20 + L)
ADD HL,HL ; HL = 8*(256*20 + L) = 40960 + 8*L

POKE 35123,0 replaces the middle ADD HL,HL with NOP, so HL only gets
doubled twice. It therefore tries to look up the guardian-class at
(20480 + 4*L) - an address in video RAM! So instead of removing the
guardians, it looks them up at an erroneous place in memory. Most of
them turn out to be invalid when interpreted as guardian-classes, so
the game-engine ignores them (creating the illusion that the poke
removes guardians). A few of them turn out to be valid guardian-
classes, which accounts for the arrows and black blobs in various
rooms.

--
Dr. Andrew Broad
http://www.geocities.com/andrewbroad/
http://www.geocities.com/andrewbroad/spectrum/
http://www.geocities.com/andrewbroad/spectrum/willy/

http://groups.yahoo.com/group/manicminerandjetsetwilly/

 

 

arrowleft
arrowright