Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
c538d10
Fix package so we can depend on it externally (I hope)
Timendus Aug 15, 2025
9323ef9
Update test runner
Timendus Aug 15, 2025
e2158ca
npm update
Timendus Aug 15, 2025
841a856
Colours seem to have changed a tiny amount. Not sure why..? Let's jus…
Timendus Aug 15, 2025
a6845a5
A couple of tiny fixes found on my harddrive
Timendus Aug 15, 2025
75736f9
go fmt all the things
Timendus Aug 15, 2025
17eba5f
Move build constraints to new format
Timendus Aug 15, 2025
a72e740
Again some info I found on my harddrive
Timendus Aug 15, 2025
ec60417
Let's see if we can build the WASM using Github actions
Timendus Aug 15, 2025
983652e
Can't remove what isn't checked out yet
Timendus Aug 15, 2025
91e47a5
Try with more specific tinygo version
Timendus Aug 15, 2025
de15f5b
Try npm install first
Timendus Aug 15, 2025
f9f818b
Don't mess with gopath
Timendus Aug 15, 2025
33937e8
Fix issues for new version of tinygo
Timendus Aug 15, 2025
bd7d970
Reformat tests and commit new scrolling tests
Timendus Aug 15, 2025
6cf16a0
Rebuild wasm file
Timendus Aug 15, 2025
df01298
Fix function imports
Timendus Aug 15, 2025
45585d9
Rebuild javascripts
Timendus Aug 15, 2025
5ad17ca
Rewrite javascript to use es6 modules that the browser can load witho…
Timendus Aug 15, 2025
81b1871
Get rid of the webpack dependencies
Timendus Aug 15, 2025
5dc4190
Convert tests to ESM syntax
Timendus Aug 16, 2025
46e6e8e
Create deploy to github pages workflow
Timendus Aug 16, 2025
291b8ee
Internalize CSS dependencies
Timendus Aug 16, 2025
3376a9e
Convert terminal runner to ESM too
Timendus Aug 16, 2025
415f3ab
Auto-format all the things
Timendus Aug 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Silicon8 deployment to GitHub pages

on:
push:
branches:
- main

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
strategy:
matrix:
go-version: ['1.21']
node-version: [latest]
tinygo-version: ['0.30.0']
steps:
# Check out repository and build the project
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
cache-dependency-path: silicon8/go.sum
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- uses: acifani/setup-tinygo@v2
with:
tinygo-version: ${{ matrix.tinygo-version }}
- name: Build binaries
run: |
npm install
npm run build

# Deploy resulting files to Github pages
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: './docs'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4


27 changes: 11 additions & 16 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
# Adaptation of Node.js workflow template at https://github.com/actions/starter-workflows/blob/main/ci/node.js.yml
# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI
name: Silicon8 Jest tests

on:
push:
Expand All @@ -11,21 +7,20 @@ on:
branches: [ main ]

