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

Author: andrewbroad

Date: 20/04/2004

Subject: Re: SPECSAISIE 1.3: MMtoJSW and JSWtoJSW128

 

john_elliott_uk wrote:

>
>> if (velocity < 0) {
>> top+= (startPos - top) % velocity;
>> bottom-= (bottom - top) % velocity;
>> }
>
> [...]
>
> Wow. Am I allowed to use that code in my own programs?

Yes. I give general permission for people to reuse bits of code from
SPECSAISIE, provided that I am credited accordingly in the
documentation that accompanies others' programs.

The above code is from the MMtoJSW function of SPECSAISIE 1.3, which
I expect to release later this year. It's the bit that tweaks the
top and bottom boundaries of vertical guardians when they are
converted from MM to JSW, in order that the actual boundaries in the
JSW game correspond to those in the MM game.

Here's another useful code-fragment that I wrote today. It's part of
the JSWtoJSW128Title function, which converts a 6912-byte screenshot
to a title.js7 file. The following code comes after the standard
copying of pixels and colour-attributes. It generates two more
copies of the colour-attributes, with three specified colours (e.g.
blue, green and cyan) rotated.

for (int n= 0; n < 2; n++) {
int a= 53248 + 512*n;
for (int i= 0; i < 512; i++) {
int c= _memory.peekU(a+i);
for (int X= 0; X < 3; X++) { // rotate INK-colours
if ((c & 7) == colour[X]) {
c= (c & 248) + colour[(X+1)%3];
break;
}
}
for (int X= 0; X < 3; X++) { // rotate PAPER-colours
if ((c & 56) == 8*colour[X]) {
c= (c & 199) + 8*colour[(X+1)%3];
break;
}
}
_memory.poke(a+512+i, (byte)c);
}
}

I've also written a function JSWtoJSW128Rooms, which creates a
rooms.jsX file from a 48K JSW game, setting Offsets 223, 224
(guardian-class table), 233-236 (room-connections) and 237 (player's
sprite-page). This can even take as input a text-file specifying the
mapping of sprite-pages from JSW to JSW128 - here's the one for
Part 1 -> PW128:
>>>
151 -> 201
155 -> 202
156 -> 203
158 -> 204
166 -> 202
167 -> 205
168 -> 206
169 -> 189
170 -> 207
171 -> 151
172 -> 169
173 -> 208
174 -> 209
175 -> 210
176 -> 211
177 -> 167
179 -> 212
183 -> 213
185 -> 214
187 -> 215
189 -> 216
190 -> 217
<<<
(since SP 202 is mapped-to from both 155 and 166, I'll have to tweak
the sprite-page - and the start-sprites of the relevant guardian-
instances - by hand).

And I've written JSWtoJSW128Rtime, which modifies the rtime.js2 file
to incorporate selected aspects of a 48K JSW game, namely sprites
(according to a sprite-page mapping file as above), the guardian-
class table, the item-table (which can either overwrite, or be
inserted into, the existing JSW128 item-table), start-room, start-
position and start-time.

I now plan to implement a patch to allow both Rooms 33 and 97 to be
Bathrooms, and both Rooms 35 and 99 to be Master Bedrooms. If I
succeed, the Part 1 end-game sequence will be initiated on
collecting 128 items, and the Part 1 toilet will teleport you to
Part 2 - setting (STATUS) to 0, and (34253) to 255 to take full
advantage of that fossil from Manic Miner! :-)

I then need to tie up various loose ends, fix the sprites for
remaining lives, and decide what to do about the music (either code
up Beethoven's Ninth or write a conversion-function to generate 128K
versions of "Where Bluebirds Fly" and "A Wolf At The Door").

--
Dr. Andrew Broad
http://www.geocities.com/andrewbroad/
http://www.geocities.com/andrewbroad/spectrum/
http://www.geocities.com/andrewbroad/spectrum/willy/
http://www.geocities.com/andrewbroad/spectrum/download/
http://www.geocities.com/andrewbroad/spectrum/download/specsaisie.htm
l

 

 

arrowleft
arrowright