ObjFW  Diff

Differences From Artifact [3474e8e70a]:

To Artifact [c350ebfc99]:


37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
37
38
39
40
41
42
43

44
45
46
47
48
49
50







-







#ifdef OF_IOS
# include <CoreFoundation/CoreFoundation.h>
#endif

#ifdef OF_WII
# define asm __asm__
# include <gccore.h>
# include <wiiuse/wpad.h>
# undef asm
#endif

#ifdef OF_NINTENDO_DS
# define asm __asm__
# include <nds.h>
# undef asm
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
119
120
121
122
123
124
125

126
127
128
129
130
131
132







-








	CFRelease(resourcesURL);
#elif defined(OF_WII)
	GXRModeObj *mode;
	void *nextFB;

	VIDEO_Init();
	WPAD_Init();

	mode = VIDEO_GetPreferredMode(NULL);
	nextFB = MEM_K0_TO_K1(SYS_AllocateFramebuffer(mode));
	VIDEO_Configure(mode);
	VIDEO_SetNextFramebuffer(nextFB);
	VIDEO_SetBlack(FALSE);
	VIDEO_Flush();
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328

329
330
331
332
333
334
335


336
337
338
339
340
341



342
343
344
345
346
347
348
307
308
309
310
311
312
313













314
315
316
317
318
319
320
321
322
323
324
325
326
327
328

329
330
331
332
333
334
335
336
337
338







-
-
-
-
-
-
-
-
-
-
-
-
-
+







+
+





-
+
+
+







		if (description != nil)
			[OFStdOut writeLine: description];

		break;
	}

	if (status == StatusFailed) {
#if defined(OF_WII)
		[OFStdOut setForegroundColor: [OFColor silver]];
		[OFStdOut writeLine: @"Press A to continue"];

		for (;;) {
			WPAD_ScanPads();

			if (WPAD_ButtonsDown(0) & WPAD_BUTTON_A)
				break;

			VIDEO_WaitVSync();
		}
#elif defined(OF_NINTENDO_DS) || defined(OF_NINTENDO_3DS)
#if defined(OF_WII) || defined(OF_NINTENDO_DS) || defined(OF_NINTENDO_3DS)
		[OFStdOut setForegroundColor: [OFColor silver]];
		[OFStdOut writeLine: @"Press A to continue"];

		for (;;) {
			void *pool = objc_autoreleasePoolPush();
			OFGameController *controller =
			    [[OFGameController controllers] objectAtIndex: 0];

			[controller retrieveState];

			if ([controller.pressedButtons containsObject:
			    OFGameControllerEastButton])
				break;

# if defined(OF_NINTENDO_DS)
# if defined(OF_WII)
			VIDEO_WaitVSync();
# elif defined(OF_NINTENDO_DS)
			swiWaitForVBlank();
# elif defined(OF_NINTENDO_3DS)
			gspWaitForVBlank();
# endif
			objc_autoreleasePoolPop(pool);
		}
#elif defined(OF_NINTENDO_SWITCH)
594
595
596
597
598
599
600
601

602

603




604
605



606


607


608





609
610

611
612
613

614
615
616
617
618
619
620
621
622
623
624

625
626
627
628
629
630
631
632
633
634


635
636
637
638
639
640
641
642
643
644
645
584
585
586
587
588
589
590

591
592
593

594
595
596
597
598
599
600
601
602

603
604
605
606
607

608
609
610
611
612
613
614
615
616


617




618






619









620
621
622
623
624
625
626
627
628
629
630
631
632
633







-
+

+
-
+
+
+
+


+
+
+
-
+
+

+
+
-
+
+
+
+
+


+

-
-
+
-
-
-
-

-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-

+
+











#endif
	[OFStdOut writeFormat: @"%zu", numSkipped];
	[OFStdOut setForegroundColor: [OFColor purple]];
	[OFStdOut writeFormat: @" test%s skipped\n",
			       (numSkipped != 1 ? "s" : "")];
	[OFStdOut reset];

#if defined(OF_WII)
#if defined(OF_WII) || defined(OF_NINTENDO_DS) || defined(OF_NINTENDO_3DS)
	[OFStdOut setForegroundColor: [OFColor silver]];
# ifdef OF_WII
	[OFStdOut writeLine: @"Press home button to exit"];
	[OFStdOut writeLine: @"Press Home button to exit"];
# else
	[OFStdOut writeLine: @"Press Start button to exit"];
# endif

	for (;;) {
		void *pool = objc_autoreleasePoolPush();
		OFGameController *controller =
		    [[OFGameController controllers] objectAtIndex: 0];
		WPAD_ScanPads();

		[controller retrieveState];

# ifdef OF_WII
		if ([controller.pressedButtons containsObject:
		if (WPAD_ButtonsDown(0) & WPAD_BUTTON_HOME)
		    OFGameControllerHomeButton])
# else
		if ([controller.pressedButtons containsObject:
		    OFGameControllerStartButton])
# endif
			break;

# if defined(OF_WII)
		VIDEO_WaitVSync();
	}
#elif defined(OF_NINTENDO_DS)
# elif defined(OF_NINTENDO_DS)
	[OFStdOut setForegroundColor: [OFColor silver]];
	[OFStdOut writeLine: @"Press start button to exit"];

	for (;;) {
		swiWaitForVBlank();
		scanKeys();

		if (keysDown() & KEY_START)
			break;
	}
#elif defined(OF_NINTENDO_3DS)
# elif defined(OF_NINTENDO_3DS)
	[OFStdOut setForegroundColor: [OFColor silver]];
	[OFStdOut writeLine: @"Press start button to exit"];

	for (;;) {
		hidScanInput();

		if (hidKeysDown() & KEY_START)
			break;

		gspWaitForVBlank();
# endif
		objc_autoreleasePoolPop(pool);
	}
#elif defined(OF_NINTENDO_SWITCH)
	while (appletMainLoop())
		updateConsole(true);

	consoleExit(NULL);
#endif

	[OFApplication terminateWithStatus: (int)numFailed];
}
@end