Skip to content

Commit

Permalink
Fix "starwars" example
Browse files Browse the repository at this point in the history
  • Loading branch information
TooTallNate committed Oct 5, 2023
1 parent af4273d commit 59779a7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions apps/starwars/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ const fontData = Switch.readFileSync(
const font = new FontFace('Hack', fontData);
Switch.fonts.add(font);

const ctx = Switch.screen.getContext('2d');
const fontSize = 30.83;
const yOffset = 180;
ctx.font = `${fontSize}px Hack`;

function fdToStream(fd: number) {
const decoder = new TextDecoder();
const buffer = new ArrayBuffer(102400);
Expand Down Expand Up @@ -45,7 +40,7 @@ async function main() {
// wait for prompt
while (true) {
const chunk = await reader.read();
if (chunk.value?.includes('More commands become available')) {
if (chunk.value?.includes('Press control-C')) {
break;
}
}
Expand All @@ -56,6 +51,11 @@ async function main() {
// next line is the "starwars" echo, which we can ignore
await reader.read();

const ctx = Switch.screen.getContext('2d');
const fontSize = 30.83;
const yOffset = 180;
ctx.font = `${fontSize}px Hack`;

// dump the movie to the console
let lineCount = 0;
while (true) {
Expand Down

0 comments on commit 59779a7

Please sign in to comment.