Fries
e5dfbf0e0c
the wii does the game loop now, as i passed some c functions to javascript. those functions are inside objects to make the js api easier to read and use.
19 lines
323 B
JavaScript
19 lines
323 B
JavaScript
const PAD_BUTTON_START = 0x1000;
|
|
const PAD_BUTTON_A = 0x0100;
|
|
|
|
while (wii.running) {
|
|
wii.pad.scan_pads();
|
|
|
|
const pressed = wii.pad.buttons_down();
|
|
|
|
if (pressed & PAD_BUTTON_START) {
|
|
wii.print("exiting from js");
|
|
wii.exit();
|
|
}
|
|
|
|
if (pressed & PAD_BUTTON_A) {
|
|
wii.print("a pressed");
|
|
}
|
|
|
|
wii.video.wait_vsync();
|
|
}
|