4.5.9 Start Screen Selection Menu

Bucket Mouse

Active member
For some reason there isn't a tutorial on how to make a selection menu on the Start Screen for the latest version of NESMaker. Why, I have no idea.
Guess it's up to me again.

This is a script you can load into Input Scripts and assign to your Select button, but it isn't just drag-and-drop -- it will require some customization. The first thing you need to do is make an 8x8 cursor icon and assign it to one of your unused Game Objects. I have it taking up space #10. Next, place it on your Start screen as Monster #1, ONE SPACE BELOW where you want it to first appear (if you've been using NESMaker for a while I shouldn't have to explain why).

In order to customize the script below you'll need to know the exact X and Y numbers on the screen where that cursor is. You don't know, I don't know, no one knows. The coordinate numbers in the left corner can't help you here. You'll just have to experiment by entering random hex numbers until you narrow it down. There is no shame in this -- it's how I had to do it.

Here's a hint: the Y coodinate is more than likely a fixed hex number, meaning it ends with zero or eight. Mine was A0; yours may not be far off.

Test out your X and Y guesses by creating an asm file that is just the one line below, and assigning it to Select on the Start Screen:

CreateObject #$??, #$??, #10, #$00

The third number is the ID of your Game Object (ten, like I said). You don't need to worry about or do anything to the fourth number. Put hex values in the question marks.

Once you know what they are, finding the coordinates for your other menu items will be a breeze. The first number will always be the same and the second will always be eight hex digits below the previous one. So if Y was A0, then the next item will have a Y of A8, and the one after that will be B0.

The last step before tackling this script is to add a User Variable to Script Settings called "startMenu."

Note that I've arranged this in an unusual order: second, third, and then first, but before that is a one-time use section that only activates upon the VERY first time you hit Select. This is to erase the Game Object you placed on the screen. And since you hit the button, it'll go to the next menu item, which means this special section should be directed to screen #2.

Oh yeah, the screen numbers. That's another thing you need to fill in. Fortunately there's no guess work here. Bring up your overworld and hover your mouse over the screens you want each menu option to take you to. They're on a hex grid of 0 through 9 and then A through F, so a screen on the tail end of the second row would be 1F.

Now paste this in place of your one-line script and start filling in the question marks. It's written for three menu items, but easily customizable for two or four.

Code:
LDX #1
LDA startMenu
CMP #$01
BEQ option2
CMP #$02
BEQ option3
CMP #$03
BEQ option4
CMP #$00
BNE +
JMP option1
+

option1: ;; used only once to erase the cursor placed onscreen
        ;; heads to second option

DestroyObject
        CreateObject #$??, #$??, #10, #$00
        INC startMenu
        INC startMenu
        LDA #$??
        STA warpToScreen
        RTS

option2: ;; second menu option

DestroyObject
        CreateObject #$??, #$??, #10, #$00
        INC startMenu
        LDA #$??
        STA warpToScreen
        RTS
      
option3: ;; third menu option

DestroyObject
        CreateObject #$??, #$??, #10, #$00
        INC startMenu
        LDA #$??
        STA warpToScreen
        RTS
      
      
option4: ;; first menu option

DestroyObject
        CreateObject #$??, #$??, #10, #$00
        DEC startMenu
        DEC startMenu
        LDA #$??
        STA warpToScreen
        RTS

The Start screen as-is will work with this Select script perfectly...with ONE exception. We have to add just two lines into startGameWithNewContinuePoints, right above LDA gameHandler:

Code:
    LDX #1
    DestroyObject

Why do we have to do this? Because for reasons that are beyond me, the cursor will be stuck onscreen for your entire game unless we specifically tell the script to get rid of it.

That's how to make a Start Screen menu in 4.5.9. Have fun out there.
 

crazygrouptrio

