File tree Expand file tree Collapse file tree 3 files changed +20
-28
lines changed Expand file tree Collapse file tree 3 files changed +20
-28
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,6 @@ debug = true
18
18
[profile .release ]
19
19
panic = " abort"
20
20
lto = true
21
- debug = true
22
21
23
22
[dependencies ]
24
23
rlibc = " *"
Original file line number Diff line number Diff line change @@ -8,29 +8,34 @@ include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
8
8
pub const fn null < T > ( ) -> * mut T { 0 as * mut T }
9
9
10
10
#[ no_mangle]
11
- pub unsafe extern fn rust_main ( ) {
12
- consoleInit ( null ( ) ) ;
13
- gfxInitDefault ( ) ;
11
+ pub extern "C" fn main ( ) -> ! {
12
+ unsafe {
13
+ consoleInit ( null ( ) ) ;
14
+ gfxInitDefault ( ) ;
14
15
15
- printf ( "\x1b [16;16HPress PLUS to exit." . as_ptr ( ) as * const i8 ) ;
16
+ printf ( "\x1b [16;16HPress PLUS to exit." . as_ptr ( ) as * const i8 ) ;
16
17
17
- while appletMainLoop ( ) {
18
- hidScanInput ( ) ;
18
+ while appletMainLoop ( ) {
19
+ hidScanInput ( ) ;
19
20
20
- let k_down = HidControllerKeys ( hidKeysDown ( HidControllerID :: CONTROLLER_P1_AUTO ) as u32 ) ;
21
+ let k_down = HidControllerKeys ( hidKeysDown ( HidControllerID :: CONTROLLER_P1_AUTO ) as u32 ) ;
21
22
22
- if k_down == HidControllerKeys :: KEY_PLUS {
23
- break ;
24
- }
23
+ if k_down == HidControllerKeys :: KEY_PLUS {
24
+ break ;
25
+ }
26
+
27
+ printf ( "This key is pressed: %d\n " . as_ptr ( ) as * const i8 , k_down) ;
25
28
26
- printf ( "This key is pressed: %d\n " . as_ptr ( ) as * const i8 , k_down) ;
29
+ gfxFlushBuffers ( ) ;
30
+ gfxSwapBuffers ( ) ;
31
+ gfxWaitForVsync ( ) ;
32
+ }
27
33
28
- gfxFlushBuffers ( ) ;
29
- gfxSwapBuffers ( ) ;
30
- gfxWaitForVsync ( ) ;
34
+ gfxExit ( ) ;
31
35
}
32
36
33
- gfxExit ( ) ;
37
+ // exit(0)
38
+ loop { }
34
39
}
35
40
36
41
pub mod lang_items;
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments