Ending: Rocket Coordinates?

Request patches for Keens 1-3.
Post Reply
User avatar
CommanderSpleen
Posts: 1017
Joined: Sun Aug 31, 2003 12:11 pm
Location: The Land of Sparkly Things
Contact:

Ending: Rocket Coordinates?

Post by CommanderSpleen »

Are there patches to change the coordinates the BWB heads to, as well as its speed, for each phase of the space flight scenes?
lemm
Posts: 554
Joined: Sun Jul 05, 2009 12:32 pm

Post by lemm »

There's three arrays that control the rocket flight:

1: 1597E to 159B9
2: 159BA to 15A65
3: 15A66 to 15B05

I believe they are pairs of deltaX/deltaY values that are applied to the ship's coords each frame or something, but I'm not sure how it works. I think deltaX and deltaY are two bytes a piece as well. All of the numbers are in between -3 and 3... maybe make a few really large and see what happens.
levellass
Posts: 3001
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Post by levellass »

Interesting. I know LL had some patches to make various stretches of the rocket flight shorter and longer, as if it were a constant velocity applied for x frames..
User avatar
CommanderSpleen
Posts: 1017
Joined: Sun Aug 31, 2003 12:11 pm
Location: The Land of Sparkly Things
Contact:

Post by CommanderSpleen »

Basically what I intend to do is scroll down at a relatively slow speed for something like 100 tiles. Animating from left to right each frame would be a pretty cool guy too.

This works for the speed, but it only scrolls down for about one screen height. (lemm dug this stuff out the other day.)

Code: Select all

%patch $834E $0W   #X scroll lolololol
%patch $8354 $00   #X scroll hi
%patch $8359 $100W #Y scroll lo
%patch $835F $00   #X scroll hi
%patch $8363 $0W   #X ship lo
%patch $8368 $00   #X ship hi
%patch $836c $100W #Y ship lo
%patch $8371 $00   #X ship hi
I imagine there's probably a for loop surrounding that area.

Edit:
Here's the loop condition:

Code: Select all

#Number of loops flight to earth pan lasts
%patch $8392 $C8 $00
Edit: Garg, I can see in theory how the loop might be restructured, but I can't figure out how to remove the X pushes to make room. The sprite just jitters all over the place.
User avatar
CommanderSpleen
Posts: 1017
Joined: Sun Aug 31, 2003 12:11 pm
Location: The Land of Sparkly Things
Contact:

Post by CommanderSpleen »

So I have a theory that if I can free up some space in that routine it can be made to animate using an add, cmp and jne around ax. But if I nop out the rocket X deltas, the sprite breaks.

What I did manage is eliminating the scrolling code:

Code: Select all

# Screen doesn't scroll horizontally on flight to earth
%patch $834A $90 $90 $90 $90 $90 $90 
%patch $8350 $90 $90 $90 $90 $90

# Screen doesn't scroll vertically on flight to earth
%patch $8355 $90 $90 $90 $90 $90 $90 
%patch $835B $90 $90 $90 $90 $90
But removing these lines, with the intention of similarly preventing rocket sprite movement along one axis, instead breaks the sprite. It hovers in one spot for a second and then disappears.

Code: Select all

:0001.8360 8146FC0003             add word ptr [bp-04], 0300
:0001.8365 8356FE00               adc word ptr [bp-02], 0000
...
:0001.837F FF76FE                 push word ptr [bp-02]
:0001.8382 FF76FC                 push word ptr [bp-04]
I guess I'm missing an ingredient in dissecting the sprite shifting code, probably off in one of those calls laced throughout the loop.
Post Reply