Resetting Screen Triggers is resulting in a Value out of range error.

GlassFrog

Member
Hey everyone,

I'm running into a problem where after I finish a level and I try and reset my Screen Triggers, if I try and reset more that 13 I get a Value out of range error on bootup.

It does no matter which triggers are reset or in which order, if any more than 13 are set to reset I get the bootup error.

Has anyone else experienced this or is there another way to reset all Screen Triggers at once other than trying to reset each one manually?
 

kevin81

Active member
A "Value out of range" error indicates that there's too much code in one of your banks.
Are you resetting triggers one by one? If so, you may want to use a loop. So instead of:

Code:
;; Reset trigger 0
;; Reset trigger 1
;; Reset trigger 2
;; Reset trigger 3
;; Reset trigger 4
;; ...

Try something like:

Code:
LDX #$80 ;; number of triggers to be reset
-
  ;; Reset trigger X
  DEX
  BNE -
 

GlassFrog

Member
Hi @kevin81, thanks for the reply.
yeah I was manually resetting each trigger with the bellow code,

LDA #INIT_TRIG_00
STA screenTriggers+0
LDA #INIT_TRIG_01
STA screenTriggers+1

I have never used loops in Nesmaker, I have just had a play around with the above example but cant seem to get anything working.
Could you please show me the code I would need to implement to say reset the first 30 screen triggers, it would be much appreciated.

Cheers,
Simon
 
Last edited:

GlassFrog

Member
After some tinkering around I seem to have got the game to run with no bank over flow error issues.

I had the reset screen trigger code in three different active scripts, so I reduced it down to two and that seems to have stemmed the overload.
 

dale_coop

Moderator
Staff member
Move the code that takes a lot of space... into another bank.
For example all the screen load code:
 
Top Bottom