Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <pspdisplay.h>
- #include <pspctrl.h>
- #include <pspkernel.h>
- #include <pspdebug.h>
- #include <pspaudio.h>
- #include <pspaudiolib.h>
- #include <psppower.h>
- #include <pspgu.h>
- #include <png.h>
- #include <stdio.h>
- #include "graphics.h"
- #include "mp3player.h"
- #define printf pspDebugScreenPrintf
- #define black 0xFF000000
- PSP_MODULE_INFO("Final Fantasy: FM", 0, 1, 0);
- /* Exit callback */
- int exit_callback(int arg1, int arg2, void *common) {
- sceKernelExitGame();
- return 0;
- }
- /* Callback thread */
- int CallbackThread(SceSize args, void *argp) {
- int cbid;
- cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
- sceKernelRegisterExitCallback(cbid);
- sceKernelSleepThreadCB();
- return 0;
- }
- /* Sets up the callback thread and returns its thread id */
- int SetupCallbacks(void) {
- int thid = 0;
- thid = sceKernelCreateThread("update_thread", CallbackThread, 0x11, 0xFA0, 0, 0);
- if(thid >= 0) {
- sceKernelStartThread(thid, 0, 0);
- }
- return thid;
- }
- int main() {
- pspDebugScreenInit();
- SetupCallbacks();
- initGraphics();
- pspAudioInit();
- SceCtrlData pad;
- scePowerSetClockFrequency(333, 333, 166);
- MP3_Init(1);
- MP3_Load("test.mp3");
- Image* Figur;
- Image* Hintergrund;
- Figur = loadImage("cursor.png");
- Hintergrund = loadImage("title.png");
- int x = 192;
- int y = 198;
- while(1) {
- sceCtrlReadBufferPositive(&pad, 1);
- sceDisplayWaitVblankStart();
- MP3_Play();
- //Ich setze den Cursor nach oben/unten
- if(pad.Buttons & PSP_CTRL_UP) {
- x = 192, y = 198;
- clearScreen(black);
- }
- if(pad.Buttons & PSP_CTRL_DOWN) {
- x = 208, y = 228;
- clearScreen(black);
- }
- //Die Syntax um ein Bild anzuzeigen sieht so aus: blitAlphaImageToScreen( XY Position im Bildfeld, Bildgröße, Image* , Position auf dem Bildschirm);
- blitAlphaImageToScreen( 0, 0, 480, 272, Hintergrund, 0, 0);
- //Da ein Code immer von oben nach unten gelesen wird, muss der Hintergrund vor der Figur sein
- blitAlphaImageToScreen( 0, 0, 48, 24, Figur, x, y);
- //Bildschirmanzeige
- flipScreen();
- }
- sceKernelExitGame();
- return 0;
- }
Add Comment
Please, Sign In to add comment