Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; ===============================================================
- ; MENU SYSTEM for SonicVaan
- ; Developed and Desgined (c) 2012 Vladikcomper
- ; ===============================================================
- ; ---------------------------------------------------------------
- ; This file contains menu prefences, textes and action scripts to
- ; be parsed by the menu core.
- ; ---------------------------------------------------------------
- ; ---------------------------------------------------------------
- ; NOTE: Data Block should be placed in following order:
- ; <InitScript>
- ; <EntryList>
- ; <TextPointers>
- ; ---------------------------------------------------------------
- ; ---------------------------------------------------------------
- ; ENTRY LIST METHODS:
- ;
- ; _ME_TextID: ID of Text string listed in <TextPointers>
- ;
- ; _ME_Type: Menu Entry Type
- ; _ME_Normal = Normal selectable entry
- ; _ME_Option = Option entry
- ;
- ; _ME_Action: Entry action when selected (if _ME_Type = _ME_Normal)
- ; _ME_Nothing = No effect
- ; _ME_GoToMenu = Go to menu set by _ME_ActionVal
- ; _ME_GoToGameMode = Go to Game Mode set by _ME_ActionVal
- ; _ME_CallHandler = Call handler routine set by _ME_ActionVal
- ;
- ; _ME_ActionVal: Value for _ME_Action (see above)
- ;
- ; _ME_OpnNum: Number of options, zero-based (if _ME_Type = _ME_Option)
- ;
- ; _ME_OpnAddr: Memory address that represents option field
- ;
- ; _ME_OpnTextID: Start ID of text string for option variants
- ;
- ; _ME_OpnTextPos: Text position of option text (in tiles)
- ;
- ; ---------------------------------------------------------------
- ; ---------------------------------------------------------------
- ; Prefences
- ; ---------------------------------------------------------------
- _Menu_BGM equ $91
- _Menu_Snd_Select equ $A1
- _Menu_Snd_Switch equ $CD
- ; ---------------------------------------------------------------
- ; Menu Scripts constants
- ; ---------------------------------------------------------------
- ; Entry Types
- _ME_Normal = 0
- _ME_Option = 1
- ; Entry Actions
- _ME_Nothing = 0
- _ME_GoToMenu = 1
- _ME_GoToGameMode = 2
- _ME_CallHandler = -1 ; Custom handler
- ; ---------------------------------------------------------------
- ; Main Macros
- ; ---------------------------------------------------------------
- ; Reset methods
- _ME_TextID = 0
- _ME_Type = 0
- _ME_Action = 0
- _ME_ActionVal = 0
- _ME_OpnNum = 0
- _ME_OpnAddr = 0
- _ME_OpnTextID = 0
- _ME_OpnTextPos = 0
- _Menu_CreateEntry macro
- dc.w _ME_TextID
- dc.b _ME_Type
- if _ME_Type=_ME_Normal
- dc.b _ME_Action
- if _ME_Action=_ME_Nothing
- dc.l 0
- elseif _ME_Action=_ME_GoToMenu
- dc.b _ME_ActionVal
- dc.b 0,0,0
- elseif _ME_Action=_ME_GoToGameMode
- dc.b _ME_ActionVal
- dc.b 0,0,0
- else
- dc.l _ME_ActionVal
- endc
- else
- dc.b _ME_OpnNum
- dc.w _ME_OpnAddr&$FFFF
- dc.b _ME_OpnTextID
- dc.b _ME_OpnTextPos
- endc
- endm
- ; ===============================================================
- ; ---------------------------------------------------------------
- ; Main Pointers array
- ; ---------------------------------------------------------------
- Menu_DataPointers:
- @Lst
- ; $00 - Main Menu
- dc.w MainMenu_InitScript-@Lst
- dc.w MainMenu_EntryList-@Lst
- dc.w MainMenu_TextPointers-@Lst
- ; $01 - Options
- dc.w Options_InitScript-@Lst
- dc.w Options_EntryList-@Lst
- dc.w Options_TextPointers-@Lst
- ; $02 - Extras
- dc.w Extras_InitScript-@Lst
- dc.w Extras_EntryList-@Lst
- dc.w Extras_TextPointers-@Lst
- ; ===============================================================
- ; ===============================================================
- ; ---------------------------------------------------------------
- ; Main menu
- ; ---------------------------------------------------------------
- MainMenu_InitScript:
- ; Art Load Cues
- dc.w 0 ; Number of cues ($0 = None)
- ; External Objects
- dc.w 1 ; Number of objects ($0 = None)
- dc.l Obj_Emerald
- ; Palettes
- dc.w $A42,$C44,$C64 ; BG Palette
- dc.w $000,$EEE ; Normal Menu Entry
- dc.w $000,$6E6 ; Active Menu Entry
- hex 0000006000A000C600EA ; Emerald palette
- ; Menu prefences
- dc.b 0 ; Scroll Direction
- dc.b 3 ; Number of entries (zero-based)
- dc.b 12, 8 ; XY position of top left corner (in tiles)
- ; ---------------------------------------------------------------
- MainMenu_EntryList:
- ; START GAME
- _ME_TextID: = 0
- _ME_Type: = _ME_Normal
- _ME_Action: = _ME_GoToGameMode
- _ME_ActionVal: = $0C
- _Menu_CreateEntry
- ; EXTRAS
- _ME_TextID: = 1
- _ME_Type: = _ME_Normal
- _ME_Action: = _ME_GoToMenu
- _ME_ActionVal: = $02
- _Menu_CreateEntry
- ; OPTIONS
- _ME_TextID: = 2
- _ME_Type: = _ME_Normal
- _ME_Action: = _ME_GoToMenu
- _ME_ActionVal: = $01
- _Menu_CreateEntry
- ; BETA INFO
- _ME_TextID: = 3
- _ME_Type: = _ME_Normal
- _ME_Action: = _ME_GoToGameMode
- _ME_ActionVal: = $28
- _Menu_CreateEntry
- ; ---------------------------------------------------------------
- MainMenu_TextPointers:
- @Lst dc.w @0-@Lst
- dc.w @1-@Lst
- dc.w @2-@Lst
- dc.w @3-@Lst
- @0 dc.b 'START GAME',0
- @1 dc.b 'EXTRAS',0
- @2 dc.b 'OPTIONS',0
- @3 dc.b 'BETA INFO',0
- even
- ; ===============================================================
- ; ===============================================================
- ; Options
- ; ===============================================================
- Options_InitScript:
- ; Art Load Cues
- dc.w 1 ; Number of cues ($0 = None)
- dc.l Art_MenuHeaders
- dc.w _VRAM_CArt
- ; External Objects
- dc.w 2 ; Number of objects ($0 = None)
- dc.l Obj_Header
- dc.l Obj_Emerald
- ; Palettes
- dc.w $44A,$44C,$46C ; BG Palette
- dc.w $000,$EEE ; Normal Menu Entry
- dc.w $000,$0EE ; Active Menu Entry
- hex 00000024006800AC02EE
- ; Menu prefences
- dc.b 1 ; Scroll Direction
- dc.b 3 ; Number of entries (zero-based)
- dc.b 8, 10 ; XY position of top left corner (in tiles)
- ; ---------------------------------------------------------------
- Options_EntryList:
- ; DIFFICULTY
- _ME_TextID: = 0
- _ME_Type: = _ME_Option
- _ME_OpnNum: = 2
- _ME_OpnAddr: = $FFFFFF3E
- _ME_OpnTextID: = 3
- _ME_OpnTextPos: = 18
- _Menu_CreateEntry
- ; SECRET OPTION
- _ME_TextID: = 1
- _ME_Type: = _ME_Option
- _ME_OpnNum: = 1
- _ME_OpnAddr: = $FFFFFF3F
- _ME_OpnTextID: = 6
- _ME_OpnTextPos: = 21
- _Menu_CreateEntry
- ; CLEAR SAVE DATA
- _ME_TextID: = 2
- _ME_Type: = _ME_Normal
- _ME_Action: = _ME_CallHandler
- _ME_ActionVal: = Hndl_ClearSave
- _Menu_CreateEntry
- ; BACK TO MAIN MENU
- _ME_TextID: = 8
- _ME_Type: = _ME_Normal
- _ME_Action: = _ME_GoToMenu
- _ME_ActionVal: = $00
- _Menu_CreateEntry
- ; ---------------------------------------------------------------
- Options_TextPointers:
- @Lst dc.w @0-@Lst
- dc.w @1-@Lst
- dc.w @2-@Lst
- dc.w @3-@Lst
- dc.w @4-@Lst
- dc.w @5-@Lst
- dc.w @6-@Lst
- dc.w @7-@Lst
- dc.w @8-@Lst
- @0 dc.b 'DIFFICULTY',0
- @1 dc.b 'SECRET OPTION',0
- @2 dc.b 'CLEAR SAVE DATA',0
- @3 dc.b ' EASY',0
- @4 dc.b 'NORMAL',0
- @5 dc.b ' HARD',0
- @6 dc.b 'OFF',0
- @7 dc.b ' ON',0
- @8 dc.b 'BACK TO MAIN MENU',0
- even
- ; ===============================================================
- ; ===============================================================
- ; ---------------------------------------------------------------
- ; Extras
- ; ---------------------------------------------------------------
- Extras_InitScript:
- ; Art Load Cues
- dc.w 1 ; Number of cues ($0 = None)
- dc.l Art_MenuHeaders
- dc.w _VRAM_CArt
- ; External Objects
- dc.w 1 ; Number of objects ($0 = None)
- dc.l Obj_Header
- ; Palettes
- dc.w $444,$666,$888 ; BG Palette
- dc.w $000,$EEE ; Normal Menu Entry
- dc.w $000,$0EE ; Active Menu Entry
- dc.w $00E,$00E,$00E,$00E,$00E ; Emerald palette ###
- ; Menu prefences
- dc.b 1 ; Scroll Direction
- dc.b 0 ; Number of entries (zero-based)
- dc.b 11, 22 ; XY position of top left corner (in tiles)
- ; ---------------------------------------------------------------
- Extras_EntryList:
- ; BACK TO MAIN MENU
- _ME_TextID: = 0
- _ME_Type: = _ME_Normal
- _ME_Action: = _ME_GoToMenu
- _ME_ActionVal: = $00
- _Menu_CreateEntry
- ; ---------------------------------------------------------------
- Extras_TextPointers:
- @Lst dc.w @0-@Lst
- @0 dc.b 'BACK TO MAIN MENU',0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement