Newbie wanting help

General Programming help in C, C++ or ASM, Compiling / Debugging, and R3000A Central Processing Unit (CPU) information
Chris
Active PSXDEV User
Active PSXDEV User
Posts: 47
Joined: Jul 03, 2013
Location: USA
Contact:

Post by Chris » January 18th, 2015, 6:18 pm

So I tried doing this:

Code: Select all

    for(treea.x=-10;treea.x<200;treea.x=treea.x+40)
    {
         // if the tree is off the screen, update the position
         if (treea.x == 30) { treea.x = treesxscreen1[0]; treea.y = treesxscreen1[0]; }
         if (treea.x == 70) { treea.x = treesxscreen1[1]; treea.y = treesxscreen1[1]; }
         if (treea.x == 110) { treea.x = treesxscreen1[2]; treea.y = treesxscreen1[2]; }	
         if (treea.x == 150) { treea.x = treesxscreen1[3]; treea.y = treesxscreen1[3]; }
         if (treea.x == 190) { treea.x = treesxscreen1[4]; treea.y = treesxscreen1[4]; }	 
    }	
and it just puts one tree at 190,190.

User avatar
Shadow
Admin / PSXDEV
Admin / PSXDEV
Posts: 2670
Joined: Dec 31, 2012
PlayStation Model: H2000/5502
Discord: Shadow^PSXDEV

Post by Shadow » January 18th, 2015, 8:41 pm

Ensure it is in your entire program loop. The for loop may not be required as it was just an example. I don't know your code, but just play around and you will eventually figure it out. Just think logically, and use what you can in C to get it going :)
Development Console: SCPH-5502 with 8MB RAM, MM3 Modchip, PAL 60 Colour Modification (for NTSC), PSIO Switch Board, DB-9 breakout headers for both RGB and Serial output and an Xplorer with CAETLA 0.34.

PlayStation Development PC: Windows 98 SE, Pentium 3 at 400MHz, 128MB SDRAM, DTL-H2000, DTL-H2010, DTL-H201A, DTL-S2020 (with 4GB SCSI-2 HDD), 21" Sony G420, CD-R burner, 3.25" and 5.25" Floppy Diskette Drives, ZIP 100 Diskette Drive and an IBM Model M keyboard.

Chris
Active PSXDEV User
Active PSXDEV User
Posts: 47
Joined: Jul 03, 2013
Location: USA
Contact:

Post by Chris » January 19th, 2015, 12:02 pm

I've tried a lot of stuff and nothing seems to do anything. The best I could do was get five trees flashing, but I don't want them to do that, I want them to be all on the screen at once. Or is there a limit to how many sprites can be on the screen at one time? Link to my code is here:
http://www.atari2600land.com/jackandthebeanstalk/

Chris
Active PSXDEV User
Active PSXDEV User
Posts: 47
Joined: Jul 03, 2013
Location: USA
Contact:

Post by Chris » January 25th, 2015, 4:17 am

What nobody told me is I had to define each tree copy as its own sprite. If I do this, then why bother with the array and just define each tree with the treea.x and treea.y variables? I guess I could see where an array would come in handy for each screen, but I just did what I did for now. So I guess the next step is collision detection for the trees. I would have absolutely no idea how to do this. Will anyone help me?

User avatar
Greg
Serious PSXDEV User
Serious PSXDEV User
Posts: 101
Joined: Sep 09, 2013
PlayStation Model: SCPH-7501
Location: Port-au-Prince, HAITI

Post by Greg » January 25th, 2015, 6:25 am

Hello Chris,

I tried to compile your source, but the "main.h" file is missing.
1 x SCPH-7501, 2 x SCPH-7001, 2 x SCPH-5501
1 x Pro Action Replay with "Dual Rom Mod", ROM 1: Caetla, ROM 2: UNIROM
1 x Xplorer V2 with Caetla
1 x GameShark V2.1
1 x GameShark Pro V3.0
1 x CommLinkUSB
1 x XLinkUSB

Chris
Active PSXDEV User
Active PSXDEV User
Posts: 47
Joined: Jul 03, 2013
Location: USA
Contact:

Post by Chris » January 25th, 2015, 8:58 am

I didn't know you would need the .h file. I've added it on the website.

Chris
Active PSXDEV User
Active PSXDEV User
Posts: 47
Joined: Jul 03, 2013
Location: USA
Contact:

Post by Chris » March 10th, 2015, 4:25 pm

So I was going to ask for help with collision detection when I thought it out and I think this works OK. Took me at least a couple of hours, though. Link to the latest version is in my signature.

User avatar
Shadow
Admin / PSXDEV
Admin / PSXDEV
Posts: 2670
Joined: Dec 31, 2012
PlayStation Model: H2000/5502
Discord: Shadow^PSXDEV

Post by Shadow » March 10th, 2015, 4:50 pm

I just tested it on PSIO, and it works fine. I'm not sure what is going on, but it's pretty funny :)

When I press start on the "chicken cut-scene", the whole screen goes black and then flickers every 5 seconds.
Nothing else happens after that...

Here is an ISO of the PS-EXE dated March 9, 2015. It's licensed for Japan.
JACK.ISO
You do not have the required permissions to view the files attached to this post.
Development Console: SCPH-5502 with 8MB RAM, MM3 Modchip, PAL 60 Colour Modification (for NTSC), PSIO Switch Board, DB-9 breakout headers for both RGB and Serial output and an Xplorer with CAETLA 0.34.

PlayStation Development PC: Windows 98 SE, Pentium 3 at 400MHz, 128MB SDRAM, DTL-H2000, DTL-H2010, DTL-H201A, DTL-S2020 (with 4GB SCSI-2 HDD), 21" Sony G420, CD-R burner, 3.25" and 5.25" Floppy Diskette Drives, ZIP 100 Diskette Drive and an IBM Model M keyboard.

Chris
Active PSXDEV User
Active PSXDEV User
Posts: 47
Joined: Jul 03, 2013
Location: USA
Contact:

Post by Chris » March 10th, 2015, 5:16 pm

Nothing real exciting going on right now, just Jack walking among the trees. I tested this in PS7 and everything works fine, so I wonder what is going on with PSIO.

User avatar
Shadow
Admin / PSXDEV
Admin / PSXDEV
Posts: 2670
Joined: Dec 31, 2012
PlayStation Model: H2000/5502
Discord: Shadow^PSXDEV

Post by Shadow » March 10th, 2015, 7:12 pm

Have you tested in on real hardware before?
Development Console: SCPH-5502 with 8MB RAM, MM3 Modchip, PAL 60 Colour Modification (for NTSC), PSIO Switch Board, DB-9 breakout headers for both RGB and Serial output and an Xplorer with CAETLA 0.34.

PlayStation Development PC: Windows 98 SE, Pentium 3 at 400MHz, 128MB SDRAM, DTL-H2000, DTL-H2010, DTL-H201A, DTL-S2020 (with 4GB SCSI-2 HDD), 21" Sony G420, CD-R burner, 3.25" and 5.25" Floppy Diskette Drives, ZIP 100 Diskette Drive and an IBM Model M keyboard.

Chris
Active PSXDEV User
Active PSXDEV User
Posts: 47
Joined: Jul 03, 2013
Location: USA
Contact:

Post by Chris » March 10th, 2015, 7:24 pm

No, I don't know how.

User avatar
Shadow
Admin / PSXDEV
Admin / PSXDEV
Posts: 2670
Joined: Dec 31, 2012
PlayStation Model: H2000/5502
Discord: Shadow^PSXDEV

Post by Shadow » March 10th, 2015, 7:41 pm

Okay, it would be that you have developed and optimised it for use under PS7 which you should never do. Always program PlayStation games for the original hardware. Use PSXSERIAL (and make a cable) to test your game if you don't have an Xplorer. If you can't make a cable, I can make one for you. Just let me know :)
Development Console: SCPH-5502 with 8MB RAM, MM3 Modchip, PAL 60 Colour Modification (for NTSC), PSIO Switch Board, DB-9 breakout headers for both RGB and Serial output and an Xplorer with CAETLA 0.34.

PlayStation Development PC: Windows 98 SE, Pentium 3 at 400MHz, 128MB SDRAM, DTL-H2000, DTL-H2010, DTL-H201A, DTL-S2020 (with 4GB SCSI-2 HDD), 21" Sony G420, CD-R burner, 3.25" and 5.25" Floppy Diskette Drives, ZIP 100 Diskette Drive and an IBM Model M keyboard.

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests