-
spectre1989
- Posts: 24
- Joined: Tue Jun 23, 2009 7:19 pm
Post
by spectre1989 » Thu Jul 02, 2009 5:51 pm
StevenH wrote:No just look at the console.c code in the SVN as I used that as the basis of my graphics console, hell even my voxel test and fli player accesses the memory directly instead of via a buffer...
Ah man, thanks so much! I changed to direct access of the map memory and it all just came to life. I also switched to using swiCopy to copy the tiles into tile memory, is that the right thing to do, or is dmaCopy preferable?
cheers
Spec
-
StevenH
- Posts: 133
- Joined: Sun Feb 22, 2009 7:59 pm
Post
by StevenH » Thu Jul 02, 2009 6:31 pm
That's one thing that I would not know about, I know that dmaCopy() is fast but I don't know which is the one to use for putting things into the correct memory areas. I use dmaCopy for as that's what's in all the examples
-
WinterMute
- Site Admin
- Posts: 1986
- Joined: Tue Aug 09, 2005 3:21 am
- Location: UK
-
Contact:
Post
by WinterMute » Fri Jul 03, 2009 1:52 am
StevenH wrote:OK, I've just had a quick scan over your code and a couple of things pop into my "DANGER WILL ROBINSONE, DANGER!" tray XD
1) Your attempting to use packed structs on the DS - Unfortunatly this is not possible as if you do a make clean then a make you will see a few warnings about __attribute__ ((packed)) being ignored as not supported on this archutecture.
This isn't actually true. The packed attribute is supported just fine and I get no warnings when compiling your code.
One caveat with this is that the ARM processor does rather odd things with misaligned reads which can cause peculiar side effects in your code if packing the struct causes misalignment. It depends if the compiler is aware of the misalignment or not - where the compiler knows it will emit code that compensates but has a slight speed penalty if that's important.
-
StevenH
- Posts: 133
- Joined: Sun Feb 22, 2009 7:59 pm
Post
by StevenH » Fri Jul 03, 2009 1:55 am
I've just re-checked my code I was using #pragma's (well after wintermute requested some example code)
Apparently the __attribute__ ((packed)) does work - just checked on a stupidly setup structure...
-
spectre1989
- Posts: 24
- Joined: Tue Jun 23, 2009 7:19 pm
Post
by spectre1989 » Fri Jul 03, 2009 1:11 pm
Ah good good, yeah I heard that sometimes packed structs can lead to gcc panicking sometimes.
Don't suppose you could clear up the swiCopy vs dmaCopy question Wintermute?
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot] and 1 guest