Skip to content

Commit a924371

Browse files
committed
Thu 30 Jan 2020 08:00:49 EST address #51 - NES Update
1 parent 2d007cf commit a924371

File tree

1 file changed

+58
-57
lines changed
  • Components/super-go-play/nesemu-go/components/nofrendo-esp32

1 file changed

+58
-57
lines changed

Components/super-go-play/nesemu-go/components/nofrendo-esp32/video_audio.c

Lines changed: 58 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,9 @@ static int osd_init_sound(void)
132132

133133
#endif
134134

135-
audio_callback = NULL;
135+
audio_callback = NULL;
136136

137-
return 0;
137+
return 0;
138138
}
139139

140140
void osd_getsoundinfo(sndinfo_t *info)
@@ -189,7 +189,7 @@ void osd_togglefullscreen(int code)
189189
/* initialise video */
190190
static int init(int width, int height)
191191
{
192-
return 0;
192+
return 0;
193193
}
194194

195195
static void shutdown(void)
@@ -394,44 +394,44 @@ static int ConvertJoystickInput()
394394
odroid_gamepad_state state;
395395
odroid_input_gamepad_read(&state);
396396

397-
int result = 0;
397+
int result = 0;
398398

399399

400-
// A
401-
if (!state.values[ODROID_INPUT_A])
402-
{
403-
result |= (1<<13);
404-
}
400+
// A
401+
if (!state.values[ODROID_INPUT_A])
402+
{
403+
result |= (1<<13);
404+
}
405405

406-
// B
407-
if (!state.values[ODROID_INPUT_B])
408-
{
409-
result |= (1 << 14);
410-
}
406+
// B
407+
if (!state.values[ODROID_INPUT_B])
408+
{
409+
result |= (1 << 14);
410+
}
411411

412-
// select
413-
if (!state.values[ODROID_INPUT_SELECT])
414-
result |= (1 << 0);
412+
// select
413+
if (!state.values[ODROID_INPUT_SELECT])
414+
result |= (1 << 0);
415415

416-
// start
417-
if (!state.values[ODROID_INPUT_START])
418-
result |= (1 << 3);
416+
// start
417+
if (!state.values[ODROID_INPUT_START])
418+
result |= (1 << 3);
419419

420-
// right
421-
if (!state.values[ODROID_INPUT_RIGHT])
422-
result |= (1 << 5);
420+
// right
421+
if (!state.values[ODROID_INPUT_RIGHT])
422+
result |= (1 << 5);
423423

424-
// left
425-
if (!state.values[ODROID_INPUT_LEFT])
426-
result |= (1 << 7);
424+
// left
425+
if (!state.values[ODROID_INPUT_LEFT])
426+
result |= (1 << 7);
427427

428-
// up
429-
if (!state.values[ODROID_INPUT_UP])
430-
result |= (1 << 4);
428+
// up
429+
if (!state.values[ODROID_INPUT_UP])
430+
result |= (1 << 4);
431431

432-
// down
433-
if (!state.values[ODROID_INPUT_DOWN])
434-
result |= (1 << 6);
432+
// down
433+
if (!state.values[ODROID_INPUT_DOWN])
434+
result |= (1 << 6);
435435

436436

437437
if (!previousJoystickState.values[ODROID_INPUT_VOLUME] && state.values[ODROID_INPUT_VOLUME])
@@ -496,11 +496,12 @@ static int ConvertJoystickInput()
496496
case 4:
497497
hud_progress("Saving...", true);
498498
hud_deinit();
499+
499500
odroid_audio_terminate();
500-
xQueueSend(vidQueue, &arg, portMAX_DELAY);
501-
while(vidTaskIsRunning) {vTaskDelay(10);}
501+
// xQueueSend(vidQueue, &arg, portMAX_DELAY);
502+
// while(vidTaskIsRunning) {vTaskDelay(10);}
502503
SaveState();
503-
ili9341_clear(0);
504+
// ili9341_clear(0);
504505
esp_restart();
505506
break;
506507
case 5:
@@ -536,7 +537,7 @@ static int ConvertJoystickInput()
536537

537538
previousJoystickState = state;
538539

539-
return result;
540+
return result;
540541
}
541542

542543

@@ -545,25 +546,25 @@ extern nes6502_context cpu;
545546

546547
void osd_getinput(void)
547548
{
548-
const int ev[16]={
549-
event_joypad1_select,0,0,event_joypad1_start,event_joypad1_up,event_joypad1_right,event_joypad1_down,event_joypad1_left,
550-
0,0,0,0,event_soft_reset,event_joypad1_a,event_joypad1_b,event_hard_reset
551-
};
552-
static int oldb=0xffff;
553-
int b=ConvertJoystickInput();
554-
int chg=b^oldb;
555-
int x;
556-
oldb=b;
557-
event_t evh;
558-
// printf("Input: %x\n", b);
559-
for (x=0; x<16; x++) {
560-
if (chg&1) {
561-
evh=event_get(ev[x]);
562-
if (evh) evh((b&1)?INP_STATE_BREAK:INP_STATE_MAKE);
563-
}
564-
chg>>=1;
565-
b>>=1;
566-
}
549+
const int ev[16]={
550+
event_joypad1_select,0,0,event_joypad1_start,event_joypad1_up,event_joypad1_right,event_joypad1_down,event_joypad1_left,
551+
0,0,0,0,event_soft_reset,event_joypad1_a,event_joypad1_b,event_hard_reset
552+
};
553+
static int oldb=0xffff;
554+
int b=ConvertJoystickInput();
555+
int chg=b^oldb;
556+
int x;
557+
oldb=b;
558+
event_t evh;
559+
// printf("Input: %x\n", b);
560+
for (x=0; x<16; x++) {
561+
if (chg&1) {
562+
evh=event_get(ev[x]);
563+
if (evh) evh((b&1)?INP_STATE_BREAK:INP_STATE_MAKE);
564+
}
565+
chg>>=1;
566+
b>>=1;
567+
}
567568
}
568569

569570
static void osd_freeinput(void)
@@ -581,8 +582,8 @@ void osd_getmouse(int *x, int *y, int *button)
581582
/* this is at the bottom, to eliminate warnings */
582583
void osd_shutdown()
583584
{
584-
osd_stopsound();
585-
osd_freeinput();
585+
osd_stopsound();
586+
osd_freeinput();
586587
}
587588

588589
static int logprint(const char *string)

0 commit comments

Comments
 (0)