Posted: 15 Jun 2012 11:31:30 am Post subject: pSDL v1.0.0
I have been working on porting nSDL to the prizm so people can write one program to run on both prizm and both nspires. It now even compiles for on calc so it should be ready for anyone who wants to to test it. Until it gets to version 1 and I get most bugs out I will not be distributing binaries so you will have to build it. To compile it run make -f Makefile.prizm and it should compile. to install it assumes you built it in the /projects directory of the prizm sdk then run make -f Makefile.prizm install to install it to your prizm sdk
I need people to help me find any errors I might have made and to test the library. If someone could please help me the code is at https://github.com/ruler501/pSDL It now compiles fine and will run if you use a 8 bit surface. malloc seems to fail if it tries to use a 16bpp surface the size of the screen. If someone could please find a way to get malloc working with large values that could allow much more usability
I could not have done this without hoffa's wonderful nSDL. I have copied most of his code and only changed the parts that are platform specific(mainly).
This is a demo of a program called explosion I cannot currently remember where I got it from. Other than removing functions the prizm doesnt support very little work was needed to port it
http://www.omnimaga.org/index.php?action=dlattach;topic=13820.0;attach=13109 is the binaries for version 1.0.0 which I will be updating soon since the current version does not support anywhere near the whole keyboard like it should.
pSDL has also moved so that it is now called pSDL on my github instead of still being called nSDL
EDIT:Touched up the entire post to be more concise and organized
Last edited by ruler501 on 04 Aug 2012 08:43:46 pm; edited 7 times in total
Get me a list of functions that are missing. I'm not about to go implementing the entire stdlib, but knowing what's needed (probably not much) allows me to do something-- anything. _________________ Ask questions the smart way · タリ
I have not looked close enough to say what functions but all the errors so far have come from SDL_malloc.c in stdlib folder when I get time later right now I can't though
EDIT: I tested one thing real quick and all you ahve to do to make it compile is add -D HAVE_MALLOC and it compiles I'm getting my calc back later today so I'll run some test programs and see if there are any other problems
EDIT2: When trying to use the library produced from compiling with HAVE_MALLOC I get lots of undefined errors. I need to find what functions in src/stdlib/SDL_malloc.c need to be implemented then I will tell you.
I had forgotten to include the define that actually made it compile for prizm so once I added it it no longer compiles. I will be gone for a while so I will not be able to update this at all until I get back. Currently it will not build for the prizm and fails with a lot of errors which i hae to go through and find a source for _________________ -----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCM/CS/M/S d- s++: a---- C++ UL++ P+ L++ E---- W++ N o? K- w-- o? !M V?
PS+ PE+ Y+ PGP++ t 5? X R tv-- b+++ DI+ D+ G++ e- h! !r y
------END GEEK CODE BLOCK------
I'm slowly working through the errors but I am finding things that are missing that need to be added to the SDK for it to compile.
The things I've found so far that need implementation are:
stdint.h (Though i think I got this working acceptably you can see my slightly modified version of it in the include folder of the most recent commit)
stdarg.h(for va_list)
and probably more but until I get past one I can't see the next problems _________________ -----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCM/CS/M/S d- s++: a---- C++ UL++ P+ L++ E---- W++ N o? K- w-- o? !M V?
PS+ PE+ Y+ PGP++ t 5? X R tv-- b+++ DI+ D+ G++ e- h! !r y
------END GEEK CODE BLOCK------
I'm pretty sure these missing headers are Jonimus' fault. The toolchain I compiled from source has all of these, so your current problem is something in how Jonimus packaged everything. _________________ Ask questions the smart way · タリ
Tari I think the problem there is from how the wiki says to build the toolchain for nonArch linuxes it says to build with the option --without-headers. My guess for this is that the headers/libraries will not work on the prizm without some platform specific fiddling.
Though if you could try compiling the most recent version from my github and test it that would be great. If it works I know that the problem is in the build instruction for the prizm sdk _________________ -----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCM/CS/M/S d- s++: a---- C++ UL++ P+ L++ E---- W++ N o? K- w-- o? !M V?
PS+ PE+ Y+ PGP++ t 5? X R tv-- b+++ DI+ D+ G++ e- h! !r y
------END GEEK CODE BLOCK------
Joined: 14 Mar 2005 Posts: 55751 Location: Earth, Sol, Milky Way
Posted: 26 Jun 2012 09:27:17 am Post subject:
Congratulations! The issue there is that bitmaps (BMP) are a huge and unwieldy format, and may not be used for embedded images here. Almost any image editor can turn that into a PNG for you. _________________
Ok thanks for the info I'll fix it in a little bit
I forgot to post this last night before i went to sleep but here is a video demo of what pSDL can do
and i even remembered to use preview this time _________________ -----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCM/CS/M/S d- s++: a---- C++ UL++ P+ L++ E---- W++ N o? K- w-- o? !M V?
PS+ PE+ Y+ PGP++ t 5? X R tv-- b+++ DI+ D+ G++ e- h! !r y
------END GEEK CODE BLOCK------
I now have a working game and if you want the source/program for the demo I can send it to you but its not very good looking code and it has some errors in event handling(has locked up my calc a couple times)
I need help in image loading my current code leaves a blue shift in the resulting image.
Joined: 14 Mar 2005 Posts: 55751 Location: Earth, Sol, Milky Way
Posted: 01 Jul 2012 07:30:26 am Post subject:
That looks fine to me; you have the proper *8 (== <<3) on the blue and red, and the *4 (== <<2) on the green. Is it possible the issue is in your rendering code? _________________
I had a few problems with rendering but it seems to have rendering ok but all the colors are messed up so there has to be a problem somewhere.
EDIT: couldnt get 8 bit working but heres the function that correctly loads 16 bit Code:
SDL_Surface* LoadSCImage(Uint16* image, int x, int y)
{
SDL_Surface *rimage, *tempsurf = SDL_CreateRGBSurfaceFrom(image, x, y, 16, 2*x, PZM_RMASK16,PZM_GMASK16,PZM_BMASK16,0);
rimage = SDL_DisplayFormat(tempsurf);
SDL_FreeSurface(tempsurf);
return rimage;
}
I'll compile this and a few things from hoffa's nSDL to a seperate library when i came back to work on this in August _________________ -----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCM/CS/M/S d- s++: a---- C++ UL++ P+ L++ E---- W++ N o? K- w-- o? !M V?
PS+ PE+ Y+ PGP++ t 5? X R tv-- b+++ DI+ D+ G++ e- h! !r y
------END GEEK CODE BLOCK------
Joined: 14 Mar 2005 Posts: 55751 Location: Earth, Sol, Milky Way
Posted: 01 Jul 2012 08:29:23 am Post subject:
Great, have fun on vacation, and we hope you return with a renewed vigor for this project (and Prizm programming in general). Nice progress! _________________
I'm back now and now I need to decide what I need to do with this project. I think that one of the main things that will need to be done is get the events to recognize all keys. If anyone knows a way to do this please tell me. I also plan on making some demo's and trying to find more efficient ways to implement some of the internal functions.
What I need help with:
Testing what keys are down for the entire prizm keyboard
Getting file i/o for bmp loading
Getting other SDL libraries working(SDL_gfx most importantly)
If I could get these things working I think it would greatly improve this library _________________ -----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCM/CS/M/S d- s++: a---- C++ UL++ P+ L++ E---- W++ N o? K- w-- o? !M V?
PS+ PE+ Y+ PGP++ t 5? X R tv-- b+++ DI+ D+ G++ e- h! !r y
------END GEEK CODE BLOCK------
The one thing about those though is that it does not allow me to check for all keys that have been pressed and place those into the event queue. I would like something like the Debouncing Multiple-Keypress PRGM GetKey from the wiki. In fact thats what i currently use but the documentation on it says it only works for the KEY_PRGM_ codes while I need to be able to use all keys on the keyboard. _________________ -----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCM/CS/M/S d- s++: a---- C++ UL++ P+ L++ E---- W++ N o? K- w-- o? !M V?
PS+ PE+ Y+ PGP++ t 5? X R tv-- b+++ DI+ D+ G++ e- h! !r y
------END GEEK CODE BLOCK------
Joined: 01 Dec 2010 Posts: 2418 Location: Stomp Stomp Stomp, The Idiot Convention
Posted: 01 Aug 2012 07:09:45 am Post subject:
ruler501 wrote:
The one thing about those though is that it does not allow me to check for all keys that have been pressed and place those into the event queue. I would like something like the Debouncing Multiple-Keypress PRGM GetKey from the wiki. In fact thats what i currently use but the documentation on it says it only works for the KEY_PRGM_ codes while I need to be able to use all keys on the keyboard.
Yeah, so you're going to have to manually keep track of when they were pressed during the run of the SDL_PollEvent(), SDL_WaitEvent(), etc. routines. The routines, if used correctly, can be used/modified to work so that they store all pressed keys into a queue, not just the very last few pressed. Actually shouldn't be very hard to modify for that purpose.
As for the routine, it does work for every key on the keyboard, you're just going to have to define the other KEY_PRGM defines if you want to keep track of names. _________________ -Ashbad
so I have to find out what the KEY_PRGM defines are for the rest of the keys to use them or what defines do I use? _________________ -----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCM/CS/M/S d- s++: a---- C++ UL++ P+ L++ E---- W++ N o? K- w-- o? !M V?
PS+ PE+ Y+ PGP++ t 5? X R tv-- b+++ DI+ D+ G++ e- h! !r y
------END GEEK CODE BLOCK------
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum