Just wondering, what ways can I load modules, which ones can load relative file names, and which can load relative file paths, as I can't seem to find one that does all three correctly. (Still having this problem) :Argh:
-Aura
Printable View
Just wondering, what ways can I load modules, which ones can load relative file names, and which can load relative file paths, as I can't seem to find one that does all three correctly. (Still having this problem) :Argh:
-Aura
User Mode: Relative and Exact Paths
Kernel Model: Exact Paths
Is that a specific command, such as pspSdkLoadStartModule, or does it work with them all? Because I'm having problems loading in both user and kernel modes.
-Aura
What are the arguments that can be used in sceKernelSleepThread(); ?
(Lemme guess...none?)
Yup, isZitat:
Zitat von MrChaos
therefore meaning that nothing is required inside the brackets.Code:int sceKernelSleepThread(void);
-Aura
It's almost the same thing as saying sceKernelSleepThread(); though.Zitat:
Zitat von Auraomega
Ok thanks.
Well, if you put the snippet of code that I used into your program, you will get an error (at least I think you will), thats the code contained in the pspthreadman.h file... taking a look inside the brackets indicates the required arguments, and if its void, then none are required. I was showing that code purely to prove that nothing is required... its also a good way to see what you do need for things like this in the future.Zitat:
Zitat von MrChaos
-Aura
Yeah, I kinda noticed that it meant nothing is required, but I was trying to figure out if there was the argument to stall it for a few seconds, but thats a different function. (Which I just found out).Zitat:
Zitat von Auraomega
That's sceKernelDelayThread() for those of you who are wondering what the function is.
k yaustar how would you solve the problem as like i said i've never come across this problem
also i'm unsure what you mean by how i am accesing it by 1d array from a 2d array
I have been referred to pspprogramming.com by someone on the internet but have had heaps of problems. After downloading, when i try to set the psptoolchain up, it says that files are missing and I can't get it working. Does anyone have any ideas apart from re-downloading everything?
Screenshots and/or error messages would be nice.
Download the pre-pspdev from my sig to help you out.
-= Double Post =-
Also theres a fix for that problem in that thread.
The psptoolchain has been made to compile on linux , you wont get any errors on linux , cygwin is only a simulation or something of linux and doesnt work that good
That's bull****.Zitat:
Zitat von hallo007
Also, don't do it the easy way. Just follow this tutorial.
Wrong. Unless that linux distro has the required libraries installed (binutils, subversion, newlib, gcc, etc.) they'll get the same error as in cygwin.Zitat:
Zitat von hallo007
He means to say it emulates a Linux environment...Zitat:
Zitat von hallo007
Strictly opinionated. Just because maybe you aren't able to comprehend the anomaly that is a 'Linux environment' doesn't mean others can not.Zitat:
Zitat von hallo007
P.S. "and doesnt work that well"
True, but its much easier to solve in linux. For example when I did not have those libraries installed I just typedZitat:
Zitat von AdjutantReflex
etc.Code:sudo apt-get install subversion
sudo apt-get install automake
There is nothing wrong with cygwin. It is easier for a noob to install psptoolchain on Linux then on cygwin though.
That is bull****, as well. How the hell do you think the toolchain gets the libraries? It uses wget. Same result, different application.Zitat:
Zitat von mazor55
It is not 'much easier' at all. It may be faster as linux does not have to emulate itself, as cygwin has to emulate linux.
#1 Reason For People Failing to Install the Toolchain: Every idiot who signs on to the internet is automatically a retard and is completely too incompetent to follow a set of instructions.
It's like having a 4 year old type a college-level essay. It is the person's (Who attempted to install the toolchain and failed) fault for being such a retard and not being able to do such a simple thing.
ok how do i solve the following problem:
ok yauster responded that i was:Zitat:
Zitat von slicer4ever
when i responded i thought i knew what he was saying however after re-reading it i reliezed i misread it but now i understand what he is saying however i'm unsure how i am doing thisZitat:
Zitat von yauster
No need to blame your incapabilities to read and do instructions properly on the program itself ;)
Give that a shot, however I'm not quite sure exactly your true problem/question is though...Code:float vertexs[MAX_VERTICES][7];
int *polygons;
polygons = (int*) malloc (sizeof(int)*300);
int number=0;
int actual_polygon=0;
for(int i=0;i<current_mesh;i++){
for(int b=0;b<3;b++){
if(b==0){
test.vertexs[number][1] = vertexs[polygons][actual_polygon];
}else if(b==1){
test.vertexs[number][2] = vertexs[polygons][actual_polygon];
}else if(b==2){
test.vertexs[number][3] = vertexs[polygons][actual_polygon];
}
actual_polygon++;
}
number++;
}
Zitat:
Zitat von slicer4ever
Okay, I tried to go over it and fix your completely obvious mistakes, but there are too many.Code:float vertexs[MAX_VERTICES][7];
float *vertexs;
int *polygons;
vertexs = (float*) malloc (sizeof(float)*300);
polygons = (int*) malloc (sizeof(int)*300);
int number=0;
int actual_polygon=0;
for(int i=0;i<current_mesh;i++){
for(int b=0;b<3;b++){
if(b==0){
test.vertexs[number][1] = vertexs[polygons[actual_polygon]];
}else if(b==1){
test.vertexs[number][2] = vertexs[polygons[actual_polygon]];
}else if(b==2){
test.vertexs[number][3] = vertexs[polygons[actual_polygon]];
}
actual_polygon++;
}
number++;
}
1.)
So we have an array of MAX_VERTICES vertices each with 7 floats. Then we have a pointer to a float with the same name as our array? What is that?Code:float vertexs[MAX_VERTICES][7];
float *vertexs;
2.)
We have a pointer to an int named polygons. You allocate the pointer memory, then don't assign anything to the memory. You also decide to allocate memory to vertexs. So, when you decide to assign 'test.vertexs[number][anInt]' to the 'vertexs[polygon[actual_polygon]]' you are assigning nothing to.... to nothing.
4.)
Why the hell do you have the temporary variables. Even though your loop makes as much sense as a retarded fish, you don't need them at all.
5.)Code:for(int i=0;i<current_mesh;i++){
for(int b=0;b<3;b++){
test.vertexs[i][b] = vertexs[someWeird****ThatMakesNoSense];
}
}
Is a 2D array. Notice, 'float vertexs[MAX_VERTICES][7]'. Two fields means it is a 2D array. One would be a 1D array.Code:float vertexs[MAX_VERTICES][7];
That being said, this makes no sense.
You only used a 1D array for 'vertexs', which you defined as a 2D array.Code:if(b==0){
test.vertexs[number][1] = vertexs[polygons[actual_polygon]];
}else if(b==1){
test.vertexs[number][2] = vertexs[polygons[actual_polygon]];
}else if(b==2){
test.vertexs[number][3] = vertexs[polygons[actual_polygon]];
}
My suggestion to you would be to read a book on C syntax and usage, then try something a bit simpler as you obviously have no idea what you are doing.
Note: There are probably more mistakes, those are just the ones that stuck out to me the most.
I'm not one to bad talk a beginner (as I too was one and got my fair share of beatings) but that was pretty funny... I actually laughed when reading it, and not one of those 'oh yeah... ill just put "lol" to think make him think he's funny' kind of things...Zitat:
Zitat von FistPump
Anywho, yaustar should bud in soon and consult you directly (should you still need some help), either through here or PM.
Spoiler for life:
FistPump highlighted something I completely missed which was the naming of two variables are exactly the same so I have even less of a clue what is going on in that code.
THat should already give you one error. If not then you gave us a VERY bad code snippet.Code:float vertexs[MAX_VERTICES][7];
float *vertexs;
What structure is 'test'? What is the definition of the struct? Is vertexs in this case a 1D or 2D array? If it is 1D then why are you accessing it this way?Code:test.vertexs[number][1]
That inner loop is pointless, this is what it should look like:Code:float vertexs[MAX_VERTICES][7];
float *vertexs;
int *polygons;
vertexs = (float*) malloc (sizeof(float)*300);
polygons = (int*) malloc (sizeof(int)*300);
int number=0;
int actual_polygon=0;
for(int i=0;i<current_mesh;i++){
for(int b=0;b<3;b++){
if(b==0){
test.vertexs[number][1] = vertexs[polygons[actual_polygon]];
}else if(b==1){
test.vertexs[number][2] = vertexs[polygons[actual_polygon]];
}else if(b==2){
test.vertexs[number][3] = vertexs[polygons[actual_polygon]];
}
actual_polygon++;
}
number++;
}
Should be:
Code:float vertexs[MAX_VERTICES][7];
float *vertexs;
int *polygons;
vertexs = (float*) malloc (sizeof(float)*300);
polygons = (int*) malloc (sizeof(int)*300);
int number=0;
int actual_polygon=0;
for(int i=0;i<current_mesh;i++){
for(int b=1;b<=3;b++){
test.vertexs[number][i] = vertexs[polygons[actual_polygon]];
actual_polygon++;
}
number++;
}}
Ive tried so hard to figure out why this isnt working but i cant see whats wrong. When i run it, the screen is black, not even the background is the colour i wanted. Heres the code:
window.h:
window.cpp:Code:#ifndef WINDOW_H
#define WINDOW_H
#include <pspdisplay.h>
#include <pspctrl.h>
#include <pspkernel.h>
#include <pspdebug.h>
#include <pspgu.h>
#include <png.h>
#include <stdio.h>
#include "graphics.h"
#define RGB(r, g, b) ((r)|((g)<<8)|((b)<<16))
typedef struct
{
int Width;
int Height;
int X;
int Y;
Color color;
} WND;
class Window
{
public:
void Register( WND wnd );
void DrawWindow( WND wnd );
private:
Image* Pane;
Image* Frame;
bool Registered;
};
#endif
main.cpp:Code:#include "window.h"
void Window::Register( WND wnd )
{
Pane = createImage( wnd.Width, wnd.Height );
Frame = createImage( (wnd.Width + 4), (wnd.Height + 14) );
Registered = true;
}
void Window::DrawWindow( WND wnd )
{
if( Registered == true )
{
clearImage( RGB(0, 0, 255), Frame );
clearImage( RGB(255, 255, 255), Pane );
blitAlphaImageToScreen( 0, 0, (wnd.Width + 4), (wnd.Height + 4), Frame, (wnd.X - 2), (wnd.Y - 12) );
blitAlphaImageToScreen( 0, 0, wnd.Width, wnd.Height, Pane, wnd.X, wnd.Y );
}
}
I must be missing out something, but i cant see what.Code:#include "window.h"
PSP_MODULE_INFO( "Shell", 0, 1, 1 );
/* 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()
{
SetupCallbacks();
initGraphics();
bool exit = false;
WND tes;
tes.color = RGB(0, 100, 100);
tes.Height = 70;
tes.Width = 100;
tes.X = 20;
tes.Y = 20;
Window test;
test.Register( tes );
while( exit == false )
{
clearScreen( RGB(0, 100, 100) );
test.DrawWindow( tes );
flipScreen();
}
sceKernelExitGame();
return 0;
}
Where's your constructor / destructor?
Also IIRC, graphics.c/h doesn't actually accept a RGB argument for clearscreen, it's always 0 (black).
Hmm, ill add a constructor and destructor, but i dont think it will make a difference, the compiler didnt give any errors about my class. Your right about the background, but why cant i display the images that I have created?Zitat:
Zitat von jsharrad
If you don't explicitly declare them in your code, they are automatically generated (ref: Gang of Four).Zitat:
Zitat von jsharrad
-= Double Post =-
Because they are the same colour as the background?Zitat:
Zitat von JaSo PsP
No, ive sorted it now, the images created using createImage() dont work with blitAlphaImageToScreen(), i had to use blitImageToScreen() instead.Zitat:
Zitat von yaustar
The variable 'number' is also pointless as the outer-loop is incremented exactly the same way. Another thing I missed was he started his array at 1, not 0.Zitat:
Zitat von yaustar
So in short, this is what we think it is supposed to look like without fixing the compiler error:
Code:int actual_polygon = 0;
for(int i = 0; i < current_mesh; i++)
{
for(int b = 0; b < 3; b++)
{
test.vertexs[i][i] = vertexs[polygons[actual_polygon]];
actual_polygon++;
}
}