diff --git a/.gitignore b/.gitignore index d016315..2e442e2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ *.sav bin2/* mgba/* +tgt/* # random crap that tends to appear over time Thumbs.db diff --git a/compile b/compile new file mode 100755 index 0000000..56ffb51 --- /dev/null +++ b/compile @@ -0,0 +1,31 @@ +#!/bin/bash + +ROOT=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) + +rm -rf "$ROOT"/tgt + +maketgt() { + local target_dir="$ROOT"/tgt/gvasm-"$1" + local zip_file="$ROOT"/tgt/gvasm-"$1".zip + + mkdir -p "$target_dir" + + deno compile \ + --target "$1" \ + --output "$target_dir"/gvasm \ + --allow-read \ + --allow-write \ + --allow-run \ + "$ROOT"/gvasm.ts + + # Navigate to the target directory and zip everything inside it without the directory path + (cd "$target_dir" && zip -r "$zip_file" *) + + # Remove the original target directory after creating the zip + rm -rf "$target_dir" +} + +maketgt x86_64-unknown-linux-gnu +maketgt x86_64-pc-windows-msvc +maketgt x86_64-apple-darwin +maketgt aarch64-apple-darwin diff --git a/src/deps.ts b/src/deps.ts index 82d46d2..d7e9059 100644 --- a/src/deps.ts +++ b/src/deps.ts @@ -5,10 +5,10 @@ // SPDX-License-Identifier: 0BSD // -import * as canvas from 'https://raw.githubusercontent.com/DjDeveloperr/deno-canvas/f6fc1f5a73dc77b991ff035ef1f7627008c6b51c/mod.ts'; +import * as canvas from 'https://raw.githubusercontent.com/DjDeveloperr/deno-canvas/ac6f50dcda4471d7710b22eef8017cdd634fb9a9/mod.ts'; import * as path from 'https://deno.land/std@0.182.0/path/mod.ts'; -export { parse as argParse } from 'https://deno.land/std@0.182.0/flags/mod.ts'; -export { exists as fileExists } from 'https://deno.land/std@0.182.0/fs/exists.ts'; +export { parse as argParse } from 'https://deno.land/std@0.198.0/flags/mod.ts'; +export { exists as fileExists } from 'https://deno.land/std@0.198.0/fs/exists.ts'; export interface Image { width: number; diff --git a/src/ops.ts b/src/ops.ts index 030be72..a06b8c5 100644 --- a/src/ops.ts +++ b/src/ops.ts @@ -946,7 +946,7 @@ export namespace ARM { '$oper$s.$cond $Rd, $Rm, $shift #$amount', '$oper$cond$s $Rd, $Rm, $shift #$amount', ], - run: (cpu: CPU, sym: SymReader) => { + run: (cpu: CPU, sym: SymReader): void => { const oper = sym('oper'); const s = !!sym('s'); const cond = sym('cond'); @@ -1413,7 +1413,7 @@ export namespace ARM { '$oper$cond $Rn, #$expression', '$oper.$cond $Rn, #$expression', ], - run: (cpu: CPU, sym: SymReader) => { + run: (cpu: CPU, sym: SymReader): void => { const oper = sym('oper'); const cond = sym('cond'); const Rn = sym('Rn'); diff --git a/src/sink.ts b/src/sink.ts index e7a6915..6bb3830 100644 --- a/src/sink.ts +++ b/src/sink.ts @@ -15652,7 +15652,7 @@ export function scr_dump( const str = prg.debugTable[i]; const slen = str === null ? 4 : str.length; const slenb = '' + - String.fromCharCode((slen) & 0xFF) + + String.fromCharCode(slen & 0xFF) + String.fromCharCode((slen >> 8) & 0xFF) + String.fromCharCode((slen >> 16) & 0xFF) + String.fromCharCode((slen >> 24) & 0xFF);