Discuss using and improving Lua and the Lua Player specific to the PSP.
Moderators: Shine , Insert_witty_name
Julu Julu
Posts: 9 Joined: Tue Nov 01, 2005 8:57 am
Location: Germany
Post
by Julu Julu » Wed Nov 09, 2005 9:06 am
Hi.
I made an Array in LuaPlayer.
Code: Select all
for i=0,3000 do
Array[i] ={}
for j=0,3000 do
Array[i][j] = 555555
end
end
But if I start the program, then I get this error message
KawaGeo
Posts: 191 Joined: Sat Aug 27, 2005 6:52 am
Location: Calif Mountains
Post
by KawaGeo » Wed Nov 09, 2005 12:48 pm
Hmm... let's calculate how much memeory it needs.
Each element of the 2-D array needs 4 bytes to store a number. Hence, 3000 x 3000 x 4 = 36,000,000. That's a lot for PSP"s RAM! Doesn't it have only 32 MB RAM?
Geo Massar
Retired Engineer
chaos
Posts: 135 Joined: Sun Apr 10, 2005 5:05 pm
Post
by chaos » Wed Nov 09, 2005 2:50 pm
hehe..
mrn
Posts: 116 Joined: Wed Nov 02, 2005 2:26 am
Post
by mrn » Sun Nov 13, 2005 11:01 am
is there a way somehow to use the MS as swap?
(or are all the games using only 32Megs?)
m
Zenurb
Posts: 106 Joined: Fri Sep 30, 2005 8:33 am
Location: United Kingdom
Contact:
Post
by Zenurb » Sun Nov 13, 2005 11:04 am
Most memory sticks are too slow to use as swap.
Proud Dvorak User
US 1.5 PSP (Original)
KawaGeo
Posts: 191 Joined: Sat Aug 27, 2005 6:52 am
Location: Calif Mountains
Post
by KawaGeo » Sun Nov 13, 2005 2:26 pm
If any number in the array is smaller than +-128, share each memory 4-byte cell for two numbers. Would it help, I hope?
Geo Massar
Retired Engineer
Zenurb
Posts: 106 Joined: Fri Sep 30, 2005 8:33 am
Location: United Kingdom
Contact:
Post
by Zenurb » Sun Nov 13, 2005 11:31 pm
Master Inuyasha wrote: by the way, what is an array?
A group of data entries being referenced by the same variable name
in php
Code: Select all
<?php
$blah = array(0,1,2,3,4,5,6,7,8,9);
echo $blah[5]; // would return "4" because it's the fifth index
?>
Proud Dvorak User
US 1.5 PSP (Original)