Skip to content

Commit 96b6851

Browse files
authored
Merge pull request #322 from fjtrujy/fix_scegu_init
Fixing missing function on the first start call
2 parents eb2f396 + cae1806 commit 96b6851

File tree

5 files changed

+8
-2
lines changed

5 files changed

+8
-2
lines changed

src/gu/guInternal.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ GuSettings gu_settings;
1515
GuDisplayList* gu_list;
1616
int gu_curr_context;
1717
int gu_init;
18+
int gu_first_start;
1819
int gu_display_on;
1920
int gu_call_mode;
2021
int gu_states;

src/gu/guInternal.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ extern GuSettings gu_settings;
7979
extern GuDisplayList *gu_list;
8080
extern int gu_curr_context;
8181
extern int gu_init;
82+
extern int gu_first_start;
8283
extern int gu_display_on;
8384
extern int gu_call_mode;
8485
extern int gu_states;

src/gu/sceGuInit.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@ static void sceGuResetGlobalVariables(void)
239239
unsigned int i;
240240

241241
gu_init = 0;
242+
gu_first_start = 0;
242243

243244
gu_states = 0;
244245
gu_object_stack_depth = 0;
@@ -371,5 +372,6 @@ int sceGuInit(void)
371372
gu_settings.swapBuffersBehaviour = PSP_DISPLAY_SETBUF_NEXTHSYNC;
372373

373374
gu_init = 1;
375+
gu_first_start = 1;
374376
return 0;
375377
}

src/gu/sceGuStart.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ int sceGuStart(int ctype, void *list)
5050
gu_settings.signal_offset = 0;
5151
}
5252

53-
if (!gu_init)
53+
if (gu_first_start)
5454
{
5555
static int dither_matrix[16] =
5656
{
@@ -67,7 +67,7 @@ int sceGuStart(int ctype, void *list)
6767
sceGuSpecular(1.0f);
6868
sceGuTexScale(1.0f, 1.0f);
6969

70-
gu_init = 1;
70+
gu_first_start = 0;
7171
}
7272

7373
if (ctype == GU_DIRECT && gu_draw_buffer.frame_width != 0)

src/gu/sceGuTerm.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,6 @@ void sceGuTerm(void)
2222

2323
sceKernelDeleteEventFlag(gu_settings.kernel_event_flag);
2424
sceGeUnsetCallback(gu_settings.ge_callback_id);
25+
26+
gu_init = 0;
2527
}

0 commit comments

Comments
 (0)