![]() |
| Forums | Gaming News | Videos | Downloads | Today's Posts | Mark Forums Read | Chat | FAQ | Members List | Contact |
| ||||||
This is a discussion on MathOps - A simple example within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; Hey, for everyone who has finished doing Yeldarb's first two tutorials. I wrote a really simple program to help learn ...
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 |
![]() |
Hey, for everyone who has finished doing Yeldarb's first two tutorials. I wrote a really simple program to help learn more functions, and to just practice. I think you guys would really appreciate it, and hopefully it can help you be on your way to creating your own program. There is a lot more information in the readme file, but if you still need help or anything, email me at OmahaStylee@gmail.com. Have fun!
http://www.sr-films.com/psp/MathOps_v0.1.zip
__________________
[center][img]http://i3.photobucket.com/albums/y96/HomelessJamaican/Other/er_banner_waves.jpg[/img][/center] [COLOR=Navy][FONT=Tahoma][CENTER][B]Yes I am a noob, but I'll get there.[/B] [/CENTER][/FONT][/COLOR] |
|
|
|
|
|
#2 |
![]() NDS Mod
|
thanks
__________________
"15% percent of programing is creating a program, 85% percent is getting it to work like it should." - Me [URL=http://www.mozilla.org/products/firefox/][IMG]http://img439.imageshack.us/img439/5667/getfirefox0sr.png[/IMG][/URL] |
|
|
|
|
|
#3 |
![]() |
Soadnation, I didn't have time to scan completely through your code, but one thing that really stood out is this.
Code:
// My second PSP program - Hello World(advanced)
/*
This was made by Mitch Pordon.
It is a simple program that says
different thing with different key strokes.
*/
// Starting Code
#include <pspkernel.h>
#include <pspdebug.h>
#include <pspctrl.h>
#include <string.h>
PSP_MODULE_INFO("Communication",0,1,1);
#define printf pspDebugScreenPrintf
/* Exit callback */
int exit_callback(int arg1, int arg2, void *common) {
sceKernelExitGame();
return 0;
}
/* Callback thread */
int CallbackThread(SceSize args, void *argp) {
int cbid;
cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
sceKernelRegisterExitCallback(cbid);
sceKernelSleepThreadCB();
return 0;
}
/* Sets up the callback thread and returns its thread id */
int SetupCallbacks(void) {
int thid = 0;
thid = sceKernelCreateThread("update_thread", CallbackThread, 0x11, 0xFA0, 0, 0);
if(thid >= 0) {
sceKernelStartThread(thid, 0, 0);
}
return thid;
}
int main()
{
//Active Controlls
SceCtrlData pad;
sceCtrlSetSamplingCycle(0);
sceCtrlSetSamplingMode(PSP_CTRL_MODE_ANALOG);
while(1){
// Set it up to read the Controls
sceCtrlReadBufferPositive(&pad, 1);
//End
pspDebugScreenInit();
SetupCallbacks();
pspDebugScreenSetXY(0,0);
printf("Hit 'R' then 'L' then left");
/*Start if's*/
show what is included in the function. Also, no semicollon. Code:
if (pad.Buttons & PSP_CTRL_RTRIGGER) {
/*Start writing the screen(first time)*/
pspDebugScreenSetXY(0,7);
printf("Hello World!");
/* End writing to the screen(First time)*/
}
if (pad.Buttons & PSP_CTRL_LTRIGGER) {
/*start writing to the screen(second time)*/
pspDebugScreenSetXY(0,14);
printf("How's it going?");
/*End writing to screen(second time)*/
}
if (pad.Buttons & PSP_CTRL_DOWN) {
/*Start writing to screen(Last time)*/
pspDebugScreenSetXY(0,21);
printf("See you later!");
/*End writing to screen(last time)*/
}
sceKernelSleepThread();
return 0;
}
__________________
[center][img]http://i3.photobucket.com/albums/y96/HomelessJamaican/Other/er_banner_waves.jpg[/img][/center] [COLOR=Navy][FONT=Tahoma][CENTER][B]Yes I am a noob, but I'll get there.[/B] [/CENTER][/FONT][/COLOR] |
|
|
|
|
|
#4 |
![]() NDS Mod
|
How do you round numbers?
__________________
"15% percent of programing is creating a program, 85% percent is getting it to work like it should." - Me [URL=http://www.mozilla.org/products/firefox/][IMG]http://img439.imageshack.us/img439/5667/getfirefox0sr.png[/IMG][/URL] |
|
|
|
|
|
#5 |
![]() |
thank you for helping me. i didnt read your source close enough., that wasnt the only problem though. it kept saying there was an error with the last line. i got fed up with it and for some strange reason i decided to put 1 more "}"
at the end. and it worked. im guesing i had an open one somehwere in the code. now i just gota put it on my psp ok i piut it on my psp and nothing happens. the screen shows up and writing apears. but when i hit the button the writing that is suppos to shoiw doesnt. |
|
|
|
|
|
#6 | |
![]() |
Quote:
__________________
[center][img]http://i3.photobucket.com/albums/y96/HomelessJamaican/Other/er_banner_waves.jpg[/img][/center] [COLOR=Navy][FONT=Tahoma][CENTER][B]Yes I am a noob, but I'll get there.[/B] [/CENTER][/FONT][/COLOR] |
|
|
|
|
|
|
#8 |
![]() |
Sometimes I just get lost in all of the code and can't remember why I did certain things. So just starting fresh kinda clears it up. Plus once I have the idea of how the script is going to work, I can duplicate it easy.
__________________
[center][img]http://i3.photobucket.com/albums/y96/HomelessJamaican/Other/er_banner_waves.jpg[/img][/center] [COLOR=Navy][FONT=Tahoma][CENTER][B]Yes I am a noob, but I'll get there.[/B] [/CENTER][/FONT][/COLOR] |
|
|
|
|
|
#10 |
![]() |
I originally saw the code in Redbluefire's guessing game. Then, I looked in the file that holds the code for control functions and learned all the buttons names.
__________________
[center][img]http://i3.photobucket.com/albums/y96/HomelessJamaican/Other/er_banner_waves.jpg[/img][/center] [COLOR=Navy][FONT=Tahoma][CENTER][B]Yes I am a noob, but I'll get there.[/B] [/CENTER][/FONT][/COLOR] |
|
|
|
![]() |
| Tags |
| mathops , simple |
| Thread Tools | |
|
|