Unless there's something weird about it, then BGR5A1 ought to look like thisThe only thing I can think of is: Maybe the alpha value comes first? So it would look like:
1 bit a
5 bit b
5 bit g
5 bit r
Code:
abbbbbgggggrrrrr
15-------------0
Unless there's something weird about it, then BGR5A1 ought to look like thisThe only thing I can think of is: Maybe the alpha value comes first? So it would look like:
1 bit a
5 bit b
5 bit g
5 bit r
abbbbbgggggrrrrr
15-------------0
Unless there's something weird about it, then BGR5A1 ought to look like this
Code:abbbbbgggggrrrrr 15-------------0
Try this out then:http://fossies.org/linux/SDL2/src/render/psp/SDL_render_psp.c
According to this, GU_PSM_5551(the psp render type the emu is using) means (SDL_PIXELFORMAT_)ABGR1555. So would that still be correct?
#define BGR5A1_RGB5A1(src) ((src & 0x7C00) >> 10) | ((src & 0x1F) << 10) | (src & 0x83E0))
As an developer using SDL, after looking at the documentation for that format I think the way we both said looks to be it. Give it a try and see what happens.http://fossies.org/linux/SDL2/src/render/psp/SDL_render_psp.c
According to this, GU_PSM_5551(the psp render type the emu is using) means (SDL_PIXELFORMAT_)ABGR1555. So would that still be correct?
this is amazingYeah, you read that right.
I have been working quite a bit on porting Desmume to the 3DS. As it stands, it:
Appears to run at a decent fps
Has massive graphical corruption
Can't do much of anything do to lack of input support.
Not only did I make this thread to keep people updated on the project, I also need some help.
I'm not the most experienced with sf2dlib, so I end up with graphical corruption. If anyone with experience with sf2dlib would want to provide some tips/advice as to what could be going wrong, here's the rendering code:
Code:for(i=0; i < 256*192; i++) { dstA[i] = src[i]; //Screen buffer to top screen buffer dstB[i] = src[(256*192)+i]; //Screen buffer to bottom screen buffer } sf2d_texture *texture = sf2d_create_texture(256, 192, TEXFMT_RGB5A1, SF2D_PLACE_RAM); void* texturedata = texture->data; u16* texturedata16 = (u16*)texturedata; for(x=0; x < (256*192); x++){ texturedata16[x] = dstA[x]; }
Thanks!
BTW, please no spamming. Lets actually try to keep the discussion on topic, shall we? Thanks.
EDIT: http://gbatemp.net/threads/early-w-i-p-ds-emulation-on-3ds.430223/page-6#post-6430835
Try this out then:Code:#define BGR5A1_RGB5A1(src) ((src & 0x7C00) >> 10) | ((src & 0x1F) << 10) | (src & 0x83E0))
Then Iguess it worked, since it's converted from a smaller color space.Nope, that just gives a more yellow tint.
I almost wonder...
Try the previous method, but convert it to rgba8.
It appears almost like what it would be if you set a PC to lower colors(like 256 colors mode or something like that), if that helps at all.
Cool ^^ !!Wait, I might have actually been using the wrong piece of code for that last test. Just a minute.
EDIT:
Here's a picture:
![]()
This is amazingWait, I might have actually been using the wrong piece of code for that last test. Just a minute.
EDIT:
Here's a picture:
![]()
Did you use something like this
http://wiki.libretro.com/index.php?title=DeSmuME
Talk about hard work![]()
How about you edit the OP as well?Ok, I edited the previous post with a picture of what is happening.