Active member
Just for the sake of having options, it's worth noting that Dale Coop's selection menu tutorial for 4.15 works fine in 4.5 - you only have to change the part in the beginning that checks for a special screen and replace it with another contingency (gameState, screenType, etc).
A Selection Menu on the Start Screen [4.1.X Basic module]
Each method has its own advantages and disadvantages (this method is object based while Dale's is sprite based for example). But having options is always nice.
 
Last edited:

vanderblade

Active member
Just for the sake of having options, it's worth noting that Dale Coop's selection menu tutorial for 4.15 works fine in 4.5 - you only have to change the part in the beginning that checks for a special screen and replace it with another contingency (gameState, screenType, etc).
A Selection Menu on the Start Screen [4.1.X Basic module]
Each method has its own advantages and disadvantages (this method is object based while Dale's is sprite based for example). But having options is always nice.
Do you mind elaborating on this specific changes that have to be made in order to get Dale's method to work in 4.5?
 

Jonny

Well-known member
I like this method because pretty much everything is done within the input script. I haven't tried it yet but the only difference I can see is that Dale's uses UP and DOWN press instead of SELECT for the input script but that check could be added to @Bucket Mouse code too and then just assign to both UP and DOWN in the input editor.

@vanderblade I'll do a post this week in 'scripts' of 4.5.9 update of Dales scripts. If you just want a cursor (object) rather than using the spritePreDraw loop, I'd be tempted to modify the above to be honest. Depends what you want to do visually.
 

crazygrouptrio

Active member
Do you mind elaborating on this specific changes that have to be made in order to get Dale's method to work in 4.5?
I'm pretty sure all of the code in Dale's works as is, but just those few lines in the beginning of PreDraw before ";; is START screen" need to be removed because 4.5 doesn't use Special screens. Then just use your own contingency on what screens have a menu. Whether its a gameState check or screenType. For example:
Code:
LDA gameState
CMP #$04
BEQ +
RTS
+
Would only draw the menu stuff on gameState 4.
 

Jonny

Well-known member
I'm pretty sure all of the code in Dale's works as is, but just those few lines in the beginning of PreDraw before ";; is START screen" need to be removed because 4.5 doesn't use Special screens. Then just use your own contingency on what screens have a menu. Whether its a gameState check or screenType. For example:
Code:
LDA gameState
CMP #$04
BEQ +
RTS
+
Would only draw the menu stuff on gameState 4.

I've posted it updated anyway for vanderblade. Although, I didn't use RTS for the gameState check. I saw this afterwards, probably a better way this, depending if there's other stuff being done in spritePreDraw and (for whatever reason) didn't want to return from subroutine at that point.
Pretty sure there's only one other change at the end. All the other scripts and the tutorial work in 4.5.9
 

chains

Member
Guys,

Sorry to unearth an ancient topic, but I believe I made a subtly change in this script (as well as @dale_coop 's) that might help others.

1) Add the startMenu variable to the Users Variable
2) Create this script and name it as `moveCursorTitleScreen.asm`

Code:
;; this script moves the cursor in the title screen
;; it's based on Bucket Mouse and Dale Cooper script: https://www.nesmakers.com/index.php?threads/4-5-9-start-screen-selection-menu.6996
;; it's assumed that a user variable startMenu is defined in project settings


LDA gamepad
AND #%00110000 ;; either up or down has been pressed
BNE continueCheckingSelection
JMP endCheckingSelection

continueCheckingSelection
    LDA gamepad
    AND #%00010000
    BNE selectionUp
    LDA gamepad
    AND #%00100000
    BNE selectionDown
    JMP endCheckingSelection

selectionUp:
    LDA startMenu
    BNE +
        JMP endCheckingSelection ;; #$00 is the default value, and we pressed up, nothing changes
    +
    DEC startMenu ;; subtract our control var
    LDX #$01 ;; loads the first object in the screen in register X (#0 is the char)
    ;; gets the curr object x, y
    LDA Object_x_hi,x
    STA tempA
   
    LDA Object_y_hi,x
    SEC
    SBC #$10 ;; this is the difference between the items height in the menu
    STA tempB
    DestroyObject ;; destroy the current
    CreateObject tempA, tempB, #$10, #$00 ;; create the new object above
    ;; since we have only two items in the menu, we can take this simple approach
    ;; for more complex scenarios, we can have another script to map the startMenu to the target screen
    LDA #$01 ;; first screen of the game
    STA warpToScreen

    ;; return
    JMP endCheckingSelection

   
selectionDown:
    LDA startMenu
    CMP #$01 ;; could be the max number of items you have in the menu
    BNE +
        JMP endCheckingSelection ;; only two items in the menu, nothing changes, good bye
    +
    INC startMenu
    LDX #$01 ;; loads the second object in the screen in register X (#$00 is the char)
    ;; gets the curr object x, y
    LDA Object_x_hi,x
    STA tempA
   
    LDA Object_y_hi,x
    CLC
    ADC #$10
    STA tempB
    DestroyObject ;; destroy the current
    CreateObject tempA, tempB, #$10, #$00 ;; #$10 is my arrow, create the object bellow the previous location
    LDA #$02 ;; credits screen
    STA warpToScreen

endCheckingSelection: ;; nothing to check, bye

RTS

The comments are self-explanatory.

3) Map this script to up and down in 'Start Screen'
4) Map the script `startGameWithNewContinuePoints.asm` to the start button in 'Start Screen'.

