chore: Use UNIX line endings

This commit is contained in:
Antonio Niño Díaz 2025-01-06 22:43:23 +00:00
parent af225bd7e0
commit 59700b44de
699 changed files with 46881 additions and 46881 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,34 +1,34 @@
PAlib documentation folder PAlib documentation folder
========================== ==========================
Instructions for normal users Instructions for normal users
----------------------------- -----------------------------
This directory contains the PAlib documentation in two languages, This directory contains the PAlib documentation in two languages,
English and French. Just go to the subfolder of your choice to English and French. Just go to the subfolder of your choice to
pick a language. pick a language.
Each language subfolder has three versions of the documentation: Each language subfolder has three versions of the documentation:
- PAlib.chm - The CHM version for use with Windows. - PAlib.chm - The CHM version for use with Windows.
- PAlib.pdf - The printable PDF version. - PAlib.pdf - The printable PDF version.
- /html/ subfolder - The browsable HTML version. - /html/ subfolder - The browsable HTML version.
Instructions for developers Instructions for developers
--------------------------- ---------------------------
The folder dev contains tools/scripts to generate the documentation. The folder dev contains tools/scripts to generate the documentation.
By default it's set up for a Windows system with PAlib installed in By default it's set up for a Windows system with PAlib installed in
the folder C:\devkitPro\PAlib, but you can adapt it by: the folder C:\devkitPro\PAlib, but you can adapt it by:
- Changing the STRIP_FROM_PATH and the HHC_LOCATION variable. - Changing the STRIP_FROM_PATH and the HHC_LOCATION variable.
- Disabling the .chm creation support (GENERATE_HTMLHELP = NO) - Disabling the .chm creation support (GENERATE_HTMLHELP = NO)
because it depends on a Windows executable. because it depends on a Windows executable.
To generate the documentation you need the following installed: To generate the documentation you need the following installed:
- Doxygen - Doxygen
- MikTeX on Windows or pdfTeX on other OSes - MikTeX on Windows or pdfTeX on other OSes
Just run the appropiate batch file on Windows or follow these steps: Just run the appropiate batch file on Windows or follow these steps:
- Run "doxygen Doxyfile_[Language]" where Language is the language - Run "doxygen Doxyfile_[Language]" where Language is the language
you want to generate the documentation for. you want to generate the documentation for.
- Run make on the [Language]/latex folder. - Run make on the [Language]/latex folder.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1 +1 @@
include ../../../Makefile_example include ../../../Makefile_example

View File

@ -1,17 +1,17 @@
//Gfx converted using Mollusk's PAGfx Converter //Gfx converted using Mollusk's PAGfx Converter
//This file contains all the .h, for easier inclusion in a project //This file contains all the .h, for easier inclusion in a project
#ifndef ALL_GFX_H #ifndef ALL_GFX_H
#define ALL_GFX_H #define ALL_GFX_H
// Sprite files : // Sprite files :
extern const unsigned char ropes_Sprite[192] __attribute__ ((aligned (4))) ; // Pal : ropes_Pal extern const unsigned char ropes_Sprite[192] __attribute__ ((aligned (4))) ; // Pal : ropes_Pal
// Palette files : // Palette files :
extern const unsigned short ropes_Pal[7] __attribute__ ((aligned (4))) ; extern const unsigned short ropes_Pal[7] __attribute__ ((aligned (4))) ;
#endif #endif

View File

@ -1,18 +1,18 @@
//Sprite created using PAGfx //Sprite created using PAGfx
//This sprite uses ropes_Pal //This sprite uses ropes_Pal
const unsigned char ropes_Sprite[192] __attribute__ ((aligned (4))) = { const unsigned char ropes_Sprite[192] __attribute__ ((aligned (4))) = {
0, 33, 3, 0, 0, 32, 84, 0, 0, 0, 81, 2, 0, 0, 66, 5, 0, 33, 3, 0, 0, 32, 84, 0, 0, 0, 81, 2, 0, 0, 66, 5,
0, 0, 81, 2, 0, 0, 97, 3, 0, 16, 33, 0, 0, 19, 2, 0, 0, 0, 81, 2, 0, 0, 97, 3, 0, 16, 33, 0, 0, 19, 2, 0,
48, 19, 0, 0, 53, 3, 0, 0, 35, 3, 0, 0, 85, 3, 0, 0, 48, 19, 0, 0, 53, 3, 0, 0, 35, 3, 0, 0, 85, 3, 0, 0,
35, 1, 0, 0, 101, 2, 0, 0, 48, 18, 0, 0, 0, 101, 2, 0, 35, 1, 0, 0, 101, 2, 0, 0, 48, 18, 0, 0, 0, 101, 2, 0,
0, 0, 81, 2, 0, 16, 33, 0, 0, 19, 2, 0, 48, 19, 0, 0, 0, 0, 81, 2, 0, 16, 33, 0, 0, 19, 2, 0, 48, 19, 0, 0,
80, 3, 0, 0, 35, 3, 0, 0, 85, 3, 0, 0, 35, 1, 0, 0, 80, 3, 0, 0, 35, 3, 0, 0, 85, 3, 0, 0, 35, 1, 0, 0,
101, 2, 0, 0, 48, 18, 0, 0, 0, 101, 2, 0, 0, 33, 3, 0, 101, 2, 0, 0, 48, 18, 0, 0, 0, 101, 2, 0, 0, 33, 3, 0,
0, 32, 84, 0, 0, 0, 50, 3, 0, 0, 65, 5, 0, 0, 49, 2, 0, 32, 84, 0, 0, 0, 50, 3, 0, 0, 65, 5, 0, 0, 49, 2,
50, 1, 0, 0, 53, 3, 0, 0, 35, 3, 0, 0, 66, 2, 0, 0, 50, 1, 0, 0, 53, 3, 0, 0, 35, 3, 0, 0, 66, 2, 0, 0,
32, 50, 0, 0, 32, 86, 0, 0, 0, 33, 2, 0, 0, 48, 86, 0, 32, 50, 0, 0, 32, 86, 0, 0, 0, 33, 2, 0, 0, 48, 86, 0,
0, 0, 33, 2, 0, 0, 98, 5, 0, 0, 49, 2, 0, 0, 33, 5, 0, 0, 33, 2, 0, 0, 98, 5, 0, 0, 49, 2, 0, 0, 33, 5,
0, 16, 33, 0, 0, 51, 1, 0, 48, 19, 0, 0, 50, 3, 0, 0 0, 16, 33, 0, 0, 51, 1, 0, 48, 19, 0, 0, 50, 3, 0, 0
}; };

View File

@ -1,4 +1,4 @@
//Palette created using Mollusk's PAGfxConverter //Palette created using Mollusk's PAGfxConverter
const unsigned short ropes_Pal[7] __attribute__ ((aligned (4))) = { const unsigned short ropes_Pal[7] __attribute__ ((aligned (4))) = {
000000, 52488, 58929, 54668, 65535, 63157, 65403}; 000000, 52488, 58929, 54668, 65535, 63157, 65403};

View File