jobs:
build:
tests:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [12.x, 14.x, 16.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
node-version: [latest]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm test
- uses: actions/checkout@v5
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm test
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,12 @@ if their interpreter works as it should. I discovered to my dismay that Silicon8
didn't do so well when it came to my very own keypad tests. So I fixed the
keyboard 😉

Also, I added an opcode that allows an XO-CHIP program to programmatically
select a colour palette from a master palette of 256 colours. This was an
experiment with a couple of people on the EmuDev Discord to see if such an
extension to XO-CHIP would be a good idea. Although it was well received it did
not make it into the XO-CHIP spec, and as such it's no more than a curiousity 😄

## Developer instructions

### How to run
Expand Down
193 changes: 106 additions & 87 deletions docs/index.html
Original file line number Diff line number Diff line change
@@ -1,90 +1,110 @@
<!doctype html>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Silicon8</title>
<link rel="icon" type="image/x-icon" href="favicon.ico" />
<link href="style/app/index.css" rel="stylesheet" />
<script type="module" src="js/app/index.js"></script>

<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Silicon8</title>
<link rel="icon" type="image/x-icon" href="favicon.ico" />
<link rel="stylesheet" href="style.css" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap" rel="stylesheet">
<link href="https://unpkg.com/nes.css/css/nes-core.min.css" rel="stylesheet" />
<script type="text/javascript" src="wasm_exec.js"></script>
<script type="text/javascript" src="index.js"></script>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script
async
src="https://www.googletagmanager.com/gtag/js?id=G-SERBNVPJ42"
></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag("js", new Date());
gtag("config", "G-SERBNVPJ42");
</script>
</head>

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-SERBNVPJ42"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-SERBNVPJ42');
</script>
</head>
<body>
<div class="display-wrapper">
<canvas id="display"></canvas>
</div>

<body>
<div class="display-wrapper">
<canvas id="display"></canvas>
</div>
<div class="notification"></div>

<div class="notification"></div>
<div class="keyboard left-keyboard">
<button data-value="1">1</button> <button data-value="2">2</button>
<button data-value="4">4</button> <button data-value="5">5</button>
<button data-value="7">7</button> <button data-value="8">8</button>
<button data-value="10">A</button> <button data-value="0">0</button>
</div>
<div class="keyboard right-keyboard">
<button data-value="3">3</button> <button data-value="12">C</button>
<button data-value="6">6</button> <button data-value="13">D</button>
<button data-value="9">9</button> <button data-value="14">E</button>
<button data-value="11">B</button> <button data-value="15">F</button>
</div>

<div class="keyboard left-keyboard">
<button data-value="1">1</button> <button data-value="2">2</button>
<button data-value="4">4</button> <button data-value="5">5</button>
<button data-value="7">7</button> <button data-value="8">8</button>
<button data-value="10">A</button> <button data-value="0">0</button>
</div>
<div class="keyboard right-keyboard">
<button data-value="3">3</button> <button data-value="12">C</button>
<button data-value="6">6</button> <button data-value="13">D</button>
<button data-value="9">9</button> <button data-value="14">E</button>
<button data-value="11">B</button> <button data-value="15">F</button>
</div>

<div class="settings">
<div class="nes-container">
<h3>Interpreter type</h3>
<label>
<input type="radio" class="nes-radio is-dark" name="interpreter" value="0" checked>
<span>Auto-detect</span>
</label>
<label>
<input type="radio" class="nes-radio is-dark" name="interpreter" value="1">
<span>VIP</span>
</label>
<label>
<input type="radio" class="nes-radio is-dark" name="interpreter" value="3">
<span>SCHIP</span>
</label>
<label>
<input type="radio" class="nes-radio is-dark" name="interpreter" value="4">
<span>XO-CHIP</span>
</label>
</div>
<div class="nes-container">
<h3>Execution speed</h3>
<div class="nes-select">
<select name="speed">
<option value="7">420Hz - 7 cycles per frame</option>
<option value="15">900Hz - 15 cycles per frame</option>
<option value="20">1.2KHz - 20 cycles per frame</option>
<option value="30" selected>1.8KHz - 30 cycles per frame</option>
<option value="100">6KHz - 100 cycles per frame</option>
<option value="200">12KHz - 200 cycles per frame</option>
<option value="500">30KHz - 500 cycles per frame</option>
<option value="1000">60KHz - 1000 cycles per frame</option>
<option value="20000">1.2MHz - Octo Ludicrous speed</option>
<option value="50000">3MHz - 50000 cycles per frame</option>
<option value="100000">6MHz - 100000 cycles per frame</option>
<option value="200000">12MHz - 200000 cycles per frame</option>
<option value="400000">24MHz - 400000 cycles per frame</option>
</select>
</div>
</div>
<!---
<div class="settings">
<div class="nes-container">
<h3>Interpreter type</h3>
<label>
<input
type="radio"
class="nes-radio is-dark"
name="interpreter"
value="0"
checked
/>
<span>Auto-detect</span>
</label>
<label>
<input
type="radio"
class="nes-radio is-dark"
name="interpreter"
value="1"
/>
<span>VIP</span>
</label>
<label>
<input
type="radio"
class="nes-radio is-dark"
name="interpreter"
value="3"
/>
<span>SCHIP</span>
</label>
<label>
<input
type="radio"
class="nes-radio is-dark"
name="interpreter"
value="4"
/>
<span>XO-CHIP</span>
</label>
</div>
<div class="nes-container">
<h3>Execution speed</h3>
<div class="nes-select">
<select name="speed">
<option value="7">420Hz - 7 cycles per frame</option>
<option value="15">900Hz - 15 cycles per frame</option>
<option value="20">1.2KHz - 20 cycles per frame</option>
<option value="30" selected>1.8KHz - 30 cycles per frame</option>
<option value="100">6KHz - 100 cycles per frame</option>
<option value="200">12KHz - 200 cycles per frame</option>
<option value="500">30KHz - 500 cycles per frame</option>
<option value="1000">60KHz - 1000 cycles per frame</option>
<option value="20000">1.2MHz - Octo Ludicrous speed</option>
<option value="50000">3MHz - 50000 cycles per frame</option>
<option value="100000">6MHz - 100000 cycles per frame</option>
<option value="200000">12MHz - 200000 cycles per frame</option>
<option value="400000">24MHz - 400000 cycles per frame</option>
</select>
</div>
</div>
<!---
<fieldset id="xo-colours">
<legend>Colour palette</legend>
<p>?</p>
Expand All @@ -94,10 +114,9 @@ <h3>Execution speed</h3>
<p>?</p>
</fieldset>
//-->
<div class="align-right">
<button class="nes-btn is-success">Start!</button>
</div>
</div>
</body>

<div class="align-right">
<button class="nes-btn is-success">Start!</button>
</div>
</div>
</body>
</html>
Loading