![]() |
| Forums | Gaming News | Videos | Downloads | Today's Posts | Mark Forums Read | Chat | FAQ | Members List | Contact |
| ||||||
This is a discussion on TIFF - Useful Routines Equivalent to NIDS Not Found within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; After a spirited discussion on IRC last night with FreePlay, I realised just how limited developement for 2.8 really is... ...
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 |
![]() ![]() ...in a dream...
|
After a spirited discussion on IRC last night with FreePlay, I realised just how limited developement for 2.8 really is... You're restircted to but a few routines that are commonly used, out of the much larger group that is commonly used...
This thread is temporary as when the eLoader comes out (if I should say) it will be a tad pointless, unless the creators can't locate certain NIDS... Anyways, I was in need of the 'atoi' or 'atof' function, whose NIDS weren't found. Instead, I searched through the source of it here (note, thats for strtol, but its ok as atoi uses strtol(string,NULL)). People who decide to contribute will find that site useful as youll find many of the useful function routines source there. After messing with what I got there, I was stuck on one little undefined reference I couldnt fix... Instead, FreePlay explained how much simpler the functions routines could be, so he recreated it... Than I got this idea, after realising I needed 'sprintf' , that there should be a large dump of useful routines to make up for hte unknown NIDS to the real functions...::MAJOR UPDATE:: The file attacht'd contains ALL of string.c as well as some functions from other libraries that are commonly used. The total list of functions now are: Code:
int Sleep(unsigned int xicount); int abs ( int i ); int atoi(char *number_string); char *strmake(char *dst, const char *src, unsigned int length); char *strmov(char *dst, const char *src); char *strnmov(char *dst, const char *src, unsigned int n); char *strcpy(char *dest, const char *src); char *strncpy(char *dest, const char *src, size_t count); char *strcat(char *dest, const char *src); char *strncat(char *dest, const char *src, size_t count); int strcmp(const char *cs, const char *ct); int strncmp(const char *cs, const char *ct, size_t count); char *strchr(const char *s, int c); char *strrchr(const char *s, int c); int strlen(const char *s); int strnlen(const char *s, size_t count); int strspn(const char *s, const char *accept); char *strpbrk(const char *cs, const char *ct); char *strtok(char *s, const char *ct); char *strstr(const char *s1, const char *s2); void *memset(void *s, int c, size_t count); char *bcopy(const char *src, char *dest, int count); void *memcpy(void *dest, const void *src, size_t count); void *memmove(void *dest, const void *src, size_t count); int memcmp(const void *cs, const void *ct, size_t count); void *memscan(void *addr, int c, size_t size); void *memchr(const void *s, int c, size_t n); void *memmem(void* haystack, int hl, const void* needle, int nl); ). Inside the attacht'd file youll find instructions on how to use them. Its simple:Code:
####################################################### ####################################################### ##### Random Common Useful Routines ##### ####################################################### ##### Currently has all of string.c ##### ##### As well as other random functions ##### ####################################################### ################## Created by SG57 #################### ####################################################### ####################################################### ####################################################### ####################################################### ####################################################### ####################################################### ##### INSTRUCTIONS ##### ####################################################### ##### Copy and paste ALL of these DECLARATIONS to ##### ##### the TOP of your code. After doing so, copy ##### ##### and paste ALL of their DEFINITIONS to the ##### ##### BOTTOM of your code saving room and getting ##### ##### them out of your way so you can have clean ##### ##### code, but still have their routines at hand ##### ####################################################### ####################################################### Spoiler for Random Common Useful Routines:
The forum screws up the text, there is indenting and such. I recommend downloading it, rather copy&paste ![]() ----------------------------------------**NOTE**----------------------------------------------- I'm adding new common function routines as I go, so if you wish to help, somehow get word to me you have a working common function whose NIDS isn't found just yet... Or in the case your routine is more efficient for the PSP, than it'll be accept'd Hopefully, this will encourage some developers to make the 2.8 users both happy kept busy... Feel free to leave comments/suggestions/advice. If you feel the need to flame, do so wisely as the mods, lately, have been ever so...
__________________
...you'll never know what it's like... spending your whole life in a dream...
Launch a Kitten out of a Cannon and win real cash! Checkout my newly updated site for all my projects (Kitten Cannon, BOXHEAD, Light Cycle 3D) Last edited by SG57; 10-01-2006 at 12:53 PM.. |
|
|
|
|
|
#3 |
![]() ![]() ...in a dream...
|
Ill make an analogy to it... On 1.5, your pretty much LIMITLESS... On 2.8 your restricted to but around 200 useful routines, out of around... 1000 or so.... Im guessing... And some of the useful routines that ARENT there on 2.8 makes creating games for it very discouraging since they'd either have to re-invent the wheel (re-create it like I have done) or work around it some how. Making this thread, any developers who couldn't make a game before because of the lack of a specific useful routine, should post which one, or take a look at hte one's above and see if it's there.
All of this is in hope to keep 2.8 strong til' the probable eLoader, even then, if they can't find the NIDS, throwing some of these working re-creations will have the same effect as if they found it I suppose
__________________
...you'll never know what it's like... spending your whole life in a dream...
Launch a Kitten out of a Cannon and win real cash! Checkout my newly updated site for all my projects (Kitten Cannon, BOXHEAD, Light Cycle 3D) |
|
|
|
|
|
#4 |
![]() Still in September 1993
|
forgive me if this is a stupid question, but can you brute force the NIDs on 2.8? If you can't, then I have been wasting a lot of time marking Fanjita's 2.8 NID list to eliminate the NIDs that are mapped, but are not in use. You may have heard me talk about this idea in the past, and I would have been finished if it weren't for a recent tragedy. I'll continue soon, but please tell me if I am wasting my time.
I am marking all the CommonGui and Paf syscalls, as they have, to the best of my knowledge, never served a purpose in homebrew. |
|
|
|
|
|
#5 |
![]() ![]() ...in a dream...
|
BreakDecks - I havent a clue... But I'm sure you can, how else did they find the current NIDS? Did they look through a 2.8 dump and found them somewhere? hmm...
__________________
...you'll never know what it's like... spending your whole life in a dream...
Launch a Kitten out of a Cannon and win real cash! Checkout my newly updated site for all my projects (Kitten Cannon, BOXHEAD, Light Cycle 3D) |
|
|
|
|
|
#6 |
![]() ![]() Developer
|
I have included these funstions in the TIFFSDK for Xcode
including one that not even 1.5 users have.
__________________
www.xart.co.uk coreXlib, old school library. ColorSync Display Profiles for MacBook (LG LCD) & New MacBook (AUO LCD) Profile for LG LP133WX1 Profile for AUO B133EW01 |
|
|
|
|
|
#7 |
![]() ![]() ...in a dream...
|
Ok well, Ive completely re-written string.c... Since most don't want to add complicated stuff to there makefile, Ive made it as simple as possible:
Download my re-written string.c file. Copy the top part to the top of your code (these are the declarations of the functions, not there definitons). Than, copy the rest to the bottom of your app. Than feel free to use any function that is in the real string.c as well as some other random routines from other libraries... Ill host it in a while when i finish the declarations...
__________________
...you'll never know what it's like... spending your whole life in a dream...
Launch a Kitten out of a Cannon and win real cash! Checkout my newly updated site for all my projects (Kitten Cannon, BOXHEAD, Light Cycle 3D) |
|
|
|
|
|
#8 |
![]() ![]() Developer
|
here is a reverse version of atoi that i used in Choice eXtreme
You may like to include this in your file Code:
char *itoa(long int value, char *buffer, int radix);
char *itoa(long int value, char *buffer, int radix) {
char *p=buffer;
unsigned int i;
if(value<0) {
value=-value;
*p++='-';
}
i=(value/100000000)?100000000:(value/10000000)?10000000:(value/1000000)?1000000:(value/100000)?100000:(value/10000)?10000:(value/1000)?1000:(value/100)?100:(value/10)?10:1;
int j;
do {
j=value/i;
if(j>=0 && j<=9) *p++=('0'+j);
value-=(j*i);
i/=10;
} while(i!=0);
*p='\0';
return buffer;
}
__________________
www.xart.co.uk coreXlib, old school library. ColorSync Display Profiles for MacBook (LG LCD) & New MacBook (AUO LCD) Profile for LG LP133WX1 Profile for AUO B133EW01 |
|
|
|
|
|
#9 |
![]() ![]() ...in a dream...
|
Could you please change it from QUOTE to CODE tags? thx and then ill a dd it to the list and file. I'm in need of something just like this... Oh and is it tested confirmed working? I had to go through all the ones I rec-created - tested them with Dev-C++ and to my astonishment - they all work
![]() These should be made into a library of some sort, or added to GFX.c/h, but not everyone uses gfx.c/h, thats the problem
__________________
...you'll never know what it's like... spending your whole life in a dream...
Launch a Kitten out of a Cannon and win real cash! Checkout my newly updated site for all my projects (Kitten Cannon, BOXHEAD, Light Cycle 3D) |
|
|
|
|
|
#10 |
![]() ![]() Developer
|
I have my own version of gfx.h, mini.h that I will be hosting for downloading on my site, Mac users can get it the moment as it is part of the TIFFSDK for Xcode, but will be making it into a seperate file for non mac users
It has stuff like full alpha channel suport on graphic functions, like blit circle line etc Comes with the 8x8 bitmap fonts and will soon be adding XFN to it, that is the smooth font type that I used in Choice This little code dose the trick for alpha blending, no float used, all ints Code:
typedef unsigned char UInt8;
typedef char SInt8;
typedef unsigned short UInt16;
typedef short SInt16;
typedef unsigned int UInt32;
typedef int SInt32;
typedef unsigned long UInt64;
typedef long SInt64;
UInt32 gfxAlphaBlend(UInt32 bg, UInt32 src)
{
UInt32 a,rb,g;
a = (src >> 24); /* alpha */
/* If source pixel is transparent, just return the background */
if (0 == a)
return bg;
if (255 == a)
return src;
/* alpha blending the source and background colors */
rb = (((src & 0x00ff00ff) * a) + ((bg & 0x00ff00ff) * (0xff - a))) & 0xff00ff00;
g = (((src & 0x0000ff00) * a) + ((bg & 0x0000ff00) * (0xff - a))) & 0x00ff0000;
return ((rb | g) >> 8);
}
__________________
www.xart.co.uk coreXlib, old school library. ColorSync Display Profiles for MacBook (LG LCD) & New MacBook (AUO LCD) Profile for LG LP133WX1 Profile for AUO B133EW01 Last edited by xart; 10-01-2006 at 01:50 PM.. |
|
|
|
|
|
#11 |
![]() Still in September 1993
|
I finished sorting through the list of functions provided with the TiffSdk. I think that either:
a) I did something wrong and wasted my time. b) I discovered the utter hoplessness of 2.8 homebrew. here's the file: http://dl.breakdecks.com/pspprograms.../functions.txt |
|
|
|
|
|
#12 |
![]() ![]() Muppet Magnet
|
I think you've misunderstood about the '??' nids.
They're all usable, we just don't necessarily know the names for them.
__________________
Using firmware v2.00-v3.50? Open up a whole world of homebrew here
The PSP Homebrew Database needs YOU! Your ISP may be illegally wiretapping all your web activity. Stop Phorm Now! Visiting the Edinburgh Festivals? Get practical advice from experts. |
|
|
|
|
|
#13 |
![]() ![]() ...in a dream...
|
Hey Fanjita - Rather than seraching for hte correct NID->Name combo, why not re-invent some of it? Instead of finding... say... atoi -- Why not just intercept any call for it, and do the manual routine, rather than hunt for the NID->name to match...?
Thats what this thread is for basically... While some can't be found, use a re-created one.
__________________
...you'll never know what it's like... spending your whole life in a dream...
Launch a Kitten out of a Cannon and win real cash! Checkout my newly updated site for all my projects (Kitten Cannon, BOXHEAD, Light Cycle 3D) |
|
|
|
|
|
#15 |
![]() ![]() Muppet Magnet
|
The majority of interesting API functions can't be easily emulated, as kyelewis pointed out.
Incidentally, SG57, I think you've not grasped the difference between libc and the SCE APIs. Sony provide the sce* functions as part of the kernel, and those are (generally) what the syscalls access. Stuff like atof() is a part of the standard compiler libraries (i.e. libc). The only reason we're not using the standard libraries is because they tend to a) require some of the sce* functions, and b) do awkward things with memory allocation at start-of-day, and fail if that doesn't work. The ideal for a lot of these functions would be to use libc. Anyway, you can generally grab public-domain implementations for most of them. To cut the above ramble into something a little more concise: the sce* funcs would be very difficult to rewrite, but the libc funcs are easy (and source is readily available).
__________________
Using firmware v2.00-v3.50? Open up a whole world of homebrew here
The PSP Homebrew Database needs YOU! Your ISP may be illegally wiretapping all your web activity. Stop Phorm Now! Visiting the Edinburgh Festivals? Get practical advice from experts. |
|
|
|
![]() |
| Tags |
| equivalent , found , nids , routines , tiff |
| Thread Tools | |
|
|