And you're done.

To find the screen you want to warp to, use these coordinates:

X = 0 and Y = 1, then you have #$10 (Y comes first)

I hope this helps someone.
 

Attachments

  • titlescreen-select.gif
    titlescreen-select.gif
    15.1 KB · Views: 65

TheRetroBro

Active member
For some reason there isn't a tutorial on how to make a selection menu on the Start Screen for the latest version of NESMaker. Why, I have no idea.
Guess it's up to me again.

This is a script you can load into Input Scripts and assign to your Select button, but it isn't just drag-and-drop -- it will require some customization. The first thing you need to do is make an 8x8 cursor icon and assign it to one of your unused Game Objects. I have it taking up space #10. Next, place it on your Start screen as Monster #1, ONE SPACE BELOW where you want it to first appear (if you've been using NESMaker for a while I shouldn't have to explain why).

In order to customize the script below you'll need to know the exact X and Y numbers on the screen where that cursor is. You don't know, I don't know, no one knows. The coordinate numbers in the left corner can't help you here. You'll just have to experiment by entering random hex numbers until you narrow it down. There is no shame in this -- it's how I had to do it.

Here's a hint: the Y coodinate is more than likely a fixed hex number, meaning it ends with zero or eight. Mine was A0; yours may not be far off.

Test out your X and Y guesses by creating an asm file that is just the one line below, and assigning it to Select on the Start Screen:

CreateObject #$??, #$??, #10, #$00

The third number is the ID of your Game Object (ten, like I said). You don't need to worry about or do anything to the fourth number. Put hex values in the question marks.

Once you know what they are, finding the coordinates for your other menu items will be a breeze. The first number will always be the same and the second will always be eight hex digits below the previous one. So if Y was A0, then the next item will have a Y of A8, and the one after that will be B0.

The last step before tackling this script is to add a User Variable to Script Settings called "startMenu."

Note that I've arranged this in an unusual order: second, third, and then first, but before that is a one-time use section that only activates upon the VERY first time you hit Select. This is to erase the Game Object you placed on the screen. And since you hit the button, it'll go to the next menu item, which means this special section should be directed to screen #2.

Oh yeah, the screen numbers. That's another thing you need to fill in. Fortunately there's no guess work here. Bring up your overworld and hover your mouse over the screens you want each menu option to take you to. They're on a hex grid of 0 through 9 and then A through F, so a screen on the tail end of the second row would be 1F.

Now paste this in place of your one-line script and start filling in the question marks. It's written for three menu items, but easily customizable for two or four.

Code:
LDX #1
LDA startMenu
CMP #$01
BEQ option2
CMP #$02
BEQ option3
CMP #$03
BEQ option4
CMP #$00
BNE +
JMP option1
+

option1: ;; used only once to erase the cursor placed onscreen
        ;; heads to second option

DestroyObject
        CreateObject #$??, #$??, #10, #$00
        INC startMenu
        INC startMenu
        LDA #$??
        STA warpToScreen
        RTS

option2: ;; second menu option

DestroyObject
        CreateObject #$??, #$??, #10, #$00
        INC startMenu
        LDA #$??
        STA warpToScreen
        RTS
     
option3: ;; third menu option

DestroyObject
        CreateObject #$??, #$??, #10, #$00
        INC startMenu
        LDA #$??
        STA warpToScreen
        RTS
     
     
option4: ;; first menu option

DestroyObject
        CreateObject #$??, #$??, #10, #$00
        DEC startMenu
        DEC startMenu
        LDA #$??
        STA warpToScreen
        RTS

The Start screen as-is will work with this Select script perfectly...with ONE exception. We have to add just two lines into startGameWithNewContinuePoints, right above LDA gameHandler:

Code:
    LDX #1
    DestroyObject

Why do we have to do this? Because for reasons that are beyond me, the cursor will be stuck onscreen for your entire game unless we specifically tell the script to get rid of it.

That's how to make a Start Screen menu in 4.5.9. Have fun out there.
Does this identify the screen I wan to warp to? Fo example I see STA warpToScreen. Do i need to use a warp macro here?
 

Luxnolucas

New member
For some reason there isn't a tutorial on how to make a selection menu on the Start Screen for the latest version of NESMaker. Why, I have no idea.
Guess it's up to me again.

This is a script you can load into Input Scripts and assign to your Select button, but it isn't just drag-and-drop -- it will require some customization. The first thing you need to do is make an 8x8 cursor icon and assign it to one of your unused Game Objects. I have it taking up space #10. Next, place it on your Start screen as Monster #1, ONE SPACE BELOW where you want it to first appear (if you've been using NESMaker for a while I shouldn't have to explain why).

In order to customize the script below you'll need to know the exact X and Y numbers on the screen where that cursor is. You don't know, I don't know, no one knows. The coordinate numbers in the left corner can't help you here. You'll just have to experiment by entering random hex numbers until you narrow it down. There is no shame in this -- it's how I had to do it.

Here's a hint: the Y coodinate is more than likely a fixed hex number, meaning it ends with zero or eight. Mine was A0; yours may not be far off.

Test out your X and Y guesses by creating an asm file that is just the one line below, and assigning it to Select on the Start Screen:

CreateObject #$??, #$??, #10, #$00

The third number is the ID of your Game Object (ten, like I said). You don't need to worry about or do anything to the fourth number. Put hex values in the question marks.

Once you know what they are, finding the coordinates for your other menu items will be a breeze. The first number will always be the same and the second will always be eight hex digits below the previous one. So if Y was A0, then the next item will have a Y of A8, and the one after that will be B0.

The last step before tackling this script is to add a User Variable to Script Settings called "startMenu."

Note that I've arranged this in an unusual order: second, third, and then first, but before that is a one-time use section that only activates upon the VERY first time you hit Select. This is to erase the Game Object you placed on the screen. And since you hit the button, it'll go to the next menu item, which means this special section should be directed to screen #2.

Oh yeah, the screen numbers. That's another thing you need to fill in. Fortunately there's no guess work here. Bring up your overworld and hover your mouse over the screens you want each menu option to take you to. They're on a hex grid of 0 through 9 and then A through F, so a screen on the tail end of the second row would be 1F.

Now paste this in place of your one-line script and start filling in the question marks. It's written for three menu items, but easily customizable for two or four.

Code:
LDX #1
LDA startMenu
CMP #$01
BEQ option2
CMP #$02
BEQ option3
CMP #$03
BEQ option4
CMP #$00
BNE +
JMP option1
+

option1: ;; used only once to erase the cursor placed onscreen
        ;; heads to second option

DestroyObject
        CreateObject #$??, #$??, #10, #$00
        INC startMenu
        INC startMenu
        LDA #$??
        STA warpToScreen
        RTS

option2: ;; second menu option

DestroyObject
        CreateObject #$??, #$??, #10, #$00
        INC startMenu
        LDA #$??
        STA warpToScreen
        RTS
     
option3: ;; third menu option

DestroyObject
        CreateObject #$??, #$??, #10, #$00
        INC startMenu
        LDA #$??
        STA warpToScreen
        RTS
     
     
option4: ;; first menu option

DestroyObject
        CreateObject #$??, #$??, #10, #$00
        DEC startMenu
        DEC startMenu
        LDA #$??
        STA warpToScreen
        RTS

The Start screen as-is will work with this Select script perfectly...with ONE exception. We have to add just two lines into startGameWithNewContinuePoints, right above LDA gameHandler:

Code:
    LDX #1
    DestroyObject

Why do we have to do this? Because for reasons that are beyond me, the cursor will be stuck onscreen for your entire game unless we specifically tell the script to get rid of it.

That's how to make a Start Screen menu in 4.5.9. Have fun out there.
thanks for this i have a little issue, when i try your tutorial like this i have "out of branch" caused by BEQ option4 in
LDX #1
LDA startMenu
CMP #$01
BEQ option2
CMP #$02
BEQ option3
CMP #$03
BEQ option4
CMP #$00
BNE +
JMP option1
+
if i comment the option4 the game works fine and i can choose two otpion, but i need four... i don't know what i'm doing wrong... If someone would have the time and motivation to help me, thank you.
 

Luxnolucas

New member
Yes, I added it to another code, but even when I try to add it alone, I get the same error for the same line. Do you want me to share my code?
 

Luxnolucas

New member
Thanks no more branch out of. And how do I get four options? I've tried a few things but I'm probably too much of a beginner in coding to achieve it. I can only get 3 options (not counting the one that disappears on the first press).
 

Luxnolucas

New member
I found it!! I'm sharing my code in case it might help someone.
Code:
LDX #1              

LDA startMenu       
CMP #$01             ; Compare the value with 1
BEQ option1          ; If they are equal, jump to label option1
CMP #$02             ; Compare the value with 2
BEQ option2          ; If they are equal, jump to label option2
CMP #$03             ; Compare the value with 3
BEQ option3          ; If they are equal, jump to label option3
JMP option4          ; Otherwise, jump to label option4

option1:             ; Second option in screen
DestroyObject       
CreateObject #$64, #$C0, #10, #$00
INC startMenu        ; Increment the value of startMenu
LDA #$E2             ; E=y 2=x
STA warpToScreen   
RTS                 

option2:             ; Third option in screen
DestroyObject       
CreateObject #$64, #$C0, #11, #$00
INC startMenu        ; Increment the value of startMenu
LDA #$E4             ; E=y 4=x
STA warpToScreen   
RTS                 

option3:             ; Fourth option in screen
DestroyObject       
CreateObject #$63, #$C0, #12, #$00
DEC startMenu        ; Decrement the value of startMenu
DEC startMenu        ; Decrement the value of startMenu
DEC startMenu        ; Decrement the value of startMenu
LDA #$0C             ; 0=y C=x
STA warpToScreen   
RTS                 

option4:             ; First option in screen
DestroyObject       
CreateObject #$64, #$C0, #09, #$00
INC startMenu        ; Increment the value of startMenu
LDA #$E0             ; E=y 0=x
STA warpToScreen   
RTS

Note that you will need to fill in your own data in CreateObject and for the warptoscreen as explained earlier in the tutorial. Thanks again for the tutorial, by the way!
 
Last edited:

NightMusic

Member
I found it!! I'm sharing my code in case it might help someone.
Code:
HTML clipboard LDX #1              

LDA startMenu       
CMP #$01             ; Compare the value with 1
BEQ option1          ; If they are equal, jump to label option1
CMP #$02             ; Compare the value with 2
BEQ option2          ; If they are equal, jump to label option2
CMP #$03             ; Compare the value with 3
BEQ option3          ; If they are equal, jump to label option3
JMP option4          ; Otherwise, jump to label option4

option1:             ; Second option in screen
DestroyObject       
CreateObject #$64, #$C0, #10, #$00
INC startMenu        ; Increment the value of startMenu
LDA #$E2             ; E=y 2=x
STA warpToScreen   
RTS                 

option2:             ; Third option in screen
DestroyObject       
CreateObject #$64, #$C0, #11, #$00
INC startMenu        ; Increment the value of startMenu
LDA #$E4             ; E=y 4=x
STA warpToScreen   
RTS                 

option3:             ; Fourth option in screen
DestroyObject       
CreateObject #$63, #$C0, #12, #$00
DEC startMenu        ; Decrement the value of startMenu
DEC startMenu        ; Decrement the value of startMenu
DEC startMenu        ; Decrement the value of startMenu
LDA #$0C             ; 0=y C=x
STA warpToScreen   
RTS                 

option4:             ; First option in screen
DestroyObject       
CreateObject #$64, #$C0, #09, #$00
INC startMenu        ; Increment the value of startMenu
LDA #$E0             ; E=y 0=x
STA warpToScreen   
RTS

Note that you will need to fill in your own data in CreateObject and for the warptoscreen as explained earlier in the tutorial. Thanks again for the tutorial, by the way!
I like the comments in the code. I forget to write comments sometimes, and these are helpful to others thank you
 
Top Bottom