Skip to content

Commit 4d9720a

Browse files
committed
name changes
1 parent 5976d57 commit 4d9720a

File tree

4 files changed

+49
-20
lines changed

4 files changed

+49
-20
lines changed

eboot_plugin/source/eboot_plugin.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ void updateController()
2828
if(ret==0)
2929
{
3030

31-
if(orbisPadGetButton(SCE_PAD_BUTTON_UP))
31+
if(orbisPadGetButton(ORBISPAD_UP))
3232
{
3333
if(y-step>=0)
3434
{
@@ -39,7 +39,7 @@ void updateController()
3939
y=0;
4040
}
4141
}
42-
if(orbisPadGetButton(SCE_PAD_BUTTON_DOWN))
42+
if(orbisPadGetButton(ORBISPAD_DOWN))
4343
{
4444
if(y+step<conf->height-1)
4545
{
@@ -50,7 +50,7 @@ void updateController()
5050
y=conf->height-1-step;
5151
}
5252
}
53-
if(orbisPadGetButton(SCE_PAD_BUTTON_RIGHT))
53+
if(orbisPadGetButton(ORBISPAD_RIGHT))
5454
{
5555
if(x+step<conf->width-1)
5656
{
@@ -61,7 +61,7 @@ void updateController()
6161
x=conf->width-1-step;
6262
}
6363
}
64-
if(orbisPadGetButton(SCE_PAD_BUTTON_LEFT))
64+
if(orbisPadGetButton(ORBISPAD_LEFT))
6565
{
6666
if(x-step>=0)
6767
{
@@ -72,21 +72,21 @@ void updateController()
7272
x=0;
7373
}
7474
}
75-
if(orbisPadGetButton(SCE_PAD_BUTTON_TRIANGLE))
75+
if(orbisPadGetButton(ORBISPAD_TRIANGLE))
7676
{
7777
sys_log("Triangle pressed exit\n");
7878

7979
flag=0;
8080

8181
}
82-
if(orbisPadGetButton(SCE_PAD_BUTTON_CIRCLE))
82+
if(orbisPadGetButton(ORBISPAD_CIRCLE))
8383
{
8484
sys_log("Circle pressed reset position and color red\n");
8585
x=1280/2;
8686
y=720/2;
8787
color=0x80ff0000;
8888
}
89-
if(orbisPadGetButton(SCE_PAD_BUTTON_CROSS))
89+
if(orbisPadGetButton(ORBISPAD_CROSS))
9090
{
9191
sys_log("Cross pressed rand color\n");
9292
R=rand()%256;
@@ -95,7 +95,7 @@ void updateController()
9595
color=0x80000000|R<<16|G<<8|B;
9696

9797
}
98-
if(orbisPadGetButton(SCE_PAD_BUTTON_SQUARE))
98+
if(orbisPadGetButton(ORBISPAD_SQUARE))
9999
{
100100
sys_log("Square pressed\n");
101101

liborbis2d/include/orbis2d.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,12 @@
55

66

77
#define ORBIS2D_DISPLAY_BUFFER_NUM 2
8-
#define ORBIS2D_FLIP_RATE 0 // 0 none 1 30fps 2 20fps
9-
#define ORBIS2D_FLIP_MODE SCE_VIDEO_OUT_FLIP_MODE_VSYNC
8+
#define ORBIS2D_FLIP_RATE 0
9+
#define ORBIS2D_FLIP_MODE_VSYNC 1
10+
#define ORBIS2D_FLIP_MODE_HSYNC 2
11+
#define ORBIS2D_FLIP_MODE_WINDOW 3
12+
#define ORBIS2D_MODE_TILE 0
13+
#define ORBIS2D_MODE_LINEAR 1
1014

1115

1216
#define ATTR_WIDTH 1280

liborbis2d/source/orbis2d.c

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,14 @@
22
#include <stdlib.h>
33
#include <sys/param.h>
44
#include <kernel.h>
5+
#include <types/event.h>
6+
7+
58
#include <gnmdriver.h>
69
#include <systemservice.h>
710
#include <videoout.h>
811
#include <types/userservice.h>
12+
913
#include "orbis2d.h"
1014
#include "logdebug.h"
1115

@@ -53,10 +57,10 @@ int orbis2dCreateConf()
5357
orbconf->width=ATTR_WIDTH;
5458
orbconf->pitch=ATTR_WIDTH;
5559
orbconf->height=ATTR_HEIGHT;
56-
orbconf->pixelFormat=SCE_VIDEO_OUT_PIXEL_FORMAT_A8R8G8B8_SRGB;
60+
orbconf->pixelFormat=0x80000000;
5761
orbconf->bytesPerPixel=4;
58-
orbconf->tilingMode=SCE_VIDEO_OUT_TILING_MODE_LINEAR;
59-
orbconf->flipMode=ORBIS2D_FLIP_MODE;
62+
orbconf->tilingMode=ORBIS2D_MODE_LINEAR;
63+
orbconf->flipMode=ORBIS2D_FLIP_MODE_VSYNC;
6064
orbconf->flipRate=ORBIS2D_FLIP_RATE;
6165
orbconf->videoHandle=-1;
6266
orbconf->currentBuffer=0;
@@ -160,7 +164,7 @@ void orbis2dStartDrawing()
160164
orbis2dWaitFlipArg(&orbconf->flipQueue);
161165

162166
}
163-
void orbis2dWritePixelColor(int x, int y, uint32_t pixelColor)
167+
void orbis2dDrawPixelColor(int x, int y, uint32_t pixelColor)
164168
{
165169
int color;
166170
int pixel = (y * orbconf->pitch) + x;
@@ -178,7 +182,7 @@ void orbis2dDrawRectColor(int x, int w, int y, int h, uint32_t color)
178182
{
179183
for(x0=x;x0<x+w;x0++)
180184
{
181-
orbis2dWritePixelColor(x0,y0,color);
185+
orbis2dDrawPixelColor(x0,y0,color);
182186
}
183187
}
184188
}
@@ -223,7 +227,7 @@ int orbis2dInitDisplayBuffer(int num, int bufIndexStart)
223227
{
224228
SceVideoOutBufferAttribute attr;
225229
int ret;
226-
sceVideoOutSetBufferAttribute(&attr,orbconf->pixelFormat,orbconf->tilingMode,SCE_VIDEO_OUT_ASPECT_RATIO_16_9,orbconf->width,orbconf->height,orbconf->pitch);
230+
sceVideoOutSetBufferAttribute(&attr,orbconf->pixelFormat,orbconf->tilingMode,0,orbconf->width,orbconf->height,orbconf->pitch);
227231

228232
sys_log("liborbis2d sceVideoOutSetBufferAttribute done\n");
229233

@@ -240,15 +244,15 @@ int orbis2dInitMemory()
240244

241245
const uint32_t align=2*1024*1024;
242246

243-
ret=sceKernelAllocateDirectMemory(0,sceKernelGetDirectMemorySize(),orbconf->videoMemStackSize,align,SCE_KERNEL_WC_GARLIC,&start);
247+
ret=sceKernelAllocateDirectMemory(0,sceKernelGetDirectMemorySize(),orbconf->videoMemStackSize,align,3,&start);
244248
if(ret==0)
245249
{
246250

247251
orbconf->videoMemOffset=start;
248252

249253
void* pointer=NULL;
250254

251-
ret=sceKernelMapDirectMemory(&pointer,orbconf->videoMemStackSize,SCE_KERNEL_PROT_CPU_READ|SCE_KERNEL_PROT_CPU_WRITE|SCE_KERNEL_PROT_GPU_READ|SCE_KERNEL_PROT_GPU_ALL,0,start,align);
255+
ret=sceKernelMapDirectMemory(&pointer,orbconf->videoMemStackSize,0x33,0,start,align);
252256
if(ret==0)
253257
{
254258
orbconf->videoMemStackBaseAddr=(uintptr_t)pointer;
@@ -264,7 +268,7 @@ int orbis2dInitVideoHandle()
264268
int handle;
265269
int ret;
266270

267-
handle=sceVideoOutOpen(SCE_USER_SERVICE_USER_ID_SYSTEM, SCE_VIDEO_OUT_BUS_TYPE_MAIN, 0, NULL);
271+
handle=sceVideoOutOpen(0xff, 0, 0, NULL);
268272

269273
if(handle<0)
270274
{
@@ -343,7 +347,7 @@ int orbis2dInit()
343347
// set status of each buffer with flipArg
344348
for(bufIndex=0;bufIndex<ORBIS2D_DISPLAY_BUFFER_NUM;bufIndex++)
345349
{
346-
orbconf->flipArgLog[bufIndex]= SCE_VIDEO_OUT_BUFFER_INITIAL_FLIP_ARG-1;
350+
orbconf->flipArgLog[bufIndex]= -2;
347351
}
348352

349353
// prepare initial clear color to the display buffers

liborbisPad/include/orbisPad.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,27 @@
55
#include <types/userservice.h>
66
#include <types/pad.h>
77

8+
9+
10+
#define ORBISPAD_L3 0x00000002
11+
#define ORBISPAD_R3 0x00000004
12+
#define ORBISPAD_OPTIONS 0x00000008
13+
#define ORBISPAD_UP 0x00000010
14+
#define ORBISPAD_RIGHT 0x00000020
15+
#define ORBISPAD_DOWN 0x00000040
16+
#define ORBISPAD_LEFT 0x00000080
17+
#define ORBISPAD_L2 0x00000100
18+
#define ORBISPAD_R2 0x00000200
19+
#define ORBISPAD_L1 0x00000400
20+
#define ORBISPAD_R1 0x00000800
21+
#define ORBISPAD_TRIANGLE 0x00001000
22+
#define ORBISPAD_CIRCLE 0x00002000
23+
#define ORBISPAD_CROSS 0x00004000
24+
#define ORBISPAD_SQUARE 0x00008000
25+
#define ORBISPAD_TOUCH_PAD 0x00100000
26+
#define ORBISPAD_INTERCEPTED 0x80000000
27+
28+
829
typedef struct OrbisPadConfig
930
{
1031
SceUserServiceUserId userId;

0 commit comments

Comments
 (0)