News:

Don't forget to visit the main site! There's lots of helpful docs, patches, and more!

Main Menu

Full Scroll question [SM]

Started by Cloud20, December 24, 2013, 08:53:52 AM

Previous topic - Next topic

Cloud20

Hello :D

I'm asking a simple question. It is possible to make appear at screen the two first top lines with the green scroll block ?



I need the camera scrolling to the two block lines shown in green, because the room must be a perfect square.

ALSO MERRY CHRISTMAS :D

Scyzer

The top 2 layers of blocks in any room technically do not exist as far as the scrolling routines are concerned, because it's where the status bar goes.
Camera scrolling is given an X and Y position in pixels, which is unsigned. 0 would be all the way to the left of a room, or all the way to the top. 0 in Y means that the top of the screen is aligned to the top of the 3rd layer of blocks. If it were to show the upper 2 layers above that, then the Y position would need to go to FFFF and down to FFE0, but the routines actually read this and think the camera is 127 screens below samus, so when she comes back down it just goes nuts.
The obvious solution would be to rewrite the scrolling routines so 0 is at the top of the top layer, but that would also involve changing almost every scrolling routine, vram updates, enemy/projectile offscreen detections, door transitions, etc.

The only work around I can think of that would be plausible is to have those rooms that need to be a perfect square as actually 1x2 rooms, with the explorable screen below and a "dummy" screen above. This will allow the camera to scroll above the top 2 layers of the real screen without going negative. Since this would also cause the camera to scroll to the dummy room, you'd put a code into the camera scrolling routine which checks whether it is above a certain threshold in certain rooms (in this case, it would not be allowed to go below $00E0).

The code you'd use for this is:

LoRom
Org $80A954 : JSR $CD90 : BCS $05
Org $80CD90
LDA $0915 : BPL + : CLC : RTS
+ LDA #$00E0 : STA $00
LDA $079D : CMP #$00FF : BEQ + : STZ $00
+ LDA $00 : CMP $0915 : BCC + : STA $0915 : + : SEC : RTS

To use it, just set the room index for any room you want this in to $FF, and add a blank screen of solid blocks above the actual room.

Cloud20

Thanks Magic Scyzer, I keep it in my mind and will try it later :)

JAM

#3
I had the same problem, but I wanted to do another solution.
So, I'll ask our guru, Scyzer.
What should I do to make the new scroll type (03, for example), that will be scrolled only by 2 bottom blocks? Like the opposite of scroll 01.

Or even better. In my hack I already did that dummy as the top screens, but I've used dummy also as the bottom screen. Just to the use all space of explorable screen (to walk on the bottom edge of screen and not to fall down through the floor).

So, I have the another question. What should I do to make the code that stops scrolling works when the value like 0002 is in Scroll field. (I can modify the code itself, to not show the bottom screen). Or the new scroll 03 still should be done then?