Search the web
Sign In
New User? Sign Up
gbadev
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
emus vs hardware 16bit alignment question   Message List  
Reply | Forward Message #10284 of 15019 |
Can anyone give me a difinitive answer to this one?

I've been working on a fractal demo in mode4 using mappy,
visualBoyAdvance(7.*), and boycottAdvance0.2.6
I don't have facilities to test on hardware yet.

Today (AFTER upping my demo to gbadev :-|) I discovered I didn't have
the latest visualBoyAdvance, and that when I tried it, my demo is
broken!

when i first wrote my putpixel routine, i was masking the lowest bit
of the x coordinate, as I assumed this was necessary, during a try
everything bug search, i discovered that this didn't seem to matter -
in every emu i have, so i left it out : see '//(x&0xfe));' below
adding the mask back in fixes the graphics on visualBoyAdvance0.8

void putPixelM4(u32 x,u32 y, u32 colour) {
u16* p = (u16*)(0x06000000+y*240+x); //(x&0xfe));
u16 screen=*p;
if(x&1) {
*p=((screen&0x00ff)|(((u16)colour)<<8));
}
else {
*p=((screen&0xff00)|(u16)colour);
}
}

I had assumed that either one of compiler/assembler/linker was
aligning things up to work, or that the arm just 'coped'

would the above code need the &0xfe mask so function correctly on
hardware, or is there something else going on here.

(how many other bugs might appear when i get a flash linker????)

cheers,

col.





Sun Mar 3, 2002 2:58 am

colinraybrown
Offline Offline
Send Email Send Email

Forward
Message #10284 of 15019 |
Expand Messages Author Sort by Date

Can anyone give me a difinitive answer to this one? I've been working on a fractal demo in mode4 using mappy, visualBoyAdvance(7.*), and boycottAdvance0.2.6 I...
colinraybrown
Offline Send Email
Mar 3, 2002
4:15 am

I've written a similar routine that works fine in mode4 on all the emulators your using... off the top of my head (not at my development machine atm) my offset...
PALMER, CHARLES
0010180@...
Send Email
Mar 6, 2002
2:39 am

Actually, I use GCC/devkitadv, and I was able to simply use C's bracket array syntax to address a certain byte. GCC seemed to take care of the rest for me....
Daniel Papenburg
dfpercush
Offline Send Email
Mar 7, 2002
8:32 am

Is Map a direct access to the video memory or your own array that is then copied across later? And is that a viable option for faster pixel plotting in mode 4?...
PALMER, CHARLES
0010180@...
Send Email
Mar 7, 2002
5:22 pm

... I think it _has_ to be a copied array - you can do byte writes to IWRAM or EWRAM then DMA them in 16 or 32 bit chunks to VRAM but you can't do VRAM byte...
Pete
dooby@...
Send Email
Mar 7, 2002
10:53 pm

in modes 0-2 the map data in video ram is 16 bits per tile isn't it? 8 bits to specify the name of the tile to show and 8 bits for h+v flip, palette selection...
Shen Mansell
shenmansell
Offline Send Email
Mar 7, 2002
10:23 pm

... wrong 10bits for name/id, 2bit h/v flip, 4bit palette # ... you would lose 768 tile names/id's (if you don't use rot/scale backgrounds)...
Markus
markus@...
Send Email
Mar 7, 2002
10:54 pm

Or you can do halfword writes and combine the byte into it by masking and thus plot one pixel... but thats slow as previously mentioned. I played around with...
PALMER, CHARLES
0010180@...
Send Email
Mar 8, 2002
4:26 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help