From 552f8f878dbc7b5255f8414f8f3e3a64ebe31782 Mon Sep 17 00:00:00 2001 From: Corwin Date: Fri, 5 Apr 2024 17:09:50 +0100 Subject: [PATCH] more mobile stuff --- website/app/src/mgba.tsx | 8 +- website/site/crash/index.html | 1 + website/site/index.html | 231 +++++++++++++++++----------------- 3 files changed, 125 insertions(+), 115 deletions(-) diff --git a/website/app/src/mgba.tsx b/website/app/src/mgba.tsx index ee53f84b..c00cc6e1 100644 --- a/website/app/src/mgba.tsx +++ b/website/app/src/mgba.tsx @@ -6,7 +6,7 @@ import { useState, } from "react"; import mGBA from "./vendor/mgba"; -import { KeyBindings } from "./bindings"; +import { GbaKey, KeyBindings } from "./bindings"; import { styled } from "styled-components"; type Module = any; @@ -36,6 +36,8 @@ const MgbaCanvas = styled.canvas` export interface MgbaHandle { restart: () => void; + buttonPress: (key: GbaKey) => void; + buttonRelease: (key: GbaKey) => void; } export const Mgba = forwardRef( @@ -87,7 +89,7 @@ export const Mgba = forwardRef( try { mgbaModule.current.quitGame(); mgbaModule.current.quitMgba(); - } catch {} + } catch { } }; }, [state]); @@ -124,6 +126,8 @@ export const Mgba = forwardRef( useImperativeHandle(ref, () => { return { restart: () => mgbaModule.current.quickReload(), + buttonPress: (key: GbaKey) => mgbaModule.current.buttonPress(key), + buttonRelease: (key: GbaKey) => mgbaModule.current.buttonRelease(key), }; }); diff --git a/website/site/crash/index.html b/website/site/crash/index.html index 6573f351..69f92245 100644 --- a/website/site/crash/index.html +++ b/website/site/crash/index.html @@ -1,6 +1,7 @@ + agbrs crash backtrace - - -
-

agb - a rust framework for making Game Boy Advance games

-
-
-
-
-
- -
-
+ .red { + background-color: #f5755e; + flex-grow: 1; + } + + .links { + margin-left: auto; + margin-right: auto; + display: flex; + justify-content: space-around; + margin-top: 40px; + margin-bottom: 40px; + max-width: 40rem; + } + + .links>a { + text-decoration: none; + color: black; + background-color: #fad288; + border: solid #fad288 2px; + border-radius: 5px; + padding: 5px 10px; + } + + .links>a:hover { + border: solid black 2px; + } + + + + +
+

agb - a rust framework for making Game Boy Advance games

+
+
+
+
+
+ +
-
-

- Press escape to open the menu where you can view or change controls - and restart the game. The game provided is a combination of multiple - Game Boy Advance games made using agb, you can press left or right on - the main menu to switch game. -

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

+ Press escape to open the menu where you can view or change controls + and restart the game. The game provided is a combination of multiple + Game Boy Advance games made using agb, you can press left or right on + the main menu to switch game. +

+
+
+ +
+ +
+ + + \ No newline at end of file