Enhance! / FAQ: Why is my HUD not hidden?

A question that pops up a lot on the forums, is the Hide Hud flag not working, especially when using a scroll-based module like the Simple Platformer, Megametrovania, Brawler and Horizontal Shooter modules. What’s the deal with this?

This is a post in both the Enhance! and FAQ categories, as it’s a question that’s asked a lot, but also is a good fix to enhance the NESmaker core.

The cause

The Hide Hud flag in NESmaker should hide the hud on screen. This flag will work for background tile based huds, used in the Maze, Adventure and Arcade modules. On scrolling modules, NESmaker uses a different type of hud by default, using sprites that are drawn on screen instead of in the background. The Hide Hud flag is only implemented for the background hud. Luckily, it’s not too difficult to implement the Hide Hud flag, by adding a few lines of code to the sprite hud drawing routine.

The fix

Open up your NESmaker project. Go to the Project Settings, then the Script Settings, and find the script that’s attached to “Handle drawing sprite HUD”. Open the attached script to modify. As always, just to be sure, create a backup of the file you’re editing.

At the beginning of the file, add the following lines of code:

  LDA ScreenFlags00   ;; Load the screen flags into the accumulator
  AND #%01000000      ;; The Hide Hud flag is in bit 6
  BEQ +               ;; If it is zero, draw the hud
    JMP +dontDrawHud  ;; if it is one, skip drawing the hud
  +                   ;; Continue drawing the hud as usual

Then, at the end of the file, add this line:

+dontDrawHud:         ;; This is where the script will jump if the hud should not be drawn

And that’s it! Save the script, compile the project and your hud will be hidden on screens where you don’t want to show it.