Merge branch 'refactor' of https://github.com/StapleButter/ctrulib into refactor

This commit is contained in:
fincs 2014-09-13 18:00:23 +02:00
commit e26017a75c
2 changed files with 7 additions and 7 deletions

View File

@ -37,12 +37,12 @@ typedef struct
typedef enum
{
GSPEVENT_PSC0 = 0,
GSPEVENT_PSC0 = 0, // memory fill completed
GSPEVENT_PSC1,
GSPEVENT_VBlank0,
GSPEVENT_VBlank1,
GSPEVENT_PPF,
GSPEVENT_P3D,
GSPEVENT_PPF, // display transfer finished
GSPEVENT_P3D, // command list processing finished
GSPEVENT_DMA,
GSPEVENT_MAX, // used to know how many events there are

View File

@ -85,15 +85,15 @@ void gspEventThreadMain(u32 arg)
svcClearEvent(gspEvent);
int count = gspEventData[1];
int last = gspEventData[0] + count;
int cur = gspEventData[0];
int last = cur + count;
while (last >= 0x34) last -= 0x34;
int cur = last;
int i;
for (i = 0; i < count; i ++)
{
int curEvt = gspEventData[0xC + cur];
cur --;
if (cur < 0) cur += 0x34;
cur ++;
if (cur >= 0x34) cur -= 0x34;
if (curEvt >= GSPEVENT_MAX) continue;
svcSignalEvent(gspEvents[curEvt]);
}