|
|
|
#1 Добавлено: 16 апреля 2012 13:21 |
|
|
|
|
Посетители
deucela
--
Возраст: -- | |
Сообщений: 19
Благодарности: 0 / 0
Репутация: 0
Предупреждений: 3
Друзья
Тут: 12 лет
|
|
Hi everyone/ My name is Alex. And i wanna use this forum..:) It will be very good Russian language practise form me:) and for you practise in psp game making Это код моего работа . Дефолт меню. Через несколько день я напишу вам код обычного 2д шутера! Вы можете менять рисунок..(Small practise):D
//(c)Frostegater for "#define RGBA ...."
#include
#include
#include
#include
#include
#include
#include "graphics.h"
#define printf pspDebugScreenPrintf
#define RGBA(r, g, b, a) 0x00000000 | a << 24 | b << 16 | g << 8 | r
PSP_MODULE_INFO("menu", 0, 1, 1);
PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER | THREAD_ATTR_VFPU);
void dump_threadstatus(void);
int done = 0;
int exit_callback(int arg1, int arg2, void *common)
{
done = 1;
return 0;
}
int CallbackThread(SceSize args, void *argp)
{
int cbid;
cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
sceKernelRegisterExitCallback(cbid);
sceKernelSleepThreadCB();
return 0;
}
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(int argc, char *argv[])
{
u32 bkg = RGBA(255,255,255,0);
u32 color = RGBA(10,60,240,0);
int menu = 0;
pspDebugScreenInit();
initGraphics();
SceCtrlData pad;
pspDebugScreenInit();
SetupCallbacks();
const char* item[5] = { "start", "options", "music", "trololo", "bee"};
while(!done){
pspDebugScreenSetXY(0, 2);
clearScreen(bkg);
sceCtrlReadBufferPositive(&pad, 1);
if (pad.Buttons & PSP_CTRL_DOWN){
menu++;
sceKernelDelayThread(900000);
}
if (pad.Buttons & PSP_CTRL_UP){
sceKernelDelayThread(900000);
menu--;
}
int i;
for(i = 0;i 5 || menu < 0){
menu = 0;
}
flipScreen();
}
return 0;
}
The source of this menu here(without a license): Вы не можете скачивать файлы с нашего сервера Сообщение отредактировано 16 апреля 2012 13:52. Редактировалось 8 раз(а)
|
|
|
|
|
#2 Добавлено: 16 апреля 2012 16:00 |
|
|
|
|
Посетители
Niko9566
--
Возраст: -- | |
Сообщений: 736
Благодарности: 32 / 79
Репутация: 59
Предупреждений: 1
Друзья
Тут: 15 лет 2 месяцa
|
|
Цитата: deucela Hi everyone/ My name is Alex. And i wanna use this forum..:) It will be very good Russian language practice form me:) and for you practice in psp game making Thank you for code =) But please, try to use English forums (wololo, dashhacks), but if you wanna to work in our forums, try) (Наверняка есть ошибки в предложениях -_-)
|
|
|
|
|
#3 Добавлено: 16 апреля 2012 18:57 |
|
|
|
|
Посетители
deucela
--
Возраст: -- | |
Сообщений: 19
Благодарности: 0 / 0
Репутация: 0
Предупреждений: 3
Друзья
Тут: 12 лет
|
|
Ok,thx:) Добавлено спустя 1 минуту 57 секунд:#include <pspkernel.h>
#include <pspdebug.h>
#include <pspctrl.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "graphics.h"
#define printf pspDebugScreenPrintf
#define RGBA(r, g, b, a) 0x00000000 | a << 24 | b << 16 | g << 8 | r
PSP_MODULE_INFO("template", 0, 1, 1);
PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER | THREAD_ATTR_VFPU);
void dump_threadstatus(void);
int done = 0;
int exit_callback(int arg1, int arg2, void *common)
{
done = 1;
return 0;
}
int CallbackThread(SceSize args, void *argp)
{
int cbid;
cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
sceKernelRegisterExitCallback(cbid);
sceKernelSleepThreadCB();
return 0;
}
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(int argc, char *argv[])
{
u32 bkg = RGBA(255,255,255,0);
u32 color = RGBA(10,60,240,0);
int menu = 0;
pspDebugScreenInit();
initGraphics();
SceCtrlData pad;
pspDebugScreenInit();
SetupCallbacks();
const char* item[5] = { "start", "options", "music", "trololo", "bee"};
while(!done){
pspDebugScreenSetXY(0, 2);
clearScreen(bkg);
sceCtrlReadBufferPositive(&pad, 1);
if (pad.Buttons & PSP_CTRL_DOWN){
menu++;
sceKernelDelayThread(900000);
}
if (pad.Buttons & PSP_CTRL_UP){
sceKernelDelayThread(900000);
menu--;
}
int i;
for(i = 0;i<5;i++)
{
printTextScreen(30,50+i*40,item[i],color);
if(menu == i){
printTextScreen(30,50+i*40,item[menu],bkg);
}
}
if(menu > 5 || menu < 0){
menu = 0;
}
flipScreen();
}
return 0;
} Добавлено спустя 39 секунд:sorry for the first post/ :(
|
|
|