4.5.6 (Shooter MOD *UPDATE*) CUT Scrolling Speed by HALF!

drexegar

Member
UPDATE - I though the vblankTimer was a normal variable it is not... it waits for game code to finish thus creating bugs with the scrolling. PLEASE switch the vblankTimer to custom variable and that will eliminate the bugs of the camera stopping with SLOWdown and making your player disappear from the screen.


WARNING: The default speed is the slowest at 1 pixel per frame which is still to fast. A problem with this edit is when there is too many objects on the screen the scrolling will stop because of this but will resume as the slow down goes away. So use at your own RISK.

Ok so the scrolling speed in the Shooter module is too fast for me, so I spent all night as the novice coder I am to look through the files and found out how to cut the scrolling speed by half with the VblankTimer for a more closer speed of an average shooter like Gradius.

You need to place a few lines of code in these two files:

NESmaker_4_5_6\GameEngineData\Routines\BASE_4_5\Game\MOD_shooter\Subroutines\doUpdateCamera_shooter2.asm

NESmaker_4_5_6\GameEngineData\Routines\BASE_4_5\Game\MOD_shooter\Subroutines\doHandlePhysics_shooter2.asm


STEP 1: doUpdateCamera_shooter2.asm
We need to check Vblank for every other frame to skip the code:

1.This code goes right above the top of the file to check the Vblank:
Code:
	LDA vBlankTimer			;;Loads the vBlankTimer into the Accumalator
	AND #%00000001			;;Checks to see if the number is ODD
	BNE doUpdateCamera		;; If Not Equal to ODD number Branch to doUpdateCamera: label
	JMP skipCamera			;; skip over all code and jump straight to skipCamera: label

doUpdateCamera:

It should look like this:
CODE1A.jpg

All the way in the bottom right before the "RTS" put the skipCamera Label so it will complete the JMP we did earlier.
Code:
skipCamera:

It should look like this:
CODE1B.jpg

Save your file, you can test the game if you want, the background should move HALF SPEED, but the objects will not and will be pushing forward so lets fix that.



STEP 2: doHandlePhysics_shooter2.asm
we are going to do a similar thing this to cut that in half too.

We need to go the skipPhysics: section on line 411 and under the right ScreenFlagscode check after line 415 you can add these 3 lines:
Code:
	LDA vBlankTimer			;;Loads the vBlankTimer into the Accumalator
		AND #%00000001			;;Checks to see if the number is ODD
		BNE +skipCamMovement		;;If Not Equal to ODD number Branch to +skipCamMovement label

the +skipCamMovement already exist so we are skipping over to that.

So it should look like this:
CODE2.jpg

Save and Test the code and BAM! everything should scroll at half speed with no problems!

Enjoy!
 

drexegar

Member
PasseGaming said:
Cool, I was asking about this yesterday. Though, I find it too slow. Just want to speed it up a tad.

The only way I think of is adding another variable and doing every other every other frame. That will speed up a little bit but may make the scrolling look choppy and weird for the eyes.
 

Icon-Ninja

New member
@drexegar: Could you clarify what you mean about changing the vblankTimer to a custom variable? You've nailed the speed, as far as I'm concerned (way closer to Gradius and Life Force/Salamander like you said), but I'm not entirely sure what you mean in your update at the top. I'd love to get this cleaned up in my game because it already looks better with this slower scrolling speed.
 

drexegar

Member
@drexegar: Could you clarify what you mean about changing the vblankTimer to a custom variable? You've nailed the speed, as far as I'm concerned (way closer to Gradius and Life Force/Salamander like you said), but I'm not entirely sure what you mean in your update at the top. I'd love to get this cleaned up in my game because it already looks better with this slower scrolling speed.
Simple just make a new varible and give it a name like "delay" or "TimerA" and do the same exact thing check for an even or odd number, vblankTimer is connected to sync and will force a wait on something else happening making the screen stop often.
 
Top Bottom