XrossMediaBar (XMB) is what the PSP/PS3 navigates on. Why is this called the XMB you wonder:
So the mission is to recreate the DBP equivalent of the PS3 XMB:
Now I whipped this up the other day to resemble how it works, nothing special, just a rush job:
#constant MAX_XMB_ITEMS 255
#constant XMBAR_ITEM_SPACE 86
#constant XMBAR_OFFSETX 96
#constant XMBAR_OFFSETY 64
#constant XMBAR_Y 64
#constant XMBAR_X 128
#constant XMB_MIN_ITEMSCALE_XY 56
#constant XMB_MAX_ITEMSCALE_XY 56
global XMBar_Item_Pic as integer
global XMB_Item_Pic as integer
global keyPress as boolean
XMBar_Item_Pic = 0
XMB_Item_Pic = 0
type Str_XMB_Item
handle as string
parent as string
caption as string
pic as string
img as integer
spr as integer
excuteType as string
currentChild as integer
childCount as integer
x as integer
y as integer
endtype
type Str_XMB_Slot
handle as string
index as integer
x as integer
y as integer
endtype
dim XMBItem() as Str_XMB_Item
dim XMBarItem() as Str_XMB_Item
dim XMB(MAX_XMB_ITEMS,MAX_XMB_ITEMS) as Str_XMB_Item
dim images(0) as boolean
dim sprites(0) as boolean
init.Display( 0 )
global IconIMG as integer : IconIMG = findFreeImage()
global IconSpr as integer : IconSpr = findFreeSprite()
createXMBelement( "xmb_m_settings" , "xmbar_main" , "Settings" , 0 )
addToXMBelement( "xmb_m_netupdate" , "xmb_m_settings" , "Net Update" , 0 )
addToXMBelement( "xmb_m_vidset" , "xmb_m_settings" , "Video Settings" , 0 )
addToXMBelement( "xmb_m_phoset" , "xmb_m_settings" , "Photo Settings" , 0 )
addToXMBelement( "xmb_m_sysset" , "xmb_m_settings" , "System Settings" , 0 )
addToXMBelement( "xmb_m_thmset" , "xmb_m_settings" , "Theme Settings" , 0 )
addToXMBelement( "xmb_m_timeset" , "xmb_m_settings" , "Date $ Time Settings" , 0 )
addToXMBelement( "xmb_m_sndset" , "xmb_m_settings" , "Sound Settings" , 0 )
addToXMBelement( "xmb_m_timeset" , "xmb_m_settings" , "Date $ Time Settings" , 0 )
createXMBelement( "xmb_m_photo" , "xmbar_main" , "Photo" , 0 )
createXMBelement( "xmb_m_music" , "xmbar_main" , "Music" , 0 )
addToXMBelement( "xmb_m_libaray" , "xmb_m_music" , "Libaray" , 0 )
addToXMBelement( "xmb_m_plylst" , "xmb_m_music" , "Playlist" , 0 )
createXMBelement( "xmb_m_video" , "xmbar_main" , "Video" , 0 )
createXMBelement( "xmb_m_game" , "xmbar_main" , "Game" , 0 )
createXMBelement( "xmb_m_network" , "xmbar_main" , "Network" , 0 )
addToXMBelement( "xmb_m_instr" , "xmb_m_network" , "Instructions" , 0 )
addToXMBelement( "xmb_m_hehe" , "xmb_m_network" , "Hehe" , 0 )
addToXMBelement( "xmb_m_lol" , "xmb_m_network" , "LOL" , 0 )
sync on : sync rate 0
autocam off
do
updateXMB()
if scancode() = 0 then keyPress = 0
sync
loop
function init.Display( vsync )
WindowWidth = 480
WindowHeight = 272
set window on
set display mode WindowWidth , WindowHeight , 32
set window size WindowWidth , WindowHeight
set window layout 0,0,0
load dll "user32.dll",1
SystemWidth = call dll( 1 , "GetSystemMetrics" , 0 )
SystemHeight = call dll( 1 , "GetSystemMetrics" , 1 )
delete dll 1
x = (SystemWidth - WindowWidth) / 2
y = (SystemHeight - WindowHeight) / 2
set window position x , y
endfunction
`return the first free object id
function findFreeSprite()
array insert at bottom sprites()
spr = array count( sprites() )
If ( ( sprite exist( spr ) = 0 ) && ( sprites( spr ) = 0 ) )
sprites() = 1
endif
endfunction spr
`return the first free object id
function findFreeImage()
array insert at bottom images()
img = array count( images() )
If ( ( image exist( img ) = 0 ) && ( images( img ) = 0 ) )
images() = 1
endif
endfunction img
function getXMBarItemIndex( handle$ )
for n = 0 to array count( XMBarItem() )
if XMBarItem( n ).handle = handle$
exitfunction n
endif
next n
endfunction 0
function createXMBelement( handle$ , parent$ , caption$ , pic )
array insert at bottom XMBarItem()
XMBarItem().handle = handle$
XMBarItem().parent = parent$
XMBarItem().caption = caption$
`XMBarItem().pic = pic$
XMBarItem().img = findFreeImage()
XMBarItem().spr = findFreeSprite()
XMBarItem().childCount = -1
XMBarItem().currentChild = 0
ink rgb(255,0,0),0
box 0,0,XMB_MAX_ITEMSCALE_XY,XMB_MAX_ITEMSCALE_XY
ink rgb(255,255,255),0
center text 32,(XMB_MAX_ITEMSCALE_XY/2)-(text size()/2),str$(array count(XMBarItem()))
get image XMBarItem().img,0,0,XMB_MAX_ITEMSCALE_XY,XMB_MAX_ITEMSCALE_XY,1 : cls
sprite XMBarItem().spr,0,0,XMBarItem().img
i = getXMBarItemIndex( handle$ )
XMBarItem(i).x = i * XMBAR_ITEM_SPACE
XMBarItem(i).y = XMBAR_Y
endfunction
function addToXMBelement( handle$ , parent$ , caption$ , pic )
array insert at bottom XMBItem()
XMBItem().handle = handle$
XMBItem().parent = parent$
XMBItem().caption = caption$
`XMBItem().pic = pic
XMBItem().img = findFreeImage()
XMBItem().spr = findFreeSprite()
i = getXMBarItemIndex( parent$ )
inc XMBarItem(i).childCount : c = XMBarItem(i).childCount
XMBItem().x = 0
XMBItem().y = c * XMBAR_OFFSETY
ink rgb(255,0,0),0
box 0,0,XMB_MAX_ITEMSCALE_XY,XMB_MAX_ITEMSCALE_XY
ink rgb(255,255,255),0
center text 32,(XMB_MAX_ITEMSCALE_XY/2)-(text size()/2), chr$(65+c)
get image XMBItem().img,0,0,64,64,1 : cls
sprite XMBItem().spr,0,0,XMBItem().img
size sprite XMBItem().spr , 48 , 48
endfunction
function updateXMB()
if array count(XMBarItem()) > -1
for n = 0 to array count(XMBarItem())
if leftkey() > 0 and keyPress = 0
if XMBar_Item_Pic < 1
XMBar_Item_Pic = 0
else
dec XMBar_Item_Pic
endif
keyPress = 1
endif
if rightkey() > 0 and keyPress = 0
if XMBar_Item_Pic = array count(XMBarItem())
XMBar_Item_Pic = array count(XMBarItem())
else
inc XMBar_Item_Pic
endif
keyPress = 1
endif
barX = XMBarItem(n).x - (XMBar_Item_Pic * XMBAR_ITEM_SPACE) + XMBAR_OFFSETX
barY = XMBarItem(n).y
if n = XMBar_Item_Pic
sprite XMBarItem(n).spr , barX-(56/2) , barY-4 , XMBarItem(n).img
size sprite XMBarItem(n).spr , 56 , 56
ink rgb(255,255,255),0
center text barX , barY+56 , XMBarItem(n).caption
if array count(XMBItem()) > -1
pos = -1
for i = 0 to array count(XMBItem())
if XMBItem(i).parent = XMBarItem(XMBar_Item_Pic).handle
inc pos
show sprite XMBItem(i).spr
if upkey() > 0 and keyPress = 0
if XMBItem(XMBar_Item_Pic).currentChild < 1
XMBItem(XMBar_Item_Pic).currentChild = 0
else
dec XMBItem(XMBar_Item_Pic).currentChild
endif
keyPress = 1
endif
if downkey() > 0 and keyPress = 0
if XMBItem(XMBar_Item_Pic).currentChild = XMBarItem(XMBar_Item_Pic).childCount
XMBItem(XMBar_Item_Pic).currentChild = XMBarItem(XMBar_Item_Pic).childCount
else
inc XMBItem(XMBar_Item_Pic).currentChild
endif
keyPress = 1
endif
x = XMBItem(i).x + XMBAR_OFFSETX
if pos < XMBItem(XMBar_Item_Pic).currentChild
y = XMBItem(i).y - (XMBItem(XMBar_Item_Pic).currentChild * 64) + 64
else
y = XMBItem(i).y - (XMBItem(XMBar_Item_Pic).currentChild * 64) + 128+16
endif
sprite XMBItem(i).spr , x-(48/2) , y-4 , XMBItem(i).img
size sprite XMBItem(i).spr , 48 , 48
if pos = XMBItem(XMBar_Item_Pic).currentChild
ink rgb(255,255,255),0
else
ink rgb(192,192,192),0
endif
text x+64 , y+(42/2)-text size()/2,XMBItem(i).caption
else
hide sprite XMBItem(i).spr
endif
next i
endif
endif
if n <> XMBar_Item_Pic
sprite XMBarItem(n).spr , barX-(48/2) , barY , XMBarItem(n).img
size sprite XMBarItem(n).spr , 48 , 48
endif
next n
endif
endfunction
Now the major rewrite will commence and the addition of all the other features. So hopefully with your help I can do this. So where to start?
1. How to make the Background?
Background colors should be a simple image, I went with a 512x512 png image for mine. Apply that to a sprite and size it to screen width/height (same for wallpaper) and we've got are background color (or wallpaper). Please tell me if you've got a better idea.
I have kind of a clue how the wave bit is made, just by looking at it, it looks like an subdivided quad (bit like a matrix, but a plain) with i'm guessing a shader apply to it. I guess the vertex shader would handle the movement and the pixel for the holographic look. Anyway I've decide to not make that one cause i'll be spending hour getting working so i'll make the psp one instead.
So the psp waves are 2d, they seem dynamic, not sure if it's and image that dynamically being scrolled with it's scale also being dynamically altered. Or one long image that just scrolls.
Edit: just looking at it now, I have no clue how this is made.
So any idea's?
A dream is a fantasy, if you achieve that fantasy it was never a dream to begin with.