Hey there
I'm working on a game that incorporates a menu system similar to that in Mother (Earthbound 0). The method I use takes a .bin file with the menu completely mapped out (border and text) and loads everything straight from there. Everytime the loader hits a $00 in the in the bin, it increases the name table register by $0020. This works fine if the menu is only 5 lines (including top and bottom border; 3 lines of text) but if it's any larger, only the first five lines render correctly, with every line after glitching randomly. The data is loaded correctly into the system memory, but something breaks down when it is loaded into the name table.
I'm writing in NBasic. My code looks like this:
The first five bytes in the menu data are as follows: first half of starting name table location, second half of starting name table location, arrow Y location, arrow X location, max arrow Y location. Everything after is the raw menu data.
The standard glitch looks like this:
Help?
Josh
I'm working on a game that incorporates a menu system similar to that in Mother (Earthbound 0). The method I use takes a .bin file with the menu completely mapped out (border and text) and loads everything straight from there. Everytime the loader hits a $00 in the in the bin, it increases the name table register by $0020. This works fine if the menu is only 5 lines (including top and bottom border; 3 lines of text) but if it's any larger, only the first five lines render correctly, with every line after glitching randomly. The data is loaded correctly into the system memory, but something breaks down when it is loaded into the name table.
I'm writing in NBasic. My code looks like this:
Code:
draw_test_menu:
set loc [menu_pointers menu_id]
set i loc
set location_1 [menu_data i]
inc i
set location_2 [menu_data i]
set $2006 location_1
set $2006 location_2
inc i
set arrow_y [menu_data i]
set arrow_min [menu_data i]
inc i
set arrow_x [menu_data i]
inc i
set arrow_max [menu_data i]
inc i
load_menu_1:
set $2007 [menu_data i]
inc i
set j [menu_data i]
if j = 0 then
set location_2 + location_2 $20
set $2006 location_1
set $2006 location_2
inc i
endif
if j <> 1 goto load_menu_1
return
set loc [menu_pointers menu_id]
set i loc
set location_1 [menu_data i]
inc i
set location_2 [menu_data i]
set $2006 location_1
set $2006 location_2
inc i
set arrow_y [menu_data i]
set arrow_min [menu_data i]
inc i
set arrow_x [menu_data i]
inc i
set arrow_max [menu_data i]
inc i
load_menu_1:
set $2007 [menu_data i]
inc i
set j [menu_data i]
if j = 0 then
set location_2 + location_2 $20
set $2006 location_1
set $2006 location_2
inc i
endif
if j <> 1 goto load_menu_1
return
The first five bytes in the menu data are as follows: first half of starting name table location, second half of starting name table location, arrow Y location, arrow X location, max arrow Y location. Everything after is the raw menu data.
The standard glitch looks like this:
Help?
Josh