@ -1,39 +1,39 @@
// Includes // Includes
#include <PA9.h> // Include for PA_Lib #include <PA9.h> // Include for PA_Lib
#include "all_gfx.h" #include "all_gfx.h"
// Function: main() // Function: main()
int main() int main()
{ {
PA_Init(); // Initializes PA_Lib PA_Init(); // Initializes PA_Lib
PA_Init16cBg(0, 2); //Initializes a 16 color bg PA_Init16cBg(0, 2); //Initializes a 16 color bg
PA_LoadPal16c(PAL_BG0, ropes_Pal); //And loads its palette PA_LoadPal16c(PAL_BG0, ropes_Pal); //And loads its palette
PA_16cErase(0); //Clear bg before start drawing PA_16cErase(0); //Clear bg before start drawing
u8 i=0; // position of our rope, from bottom u8 i=0; // position of our rope, from bottom
u8 j=0; // step of our animation u8 j=0; // step of our animation
u8 frames=0; //frames rendered, usefull to do animation timing u8 frames=0; //frames rendered, usefull to do animation timing
// Infinite loop to keep the program running // Infinite loop to keep the program running
while (1) while (1)
{ {
i+=1; //Move the rope up 1 pixels i+=1; //Move the rope up 1 pixels
if (i>192) i=0; //If the rope has hit the top of the screen, start again from bottom if (i>192) i=0; //If the rope has hit the top of the screen, start again from bottom
if (++frames==20) //If we have render 20 consecutive frames if (++frames==20) //If we have render 20 consecutive frames
{ {
j=j+64; //Change animation to next frame j=j+64; //Change animation to next frame
// ropes_Sprite has three 8x16 pixels frames, so each frame is (8x16)/2 = 64 bytes (since each pixels is 4bits) // ropes_Sprite has three 8x16 pixels frames, so each frame is (8x16)/2 = 64 bytes (since each pixels is 4bits)
// so our stride on the animation image is 64. // so our stride on the animation image is 64.
if (j>128) j=0;//Check frame limit (only 3 frames on this animation) if (j>128) j=0;//Check frame limit (only 3 frames on this animation)
frames=0; //Reset frame counter frames=0; //Reset frame counter
} }
PA_WaitForVBL(); //Typical wait for vertical blank... PA_WaitForVBL(); //Typical wait for vertical blank...
PA_16cErase(0); //Erase background (if there is only one row like in this example, you should erase only the space ocupped by the row). PA_16cErase(0); //Erase background (if there is only one row like in this example, you should erase only the space ocupped by the row).
PA_16c8Xi(0,125,192-i,(u32*)(ropes_Sprite+j),i); //Draw the row. PA_16c8Xi(0,125,192-i,(u32*)(ropes_Sprite+j),i); //Draw the row.
} }
return 0; return 0;
} // End of main() } // End of main()

View File

@ -1 +1 @@
include ../../../Makefile_example include ../../../Makefile_example

View File

@ -1,19 +1,19 @@
// Graphics converted using PAGfx by Mollusk. // Graphics converted using PAGfx by Mollusk.
#pragma once #pragma once
#include <PA_BgStruct.h> #include <PA_BgStruct.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C"{ extern "C"{
#endif #endif
// Sprites: // Sprites:
extern const unsigned char shot_Sprite[32] _GFX_ALIGN; // Palette: shot_Pal extern const unsigned char shot_Sprite[32] _GFX_ALIGN; // Palette: shot_Pal
// Palettes: // Palettes:
extern const unsigned short shot_Pal[256] _GFX_ALIGN; extern const unsigned short shot_Pal[256] _GFX_ALIGN;
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -1,73 +1,73 @@
// Includes // Includes
#include <PA9.h> // Include for PA_Lib #include <PA9.h> // Include for PA_Lib
#include "all_gfx.h" #include "all_gfx.h"
#define N_SHOTS 400 // number of shots #define N_SHOTS 400 // number of shots
typedef struct{ typedef struct{
u8 screen; u8 screen;
s16 screenx, screeny; s16 screenx, screeny;
s32 x, y, vx, vy; s32 x, y, vx, vy;
} shottype; } shottype;
shottype shots[N_SHOTS]; // Have 200 shots... shottype shots[N_SHOTS]; // Have 200 shots...
// Function: main() // Function: main()
int main() int main()
{ {
PA_Init(); // Initializes PA_Lib PA_Init(); // Initializes PA_Lib
// Init a 16c background for both screens // Init a 16c background for both screens
PA_InitComplete16c(1, // background number to use PA_InitComplete16c(1, // background number to use
(void*)shot_Pal); // palette to use... (void*)shot_Pal); // palette to use...
s32 i; s32 i;
// Fill shots with random postions and directions... // Fill shots with random postions and directions...
for (i = 0; i < N_SHOTS; i++){ for (i = 0; i < N_SHOTS; i++){
shots[i].x = 8+PA_Rand()%240; shots[i].x = shots[i].x << 8; // 8 bit fixed point shots[i].x = 8+PA_Rand()%240; shots[i].x = shots[i].x << 8; // 8 bit fixed point
shots[i].y = 8+PA_Rand()%366; shots[i].y = shots[i].y << 8; shots[i].y = 8+PA_Rand()%366; shots[i].y = shots[i].y << 8;
shots[i].screen = 0; shots[i].screenx = 256; shots[i].screeny = 0; // hide sprite at first shots[i].screen = 0; shots[i].screenx = 256; shots[i].screeny = 0; // hide sprite at first
s16 angle = PA_Rand()%512; s16 angle = PA_Rand()%512;
shots[i].vx = PA_Cos(angle); shots[i].vx = PA_Cos(angle);
shots[i].vy = -PA_Sin(angle); shots[i].vy = -PA_Sin(angle);
} }
// Infinite loop to keep the program running // Infinite loop to keep the program running
while (1) while (1)
{ {
// Move shots // Move shots
for (i = 0; i < N_SHOTS; i++) { for (i = 0; i < N_SHOTS; i++) {
// Add speed... // Add speed...
shots[i].x += shots[i].vx; shots[i].x += shots[i].vx;
shots[i].y += shots[i].vy; shots[i].y += shots[i].vy;
// Screen positions // Screen positions
shots[i].screenx = (shots[i].x >> 8); // screen position... shots[i].screenx = (shots[i].x >> 8); // screen position...
shots[i].screeny = (shots[i].y >> 8); // same here... shots[i].screeny = (shots[i].y >> 8); // same here...
// Adjust speed to avoid moving out of screen... // Adjust speed to avoid moving out of screen...
if((shots[i].screenx < 4)||(shots[i].screenx > 256-4)) shots[i].vx = -shots[i].vx; if((shots[i].screenx < 4)||(shots[i].screenx > 256-4)) shots[i].vx = -shots[i].vx;
if((shots[i].screeny < 4)||(shots[i].screeny > 387)) shots[i].vy = -shots[i].vy; if((shots[i].screeny < 4)||(shots[i].screeny > 387)) shots[i].vy = -shots[i].vy;
// See on which screen we'll display it... // See on which screen we'll display it...
if(shots[i].screeny < 199) shots[i].screen = 1; // top screen if(shots[i].screeny < 199) shots[i].screen = 1; // top screen
else { else {
shots[i].screen = 0; // bottom screen shots[i].screen = 0; // bottom screen
shots[i].screeny = shots[i].screeny-200; // 8pixel space between screens, just for the sake of it ! shots[i].screeny = shots[i].screeny-200; // 8pixel space between screens, just for the sake of it !
} }
} }
PA_WaitForVBL(); PA_WaitForVBL();
PA_Dual16cErase(); // Erase both screens right after VBL... PA_Dual16cErase(); // Erase both screens right after VBL...
// Display shots... must be done RIGHT AFTER the erase... // Display shots... must be done RIGHT AFTER the erase...
for (i = 0; i < N_SHOTS; i++) PA_16c8X8(shots[i].screen, shots[i].screenx-4, shots[i].screeny-4, (void*)shot_Sprite); for (i = 0; i < N_SHOTS; i++) PA_16c8X8(shots[i].screen, shots[i].screenx-4, shots[i].screeny-4, (void*)shot_Sprite);
} }
return 0; return 0;
} // End of main() } // End of main()

View File

@ -1 +1 @@
include ../../../Makefile_example include ../../../Makefile_example

View File

@ -1,42 +1,42 @@
// Includes // Includes
#include <PA9.h> // Include for PA_Lib #include <PA9.h> // Include for PA_Lib
// Function: main() // Function: main()
int main() int main()
{ {
PA_Init(); // Initializes PA_Lib PA_Init(); // Initializes PA_Lib
PA_Init16cBg(0, 3); PA_Init16cBg(1, 3); // 16 color background init with default colors for text PA_Init16cBg(0, 3); PA_Init16cBg(1, 3); // 16 color background init with default colors for text
PA_16cText(1, //screen PA_16cText(1, //screen
10, 10, 255, 20, //x1, y1, x2, y2 position 10, 10, 255, 20, //x1, y1, x2, y2 position
"Hello World", //text "Hello World", //text
1, //color (1-10) 1, //color (1-10)
0, // text size (0-4) 0, // text size (0-4)
100); // maximum number of characters (use like 10000 if you don't know) 100); // maximum number of characters (use like 10000 if you don't know)
PA_16cText(1, 10, 25, 255, 40, "Hello World", 1, 1, 100); PA_16cText(1, 10, 25, 255, 40, "Hello World", 1, 1, 100);
PA_16cText(1, 10, 40, 255, 60, "Hello World", 1, 2, 100); PA_16cText(1, 10, 40, 255, 60, "Hello World", 1, 2, 100);
PA_16cText(1, 10, 60, 255, 80, "Hello World", 1, 3, 100); PA_16cText(1, 10, 60, 255, 80, "Hello World", 1, 3, 100);
PA_16cText(1, 10, 80, 255, 100, "Hello World", 1, 4, 100); PA_16cText(1, 10, 80, 255, 100, "Hello World", 1, 4, 100);
u8 i; u8 i;
// Different colors on the bottom sreen... // Different colors on the bottom sreen...
for (i = 0; i < 10; i++){ for (i = 0; i < 10; i++){
PA_16cText(0, 10, i*20, 255, i*20 + 20, "Hello World", i+1, 3, 100); PA_16cText(0, 10, i*20, 255, i*20 + 20, "Hello World", i+1, 3, 100);
} }
// Infinite loop to keep the program running // Infinite loop to keep the program running
while (1) while (1)
{ {
PA_WaitForVBL(); PA_WaitForVBL();
} }
return 0; return 0;
} // End of main() } // End of main()

View File

@ -1 +1 @@
include ../../../Makefile_example include ../../../Makefile_example

View File

@ -1,36 +1,36 @@
// Includes // Includes
#include <PA9.h> // Include for PA_Lib #include <PA9.h> // Include for PA_Lib
#include <stdio.h> // standard lib for texts... #include <stdio.h> // standard lib for texts...
char text[200]; char text[200];
// Function: main() // Function: main()
int main() int main()
{ {
PA_Init(); // Initializes PA_Lib PA_Init(); // Initializes PA_Lib
PA_Init16cBg(0, 3); PA_Init16cBg(1, 3); // 16 color background init with default colors for text PA_Init16cBg(0, 3); PA_Init16cBg(1, 3); // 16 color background init with default colors for text
// Infinite loop to keep the program running // Infinite loop to keep the program running
while (1) while (1)
{ {
sprintf(text, // string to use sprintf(text, // string to use
"%02d/%02d/%02d", PA_RTC.Day, PA_RTC.Month, PA_RTC.Year); // String to transform "%02d/%02d/%02d", PA_RTC.Day, PA_RTC.Month, PA_RTC.Year); // String to transform
PA_16cText(0, 10, 20, 255, 40, text, 1, 3, 100); // Display the text transformed :) PA_16cText(0, 10, 20, 255, 40, text, 1, 3, 100); // Display the text transformed :)
// And the time... // And the time...
sprintf(text, "%02d:%02d %02d seconds", PA_RTC.Hour, PA_RTC.Minutes, PA_RTC.Seconds); sprintf(text, "%02d:%02d %02d seconds", PA_RTC.Hour, PA_RTC.Minutes, PA_RTC.Seconds);
PA_16cText(0, 10, 40, 255, 60, text, 1, 3, 100); // Display the text transformed :) PA_16cText(0, 10, 40, 255, 60, text, 1, 3, 100); // Display the text transformed :)
PA_WaitForVBL(); PA_WaitForVBL();
PA_16cErase(0); PA_16cErase(0);
} }
return 0; return 0;
} // End of main() } // End of main()

View File

@ -1 +1 @@
include ../../../Makefile_example include ../../../Makefile_example

View File

@ -1,34 +1,34 @@
// Includes // Includes
#include <PA9.h> // Include for PA_Lib #include <PA9.h> // Include for PA_Lib
// Function: main() // Function: main()
int main() int main()
{ {
PA_Init(); // Initializes PA_Lib PA_Init(); // Initializes PA_Lib
PA_LoadDefaultText(0, 0); PA_LoadDefaultText(0, 0);
PA_Init16cBg(0, 3); PA_Init16cBg(1, 3); // 16 color background init with default colors for text PA_Init16cBg(0, 3); PA_Init16cBg(1, 3); // 16 color background init with default colors for text
PA_16cTextAlign(ALIGN_LEFT); PA_16cTextAlign(ALIGN_LEFT);
PA_16cText(1, 0, 10, 255, 50, "Left aligned text, blabla, blabla, life is life, and if you don't like PAlib, just don't use it and stop ditching... More blabla to make the text long enough to test the text system.", 1, 2, 1000); PA_16cText(1, 0, 10, 255, 50, "Left aligned text, blabla, blabla, life is life, and if you don't like PAlib, just don't use it and stop ditching... More blabla to make the text long enough to test the text system.", 1, 2, 1000);
PA_16cTextAlign(ALIGN_RIGHT); PA_16cTextAlign(ALIGN_RIGHT);
PA_16cText(1, 0, 50, 255, 90, "Right aligned text, blabla, blabla, life is life, and if you don't like PAlib, just don't use it and stop ditching... More blabla to make the text long enough to test the text system.", 1, 2, 1000); PA_16cText(1, 0, 50, 255, 90, "Right aligned text, blabla, blabla, life is life, and if you don't like PAlib, just don't use it and stop ditching... More blabla to make the text long enough to test the text system.", 1, 2, 1000);
PA_16cTextAlign(ALIGN_CENTER); PA_16cTextAlign(ALIGN_CENTER);
PA_16cText(1, 0, 90, 255, 130, "Centered text, blabla, blabla, life is life, and if you don't like PAlib, just don't use it and stop ditching... More blabla to make the text long enough to test the text system.", 1, 2, 1000); PA_16cText(1, 0, 90, 255, 130, "Centered text, blabla, blabla, life is life, and if you don't like PAlib, just don't use it and stop ditching... More blabla to make the text long enough to test the text system.", 1, 2, 1000);
PA_16cTextAlign(ALIGN_JUSTIFY); PA_16cTextAlign(ALIGN_JUSTIFY);
PA_16cText(1, 0, 130, 255, 180, "Justified text, blabla, blabla, life is life, and if you don't like PAlib, just don't use it and stop ditching... More blabla to make the text long enough to test the text system.", 1, 2, 1000); PA_16cText(1, 0, 130, 255, 180, "Justified text, blabla, blabla, life is life, and if you don't like PAlib, just don't use it and stop ditching... More blabla to make the text long enough to test the text system.", 1, 2, 1000);
// Infinite loop to keep the program running // Infinite loop to keep the program running
while (1) while (1)
{ {
PA_WaitForVBL(); PA_WaitForVBL();
} }
return 0; return 0;
} // End of main() } // End of main()

View File

@ -1 +1 @@
include ../../../Makefile_example include ../../../Makefile_example

View File

@ -1,19 +1,19 @@
// Graphics converted using PAGfx by Mollusk. // Graphics converted using PAGfx by Mollusk.
#pragma once #pragma once
#include <PA_BgStruct.h> #include <PA_BgStruct.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C"{ extern "C"{
#endif #endif
// Backgrounds: // Backgrounds:
extern const PA_BgStruct bigfont; extern const PA_BgStruct bigfont;
extern const PA_BgStruct smallfont; extern const PA_BgStruct smallfont;
// Palettes: // Palettes:
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -1,17 +1,17 @@
#include <PA_BgStruct.h> #include <PA_BgStruct.h>
extern const char bigfont_Tiles[]; extern const char bigfont_Tiles[];
extern const char bigfont_Map[]; extern const char bigfont_Map[];
extern const char bigfont_Sizes[]; extern const char bigfont_Sizes[];
const PA_BgStruct bigfont = { const PA_BgStruct bigfont = {
PA_Font4bit, PA_Font4bit,
512, 128, 512, 128,
bigfont_Tiles, bigfont_Tiles,
bigfont_Map, bigfont_Map,
{bigfont_Sizes}, {bigfont_Sizes},
8256, 8256,
{14} {14}
}; };

View File

@ -1,17 +1,17 @@
#include <PA_BgStruct.h> #include <PA_BgStruct.h>
extern const char smallfont_Tiles[]; extern const char smallfont_Tiles[];
extern const char smallfont_Map[]; extern const char smallfont_Map[];
extern const char smallfont_Sizes[]; extern const char smallfont_Sizes[];
const PA_BgStruct smallfont = { const PA_BgStruct smallfont = {
PA_Font4bit, PA_Font4bit,
256, 64, 256, 64,
smallfont_Tiles, smallfont_Tiles,
smallfont_Map, smallfont_Map,
{smallfont_Sizes}, {smallfont_Sizes},
3168, 3168,
{6} {6}
}; };

View File

@ -1,31 +1,31 @@
#include <PA9.h> #include <PA9.h>
// Include the newly converted fonts... // Include the newly converted fonts...
#include "all_gfx.h" #include "all_gfx.h"
int main(){ int main(){
int i; int i;
PA_Init(); PA_Init();
// 16 color background init with default colors for text // 16 color background init with default colors for text
PA_Init16cBg(0, 3); PA_Init16cBg(0, 3);
PA_Init16cBg(1, 3); PA_Init16cBg(1, 3);
// Slots 0-4 are already used by default PAlib fonts, so we'll load on slots 5 and 6. // Slots 0-4 are already used by default PAlib fonts, so we'll load on slots 5 and 6.
// Available slots : 5-9. You can overwrite a PAlib font though if you want to use slot 0 for example... // Available slots : 5-9. You can overwrite a PAlib font though if you want to use slot 0 for example...
PA_Add16cFont(5, &smallfont); PA_Add16cFont(5, &smallfont);
PA_Add16cFont(6, &bigfont); PA_Add16cFont(6, &bigfont);
PA_16cText(1, 10, 25, 255, 40, "Small custom font...", 1, 5, 100); PA_16cText(1, 10, 25, 255, 40, "Small custom font...", 1, 5, 100);
PA_16cText(1, 10, 40, 255, 60, "Big custom font...", 1, 6, 100); PA_16cText(1, 10, 40, 255, 60, "Big custom font...", 1, 6, 100);
// Different colors on the bottom sreen... // Different colors on the bottom sreen...
for (i = 0; i < 10; i++) for (i = 0; i < 10; i++)
PA_16cText(0, 10, i*20, 255, i*20 + 20, "Hello World", i+1, 6, 100); PA_16cText(0, 10, i*20, 255, i*20 + 20, "Hello World", i+1, 6, 100);
// Infinite loop to keep the program running // Infinite loop to keep the program running
while(true){ while(true){
PA_WaitForVBL(); PA_WaitForVBL();
} }
} }

View File

@ -1 +1 @@
include ../../Makefile_example include ../../Makefile_example

View File

@ -1,20 +1,20 @@
// Graphics converted using PAGfx by Mollusk. // Graphics converted using PAGfx by Mollusk.
#pragma once #pragma once
#include <PA_BgStruct.h> #include <PA_BgStruct.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C"{ extern "C"{
#endif #endif
// Sprites: // Sprites:
extern const unsigned char mollusk_Texture[4096] _GFX_ALIGN; // 16bit texture extern const unsigned char mollusk_Texture[4096] _GFX_ALIGN; // 16bit texture
extern const unsigned char AnarX_Texture[4096] _GFX_ALIGN; // 16bit texture extern const unsigned char AnarX_Texture[4096] _GFX_ALIGN; // 16bit texture
extern const unsigned char Abrexxes_Texture[4096] _GFX_ALIGN; // 16bit texture extern const unsigned char Abrexxes_Texture[4096] _GFX_ALIGN; // 16bit texture
// Palettes: // Palettes:
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -1,79 +1,79 @@
/* /*
// 3D Sprite Moving example... // 3D Sprite Moving example...
*/ */
// Includes // Includes
#include <PA9.h> // Include for PA_Lib #include <PA9.h> // Include for PA_Lib
#include "all_gfx.h" #include "all_gfx.h"
#define N_SPRITES 1024 // Number of sprites in the example #define N_SPRITES 1024 // Number of sprites in the example
u16 gfx[3]; u16 gfx[3];
typedef struct{ typedef struct{
s32 x, y, vx, vy; s32 x, y, vx, vy;
} spritepos; } spritepos;
spritepos sprites[1024]; // Let's manage the sprite positions ^^ spritepos sprites[1024]; // Let's manage the sprite positions ^^
// Function: main() // Function: main()
int main(void) int main(void)
{ {
PA_Init(); // Initializes PA_Lib PA_Init(); // Initializes PA_Lib
PA_Init3D(); // Uses Bg0 PA_Init3D(); // Uses Bg0
PA_Reset3DSprites(); PA_Reset3DSprites();
// Initialise the text system on the top screen // Initialise the text system on the top screen
PA_LoadDefaultText(0, 1); PA_LoadDefaultText(0, 1);
PA_LoadDefaultText(1, 1); // Initialise the text system on the top screen PA_LoadDefaultText(1, 1); // Initialise the text system on the top screen
PA_OutputSimpleText(1, 2, 6, " 3d Sprite Example, 1024 64x64sprites resized to 16x16 and moving around !"); PA_OutputSimpleText(1, 2, 6, " 3d Sprite Example, 1024 64x64sprites resized to 16x16 and moving around !");
// First, create the gfx with the corresponding images and sizes. Images converted as 16bit textures in PAGfx // First, create the gfx with the corresponding images and sizes. Images converted as 16bit textures in PAGfx
gfx[0] = PA_3DCreateTex((void*)mollusk_Texture, // Texture gfx[0] = PA_3DCreateTex((void*)mollusk_Texture, // Texture
64, 64, // Width, Height 64, 64, // Width, Height
TEX_16BITS ); // Texture Format TEX_16BITS ); // Texture Format
gfx[1] = PA_3DCreateTex((void*)AnarX_Texture, 64, 64, TEX_16BITS); gfx[1] = PA_3DCreateTex((void*)AnarX_Texture, 64, 64, TEX_16BITS);
gfx[2] = PA_3DCreateTex((void*)Abrexxes_Texture, 64, 64, TEX_16BITS); gfx[2] = PA_3DCreateTex((void*)Abrexxes_Texture, 64, 64, TEX_16BITS);
s32 i; s32 i;
u16 angle; u16 angle;
for(i = 0; i < N_SPRITES; i++) { for(i = 0; i < N_SPRITES; i++) {
sprites[i].x = 16+(PA_Rand()%224); sprites[i].x = 16+(PA_Rand()%224);
sprites[i].y = 16+(PA_Rand()%160); sprites[i].y = 16+(PA_Rand()%160);
PA_3DCreateSpriteFromTex(i, // Sprite number PA_3DCreateSpriteFromTex(i, // Sprite number
gfx[PA_Rand()%3], // Gfx, random one :p gfx[PA_Rand()%3], // Gfx, random one :p
64, 64, // Width, Height 64, 64, // Width, Height
0, // Palette 0, // Palette
sprites[i].x, sprites[i].y); // X, Y sprites[i].x, sprites[i].y); // X, Y
PA_3DSetSpriteWidthHeight(i, 16, 16); // Resize to way smaller ^^ PA_3DSetSpriteWidthHeight(i, 16, 16); // Resize to way smaller ^^
angle = PA_Rand()&511; // random angle angle = PA_Rand()&511; // random angle
sprites[i].vx = PA_Cos(angle)>>7; sprites[i].vx = PA_Cos(angle)>>7;
sprites[i].vy = -PA_Sin(angle)>>7; sprites[i].vy = -PA_Sin(angle)>>7;
} }
while(1) { while(1) {
for(i = 0; i < N_SPRITES; i++){ // Move them around and change speed if touches screen for(i = 0; i < N_SPRITES; i++){ // Move them around and change speed if touches screen
sprites[i].x += sprites[i].vx; sprites[i].x += sprites[i].vx;
if(((sprites[i].x <= 8)&&(sprites[i].vx < 0))||((sprites[i].x>=255-8)&&(sprites[i].vx > 0))) sprites[i].vx = -sprites[i].vx; if(((sprites[i].x <= 8)&&(sprites[i].vx < 0))||((sprites[i].x>=255-8)&&(sprites[i].vx > 0))) sprites[i].vx = -sprites[i].vx;
sprites[i].y += sprites[i].vy; sprites[i].y += sprites[i].vy;
if(((sprites[i].y <= 8)&&(sprites[i].vy < 0))||((sprites[i].y>=191-8)&&(sprites[i].vy > 0))) sprites[i].vy = -sprites[i].vy; if(((sprites[i].y <= 8)&&(sprites[i].vy < 0))||((sprites[i].y>=191-8)&&(sprites[i].vy > 0))) sprites[i].vy = -sprites[i].vy;
PA_3DSetSpriteXY(i, sprites[i].x, sprites[i].y); // Set new position PA_3DSetSpriteXY(i, sprites[i].x, sprites[i].y); // Set new position
} }
PA_WaitForVBL(); PA_WaitForVBL();
PA_3DProcess(); // Update 3DSprites PA_3DProcess(); // Update 3DSprites
} }
return 0; return 0;
} // End of main() } // End of main()

View File

@ -1 +1 @@
include ../../../Makefile_example include ../../../Makefile_example

View File

@ -1,20 +1,20 @@
// Graphics converted using PAGfx by Mollusk. // Graphics converted using PAGfx by Mollusk.
#pragma once #pragma once
#include <PA_BgStruct.h> #include <PA_BgStruct.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C"{ extern "C"{
#endif #endif
// Sprites: // Sprites:
extern const unsigned char mollusk_Texture[4096] _GFX_ALIGN; // 16bit texture extern const unsigned char mollusk_Texture[4096] _GFX_ALIGN; // 16bit texture
extern const unsigned char AnarX_Texture[4096] _GFX_ALIGN; // 16bit texture extern const unsigned char AnarX_Texture[4096] _GFX_ALIGN; // 16bit texture
extern const unsigned char Abrexxes_Texture[4096] _GFX_ALIGN; // 16bit texture extern const unsigned char Abrexxes_Texture[4096] _GFX_ALIGN; // 16bit texture
// Palettes: // Palettes:
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -1,57 +1,57 @@
/* /*
// 3DCreateSprite // 3DCreateSprite
*/ */
// Includes // Includes
#include <PA9.h> // Include for PA_Lib #include <PA9.h> // Include for PA_Lib
#include "all_gfx.h" #include "all_gfx.h"
u16 gfx[3]; u16 gfx[3];
// Function: main() // Function: main()
int main() int main()
{ {
PA_Init(); // Initializes PA_Lib PA_Init(); // Initializes PA_Lib
PA_Init3D(); // Uses Bg0, Init 3D... PA_Init3D(); // Uses Bg0, Init 3D...
PA_Reset3DSprites(); // Init or Reset 3D Sprites PA_Reset3DSprites(); // Init or Reset 3D Sprites
// Initialise the text system on the top screen // Initialise the text system on the top screen
PA_LoadDefaultText(1, 1); // Initialise the text system on the top screen PA_LoadDefaultText(1, 1); // Initialise the text system on the top screen
PA_OutputSimpleText(1, 2, 6, " 3DSprites Example : 16bits"); PA_OutputSimpleText(1, 2, 6, " 3DSprites Example : 16bits");
// First, create the gfx with the corresponding images and sizes. Images converted as 16bit textures in PAGfx // First, create the gfx with the corresponding images and sizes. Images converted as 16bit textures in PAGfx
gfx[0] = PA_3DCreateTex((void*)mollusk_Texture, // Texture gfx[0] = PA_3DCreateTex((void*)mollusk_Texture, // Texture
64, 64, // Width, Height 64, 64, // Width, Height
TEX_16BITS ); // Texture Format TEX_16BITS ); // Texture Format
gfx[1] = PA_3DCreateTex((void*)AnarX_Texture, 64, 64, TEX_16BITS); gfx[1] = PA_3DCreateTex((void*)AnarX_Texture, 64, 64, TEX_16BITS);
gfx[2] = PA_3DCreateTex((void*)Abrexxes_Texture, 64, 64, TEX_16BITS); gfx[2] = PA_3DCreateTex((void*)Abrexxes_Texture, 64, 64, TEX_16BITS);
// Create 3 sprites... // Create 3 sprites...
PA_3DCreateSpriteFromTex(0, // Sprite number PA_3DCreateSpriteFromTex(0, // Sprite number
gfx[0], // Gfx... gfx[0], // Gfx...
64, 64, // Width, Height 64, 64, // Width, Height
0, // Palette, unused in 16bit... 0, // Palette, unused in 16bit...
32, 32); // X, Y SPRITE CENTER ! 32, 32); // X, Y SPRITE CENTER !
PA_3DCreateSpriteFromTex(1, gfx[1], 64, 64, 0, 96, 96); PA_3DCreateSpriteFromTex(1, gfx[1], 64, 64, 0, 96, 96);
PA_3DCreateSpriteFromTex(2, gfx[2], 64, 64, 0, 160, 96+64); PA_3DCreateSpriteFromTex(2, gfx[2], 64, 64, 0, 160, 96+64);
while(1) { while(1) {
PA_WaitForVBL(); PA_WaitForVBL();
PA_3DProcess(); // Update sprites PA_3DProcess(); // Update sprites
} }
return 0; return 0;
} // End of main() } // End of main()

View File

@ -1 +1 @@
include ../../../Makefile_example include ../../../Makefile_example

View File

@ -1,23 +1,23 @@
// Graphics converted using PAGfx by Mollusk. // Graphics converted using PAGfx by Mollusk.
#pragma once #pragma once
#include <PA_BgStruct.h> #include <PA_BgStruct.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C"{ extern "C"{
#endif #endif
// Sprites: // Sprites:
extern const unsigned char mollusk_Texture[2048] _GFX_ALIGN; // Palette: mollusk_Pal extern const unsigned char mollusk_Texture[2048] _GFX_ALIGN; // Palette: mollusk_Pal
extern const unsigned char AnarX_Texture[2048] _GFX_ALIGN; // Palette: AnarX_Pal extern const unsigned char AnarX_Texture[2048] _GFX_ALIGN; // Palette: AnarX_Pal
extern const unsigned char Abrexxes_Texture[2048] _GFX_ALIGN; // Palette: Abrexxes_Pal extern const unsigned char Abrexxes_Texture[2048] _GFX_ALIGN; // Palette: Abrexxes_Pal
// Palettes: // Palettes:
extern const unsigned short mollusk_Pal[256] _GFX_ALIGN; extern const unsigned short mollusk_Pal[256] _GFX_ALIGN;
extern const unsigned short AnarX_Pal[256] _GFX_ALIGN; extern const unsigned short AnarX_Pal[256] _GFX_ALIGN;
extern const unsigned short Abrexxes_Pal[256] _GFX_ALIGN; extern const unsigned short Abrexxes_Pal[256] _GFX_ALIGN;
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -1,63 +1,63 @@
/* /*
// 3DCreateSprite // 3DCreateSprite
*/ */
// Includes // Includes
#include <PA9.h> // Include for PA_Lib #include <PA9.h> // Include for PA_Lib
#include "all_gfx.h" #include "all_gfx.h"
u16 gfx[3]; u16 gfx[3];
// Function: main() // Function: main()
int main() int main()
{ {
PA_Init(); // Initializes PA_Lib PA_Init(); // Initializes PA_Lib
PA_Init3D(); // Uses Bg0, Init 3D... PA_Init3D(); // Uses Bg0, Init 3D...
PA_Reset3DSprites(); // Init or Reset 3D Sprites PA_Reset3DSprites(); // Init or Reset 3D Sprites
// Initialise the text system on the top screen // Initialise the text system on the top screen
PA_LoadDefaultText(1, 1); // Initialise the text system on the top screen PA_LoadDefaultText(1, 1); // Initialise the text system on the top screen
PA_OutputSimpleText(1, 2, 2, "3DSprites Example : 16colors"); PA_OutputSimpleText(1, 2, 2, "3DSprites Example : 16colors");
// First, create the gfx with the corresponding images and sizes. Images converted as 16colors textures in PAGfx // First, create the gfx with the corresponding images and sizes. Images converted as 16colors textures in PAGfx
gfx[0] = PA_3DCreateTex((void*)mollusk_Texture, // Texture gfx[0] = PA_3DCreateTex((void*)mollusk_Texture, // Texture
64, 64, // Width, Height 64, 64, // Width, Height
TEX_16COL ); // Texture Format TEX_16COL ); // Texture Format
gfx[1] = PA_3DCreateTex((void*)AnarX_Texture, 64, 64, TEX_16COL); gfx[1] = PA_3DCreateTex((void*)AnarX_Texture, 64, 64, TEX_16COL);
gfx[2] = PA_3DCreateTex((void*)Abrexxes_Texture, 64, 64, TEX_16COL); gfx[2] = PA_3DCreateTex((void*)Abrexxes_Texture, 64, 64, TEX_16COL);
// Load the Palettes ! // Load the Palettes !
PA_Load3DSpritePal(0, // Slot PA_Load3DSpritePal(0, // Slot
(void*)mollusk_Pal); // Palette (void*)mollusk_Pal); // Palette
PA_Load3DSpritePal(1, (void*)AnarX_Pal); PA_Load3DSpritePal(1, (void*)AnarX_Pal);
PA_Load3DSpritePal(2, (void*)Abrexxes_Pal); PA_Load3DSpritePal(2, (void*)Abrexxes_Pal);
// Create 3 sprites... // Create 3 sprites...
PA_3DCreateSpriteFromTex(0, // Sprite number PA_3DCreateSpriteFromTex(0, // Sprite number
gfx[0], // Gfx... gfx[0], // Gfx...
64, 64, // Width, Height 64, 64, // Width, Height
0, // Palette, unused in 16bit... 0, // Palette, unused in 16bit...
32, 32); // X, Y SPRITE CENTER ! 32, 32); // X, Y SPRITE CENTER !
PA_3DCreateSpriteFromTex(1, gfx[1], 64, 64, 1, 96, 96); PA_3DCreateSpriteFromTex(1, gfx[1], 64, 64, 1, 96, 96);
PA_3DCreateSpriteFromTex(2, gfx[2], 64, 64, 2, 160, 96+64); PA_3DCreateSpriteFromTex(2, gfx[2], 64, 64, 2, 160, 96+64);
while(1) { while(1) {
PA_3DProcess(); // Update sprites PA_3DProcess(); // Update sprites
PA_WaitForVBL(); PA_WaitForVBL();
} }
return 0; return 0;
} // End of main() } // End of main()

View File

@ -1 +1 @@
include ../../../Makefile_example include ../../../Makefile_example

View File

@ -1,23 +1,23 @@
// Graphics converted using PAGfx by Mollusk. // Graphics converted using PAGfx by Mollusk.
#pragma once #pragma once
#include <PA_BgStruct.h> #include <PA_BgStruct.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C"{ extern "C"{
#endif #endif
// Sprites: // Sprites:
extern const unsigned char mollusk_Texture[4096] _GFX_ALIGN; // Palette: mollusk_Pal extern const unsigned char mollusk_Texture[4096] _GFX_ALIGN; // Palette: mollusk_Pal
extern const unsigned char AnarX_Texture[4096] _GFX_ALIGN; // Palette: AnarX_Pal extern const unsigned char AnarX_Texture[4096] _GFX_ALIGN; // Palette: AnarX_Pal
extern const unsigned char Abrexxes_Texture[4096] _GFX_ALIGN; // Palette: Abrexxes_Pal extern const unsigned char Abrexxes_Texture[4096] _GFX_ALIGN; // Palette: Abrexxes_Pal
// Palettes: // Palettes:
extern const unsigned short mollusk_Pal[256] _GFX_ALIGN; extern const unsigned short mollusk_Pal[256] _GFX_ALIGN;
extern const unsigned short AnarX_Pal[256] _GFX_ALIGN; extern const unsigned short AnarX_Pal[256] _GFX_ALIGN;
extern const unsigned short Abrexxes_Pal[256] _GFX_ALIGN; extern const unsigned short Abrexxes_Pal[256] _GFX_ALIGN;
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -1,62 +1,62 @@
/* /*
// 3DCreateSprite // 3DCreateSprite
*/ */
// Includes // Includes
#include <PA9.h> // Include for PA_Lib #include <PA9.h> // Include for PA_Lib
#include "all_gfx.h" #include "all_gfx.h"
u16 gfx[3]; u16 gfx[3];
// Function: main() // Function: main()
int main() int main()
{ {
PA_Init(); // Initializes PA_Lib PA_Init(); // Initializes PA_Lib
PA_Init3D(); // Uses Bg0, Init 3D... PA_Init3D(); // Uses Bg0, Init 3D...
PA_Reset3DSprites(); // Init or Reset 3D Sprites PA_Reset3DSprites(); // Init or Reset 3D Sprites
// Initialise the text system on the top screen // Initialise the text system on the top screen
PA_LoadDefaultText(1, 1); // Initialise the text system on the top screen PA_LoadDefaultText(1, 1); // Initialise the text system on the top screen
PA_OutputSimpleText(1, 2, 2, "3DSprites Example : 256colors"); PA_OutputSimpleText(1, 2, 2, "3DSprites Example : 256colors");
// First, create the gfx with the corresponding images and sizes. Images converted as 256colors textures in PAGfx // First, create the gfx with the corresponding images and sizes. Images converted as 256colors textures in PAGfx
gfx[0] = PA_3DCreateTex((void*)mollusk_Texture, // Texture gfx[0] = PA_3DCreateTex((void*)mollusk_Texture, // Texture
64, 64, // Width, Height 64, 64, // Width, Height
TEX_256COL ); // Texture Format TEX_256COL ); // Texture Format
gfx[1] = PA_3DCreateTex((void*)AnarX_Texture, 64, 64, TEX_256COL); gfx[1] = PA_3DCreateTex((void*)AnarX_Texture, 64, 64, TEX_256COL);
gfx[2] = PA_3DCreateTex((void*)Abrexxes_Texture, 64, 64, TEX_256COL); gfx[2] = PA_3DCreateTex((void*)Abrexxes_Texture, 64, 64, TEX_256COL);
// Load the Palettes ! // Load the Palettes !
PA_Load3DSpritePal(0, // Slot PA_Load3DSpritePal(0, // Slot
(void*)mollusk_Pal); // Palette (void*)mollusk_Pal); // Palette
PA_Load3DSpritePal(1, (void*)AnarX_Pal); PA_Load3DSpritePal(1, (void*)AnarX_Pal);
PA_Load3DSpritePal(2, (void*)Abrexxes_Pal); PA_Load3DSpritePal(2, (void*)Abrexxes_Pal);
// Create 3 sprites... // Create 3 sprites...
PA_3DCreateSpriteFromTex(0, // Sprite number PA_3DCreateSpriteFromTex(0, // Sprite number
gfx[0], // Gfx... gfx[0], // Gfx...
64, 64, // Width, Height 64, 64, // Width, Height
0, // Palette, unused in 16bit... 0, // Palette, unused in 16bit...
32, 32); // X, Y SPRITE CENTER ! 32, 32); // X, Y SPRITE CENTER !
PA_3DCreateSpriteFromTex(1, gfx[1], 64, 64, 1, 96, 96); PA_3DCreateSpriteFromTex(1, gfx[1], 64, 64, 1, 96, 96);
PA_3DCreateSpriteFromTex(2, gfx[2], 64, 64, 2, 160, 96+64); PA_3DCreateSpriteFromTex(2, gfx[2], 64, 64, 2, 160, 96+64);
while(1) { while(1) {
PA_WaitForVBL(); PA_WaitForVBL();
PA_3DProcess(); // Update sprites PA_3DProcess(); // Update sprites
} }
return 0; return 0;
} // End of main() } // End of main()

View File

@ -1 +1 @@
include ../../../Makefile_example include ../../../Makefile_example

View File

@ -1,23 +1,23 @@
// Graphics converted using PAGfx by Mollusk. // Graphics converted using PAGfx by Mollusk.
#pragma once #pragma once
#include <PA_BgStruct.h> #include <PA_BgStruct.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C"{ extern "C"{
#endif #endif
// Sprites: // Sprites:
extern const unsigned char mollusk_Texture[1024] _GFX_ALIGN; // Palette: mollusk_Pal extern const unsigned char mollusk_Texture[1024] _GFX_ALIGN; // Palette: mollusk_Pal
extern const unsigned char AnarX_Texture[1024] _GFX_ALIGN; // Palette: AnarX_Pal extern const unsigned char AnarX_Texture[1024] _GFX_ALIGN; // Palette: AnarX_Pal
extern const unsigned char Abrexxes_Texture[1024] _GFX_ALIGN; // Palette: Abrexxes_Pal extern const unsigned char Abrexxes_Texture[1024] _GFX_ALIGN; // Palette: Abrexxes_Pal
// Palettes: // Palettes:
extern const unsigned short mollusk_Pal[256] _GFX_ALIGN; extern const unsigned short mollusk_Pal[256] _GFX_ALIGN;
extern const unsigned short AnarX_Pal[256] _GFX_ALIGN; extern const unsigned short AnarX_Pal[256] _GFX_ALIGN;
extern const unsigned short Abrexxes_Pal[256] _GFX_ALIGN; extern const unsigned short Abrexxes_Pal[256] _GFX_ALIGN;
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -1,62 +1,62 @@
/* /*
// 3DCreateSprite // 3DCreateSprite
*/ */
// Includes // Includes
#include <PA9.h> // Include for PA_Lib #include <PA9.h> // Include for PA_Lib
#include "all_gfx.h" #include "all_gfx.h"
u16 gfx[3]; u16 gfx[3];
// Function: main() // Function: main()
int main() int main()
{ {
PA_Init(); // Initializes PA_Lib PA_Init(); // Initializes PA_Lib
PA_Init3D(); // Uses Bg0, Init 3D... PA_Init3D(); // Uses Bg0, Init 3D...
PA_Reset3DSprites(); // Init or Reset 3D Sprites PA_Reset3DSprites(); // Init or Reset 3D Sprites
// Initialise the text system on the top screen // Initialise the text system on the top screen
PA_LoadDefaultText(1, 1); // Initialise the text system on the top screen PA_LoadDefaultText(1, 1); // Initialise the text system on the top screen
PA_OutputSimpleText(1, 2, 2, "3DSprites Example : 16colors"); PA_OutputSimpleText(1, 2, 2, "3DSprites Example : 16colors");
// First, create the gfx with the corresponding images and sizes. Images converted as 16colors textures in PAGfx // First, create the gfx with the corresponding images and sizes. Images converted as 16colors textures in PAGfx
gfx[0] = PA_3DCreateTex((void*)mollusk_Texture, // Texture gfx[0] = PA_3DCreateTex((void*)mollusk_Texture, // Texture
64, 64, // Width, Height 64, 64, // Width, Height
TEX_4COL ); // Texture Format TEX_4COL ); // Texture Format
gfx[1] = PA_3DCreateTex((void*)AnarX_Texture, 64, 64, TEX_4COL); gfx[1] = PA_3DCreateTex((void*)AnarX_Texture, 64, 64, TEX_4COL);
gfx[2] = PA_3DCreateTex((void*)Abrexxes_Texture, 64, 64, TEX_4COL); gfx[2] = PA_3DCreateTex((void*)Abrexxes_Texture, 64, 64, TEX_4COL);
// Load the Palettes ! // Load the Palettes !
PA_Load3DSpritePal(0, // Slot PA_Load3DSpritePal(0, // Slot
(void*)mollusk_Pal); // Palette (void*)mollusk_Pal); // Palette
PA_Load3DSpritePal(1, (void*)AnarX_Pal); PA_Load3DSpritePal(1, (void*)AnarX_Pal);
PA_Load3DSpritePal(2, (void*)Abrexxes_Pal); PA_Load3DSpritePal(2, (void*)Abrexxes_Pal);
// Create 3 sprites... // Create 3 sprites...
PA_3DCreateSpriteFromTex(0, // Sprite number PA_3DCreateSpriteFromTex(0, // Sprite number
gfx[0], // Gfx... gfx[0], // Gfx...
64, 64, // Width, Height 64, 64, // Width, Height
0, // Palette, unused in 16bit... 0, // Palette, unused in 16bit...
32, 32); // X, Y SPRITE CENTER ! 32, 32); // X, Y SPRITE CENTER !
PA_3DCreateSpriteFromTex(1, gfx[1], 64, 64, 1, 96, 96); PA_3DCreateSpriteFromTex(1, gfx[1], 64, 64, 1, 96, 96);
PA_3DCreateSpriteFromTex(2, gfx[2], 64, 64, 2, 160, 96+64); PA_3DCreateSpriteFromTex(2, gfx[2], 64, 64, 2, 160, 96+64);
while(1) { while(1) {
PA_WaitForVBL(); PA_WaitForVBL();
PA_3DProcess(); // Update sprites PA_3DProcess(); // Update sprites
} }
return 0; return 0;
} // End of main() } // End of main()

View File

@ -1 +1 @@
include ../../../Makefile_example include ../../../Makefile_example

View File

@ -1,19 +1,19 @@
// Graphics converted using PAGfx by Mollusk. // Graphics converted using PAGfx by Mollusk.
#pragma once #pragma once
#include <PA_BgStruct.h> #include <PA_BgStruct.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C"{ extern "C"{
#endif #endif
// Sprites: // Sprites:
extern const unsigned char bar_Texture[8192] _GFX_ALIGN; // Palette: bar_Pal extern const unsigned char bar_Texture[8192] _GFX_ALIGN; // Palette: bar_Pal
// Palettes: // Palettes:
extern const unsigned short bar_Pal[256] _GFX_ALIGN; extern const unsigned short bar_Pal[256] _GFX_ALIGN;
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -1,52 +1,52 @@
/* /*
// 3DCreateSprite // 3DCreateSprite
*/ */
// Includes // Includes
#include <PA9.h> // Include for PA_Lib #include <PA9.h> // Include for PA_Lib
#include "all_gfx.h" #include "all_gfx.h"
// Function: main() // Function: main()
int main() int main()
{ {
PA_Init(); // Initializes PA_Lib PA_Init(); // Initializes PA_Lib
PA_Init3D(); // Uses Bg0, Init 3D... PA_Init3D(); // Uses Bg0, Init 3D...
PA_Reset3DSprites(); // Init or Reset 3D Sprites PA_Reset3DSprites(); // Init or Reset 3D Sprites
// Initialise the text system on the top screen // Initialise the text system on the top screen
PA_LoadDefaultText(1, 1); // Initialise the text system on the top screen PA_LoadDefaultText(1, 1); // Initialise the text system on the top screen
PA_OutputSimpleText(1, 2, 2, "3DSprites Example : 256colors"); PA_OutputSimpleText(1, 2, 2, "3DSprites Example : 256colors");
// Load the Palettes ! // Load the Palettes !
PA_Load3DSpritePal(0, // Slot PA_Load3DSpritePal(0, // Slot
(void*)bar_Pal); // Palette (void*)bar_Pal); // Palette
// Create 3 sprites... // Create 3 sprites...
PA_3DCreateSprite(0, // Sprite number PA_3DCreateSprite(0, // Sprite number
(void*)bar_Texture, // Texture (void*)bar_Texture, // Texture
256, 32, // Width, Height 256, 32, // Width, Height
TEX_256COL, // Type TEX_256COL, // Type
0, // Palette, unused in 16bit... 0, // Palette, unused in 16bit...
128, 96); // X, Y SPRITE CENTER ! 128, 96); // X, Y SPRITE CENTER !
while(1) { while(1) {
PA_WaitForVBL(); PA_WaitForVBL();
PA_3DProcess(); // Update sprites PA_3DProcess(); // Update sprites
} }
return 0; return 0;
} // End of main() } // End of main()

View File

@ -1 +1 @@
include ../../Makefile_example include ../../Makefile_example

View File

@ -1,18 +1,18 @@
// Graphics converted using PAGfx by Mollusk. // Graphics converted using PAGfx by Mollusk.
#pragma once #pragma once
#include <PA_BgStruct.h> #include <PA_BgStruct.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C"{ extern "C"{
#endif #endif
// Sprites: // Sprites:
extern const unsigned char mollusk_Texture[4096] _GFX_ALIGN; // 16bit texture extern const unsigned char mollusk_Texture[4096] _GFX_ALIGN; // 16bit texture
// Palettes: // Palettes:
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -1,50 +1,50 @@
/* /*
// 3DCreateSprite // 3DCreateSprite
*/ */
// Includes // Includes
#include <PA9.h> // Include for PA_Lib #include <PA9.h> // Include for PA_Lib
#include "all_gfx.h" #include "all_gfx.h"
u16 gfx[3]; u16 gfx[3];
// Function: main() // Function: main()
int main() int main()
{ {
PA_Init(); // Initializes PA_Lib PA_Init(); // Initializes PA_Lib
PA_Init3D(); // Uses Bg0 PA_Init3D(); // Uses Bg0
PA_Reset3DSprites(); PA_Reset3DSprites();
// Initialise the text system on the top screen // Initialise the text system on the top screen
PA_LoadDefaultText(0, 1); PA_LoadDefaultText(0, 1);
PA_LoadDefaultText(1, 1); // Initialise the text system on the top screen PA_LoadDefaultText(1, 1); // Initialise the text system on the top screen
PA_OutputSimpleText(1, 0, 6, "Move the Sprite with the stylus"); PA_OutputSimpleText(1, 0, 6, "Move the Sprite with the stylus");
// First, create the gfx with the corresponding images and sizes. Images converted as 16bit sprites in PAGfx // First, create the gfx with the corresponding images and sizes. Images converted as 16bit sprites in PAGfx
gfx[0] = PA_3DCreateTex((void*)mollusk_Texture, 64, 64, TEX_16BITS); gfx[0] = PA_3DCreateTex((void*)mollusk_Texture, 64, 64, TEX_16BITS);
// Create sprite... // Create sprite...
PA_3DCreateSpriteFromTex(0, // Sprite number PA_3DCreateSpriteFromTex(0, // Sprite number
gfx[0], // Gfx... gfx[0], // Gfx...
64, 64, // Width, Height 64, 64, // Width, Height
0, // Palette 0, // Palette
128, 96); // X, Y SPRITE CENTER ! 128, 96); // X, Y SPRITE CENTER !
while(1) { while(1) {
if(Stylus.Held) PA_3DSetSpriteXY(0, Stylus.X, Stylus.Y); // Move sprite 0 to Stylus Position... This is the sprite's center ! if(Stylus.Held) PA_3DSetSpriteXY(0, Stylus.X, Stylus.Y); // Move sprite 0 to Stylus Position... This is the sprite's center !
PA_WaitForVBL(); PA_WaitForVBL();
PA_3DProcess(); // Update sprites PA_3DProcess(); // Update sprites
} }
return 0; return 0;
} // End of main() } // End of main()

View File

@ -1 +1 @@
include ../../Makefile_example include ../../Makefile_example

View File

@ -1,23 +1,23 @@
// Graphics converted using PAGfx by Mollusk. // Graphics converted using PAGfx by Mollusk.
#pragma once #pragma once
#include <PA_BgStruct.h> #include <PA_BgStruct.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C"{ extern "C"{
#endif #endif
// Sprites: // Sprites:
extern const unsigned char mollusk_Texture[4096] _GFX_ALIGN; // Palette: mollusk_Pal extern const unsigned char mollusk_Texture[4096] _GFX_ALIGN; // Palette: mollusk_Pal
extern const unsigned char AnarX_Texture[4096] _GFX_ALIGN; // Palette: AnarX_Pal extern const unsigned char AnarX_Texture[4096] _GFX_ALIGN; // Palette: AnarX_Pal
extern const unsigned char Abrexxes_Texture[4096] _GFX_ALIGN; // Palette: Abrexxes_Pal extern const unsigned char Abrexxes_Texture[4096] _GFX_ALIGN; // Palette: Abrexxes_Pal
// Palettes: // Palettes:
extern const unsigned short mollusk_Pal[256] _GFX_ALIGN; extern const unsigned short mollusk_Pal[256] _GFX_ALIGN;
extern const unsigned short AnarX_Pal[256] _GFX_ALIGN; extern const unsigned short AnarX_Pal[256] _GFX_ALIGN;
extern const unsigned short Abrexxes_Pal[256] _GFX_ALIGN; extern const unsigned short Abrexxes_Pal[256] _GFX_ALIGN;
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -1,64 +1,64 @@
/* /*
// 3DCreateSprite // 3DCreateSprite
*/ */
// Includes // Includes
#include <PA9.h> // Include for PA_Lib #include <PA9.h> // Include for PA_Lib
#include "all_gfx.h" #include "all_gfx.h"
u16 gfx[3]; u16 gfx[3];
// Function: main() // Function: main()
int main() int main()
{ {
PA_Init(); // Initializes PA_Lib PA_Init(); // Initializes PA_Lib
PA_Init3D(); // Uses Bg0, Init 3D... PA_Init3D(); // Uses Bg0, Init 3D...
PA_Reset3DSprites(); // Init or Reset 3D Sprites PA_Reset3DSprites(); // Init or Reset 3D Sprites
// Initialise the text system on the top screen // Initialise the text system on the top screen
PA_LoadDefaultText(1, 1); // Initialise the text system on the top screen PA_LoadDefaultText(1, 1); // Initialise the text system on the top screen
PA_OutputSimpleText(1, 0, 8, "Move 3DSprite to change priority"); PA_OutputSimpleText(1, 0, 8, "Move 3DSprite to change priority");
// First, create the gfx with the corresponding images and sizes. Images converted as 256colors textures in PAGfx // First, create the gfx with the corresponding images and sizes. Images converted as 256colors textures in PAGfx
gfx[0] = PA_3DCreateTex((void*)mollusk_Texture, // Texture gfx[0] = PA_3DCreateTex((void*)mollusk_Texture, // Texture
64, 64, // Width, Height 64, 64, // Width, Height
TEX_256COL ); // Texture Format TEX_256COL ); // Texture Format
// Load the Palettes ! // Load the Palettes !
PA_Load3DSpritePal(0, // Slot PA_Load3DSpritePal(0, // Slot
(void*)mollusk_Pal); // Palette (void*)mollusk_Pal); // Palette
// Create a few sprites // Create a few sprites
PA_3DCreateSpriteFromTex(0, gfx[0], 64, 64, 0, 128, 96); PA_3DCreateSpriteFromTex(0, gfx[0], 64, 64, 0, 128, 96);
u8 i; u8 i;
for(i = 0; i < 24; i++){ for(i = 0; i < 24; i++){
PA_3DCreateSpriteFromTex(i+1, gfx[0], 64, 64, 0, 32, i*8); PA_3DCreateSpriteFromTex(i+1, gfx[0], 64, 64, 0, 32, i*8);
PA_3DSetSpritePrio(i+1, 1024 + i*8); // Priority... (default is 1024) PA_3DSetSpritePrio(i+1, 1024 + i*8); // Priority... (default is 1024)
} }
while(1) { while(1) {
if(Stylus.Held) { if(Stylus.Held) {
PA_3DSetSpriteXY(0, Stylus.X, Stylus.Y); PA_3DSetSpriteXY(0, Stylus.X, Stylus.Y);
PA_3DSetSpritePrio(0, 1024 + Stylus.Y); // Priority depending on Y position... PA_3DSetSpritePrio(0, 1024 + Stylus.Y); // Priority depending on Y position...
} }
PA_WaitForVBL(); PA_WaitForVBL();
PA_3DProcess(); // Update sprites PA_3DProcess(); // Update sprites
} }
return 0; return 0;
} // End of main() } // End of main()

View File

@ -1 +1 @@
include ../../Makefile_example include ../../Makefile_example

View File

@ -1,23 +1,23 @@
// Graphics converted using PAGfx by Mollusk. // Graphics converted using PAGfx by Mollusk.
#pragma once #pragma once
#include <PA_BgStruct.h> #include <PA_BgStruct.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C"{ extern "C"{
#endif #endif
// Sprites: // Sprites:
extern const unsigned char mollusk_Texture[4096] _GFX_ALIGN; // Palette: mollusk_Pal extern const unsigned char mollusk_Texture[4096] _GFX_ALIGN; // Palette: mollusk_Pal
extern const unsigned char AnarX_Texture[4096] _GFX_ALIGN; // Palette: AnarX_Pal extern const unsigned char AnarX_Texture[4096] _GFX_ALIGN; // Palette: AnarX_Pal
extern const unsigned char Abrexxes_Texture[4096] _GFX_ALIGN; // Palette: Abrexxes_Pal extern const unsigned char Abrexxes_Texture[4096] _GFX_ALIGN; // Palette: Abrexxes_Pal
// Palettes: // Palettes:
extern const unsigned short mollusk_Pal[256] _GFX_ALIGN; extern const unsigned short mollusk_Pal[256] _GFX_ALIGN;
extern const unsigned short AnarX_Pal[256] _GFX_ALIGN; extern const unsigned short AnarX_Pal[256] _GFX_ALIGN;
extern const unsigned short Abrexxes_Pal[256] _GFX_ALIGN; extern const unsigned short Abrexxes_Pal[256] _GFX_ALIGN;
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -1,72 +1,72 @@
/* /*
// 3DCreateSprite // 3DCreateSprite
*/ */
// Includes // Includes
#include <PA9.h> // Include for PA_Lib #include <PA9.h> // Include for PA_Lib
#include "all_gfx.h" #include "all_gfx.h"
u16 gfx[3]; u16 gfx[3];
// Function: main() // Function: main()
int main() int main()
{ {
PA_Init(); // Initializes PA_Lib PA_Init(); // Initializes PA_Lib
PA_Init3D(); // Uses Bg0, Init 3D... PA_Init3D(); // Uses Bg0, Init 3D...
PA_Reset3DSprites(); // Init or Reset 3D Sprites PA_Reset3DSprites(); // Init or Reset 3D Sprites
// Initialise the text system on the top screen // Initialise the text system on the top screen
PA_LoadDefaultText(1, 1); // Initialise the text system on the top screen PA_LoadDefaultText(1, 1); // Initialise the text system on the top screen
PA_OutputSimpleText(1, 2, 6, "Click to set random texture"); PA_OutputSimpleText(1, 2, 6, "Click to set random texture");
// First, create the gfx with the corresponding images and sizes. Images converted as 256colors textures in PAGfx // First, create the gfx with the corresponding images and sizes. Images converted as 256colors textures in PAGfx
gfx[0] = PA_3DCreateTex((void*)mollusk_Texture, // Texture gfx[0] = PA_3DCreateTex((void*)mollusk_Texture, // Texture
64, 64, // Width, Height 64, 64, // Width, Height
TEX_256COL ); // Texture Format TEX_256COL ); // Texture Format
gfx[1] = PA_3DCreateTex((void*)AnarX_Texture, 64, 64, TEX_256COL); gfx[1] = PA_3DCreateTex((void*)AnarX_Texture, 64, 64, TEX_256COL);
gfx[2] = PA_3DCreateTex((void*)Abrexxes_Texture, 64, 64, TEX_256COL); gfx[2] = PA_3DCreateTex((void*)Abrexxes_Texture, 64, 64, TEX_256COL);
// Load the Palettes ! // Load the Palettes !
PA_Load3DSpritePal(0, // Slot PA_Load3DSpritePal(0, // Slot
(void*)mollusk_Pal); // Palette (void*)mollusk_Pal); // Palette
PA_Load3DSpritePal(1, (void*)AnarX_Pal); PA_Load3DSpritePal(1, (void*)AnarX_Pal);
PA_Load3DSpritePal(2, (void*)Abrexxes_Pal); PA_Load3DSpritePal(2, (void*)Abrexxes_Pal);
// Create 3 sprites... // Create 3 sprites...
PA_3DCreateSpriteFromTex(0, // Sprite number PA_3DCreateSpriteFromTex(0, // Sprite number
gfx[0], // Gfx... gfx[0], // Gfx...
64, 64, // Width, Height 64, 64, // Width, Height
0, // Palette, unused in 16bit... 0, // Palette, unused in 16bit...
32, 32); // X, Y SPRITE CENTER ! 32, 32); // X, Y SPRITE CENTER !
PA_3DCreateSpriteFromTex(1, gfx[1], 64, 64, 1, 96, 96); PA_3DCreateSpriteFromTex(1, gfx[1], 64, 64, 1, 96, 96);
PA_3DCreateSpriteFromTex(2, gfx[2], 64, 64, 2, 160, 96+64); PA_3DCreateSpriteFromTex(2, gfx[2], 64, 64, 2, 160, 96+64);
s32 i; s32 i;
while(1) { while(1) {
if(Stylus.Newpress){ if(Stylus.Newpress){
for(i = 0; i < 3; i++){ for(i = 0; i < 3; i++){
if(PA_3DSpriteTouched(i)){ // If sprite touched if(PA_3DSpriteTouched(i)){ // If sprite touched
u8 random = PA_Rand()%3; u8 random = PA_Rand()%3;
PA_3DSetSpriteTex(i, gfx[random]); // Change to random texture... PA_3DSetSpriteTex(i, gfx[random]); // Change to random texture...
PA_3DSetSpritePal(i, random); // Don't forget to change palette too ^^ PA_3DSetSpritePal(i, random); // Don't forget to change palette too ^^
} }
} }
} }
PA_WaitForVBL(); PA_WaitForVBL();
PA_3DProcess(); // Update sprites PA_3DProcess(); // Update sprites
} }
return 0; return 0;
} // End of main() } // End of main()

View File

@ -1 +1 @@
include ../../Makefile_example include ../../Makefile_example

View File

@ -1,23 +1,23 @@
// Graphics converted using PAGfx by Mollusk. // Graphics converted using PAGfx by Mollusk.
#pragma once #pragma once
#include <PA_BgStruct.h> #include <PA_BgStruct.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C"{ extern "C"{
#endif #endif
// Sprites: // Sprites:
extern const unsigned char mollusk_Texture[4096] _GFX_ALIGN; // Palette: mollusk_Pal extern const unsigned char mollusk_Texture[4096] _GFX_ALIGN; // Palette: mollusk_Pal
extern const unsigned char AnarX_Texture[4096] _GFX_ALIGN; // Palette: AnarX_Pal extern const unsigned char AnarX_Texture[4096] _GFX_ALIGN; // Palette: AnarX_Pal
extern const unsigned char Abrexxes_Texture[4096] _GFX_ALIGN; // Palette: Abrexxes_Pal extern const unsigned char Abrexxes_Texture[4096] _GFX_ALIGN; // Palette: Abrexxes_Pal
// Palettes: // Palettes:
extern const unsigned short mollusk_Pal[256] _GFX_ALIGN; extern const unsigned short mollusk_Pal[256] _GFX_ALIGN;
extern const unsigned short AnarX_Pal[256] _GFX_ALIGN; extern const unsigned short AnarX_Pal[256] _GFX_ALIGN;
extern const unsigned short Abrexxes_Pal[256] _GFX_ALIGN; extern const unsigned short Abrexxes_Pal[256] _GFX_ALIGN;
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -1,71 +1,71 @@
/* /*
// 3DCreateSprite // 3DCreateSprite
*/ */
// Includes // Includes
#include <PA9.h> // Include for PA_Lib #include <PA9.h> // Include for PA_Lib
#include "all_gfx.h" #include "all_gfx.h"
u16 gfx[3]; u16 gfx[3];
// Function: main() // Function: main()
int main() int main()
{ {
PA_Init(); // Initializes PA_Lib PA_Init(); // Initializes PA_Lib
PA_Init3D(); // Uses Bg0, Init 3D... PA_Init3D(); // Uses Bg0, Init 3D...
PA_Reset3DSprites(); // Init or Reset 3D Sprites PA_Reset3DSprites(); // Init or Reset 3D Sprites
// Initialise the text system on the top screen // Initialise the text system on the top screen
PA_LoadDefaultText(1, 1); // Initialise the text system on the top screen PA_LoadDefaultText(1, 1); // Initialise the text system on the top screen
PA_LoadDefaultText(0, 1); PA_LoadDefaultText(0, 1);
PA_OutputSimpleText(1, 2, 2, "3DSprites Example : 256colors"); PA_OutputSimpleText(1, 2, 2, "3DSprites Example : 256colors");
// First, create the gfx with the corresponding images and sizes. Images converted as 256colors textures in PAGfx // First, create the gfx with the corresponding images and sizes. Images converted as 256colors textures in PAGfx
gfx[0] = PA_3DCreateTex((void*)mollusk_Texture, // Texture gfx[0] = PA_3DCreateTex((void*)mollusk_Texture, // Texture
64, 64, // Width, Height 64, 64, // Width, Height
TEX_256COL ); // Texture Format TEX_256COL ); // Texture Format
gfx[1] = PA_3DCreateTex((void*)AnarX_Texture, 64, 64, TEX_256COL); gfx[1] = PA_3DCreateTex((void*)AnarX_Texture, 64, 64, TEX_256COL);
gfx[2] = PA_3DCreateTex((void*)Abrexxes_Texture, 64, 64, TEX_256COL); gfx[2] = PA_3DCreateTex((void*)Abrexxes_Texture, 64, 64, TEX_256COL);
// Load the Palettes ! // Load the Palettes !
PA_Load3DSpritePal(0, // Slot PA_Load3DSpritePal(0, // Slot
(void*)mollusk_Pal); // Palette (void*)mollusk_Pal); // Palette
PA_Load3DSpritePal(1, (void*)AnarX_Pal); PA_Load3DSpritePal(1, (void*)AnarX_Pal);
PA_Load3DSpritePal(2, (void*)Abrexxes_Pal); PA_Load3DSpritePal(2, (void*)Abrexxes_Pal);
// Create 3 sprites... // Create 3 sprites...
PA_3DCreateSpriteFromTex(0, // Sprite number PA_3DCreateSpriteFromTex(0, // Sprite number
gfx[0], // Gfx... gfx[0], // Gfx...
64, 64, // Width, Height 64, 64, // Width, Height
0, // Palette, unused in 16bit... 0, // Palette, unused in 16bit...
32, 32); // X, Y SPRITE CENTER ! 32, 32); // X, Y SPRITE CENTER !
PA_3DCreateSpriteFromTex(1, gfx[1], 64, 64, 1, 96, 96); PA_3DCreateSpriteFromTex(1, gfx[1], 64, 64, 1, 96, 96);
PA_3DCreateSpriteFromTex(2, gfx[2], 64, 64, 2, 160, 96+64); PA_3DCreateSpriteFromTex(2, gfx[2], 64, 64, 2, 160, 96+64);
while(1) { while(1) {
// Check if you touch one of them... // Check if you touch one of them...
if(Stylus.Held){ if(Stylus.Held){
if(PA_3DSpriteTouched(0)) PA_OutputSimpleText(0, 10, 2, "Mollusk is touched ! "); if(PA_3DSpriteTouched(0)) PA_OutputSimpleText(0, 10, 2, "Mollusk is touched ! ");
else if(PA_3DSpriteTouched(1)) PA_OutputSimpleText(0, 10, 2, "AnarX is touched ! "); else if(PA_3DSpriteTouched(1)) PA_OutputSimpleText(0, 10, 2, "AnarX is touched ! ");
else if(PA_3DSpriteTouched(2)) PA_OutputSimpleText(0, 10, 2, "Abrexxes is touched !"); else if(PA_3DSpriteTouched(2)) PA_OutputSimpleText(0, 10, 2, "Abrexxes is touched !");
else PA_OutputSimpleText(0, 10, 2, " "); // If not, erase ^^ else PA_OutputSimpleText(0, 10, 2, " "); // If not, erase ^^
} }
else PA_OutputSimpleText(0, 10, 2, " "); // If not, erase ^^ else PA_OutputSimpleText(0, 10, 2, " "); // If not, erase ^^
PA_WaitForVBL(); PA_WaitForVBL();
PA_3DProcess(); // Update sprites PA_3DProcess(); // Update sprites
} }
return 0; return 0;
} // End of main() } // End of main()

View File

@ -1 +1 @@
include ../../../Makefile_example include ../../../Makefile_example

View File

@ -1,19 +1,19 @@
// Graphics converted using PAGfx by Mollusk. // Graphics converted using PAGfx by Mollusk.
#pragma once #pragma once
#include <PA_BgStruct.h> #include <PA_BgStruct.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C"{ extern "C"{
#endif #endif
// Sprites: // Sprites:
extern const unsigned char frames_Texture[4096] _GFX_ALIGN; // Palette: frames_Pal extern const unsigned char frames_Texture[4096] _GFX_ALIGN; // Palette: frames_Pal
// Palettes: // Palettes:
extern const unsigned short frames_Pal[256] _GFX_ALIGN; extern const unsigned short frames_Pal[256] _GFX_ALIGN;
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -1,53 +1,53 @@
/* Sprite Frames... /* Sprite Frames...
*/ */
// Includes, only one sprite // Includes, only one sprite
#include <PA9.h> #include <PA9.h>
// PAGfxConverter Include // PAGfxConverter Include
#include "all_gfx.h" #include "all_gfx.h"
s16 framecount; //Frame count... s16 framecount; //Frame count...
u16 gfx[3]; u16 gfx[3];
// Main function // Main function
int main(void) { int main(void) {
// PAlib init // PAlib init
PA_Init(); PA_Init();
PA_Init3D(); // Uses Bg0, Init 3D... PA_Init3D(); // Uses Bg0, Init 3D...
PA_Reset3DSprites(); // Init or Reset 3D Sprites PA_Reset3DSprites(); // Init or Reset 3D Sprites
PA_LoadDefaultText(1, 0); PA_LoadDefaultText(1, 0);
PA_OutputText(1, 0, 10, "Press Pad to change frame"); PA_OutputText(1, 0, 10, "Press Pad to change frame");
// Load the sprite palette, // Load the sprite palette,
PA_Load3DSpritePal(0, // Palette number PA_Load3DSpritePal(0, // Palette number
(void*)frames_Pal); // Palette name (void*)frames_Pal); // Palette name
gfx[0] = PA_3DCreateTex((void*)frames_Texture, 32, 32, TEX_256COL); gfx[0] = PA_3DCreateTex((void*)frames_Texture, 32, 32, TEX_256COL);
PA_3DCreateSpriteFromTex(0, gfx[0], 32, 32, 0, 128, 96); PA_3DCreateSpriteFromTex(0, gfx[0], 32, 32, 0, 128, 96);
while(1) while(1)
{ {
if (Pad.Held.Up) PA_3DSetSpriteFrame(0, 0); // screen, sprite, frame if (Pad.Held.Up) PA_3DSetSpriteFrame(0, 0); // screen, sprite, frame
if (Pad.Held.Down) PA_3DSetSpriteFrame(0, 2); // screen, sprite, frame if (Pad.Held.Down) PA_3DSetSpriteFrame(0, 2); // screen, sprite, frame
if (Pad.Held.Left) PA_3DSetSpriteFrame(0, 3); // screen, sprite, frame if (Pad.Held.Left) PA_3DSetSpriteFrame(0, 3); // screen, sprite, frame
if (Pad.Held.Right) PA_3DSetSpriteFrame(0, 1); // screen, sprite, frame if (Pad.Held.Right) PA_3DSetSpriteFrame(0, 1); // screen, sprite, frame
PA_WaitForVBL(); PA_WaitForVBL();
PA_3DProcess(); PA_3DProcess();
} }
return 0; return 0;
} }

View File

@ -1 +1 @@
include ../../../Makefile_example include ../../../Makefile_example

View File

@ -1,22 +1,22 @@
// Graphics converted using PAGfx by Mollusk. // Graphics converted using PAGfx by Mollusk.
#pragma once #pragma once
#include <PA_BgStruct.h> #include <PA_BgStruct.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C"{ extern "C"{
#endif #endif
// Backgrounds: // Backgrounds:
extern const PA_BgStruct mariobg; extern const PA_BgStruct mariobg;
// Sprites: // Sprites:
extern const unsigned char mario_Texture[16384] _GFX_ALIGN; // Palette: mario_Pal extern const unsigned char mario_Texture[16384] _GFX_ALIGN; // Palette: mario_Pal
// Palettes: // Palettes:
extern const unsigned short mario_Pal[256] _GFX_ALIGN; extern const unsigned short mario_Pal[256] _GFX_ALIGN;
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -1,17 +1,17 @@
#include <PA_BgStruct.h> #include <PA_BgStruct.h>
extern const char mariobg_Tiles[]; extern const char mariobg_Tiles[];
extern const char mariobg_Map[]; extern const char mariobg_Map[];
extern const char mariobg_Pal[]; extern const char mariobg_Pal[];
const PA_BgStruct mariobg = { const PA_BgStruct mariobg = {
PA_BgNormal, PA_BgNormal,
256, 192, 256, 192,
mariobg_Tiles, mariobg_Tiles,
mariobg_Map, mariobg_Map,
{mariobg_Pal}, {mariobg_Pal},
11840, 11840,
{1536} {1536}
}; };

View File

@ -1,86 +1,86 @@
/* /*
// 3DCreateSprite // 3DCreateSprite
*/ */
// Includes // Includes
#include <PA9.h> // Include for PA_Lib #include <PA9.h> // Include for PA_Lib
#include "all_gfx.h" #include "all_gfx.h"
u16 gfx[3]; u16 gfx[3];
// Function: main() // Function: main()
int main() int main()
{ {
PA_Init(); // Initializes PA_Lib PA_Init(); // Initializes PA_Lib
PA_Init3D(); // Uses Bg0 PA_Init3D(); // Uses Bg0
PA_Reset3DSprites(); PA_Reset3DSprites();
// Initialise the text system on the top screen // Initialise the text system on the top screen
PA_LoadDefaultText(0, 1); PA_LoadDefaultText(0, 1);
PA_LoadDefaultText(1, 1); // Initialise the text system on the top screen PA_LoadDefaultText(1, 1); // Initialise the text system on the top screen
PA_OutputSimpleText(1, 0, 6, "Move the Stylus to move Mario"); PA_OutputSimpleText(1, 0, 6, "Move the Stylus to move Mario");
// First, create the gfx with the corresponding images and sizes. Images converted as 16bit sprites in PAGfx // First, create the gfx with the corresponding images and sizes. Images converted as 16bit sprites in PAGfx
gfx[0] = PA_3DCreateTex((void*)mario_Texture, 64, 64, TEX_256COL); gfx[0] = PA_3DCreateTex((void*)mario_Texture, 64, 64, TEX_256COL);
PA_Load3DSpritePal(0, (void*)mario_Pal); PA_Load3DSpritePal(0, (void*)mario_Pal);
PA_LoadBackground(0, 3, &mariobg); // Mario background PA_LoadBackground(0, 3, &mariobg); // Mario background
// Create sprite... // Create sprite...
PA_3DCreateSpriteFromTex(0, // Sprite number PA_3DCreateSpriteFromTex(0, // Sprite number
gfx[0], // Gfx... gfx[0], // Gfx...
64, 64, // Width, Height 64, 64, // Width, Height
0, // Palette 0, // Palette
128, 128); // X, Y SPRITE CENTER ! 128, 128); // X, Y SPRITE CENTER !
PA_3DSetSpriteWidthHeight(0, 96, 96); PA_3DSetSpriteWidthHeight(0, 96, 96);
s16 xangle = 0; s16 xangle = 0;
s16 x = 128; s16 x = 128;
while(1) { while(1) {
if(!Stylus.Held) { if(!Stylus.Held) {
while(PA_3DGetSpriteAnimFrame(0) != 0){ // Wait for animation to end... while(PA_3DGetSpriteAnimFrame(0) != 0){ // Wait for animation to end...
PA_WaitForVBL(); PA_WaitForVBL();
PA_3DProcess(); // Update sprites PA_3DProcess(); // Update sprites
} }
PA_3DStopSpriteAnim(0); PA_3DStopSpriteAnim(0);
} }
if(Stylus.Held) { if(Stylus.Held) {
if(sprite3danims[0].play == 0) PA_3DStartSpriteAnim(0, 0, 3, 10); // Sprite animation ! if(sprite3danims[0].play == 0) PA_3DStartSpriteAnim(0, 0, 3, 10); // Sprite animation !
if(Stylus.X < x-12){ if(Stylus.X < x-12){
while(xangle < 256) { while(xangle < 256) {
xangle += 16; // change angle... xangle += 16; // change angle...
PA_3DSetSpriteRotateY(0, xangle); PA_3DSetSpriteRotateY(0, xangle);
PA_WaitForVBL(); PA_WaitForVBL();
PA_3DProcess(); // Update sprites PA_3DProcess(); // Update sprites
} }
x -= 2; x -= 2;
} }
else if(Stylus.X > x+12){ else if(Stylus.X > x+12){
while(xangle > 0) { while(xangle > 0) {
xangle -= 16; // change angle... xangle -= 16; // change angle...
PA_3DSetSpriteRotateY(0, xangle); PA_3DSetSpriteRotateY(0, xangle);
PA_WaitForVBL(); PA_WaitForVBL();
PA_3DProcess(); // Update sprites PA_3DProcess(); // Update sprites
} }
x += 2; x += 2;
} }
PA_3DSetSpriteX(0, x); PA_3DSetSpriteX(0, x);
} }
PA_WaitForVBL(); PA_WaitForVBL();
PA_3DProcess(); // Update sprites PA_3DProcess(); // Update sprites
} }
return 0; return 0;
} // End of main() } // End of main()

View File

@ -1 +1 @@
include ../../../Makefile_example include ../../../Makefile_example

View File

@ -1,19 +1,19 @@
// Graphics converted using PAGfx by Mollusk. // Graphics converted using PAGfx by Mollusk.
#pragma once #pragma once
#include <PA_BgStruct.h> #include <PA_BgStruct.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C"{ extern "C"{
#endif #endif
// Sprites: // Sprites:
extern const unsigned char explosion_Texture[28672] _GFX_ALIGN; // Palette: explosion_Pal extern const unsigned char explosion_Texture[28672] _GFX_ALIGN; // Palette: explosion_Pal
// Palettes: // Palettes:
extern const unsigned short explosion_Pal[256] _GFX_ALIGN; extern const unsigned short explosion_Pal[256] _GFX_ALIGN;
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -1,57 +1,57 @@
/* This will show the new sprite animation functions !! Yay ! /* This will show the new sprite animation functions !! Yay !
Thanks to http://www.reinerstileset.4players.de:1059/englisch.htm and Arog for the sprite ;) Thanks to http://www.reinerstileset.4players.de:1059/englisch.htm and Arog for the sprite ;)
*/ */
// Includes, only one sprite // Includes, only one sprite
#include <PA9.h> #include <PA9.h>
// PAGfxConverter Include // PAGfxConverter Include
#include "all_gfx.h" #include "all_gfx.h"
s16 framecount; //Frame count... s16 framecount; //Frame count...
// Main function // Main function
int main(void) { int main(void) {
// PAlib init // PAlib init
PA_Init(); PA_Init();
PA_Init3D(); // Uses Bg0, Init 3D... PA_Init3D(); // Uses Bg0, Init 3D...
PA_Reset3DSprites(); // Init or Reset 3D Sprites PA_Reset3DSprites(); // Init or Reset 3D Sprites
PA_LoadDefaultText(1, 0); PA_LoadDefaultText(1, 0);
// Load the sprite palette, // Load the sprite palette,
PA_Load3DSpritePal(0, // Palette number PA_Load3DSpritePal(0, // Palette number
(void*)explosion_Pal); // Palette name (void*)explosion_Pal); // Palette name
// Here, we'll load a few similar sprites sprite to animate... at different speed // Here, we'll load a few similar sprites sprite to animate... at different speed
PA_3DCreateSprite(0,(void*)explosion_Texture, 64, 64, TEX_256COL, 0, 32, 96); PA_3DCreateSprite(0,(void*)explosion_Texture, 64, 64, TEX_256COL, 0, 32, 96);
PA_3DCreateSprite(1,(void*)explosion_Texture, 64, 64, TEX_256COL, 0, 64+32, 96); PA_3DCreateSprite(1,(void*)explosion_Texture, 64, 64, TEX_256COL, 0, 64+32, 96);
PA_3DCreateSprite(2,(void*)explosion_Texture, 64, 64, TEX_256COL, 0, 128+32, 96); PA_3DCreateSprite(2,(void*)explosion_Texture, 64, 64, TEX_256COL, 0, 128+32, 96);
PA_3DCreateSprite(3,(void*)explosion_Texture, 64, 64, TEX_256COL, 0, 196+32, 96); PA_3DCreateSprite(3,(void*)explosion_Texture, 64, 64, TEX_256COL, 0, 196+32, 96);
// Start the animation. Once started, it works on its own ! // Start the animation. Once started, it works on its own !
PA_3DStartSpriteAnim(0, // sprite number PA_3DStartSpriteAnim(0, // sprite number
0, // first frame is 0 0, // first frame is 0
6, // last frame is 3, since we have 4 frames... 6, // last frame is 3, since we have 4 frames...
5); // Speed, set to 5 frames per second 5); // Speed, set to 5 frames per second
PA_3DStartSpriteAnim(1, 0, 6, 15); // for the second one, speed of 15 fps... PA_3DStartSpriteAnim(1, 0, 6, 15); // for the second one, speed of 15 fps...
PA_3DStartSpriteAnim(2, 0, 6, 30); // for the third one, speed of 30 fps... PA_3DStartSpriteAnim(2, 0, 6, 30); // for the third one, speed of 30 fps...
PA_3DStartSpriteAnim(3, 0, 6, 60); // for the last one, speed of 60 fps... PA_3DStartSpriteAnim(3, 0, 6, 60); // for the last one, speed of 60 fps...
while(1) while(1)
{ {
PA_WaitForVBL(); PA_WaitForVBL();
PA_3DProcess(); // Update... PA_3DProcess(); // Update...
} }
return 0; return 0;
} }

View File

@ -1 +1 @@
include ../../../Makefile_example include ../../../Makefile_example

View File

@ -1,19 +1,19 @@
// Graphics converted using PAGfx by Mollusk. // Graphics converted using PAGfx by Mollusk.
#pragma once #pragma once
#include <PA_BgStruct.h> #include <PA_BgStruct.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C"{ extern "C"{
#endif #endif
// Sprites: // Sprites:
extern const unsigned char som_Texture[12288] _GFX_ALIGN; // Palette: som_Pal extern const unsigned char som_Texture[12288] _GFX_ALIGN; // Palette: som_Pal
// Palettes: // Palettes:
extern const unsigned short som_Pal[256] _GFX_ALIGN; extern const unsigned short som_Pal[256] _GFX_ALIGN;
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -1,61 +1,61 @@
/* This will show the new sprite animation functions !! Yay ! /* This will show the new sprite animation functions !! Yay !
Thanks to http://www.reinerstileset.4players.de:1059/englisch.htm and Arog for the sprite ;) Thanks to http://www.reinerstileset.4players.de:1059/englisch.htm and Arog for the sprite ;)
*/ */
// Includes, only one sprite // Includes, only one sprite
#include <PA9.h> #include <PA9.h>
// PAGfxConverter Include // PAGfxConverter Include
#include "all_gfx.h" #include "all_gfx.h"
s16 framecount; //Frame count... s16 framecount; //Frame count...
// Main function // Main function
int main(void) { int main(void) {
// PAlib init // PAlib init
PA_Init(); PA_Init();
PA_Init3D(); PA_Init3D();
PA_Reset3DSprites(); PA_Reset3DSprites();
PA_LoadDefaultText(1, 0); PA_LoadDefaultText(1, 0);
PA_Load3DSpritePal(0, (void*)som_Pal); // Palette.... PA_Load3DSpritePal(0, (void*)som_Pal); // Palette....
s32 x = 128; s32 y = 96; s32 x = 128; s32 y = 96;
PA_3DCreateSprite(0,(void*)som_Texture, 32, 32, TEX_256COL, 0, x, y); // Sprite PA_3DCreateSprite(0,(void*)som_Texture, 32, 32, TEX_256COL, 0, x, y); // Sprite
while(1) while(1)
{ {
// Animation code... // Animation code...
if(Pad.Newpress.Up) PA_3DStartSpriteAnim(0, 0, 3, 6); if(Pad.Newpress.Up) PA_3DStartSpriteAnim(0, 0, 3, 6);
if(Pad.Newpress.Down) PA_3DStartSpriteAnim(0, 8, 11, 6); if(Pad.Newpress.Down) PA_3DStartSpriteAnim(0, 8, 11, 6);
if(Pad.Newpress.Right) { if(Pad.Newpress.Right) {
PA_3DStartSpriteAnim(0, 4, 7, 6); PA_3DStartSpriteAnim(0, 4, 7, 6);
PA_3DSetSpriteHflip(0, 0); PA_3DSetSpriteHflip(0, 0);
} }
if(Pad.Newpress.Left) { if(Pad.Newpress.Left) {
PA_3DStartSpriteAnim(0, 4, 7, 6); PA_3DStartSpriteAnim(0, 4, 7, 6);
PA_3DSetSpriteHflip(0, 1); PA_3DSetSpriteHflip(0, 1);
} }
if(!((Pad.Held.Left)||(Pad.Held.Up)||(Pad.Held.Down)||(Pad.Held.Right))) PA_3DSpriteAnimPause(0, 1); if(!((Pad.Held.Left)||(Pad.Held.Up)||(Pad.Held.Down)||(Pad.Held.Right))) PA_3DSpriteAnimPause(0, 1);
// Moving Code // Moving Code
y += Pad.Held.Down - Pad.Held.Up; y += Pad.Held.Down - Pad.Held.Up;
x += Pad.Held.Right - Pad.Held.Left; x += Pad.Held.Right - Pad.Held.Left;
PA_3DSetSpriteXY(0, x, y); PA_3DSetSpriteXY(0, x, y);
PA_WaitForVBL(); PA_WaitForVBL();
PA_3DProcess(); // Update 3D... PA_3DProcess(); // Update 3D...
} }
return 0; return 0;
} }

View File

@ -1 +1 @@
include ../../../Makefile_example include ../../../Makefile_example

View File

@ -1,19 +1,19 @@
// Graphics converted using PAGfx by Mollusk. // Graphics converted using PAGfx by Mollusk.
#pragma once #pragma once
#include <PA_BgStruct.h> #include <PA_BgStruct.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C"{ extern "C"{
#endif #endif
// Sprites: // Sprites:
extern const unsigned char explosion_Texture[28672] _GFX_ALIGN; // Palette: explosion_Pal extern const unsigned char explosion_Texture[28672] _GFX_ALIGN; // Palette: explosion_Pal
// Palettes: // Palettes:
extern const unsigned short explosion_Pal[256] _GFX_ALIGN; extern const unsigned short explosion_Pal[256] _GFX_ALIGN;
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -1,59 +1,59 @@
/* This will show the new sprite animation functions !! Yay ! /* This will show the new sprite animation functions !! Yay !
Thanks to http://www.reinerstileset.4players.de:1059/englisch.htm and Arog for the sprite ;) Thanks to http://www.reinerstileset.4players.de:1059/englisch.htm and Arog for the sprite ;)
*/ */
// Includes, only one sprite // Includes, only one sprite
#include <PA9.h> #include <PA9.h>
// PAGfxConverter Include // PAGfxConverter Include
#include "all_gfx.h" #include "all_gfx.h"
s16 framecount; //Frame count... s16 framecount; //Frame count...
const unsigned char explosion[28672] __attribute__ ((aligned (4))); const unsigned char explosion[28672] __attribute__ ((aligned (4)));
// Main function // Main function
int main(void) { int main(void) {
// PAlib init // PAlib init
PA_Init(); PA_Init();
PA_Init3D(); PA_Init3D();
PA_Reset3DSprites(); PA_Reset3DSprites();
PA_LoadDefaultText(0, 1); PA_LoadDefaultText(0, 1);
// Load the sprite palette, // Load the sprite palette,
PA_Load3DSpritePal(0, // Palette number PA_Load3DSpritePal(0, // Palette number
(void*)explosion_Pal); // Palette name (void*)explosion_Pal); // Palette name
// Here, we'll load a few similar sprites sprite to animate... at different speed // Here, we'll load a few similar sprites sprite to animate... at different speed
PA_3DCreateSprite(0,(void*)explosion_Texture, 64, 64, TEX_256COL, 0, 32, 96); PA_3DCreateSprite(0,(void*)explosion_Texture, 64, 64, TEX_256COL, 0, 32, 96);
PA_3DCreateSprite(1,(void*)explosion_Texture, 64, 64, TEX_256COL, 0, 96, 96); PA_3DCreateSprite(1,(void*)explosion_Texture, 64, 64, TEX_256COL, 0, 96, 96);
PA_3DCreateSprite(2,(void*)explosion_Texture, 64, 64, TEX_256COL, 0, 160, 96); PA_3DCreateSprite(2,(void*)explosion_Texture, 64, 64, TEX_256COL, 0, 160, 96);
PA_3DCreateSprite(3,(void*)explosion_Texture, 64, 64, TEX_256COL, 0, 224, 96); PA_3DCreateSprite(3,(void*)explosion_Texture, 64, 64, TEX_256COL, 0, 224, 96);
// First animation will be normal // First animation will be normal
PA_3DStartSpriteAnim(0, // sprite number PA_3DStartSpriteAnim(0, // sprite number
0, // first frame is 0 0, // first frame is 0
6, // last frame is 3, since we have 4 frames... 6, // last frame is 3, since we have 4 frames...
5); // Speed, set to 5 frames per second 5); // Speed, set to 5 frames per second
// Extended animations for the rest // Extended animations for the rest
PA_3DStartSpriteAnimEx(1, 0, 6, 5, ANIM_ONESHOT); // just play it once... PA_3DStartSpriteAnimEx(1, 0, 6, 5, ANIM_ONESHOT); // just play it once...
PA_3DStartSpriteAnimEx(2, 0, 6, 5, ANIM_UPDOWN, -1); // back and forth, infinite number of times PA_3DStartSpriteAnimEx(2, 0, 6, 5, ANIM_UPDOWN, -1); // back and forth, infinite number of times
PA_3DStartSpriteAnimEx(3, 0, 6, 5, ANIM_LOOP, 5); // Play it 5 times PA_3DStartSpriteAnimEx(3, 0, 6, 5, ANIM_LOOP, 5); // Play it 5 times
PA_OutputSimpleText(0, 0, 6, "Infinite"); PA_OutputSimpleText(0, 0, 6, "Infinite");
PA_OutputSimpleText(0, 8, 7, "OneShot"); PA_OutputSimpleText(0, 8, 7, "OneShot");
PA_OutputSimpleText(0, 16, 6, " UpDown"); PA_OutputSimpleText(0, 16, 6, " UpDown");
PA_OutputSimpleText(0, 24, 7, "5 Times"); PA_OutputSimpleText(0, 24, 7, "5 Times");
while(1) while(1)
{ {
PA_WaitForVBL(); PA_WaitForVBL();
PA_3DProcess(); PA_3DProcess();
} }
return 0; return 0;
} }

View File

@ -1 +1 @@
include ../../../Makefile_example include ../../../Makefile_example

View File

@ -1,25 +1,25 @@
// Graphics converted using PAGfx by Mollusk. // Graphics converted using PAGfx by Mollusk.
#pragma once #pragma once
#include <PA_BgStruct.h> #include <PA_BgStruct.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C"{ extern "C"{
#endif #endif
// Sprites: // Sprites:
extern const unsigned char mollusk_Texture[4096] _GFX_ALIGN; // Palette: mollusk_Pal extern const unsigned char mollusk_Texture[4096] _GFX_ALIGN; // Palette: mollusk_Pal
extern const unsigned char AnarX_Texture[4096] _GFX_ALIGN; // Palette: AnarX_Pal extern const unsigned char AnarX_Texture[4096] _GFX_ALIGN; // Palette: AnarX_Pal
extern const unsigned char Abrexxes_Texture[4096] _GFX_ALIGN; // Palette: Abrexxes_Pal extern const unsigned char Abrexxes_Texture[4096] _GFX_ALIGN; // Palette: Abrexxes_Pal
extern const unsigned char pasplash_Texture[65536] _GFX_ALIGN; // Palette: pasplash_Pal extern const unsigned char pasplash_Texture[65536] _GFX_ALIGN; // Palette: pasplash_Pal
// Palettes: // Palettes:
extern const unsigned short mollusk_Pal[256] _GFX_ALIGN; extern const unsigned short mollusk_Pal[256] _GFX_ALIGN;
extern const unsigned short AnarX_Pal[256] _GFX_ALIGN; extern const unsigned short AnarX_Pal[256] _GFX_ALIGN;
extern const unsigned short Abrexxes_Pal[256] _GFX_ALIGN; extern const unsigned short Abrexxes_Pal[256] _GFX_ALIGN;
extern const unsigned short pasplash_Pal[256] _GFX_ALIGN; extern const unsigned short pasplash_Pal[256] _GFX_ALIGN;
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -1,73 +1,73 @@
/* /*
// 3DCreateSprite // 3DCreateSprite
*/ */
// Includes // Includes
#include <PA9.h> // Include for PA_Lib #include <PA9.h> // Include for PA_Lib
#include "all_gfx.h" #include "all_gfx.h"
u16 gfx[4]; u16 gfx[4];
// Function: main() // Function: main()
int main() int main()
{ {
PA_Init(); // Initializes PA_Lib PA_Init(); // Initializes PA_Lib
PA_Init3D(); // Uses Bg0, Init 3D... PA_Init3D(); // Uses Bg0, Init 3D...
PA_Reset3DSprites(); // Init or Reset 3D Sprites PA_Reset3DSprites(); // Init or Reset 3D Sprites
// Initialise the text system on the top screen // Initialise the text system on the top screen
PA_LoadDefaultText(1, 1); // Initialise the text system on the top screen PA_LoadDefaultText(1, 1); // Initialise the text system on the top screen
PA_OutputSimpleText(1, 2, 2, "3DSprites Example : Alpha"); PA_OutputSimpleText(1, 2, 2, "3DSprites Example : Alpha");
// First, create the gfx with the corresponding images and sizes. Images converted as 256colors textures in PAGfx // First, create the gfx with the corresponding images and sizes. Images converted as 256colors textures in PAGfx
gfx[0] = PA_3DCreateTex((void*)mollusk_Texture, // Texture gfx[0] = PA_3DCreateTex((void*)mollusk_Texture, // Texture
64, 64, // Width, Height 64, 64, // Width, Height
TEX_256COL ); // Texture Format TEX_256COL ); // Texture Format
gfx[1] = PA_3DCreateTex((void*)AnarX_Texture, 64, 64, TEX_256COL); gfx[1] = PA_3DCreateTex((void*)AnarX_Texture, 64, 64, TEX_256COL);
gfx[2] = PA_3DCreateTex((void*)Abrexxes_Texture, 64, 64, TEX_256COL); gfx[2] = PA_3DCreateTex((void*)Abrexxes_Texture, 64, 64, TEX_256COL);
gfx[3] = PA_3DCreateTex((void*)pasplash_Texture, 256, 256, TEX_256COL); gfx[3] = PA_3DCreateTex((void*)pasplash_Texture, 256, 256, TEX_256COL);
// Load the Palettes ! // Load the Palettes !
PA_Load3DSpritePal(0, // Slot PA_Load3DSpritePal(0, // Slot
(void*)mollusk_Pal); // Palette (void*)mollusk_Pal); // Palette
PA_Load3DSpritePal(1, (void*)AnarX_Pal); PA_Load3DSpritePal(1, (void*)AnarX_Pal);
PA_Load3DSpritePal(2, (void*)Abrexxes_Pal); PA_Load3DSpritePal(2, (void*)Abrexxes_Pal);
PA_Load3DSpritePal(3, (void*)pasplash_Pal); PA_Load3DSpritePal(3, (void*)pasplash_Pal);
// Create 3 sprites... // Create 3 sprites...
PA_3DCreateSpriteFromTex(0, // Sprite number PA_3DCreateSpriteFromTex(0, // Sprite number
gfx[0], // Gfx... gfx[0], // Gfx...
64, 64, // Width, Height 64, 64, // Width, Height
0, // Palette, unused in 16bit... 0, // Palette, unused in 16bit...
32, 32); // X, Y SPRITE CENTER ! 32, 32); // X, Y SPRITE CENTER !
PA_3DCreateSpriteFromTex(1, gfx[1], 64, 64, 1, 64, 64); PA_3DCreateSpriteFromTex(1, gfx[1], 64, 64, 1, 64, 64);
PA_3DCreateSpriteFromTex(2, gfx[2], 64, 64, 2, 96, 96); PA_3DCreateSpriteFromTex(2, gfx[2], 64, 64, 2, 96, 96);
PA_3DCreateSpriteFromTex(3, gfx[3], 256, 256, 3, 128, 96); PA_3DCreateSpriteFromTex(3, gfx[3], 256, 256, 3, 128, 96);
PA_3DSetSpritePrio(3, 800); PA_3DSetSpritePrio(3, 800);
// Different alpha levels for the 3 sprites // Different alpha levels for the 3 sprites
PA_3DSetSpriteAlpha(0, 15); PA_3DSetSpriteAlpha(0, 15);
PA_3DSetSpriteAlpha(1, 10); PA_3DSetSpriteAlpha(1, 10);
PA_3DSetSpriteAlpha(2, 5); PA_3DSetSpriteAlpha(2, 5);
PA_3DSetSpriteAlpha(2, 16); PA_3DSetSpriteAlpha(2, 16);
u8 i; u8 i;
for(i = 0; i < 4; i++) PA_3DSetSpritePolyID(i, i); // Set a different polyID for each sprite (0-63 values) for(i = 0; i < 4; i++) PA_3DSetSpritePolyID(i, i); // Set a different polyID for each sprite (0-63 values)
while(1) { while(1) {
PA_WaitForVBL(); PA_WaitForVBL();
PA_3DProcess(); // Update sprites PA_3DProcess(); // Update sprites
} }
return 0; return 0;
} // End of main() } // End of main()

View File

@ -1 +1 @@
include ../../../Makefile_example include ../../../Makefile_example

View File

@ -1,18 +1,18 @@
// Graphics converted using PAGfx by Mollusk. // Graphics converted using PAGfx by Mollusk.
#pragma once #pragma once
#include <PA_BgStruct.h> #include <PA_BgStruct.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C"{ extern "C"{
#endif #endif
// Sprites: // Sprites:
extern const unsigned char mollusk_Texture[4096] _GFX_ALIGN; // 16bit texture extern const unsigned char mollusk_Texture[4096] _GFX_ALIGN; // 16bit texture
// Palettes: // Palettes:
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -1,54 +1,54 @@
/* /*
// 3DCreateSprite // 3DCreateSprite
*/ */
// Includes // Includes
#include <PA9.h> // Include for PA_Lib #include <PA9.h> // Include for PA_Lib
#include "all_gfx.h" #include "all_gfx.h"
// Function: main() // Function: main()
int main() int main()
{ {
PA_Init(); // Initializes PA_Lib PA_Init(); // Initializes PA_Lib
PA_Init3D(); // Uses Bg0, Init 3D... PA_Init3D(); // Uses Bg0, Init 3D...
PA_Reset3DSprites(); // Init or Reset 3D Sprites PA_Reset3DSprites(); // Init or Reset 3D Sprites
// Initialise the text system on the top screen // Initialise the text system on the top screen
PA_LoadDefaultText(1, 1); // Initialise the text system on the top screen PA_LoadDefaultText(1, 1); // Initialise the text system on the top screen
PA_OutputSimpleText(1, 0, 6, "Touch one of the screen corners to move the sprite corners..."); PA_OutputSimpleText(1, 0, 6, "Touch one of the screen corners to move the sprite corners...");
// Create 3 sprites... // Create 3 sprites...
PA_3DCreateSprite(0, // Sprite number PA_3DCreateSprite(0, // Sprite number
(void*)mollusk_Texture, (void*)mollusk_Texture,
64, 64, // Width, Height 64, 64, // Width, Height
TEX_16BITS, TEX_16BITS,
0, // Palette, unused in 16bit... 0, // Palette, unused in 16bit...
128, 96); // X, Y SPRITE CENTER ! 128, 96); // X, Y SPRITE CENTER !
while(1) { while(1) {
if(Stylus.Held) { if(Stylus.Held) {
if((Stylus.X < 128)&&(Stylus.Y < 96)) PA_3DSetSpriteTopLeft(0, Stylus.X - (128-32), Stylus.Y - (96-32)); // Top left corner change if((Stylus.X < 128)&&(Stylus.Y < 96)) PA_3DSetSpriteTopLeft(0, Stylus.X - (128-32), Stylus.Y - (96-32)); // Top left corner change
if((Stylus.X > 128)&&(Stylus.Y < 96)) PA_3DSetSpriteTopRight(0, Stylus.X - (128+32), Stylus.Y - (96-32)); // Top left corner change if((Stylus.X > 128)&&(Stylus.Y < 96)) PA_3DSetSpriteTopRight(0, Stylus.X - (128+32), Stylus.Y - (96-32)); // Top left corner change
if((Stylus.X < 128)&&(Stylus.Y > 96)) PA_3DSetSpriteBottomLeft(0, Stylus.X - (128-32), Stylus.Y - (96+32)); // Top left corner change if((Stylus.X < 128)&&(Stylus.Y > 96)) PA_3DSetSpriteBottomLeft(0, Stylus.X - (128-32), Stylus.Y - (96+32)); // Top left corner change
if((Stylus.X > 128)&&(Stylus.Y > 96)) PA_3DSetSpriteBottomRight(0, Stylus.X - (128+32), Stylus.Y - (96+32)); // Top left corner change if((Stylus.X > 128)&&(Stylus.Y > 96)) PA_3DSetSpriteBottomRight(0, Stylus.X - (128+32), Stylus.Y - (96+32)); // Top left corner change
} }
PA_WaitForVBL(); PA_WaitForVBL();
PA_3DProcess(); // Update sprites PA_3DProcess(); // Update sprites
} }
return 0; return 0;
} // End of main() } // End of main()

View File

@ -1 +1 @@
include ../../../Makefile_example include ../../../Makefile_example

View File

@ -1,21 +1,21 @@
// Graphics converted using PAGfx by Mollusk. // Graphics converted using PAGfx by Mollusk.
#pragma once #pragma once
#include <PA_BgStruct.h> #include <PA_BgStruct.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C"{ extern "C"{
#endif #endif
// Sprites: // Sprites:
extern const unsigned char mollusk0_Texture[4096] _GFX_ALIGN; // 16bit texture extern const unsigned char mollusk0_Texture[4096] _GFX_ALIGN; // 16bit texture
extern const unsigned char mollusk1_Texture[4096] _GFX_ALIGN; // 16bit texture extern const unsigned char mollusk1_Texture[4096] _GFX_ALIGN; // 16bit texture
extern const unsigned char mollusk2_Texture[4096] _GFX_ALIGN; // 16bit texture extern const unsigned char mollusk2_Texture[4096] _GFX_ALIGN; // 16bit texture
extern const unsigned char mollusk3_Texture[4096] _GFX_ALIGN; // 16bit texture extern const unsigned char mollusk3_Texture[4096] _GFX_ALIGN; // 16bit texture
// Palettes: // Palettes:
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -1,53 +1,53 @@
/* /*
// 3DCreateSprite // 3DCreateSprite
*/ */
// Includes // Includes
#include <PA9.h> // Include for PA_Lib #include <PA9.h> // Include for PA_Lib
#include "all_gfx.h" #include "all_gfx.h"
// Function: main() // Function: main()
int main() int main()
{ {
PA_Init(); // Initializes PA_Lib PA_Init(); // Initializes PA_Lib
PA_Init3D(); // Uses Bg0, Init 3D... PA_Init3D(); // Uses Bg0, Init 3D...
PA_Reset3DSprites(); // Init or Reset 3D Sprites PA_Reset3DSprites(); // Init or Reset 3D Sprites
// Initialise the text system on the top screen // Initialise the text system on the top screen
PA_LoadDefaultText(1, 1); // Initialise the text system on the top screen PA_LoadDefaultText(1, 1); // Initialise the text system on the top screen
PA_OutputSimpleText(1, 0, 8, "Touch to deform ^^ Doesn't look as good as expected though"); PA_OutputSimpleText(1, 0, 8, "Touch to deform ^^ Doesn't look as good as expected though");
// Create 3 sprites... // Create 3 sprites...
PA_3DCreateSprite(0, (void*)mollusk0_Texture,64, 64, TEX_16BITS, 0, 128-32, 96-32); // X, Y SPRITE CENTER ! PA_3DCreateSprite(0, (void*)mollusk0_Texture,64, 64, TEX_16BITS, 0, 128-32, 96-32); // X, Y SPRITE CENTER !
PA_3DCreateSprite(1, (void*)mollusk1_Texture,64, 64, TEX_16BITS, 0, 128+32, 96-32); // X, Y SPRITE CENTER ! PA_3DCreateSprite(1, (void*)mollusk1_Texture,64, 64, TEX_16BITS, 0, 128+32, 96-32); // X, Y SPRITE CENTER !
PA_3DCreateSprite(2, (void*)mollusk2_Texture,64, 64, TEX_16BITS, 0, 128-32, 96+32); // X, Y SPRITE CENTER ! PA_3DCreateSprite(2, (void*)mollusk2_Texture,64, 64, TEX_16BITS, 0, 128-32, 96+32); // X, Y SPRITE CENTER !
PA_3DCreateSprite(3, (void*)mollusk3_Texture,64, 64, TEX_16BITS, 0, 128+32, 96+32); // X, Y SPRITE CENTER ! PA_3DCreateSprite(3, (void*)mollusk3_Texture,64, 64, TEX_16BITS, 0, 128+32, 96+32); // X, Y SPRITE CENTER !
while(1) { while(1) {
if((Stylus.Held)) { // in the center part if((Stylus.Held)) { // in the center part
PA_3DSetSpriteBottomRight(0, Stylus.X - 128, Stylus.Y - 96); PA_3DSetSpriteBottomRight(0, Stylus.X - 128, Stylus.Y - 96);
PA_3DSetSpriteBottomLeft(1, Stylus.X - 128, Stylus.Y - 96); PA_3DSetSpriteBottomLeft(1, Stylus.X - 128, Stylus.Y - 96);
PA_3DSetSpriteTopRight(2, Stylus.X - 128, Stylus.Y - 96); PA_3DSetSpriteTopRight(2, Stylus.X - 128, Stylus.Y - 96);
PA_3DSetSpriteTopLeft(3, Stylus.X - 128, Stylus.Y - 96); PA_3DSetSpriteTopLeft(3, Stylus.X - 128, Stylus.Y - 96);
} }
PA_WaitForVBL(); PA_WaitForVBL();
PA_3DProcess(); // Update sprites PA_3DProcess(); // Update sprites
} }
return 0; return 0;
} // End of main() } // End of main()

View File

@ -1 +1 @@
include ../../../Makefile_example include ../../../Makefile_example

View File

@ -1,18 +1,18 @@
// Graphics converted using PAGfx by Mollusk. // Graphics converted using PAGfx by Mollusk.
#pragma once #pragma once
#include <PA_BgStruct.h> #include <PA_BgStruct.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C"{ extern "C"{
#endif #endif
// Sprites: // Sprites:
extern const unsigned char mollusk_Texture[4096] _GFX_ALIGN; // 16bit texture extern const unsigned char mollusk_Texture[4096] _GFX_ALIGN; // 16bit texture
// Palettes: // Palettes:
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -1,54 +1,54 @@
/* /*
// 3DCreateSprite // 3DCreateSprite
*/ */
// Includes // Includes
#include <PA9.h> // Include for PA_Lib #include <PA9.h> // Include for PA_Lib
#include "all_gfx.h" #include "all_gfx.h"
u16 gfx[3]; u16 gfx[3];
// Function: main() // Function: main()
int main() int main()
{ {
PA_Init(); // Initializes PA_Lib PA_Init(); // Initializes PA_Lib
PA_Init3D(); // Uses Bg0 PA_Init3D(); // Uses Bg0
PA_Reset3DSprites(); PA_Reset3DSprites();
// Initialise the text system on the top screen // Initialise the text system on the top screen
PA_LoadDefaultText(0, 1); PA_LoadDefaultText(0, 1);
PA_LoadDefaultText(1, 1); // Initialise the text system on the top screen PA_LoadDefaultText(1, 1); // Initialise the text system on the top screen
PA_OutputSimpleText(1, 0, 6, "Move the Sprite with the stylus"); PA_OutputSimpleText(1, 0, 6, "Move the Sprite with the stylus");
// First, create the gfx with the corresponding images and sizes. Images converted as 16bit sprites in PAGfx // First, create the gfx with the corresponding images and sizes. Images converted as 16bit sprites in PAGfx
gfx[0] = PA_3DCreateTex((void*)mollusk_Texture, 64, 64, TEX_16BITS); gfx[0] = PA_3DCreateTex((void*)mollusk_Texture, 64, 64, TEX_16BITS);
// Create 4 sprites for the different flips...... // Create 4 sprites for the different flips......
PA_3DCreateSpriteFromTex(0, gfx[0], 64, 64, 0, 80, 48); // X, Y SPRITE CENTER ! PA_3DCreateSpriteFromTex(0, gfx[0], 64, 64, 0, 80, 48); // X, Y SPRITE CENTER !
PA_3DCreateSpriteFromTex(1, gfx[0], 64, 64, 0, 80+96, 48); // X, Y SPRITE CENTER ! PA_3DCreateSpriteFromTex(1, gfx[0], 64, 64, 0, 80+96, 48); // X, Y SPRITE CENTER !
PA_3DCreateSpriteFromTex(2, gfx[0], 64, 64, 0, 80, 80+64); // X, Y SPRITE CENTER ! PA_3DCreateSpriteFromTex(2, gfx[0], 64, 64, 0, 80, 80+64); // X, Y SPRITE CENTER !
PA_3DCreateSpriteFromTex(3, gfx[0], 64, 64, 0, 80+96, 80+64); // X, Y SPRITE CENTER ! PA_3DCreateSpriteFromTex(3, gfx[0], 64, 64, 0, 80+96, 80+64); // X, Y SPRITE CENTER !
// Set the flips // Set the flips
PA_3DSetSpriteHflip(0, 0); PA_3DSetSpriteVflip(0, 0); PA_3DSetSpriteHflip(0, 0); PA_3DSetSpriteVflip(0, 0);
PA_3DSetSpriteHflip(1, 1); PA_3DSetSpriteVflip(1, 0); PA_3DSetSpriteHflip(1, 1); PA_3DSetSpriteVflip(1, 0);
PA_3DSetSpriteHflip(2, 0); PA_3DSetSpriteVflip(2, 1); PA_3DSetSpriteHflip(2, 0); PA_3DSetSpriteVflip(2, 1);
PA_3DSetSpriteHflip(3, 1); PA_3DSetSpriteVflip(3, 1); PA_3DSetSpriteHflip(3, 1); PA_3DSetSpriteVflip(3, 1);
while(1) { while(1) {
PA_WaitForVBL(); PA_WaitForVBL();
PA_3DProcess(); // Update sprites PA_3DProcess(); // Update sprites
} }
return 0; return 0;
} // End of main() } // End of main()

View File

@ -1 +1 @@
include ../../../../Makefile_example include ../../../../Makefile_example

View File

@ -1,18 +1,18 @@
// Graphics converted using PAGfx by Mollusk. // Graphics converted using PAGfx by Mollusk.
#pragma once #pragma once
#include <PA_BgStruct.h> #include <PA_BgStruct.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C"{ extern "C"{
#endif #endif
// Sprites: // Sprites:
extern const unsigned char mollusk_Texture[4096] _GFX_ALIGN; // 16bit texture extern const unsigned char mollusk_Texture[4096] _GFX_ALIGN; // 16bit texture
// Palettes: // Palettes:
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -1,56 +1,56 @@
/* /*
// 3DCreateSprite // 3DCreateSprite
*/ */
// Includes // Includes
#include <PA9.h> // Include for PA_Lib #include <PA9.h> // Include for PA_Lib
#include "all_gfx.h" #include "all_gfx.h"
u16 gfx[3]; u16 gfx[3];
// Function: main() // Function: main()
int main() int main()
{ {
PA_Init(); // Initializes PA_Lib PA_Init(); // Initializes PA_Lib
PA_Init3D(); // Uses Bg0 PA_Init3D(); // Uses Bg0
PA_Reset3DSprites(); PA_Reset3DSprites();
// Initialise the text system on the top screen // Initialise the text system on the top screen
PA_LoadDefaultText(0, 1); PA_LoadDefaultText(0, 1);
PA_LoadDefaultText(1, 1); // Initialise the text system on the top screen PA_LoadDefaultText(1, 1); // Initialise the text system on the top screen
PA_OutputSimpleText(1, 2, 6, "Touch the screen to resize !"); PA_OutputSimpleText(1, 2, 6, "Touch the screen to resize !");
// First, create the gfx with the corresponding images and sizes. Images converted as 16bit textures in PAGfx // First, create the gfx with the corresponding images and sizes. Images converted as 16bit textures in PAGfx
gfx[0] = PA_3DCreateTex((void*)mollusk_Texture, 64, 64, TEX_16BITS); gfx[0] = PA_3DCreateTex((void*)mollusk_Texture, 64, 64, TEX_16BITS);
// Create sprite... // Create sprite...
PA_3DCreateSpriteFromTex(0, // Sprite number PA_3DCreateSpriteFromTex(0, // Sprite number
gfx[0], // Gfx... gfx[0], // Gfx...
64, 64, // Width, Height 64, 64, // Width, Height
0, // Palette 0, // Palette
128, 96); // X, Y SPRITE CENTER ! 128, 96); // X, Y SPRITE CENTER !
while(1) { while(1) {
if(Stylus.Held){ // Resize if held... if(Stylus.Held){ // Resize if held...
if(Stylus.X >= 128) PA_3DSetSpriteWidth(0, (Stylus.X-128)*2); if(Stylus.X >= 128) PA_3DSetSpriteWidth(0, (Stylus.X-128)*2);
else PA_3DSetSpriteWidth(0, (128-Stylus.X)*2); else PA_3DSetSpriteWidth(0, (128-Stylus.X)*2);
if(Stylus.Y >= 96) PA_3DSetSpriteHeight(0, (Stylus.Y-96)*2); if(Stylus.Y >= 96) PA_3DSetSpriteHeight(0, (Stylus.Y-96)*2);
else PA_3DSetSpriteHeight(0, (96-Stylus.Y)*2); else PA_3DSetSpriteHeight(0, (96-Stylus.Y)*2);
} }
PA_WaitForVBL(); PA_WaitForVBL();
PA_3DProcess(); // Update sprites PA_3DProcess(); // Update sprites
} }
return 0; return 0;
} // End of main() } // End of main()

View File

@ -1 +1 @@
include ../../../../Makefile_example include ../../../../Makefile_example

View File

@ -1,20 +1,20 @@
// Graphics converted using PAGfx by Mollusk. // Graphics converted using PAGfx by Mollusk.
#pragma once #pragma once
#include <PA_BgStruct.h> #include <PA_BgStruct.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C"{ extern "C"{
#endif #endif
// Sprites: // Sprites:
extern const unsigned char mollusk_Texture[4096] _GFX_ALIGN; // 16bit texture extern const unsigned char mollusk_Texture[4096] _GFX_ALIGN; // 16bit texture
extern const unsigned char AnarX_Texture[4096] _GFX_ALIGN; // 16bit texture extern const unsigned char AnarX_Texture[4096] _GFX_ALIGN; // 16bit texture
extern const unsigned char Abrexxes_Texture[4096] _GFX_ALIGN; // 16bit texture extern const unsigned char Abrexxes_Texture[4096] _GFX_ALIGN; // 16bit texture
// Palettes: // Palettes:
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -1,64 +1,64 @@
/* /*
// 3DCreateSprite // 3DCreateSprite
*/ */
// Includes // Includes
#include <PA9.h> // Include for PA_Lib #include <PA9.h> // Include for PA_Lib
#include "all_gfx.h" #include "all_gfx.h"
u16 gfx[3]; u16 gfx[3];
// Function: main() // Function: main()
int main() int main()
{ {
PA_Init(); // Initializes PA_Lib PA_Init(); // Initializes PA_Lib
PA_Init3D(); // Uses Bg0 PA_Init3D(); // Uses Bg0
PA_Reset3DSprites(); PA_Reset3DSprites();
// Initialise the text system on the top screen // Initialise the text system on the top screen
PA_LoadDefaultText(0, 1); PA_LoadDefaultText(0, 1);
PA_LoadDefaultText(1, 1); // Initialise the text system on the top screen PA_LoadDefaultText(1, 1); // Initialise the text system on the top screen
PA_OutputSimpleText(1, 2, 6, "3D Sprite Rotation !"); PA_OutputSimpleText(1, 2, 6, "3D Sprite Rotation !");
// First, create the gfx with the corresponding images and sizes. Images converted as 16bit textures in PAGfx // First, create the gfx with the corresponding images and sizes. Images converted as 16bit textures in PAGfx
gfx[0] = PA_3DCreateTex((void*)mollusk_Texture, 64, 64, TEX_16BITS); gfx[0] = PA_3DCreateTex((void*)mollusk_Texture, 64, 64, TEX_16BITS);
gfx[1] = PA_3DCreateTex((void*)AnarX_Texture, 64, 64, TEX_16BITS); gfx[1] = PA_3DCreateTex((void*)AnarX_Texture, 64, 64, TEX_16BITS);
gfx[2] = PA_3DCreateTex((void*)Abrexxes_Texture, 64, 64, TEX_16BITS); gfx[2] = PA_3DCreateTex((void*)Abrexxes_Texture, 64, 64, TEX_16BITS);
// Create 3 sprites... // Create 3 sprites...
PA_3DCreateSpriteFromTex(0, // Sprite number PA_3DCreateSpriteFromTex(0, // Sprite number
gfx[0], // Gfx... gfx[0], // Gfx...
64, 64, // Width, Height 64, 64, // Width, Height
0, // Palette 0, // Palette
32, 32); // X, Y SPRITE CENTER ! 32, 32); // X, Y SPRITE CENTER !
PA_3DCreateSpriteFromTex(1, gfx[1], 64, 64, 0, 96, 96); PA_3DCreateSpriteFromTex(1, gfx[1], 64, 64, 0, 96, 96);
PA_3DCreateSpriteFromTex(2, gfx[2], 64, 64, 0, 160, 96+64); PA_3DCreateSpriteFromTex(2, gfx[2], 64, 64, 0, 160, 96+64);
u16 rot = 0; u16 rot = 0;
while(1) { while(1) {
rot += 4; // add to angle... rot += 4; // add to angle...
rot &= 511; // limit range to 0-511... rot &= 511; // limit range to 0-511...
PA_3DSetSpriteRotate(0, rot); // Sprite, angle (0-511) PA_3DSetSpriteRotate(0, rot); // Sprite, angle (0-511)
PA_3DSetSpriteRotate(1, -rot); // Other way around PA_3DSetSpriteRotate(1, -rot); // Other way around
PA_3DSetSpriteRotate(2, rot*2); // Twice as fast PA_3DSetSpriteRotate(2, rot*2); // Twice as fast
PA_WaitForVBL(); PA_WaitForVBL();
PA_3DProcess(); // Update sprites PA_3DProcess(); // Update sprites
} }
return 0; return 0;
} // End of main() } // End of main()

View File

@ -1 +1 @@
include ../../../../Makefile_example include ../../../../Makefile_example

View File

@ -1,20 +1,20 @@
// Graphics converted using PAGfx by Mollusk. // Graphics converted using PAGfx by Mollusk.
#pragma once #pragma once
#include <PA_BgStruct.h> #include <PA_BgStruct.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C"{ extern "C"{
#endif #endif
// Sprites: // Sprites:
extern const unsigned char mollusk_Texture[4096] _GFX_ALIGN; // 16bit texture extern const unsigned char mollusk_Texture[4096] _GFX_ALIGN; // 16bit texture
extern const unsigned char AnarX_Texture[4096] _GFX_ALIGN; // 16bit texture extern const unsigned char AnarX_Texture[4096] _GFX_ALIGN; // 16bit texture
extern const unsigned char Abrexxes_Texture[4096] _GFX_ALIGN; // 16bit texture extern const unsigned char Abrexxes_Texture[4096] _GFX_ALIGN; // 16bit texture
// Palettes: // Palettes:
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -1,64 +1,64 @@
/* /*
// 3DCreateSprite // 3DCreateSprite
*/ */
// Includes // Includes
#include <PA9.h> // Include for PA_Lib #include <PA9.h> // Include for PA_Lib
#include "all_gfx.h" #include "all_gfx.h"
u16 gfx[3]; u16 gfx[3];
// Function: main() // Function: main()
int main() int main()
{ {
PA_Init(); // Initializes PA_Lib PA_Init(); // Initializes PA_Lib
PA_Init3D(); // Uses Bg0 PA_Init3D(); // Uses Bg0
PA_Reset3DSprites(); PA_Reset3DSprites();
// Initialise the text system on the top screen // Initialise the text system on the top screen
PA_LoadDefaultText(0, 1); PA_LoadDefaultText(0, 1);
PA_LoadDefaultText(1, 1); // Initialise the text system on the top screen PA_LoadDefaultText(1, 1); // Initialise the text system on the top screen
PA_OutputSimpleText(1, 2, 6, "3D Sprite Rotations Revisited ^^"); PA_OutputSimpleText(1, 2, 6, "3D Sprite Rotations Revisited ^^");
// First, create the gfx with the corresponding images and sizes. Images converted as 16bit textures in PAGfx // First, create the gfx with the corresponding images and sizes. Images converted as 16bit textures in PAGfx
gfx[0] = PA_3DCreateTex((void*)mollusk_Texture, 64, 64, TEX_16BITS); gfx[0] = PA_3DCreateTex((void*)mollusk_Texture, 64, 64, TEX_16BITS);
gfx[1] = PA_3DCreateTex((void*)AnarX_Texture, 64, 64, TEX_16BITS); gfx[1] = PA_3DCreateTex((void*)AnarX_Texture, 64, 64, TEX_16BITS);
gfx[2] = PA_3DCreateTex((void*)Abrexxes_Texture, 64, 64, TEX_16BITS); gfx[2] = PA_3DCreateTex((void*)Abrexxes_Texture, 64, 64, TEX_16BITS);
// Create 3 sprites... // Create 3 sprites...
PA_3DCreateSpriteFromTex(0, // Sprite number PA_3DCreateSpriteFromTex(0, // Sprite number
gfx[0], // Gfx... gfx[0], // Gfx...
64, 64, // Width, Height 64, 64, // Width, Height
0, // Palette 0, // Palette
32, 32); // X, Y SPRITE CENTER ! 32, 32); // X, Y SPRITE CENTER !
PA_3DCreateSpriteFromTex(1, gfx[1], 64, 64, 0, 96, 96); PA_3DCreateSpriteFromTex(1, gfx[1], 64, 64, 0, 96, 96);
PA_3DCreateSpriteFromTex(2, gfx[2], 64, 64, 0, 160, 96+64); PA_3DCreateSpriteFromTex(2, gfx[2], 64, 64, 0, 160, 96+64);
u16 rot = 0; u16 rot = 0;
while(1) { while(1) {
rot += 4; // add to angle... rot += 4; // add to angle...
rot &= 511; // limit range to 0-511... rot &= 511; // limit range to 0-511...
// if(Stylus.Held) PA_3DSetSpriteXY(0, Stylus.X, Stylus.Y); // if(Stylus.Held) PA_3DSetSpriteXY(0, Stylus.X, Stylus.Y);
PA_3DSetSpriteRotateX(0, rot); // Xrot PA_3DSetSpriteRotateX(0, rot); // Xrot
PA_3DSetSpriteRotateY(1, rot); // Yrot PA_3DSetSpriteRotateY(1, rot); // Yrot
PA_3DSetSpriteRotateXYZ(2, rot, rot, rot); // Let's do triple rotation and see what it does ^^ PA_3DSetSpriteRotateXYZ(2, rot, rot, rot); // Let's do triple rotation and see what it does ^^
PA_WaitForVBL(); PA_WaitForVBL();
PA_3DProcess(); // Update sprites PA_3DProcess(); // Update sprites
} }
return 0; return 0;
} // End of main() } // End of main()

View File

@ -1 +1 @@
include ../../Makefile_example include ../../Makefile_example

View File

@ -1,20 +1,20 @@
// Graphics converted using PAGfx by Mollusk. // Graphics converted using PAGfx by Mollusk.
#pragma once #pragma once
#include <PA_BgStruct.h> #include <PA_BgStruct.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C"{ extern "C"{
#endif #endif
// Sprites: // Sprites:
extern const unsigned char mollusk_Texture[4096] _GFX_ALIGN; // 16bit texture extern const unsigned char mollusk_Texture[4096] _GFX_ALIGN; // 16bit texture
extern const unsigned char AnarX_Texture[4096] _GFX_ALIGN; // 16bit texture extern const unsigned char AnarX_Texture[4096] _GFX_ALIGN; // 16bit texture
extern const unsigned char Abrexxes_Texture[4096] _GFX_ALIGN; // 16bit texture extern const unsigned char Abrexxes_Texture[4096] _GFX_ALIGN; // 16bit texture
// Palettes: // Palettes:
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -1,89 +1,89 @@
/* /*
// 3D Sprite Moving example... // 3D Sprite Moving example...
*/ */
// Includes // Includes
#include <PA9.h> // Include for PA_Lib #include <PA9.h> // Include for PA_Lib
#include "all_gfx.h" #include "all_gfx.h"
#define N_SPRITES 128 // Number of sprites in the example #define N_SPRITES 128 // Number of sprites in the example
u16 gfx[3]; u16 gfx[3];
typedef struct{ typedef struct{
s32 x, y, vx, vy; s32 x, y, vx, vy;
} spritepos; } spritepos;
spritepos sprites[1024]; // Let's manage the sprite positions ^^ spritepos sprites[1024]; // Let's manage the sprite positions ^^
// Function: main() // Function: main()
int main(void) int main(void)
{ {
PA_Init(); // Initializes PA_Lib PA_Init(); // Initializes PA_Lib
PA_Init3D(); // Uses Bg0 PA_Init3D(); // Uses Bg0
PA_Reset3DSprites(); PA_Reset3DSprites();
// Initialise the text system on the top screen // Initialise the text system on the top screen
PA_LoadDefaultText(0, 1); PA_LoadDefaultText(0, 1);
PA_LoadDefaultText(1, 1); // Initialise the text system on the top screen PA_LoadDefaultText(1, 1); // Initialise the text system on the top screen
PA_OutputSimpleText(1, 2, 6, " 3d Sprite Example, 1024 64x64sprites resized to 16x16 and moving around !"); PA_OutputSimpleText(1, 2, 6, " 3d Sprite Example, 1024 64x64sprites resized to 16x16 and moving around !");
// First, create the gfx with the corresponding images and sizes. Images converted as 16bit textures in PAGfx // First, create the gfx with the corresponding images and sizes. Images converted as 16bit textures in PAGfx
gfx[0] = PA_3DCreateTex((void*)mollusk_Texture, // Texture gfx[0] = PA_3DCreateTex((void*)mollusk_Texture, // Texture
64, 64, // Width, Height 64, 64, // Width, Height
TEX_16BITS ); // Texture Format TEX_16BITS ); // Texture Format
gfx[1] = PA_3DCreateTex((void*)AnarX_Texture, 64, 64, TEX_16BITS); gfx[1] = PA_3DCreateTex((void*)AnarX_Texture, 64, 64, TEX_16BITS);
gfx[2] = PA_3DCreateTex((void*)Abrexxes_Texture, 64, 64, TEX_16BITS); gfx[2] = PA_3DCreateTex((void*)Abrexxes_Texture, 64, 64, TEX_16BITS);
s32 i; s32 i;
u16 angle; u16 angle;
for(i = 0; i < N_SPRITES; i++) { for(i = 0; i < N_SPRITES; i++) {
sprites[i].x = ((i&31)<<4); sprites[i].x = ((i&31)<<4);
sprites[i].y = ((i>>5)<<4)-32; sprites[i].y = ((i>>5)<<4)-32;
PA_3DCreateSpriteFromTex(i, // Sprite number PA_3DCreateSpriteFromTex(i, // Sprite number
gfx[PA_Rand()%3], // Gfx, random one :p gfx[PA_Rand()%3], // Gfx, random one :p
64, 64, // Width, Height 64, 64, // Width, Height
0, // Palette 0, // Palette
sprites[i].x, sprites[i].y); // X, Y sprites[i].x, sprites[i].y); // X, Y
PA_3DSetSpriteWidthHeight(i, 16, 16); // Resize to way smaller ^^ PA_3DSetSpriteWidthHeight(i, 16, 16); // Resize to way smaller ^^
angle = PA_Rand()&511; // random angle angle = PA_Rand()&511; // random angle
sprites[i].vx = PA_Cos(angle)>>7; sprites[i].vx = PA_Cos(angle)>>7;
sprites[i].vy = -PA_Sin(angle)>>7; sprites[i].vy = -PA_Sin(angle)>>7;
} }
PA_SwitchScreens(); // Put the 3D on top PA_SwitchScreens(); // Put the 3D on top
PA_SetKeyboardScreen(1); // Top screen PA_SetKeyboardScreen(1); // Top screen
PA_LoadDefaultKeyboard(1); // Bg 1 PA_LoadDefaultKeyboard(1); // Bg 1
PA_WaitForVBL(); PA_WaitForVBL();
PA_3DProcess(); // Update 3DSprites PA_3DProcess(); // Update 3DSprites
PA_KeyboardIn(16, 192-104); // Scroll in PA_KeyboardIn(16, 192-104); // Scroll in
while(1) { while(1) {
for(i = 0; i < N_SPRITES; i++){ // Move them around and change speed if touches screen for(i = 0; i < N_SPRITES; i++){ // Move them around and change speed if touches screen
sprites[i].x += sprites[i].vx; sprites[i].x += sprites[i].vx;
if(((sprites[i].x <= 8)&&(sprites[i].vx < 0))||((sprites[i].x>=255-8)&&(sprites[i].vx > 0))) sprites[i].vx = -sprites[i].vx; if(((sprites[i].x <= 8)&&(sprites[i].vx < 0))||((sprites[i].x>=255-8)&&(sprites[i].vx > 0))) sprites[i].vx = -sprites[i].vx;
sprites[i].y += sprites[i].vy; sprites[i].y += sprites[i].vy;
if(((sprites[i].y <= 8)&&(sprites[i].vy < 0))||((sprites[i].y>=191-8)&&(sprites[i].vy > 0))) sprites[i].vy = -sprites[i].vy; if(((sprites[i].y <= 8)&&(sprites[i].vy < 0))||((sprites[i].y>=191-8)&&(sprites[i].vy > 0))) sprites[i].vy = -sprites[i].vy;
PA_3DSetSpriteXY(i, sprites[i].x, sprites[i].y); // Set new position PA_3DSetSpriteXY(i, sprites[i].x, sprites[i].y); // Set new position
} }
PA_CheckKeyboard(); PA_CheckKeyboard();
PA_WaitForVBL(); PA_WaitForVBL();
PA_3DProcess(); // Update 3DSprites PA_3DProcess(); // Update 3DSprites
} }
return 0; return 0;
} // End of main() } // End of main()

View File

@ -1 +1 @@
include ../../../Makefile_example include ../../../Makefile_example

View File

@ -1,18 +1,18 @@
// Graphics converted using PAGfx by Mollusk. // Graphics converted using PAGfx by Mollusk.
#pragma once #pragma once
#include <PA_BgStruct.h> #include <PA_BgStruct.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C"{ extern "C"{
#endif #endif
// Backgrounds: // Backgrounds:
extern const PA_BgStruct bg0; extern const PA_BgStruct bg0;
// Palettes: // Palettes:
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -1,17 +1,17 @@
#include <PA_BgStruct.h> #include <PA_BgStruct.h>
extern const char bg0_Tiles[]; extern const char bg0_Tiles[];
extern const char bg0_Map[]; extern const char bg0_Map[];
extern const char bg0_Pal[]; extern const char bg0_Pal[];
const PA_BgStruct bg0 = { const PA_BgStruct bg0 = {
PA_BgNormal, PA_BgNormal,
256, 192, 256, 192,
bg0_Tiles, bg0_Tiles,
bg0_Map, bg0_Map,
{bg0_Pal}, {bg0_Pal},
12352, 12352,
{1536} {1536}
}; };

View File

@ -1,27 +1,27 @@
// Includes // Includes
#include <PA9.h> #include <PA9.h>
// Converted using PAGfx // Converted using PAGfx
#include "all_gfx.h" #include "all_gfx.h"
int main(){ int main(){
PA_Init(); PA_Init();
PA_LoadDefaultText(1, 0); PA_LoadDefaultText(1, 0);
// Load Backgrounds with their palettes ! // Load Backgrounds with their palettes !
PA_LoadBackground(0, // screen PA_LoadBackground(0, // screen
3, // background number (0-3) 3, // background number (0-3)
&bg0); // Background name, used by PAGfx... &bg0); // Background name, used by PAGfx...
PA_OutputSimpleText(1, 2, 10, "Touch the screen to display the color on top screen"); PA_OutputSimpleText(1, 2, 10, "Touch the screen to display the color on top screen");
// Infinite loop to keep the program running // Infinite loop to keep the program running
while(true){ while(true){
PA_OutputText(1, 2, 5, "Palette Color : %d ", PA_EasyBgGetPixel(0, 3, Stylus.X, Stylus.Y)); // Screen, Bg_number, X/Y position PA_OutputText(1, 2, 5, "Palette Color : %d ", PA_EasyBgGetPixel(0, 3, Stylus.X, Stylus.Y)); // Screen, Bg_number, X/Y position
// Returns the palette number (0-255) // Returns the palette number (0-255)
PA_SetBgColor(1, PA_EasyBgGetPixelCol(0, 3, Stylus.X, Stylus.Y)); // Same thing, but returns Color value... PA_SetBgColor(1, PA_EasyBgGetPixelCol(0, 3, Stylus.X, Stylus.Y)); // Same thing, but returns Color value...
PA_WaitForVBL(); PA_WaitForVBL();
} }
} }

View File

@ -1 +1 @@
include ../../../Makefile_example include ../../../Makefile_example

View File

@ -1,18 +1,18 @@
// Graphics converted using PAGfx by Mollusk. // Graphics converted using PAGfx by Mollusk.
#pragma once #pragma once
#include <PA_BgStruct.h> #include <PA_BgStruct.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C"{ extern "C"{
#endif #endif
// Backgrounds: // Backgrounds:
extern const PA_BgStruct zelda; extern const PA_BgStruct zelda;
// Palettes: // Palettes:
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -1,17 +1,17 @@
#include <PA_BgStruct.h> #include <PA_BgStruct.h>
extern const char zelda_Tiles[]; extern const char zelda_Tiles[];
extern const char zelda_Map[]; extern const char zelda_Map[];
extern const char zelda_Pal[]; extern const char zelda_Pal[];
const PA_BgStruct zelda = { const PA_BgStruct zelda = {
PA_BgLarge, PA_BgLarge,
2048, 2048, 2048, 2048,
zelda_Tiles, zelda_Tiles,
zelda_Map, zelda_Map,
{zelda_Pal}, {zelda_Pal},
15552, 15552,
{131072} {131072}
}; };

Some files were not shown because too many files have changed in this diff Show More