mirror of
https://github.com/exoticorn/microw8.git
synced 2026-11-14 07:17:19 +01:00
Compare commits
2
Commits
v0.4.1
..
35aeebd0b6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
35aeebd0b6 | ||
|
|
937ccf60c9 |
No files matched your search
@@ -44,7 +44,7 @@ jobs:
|
|||||||
- name: Build
|
- name: Build
|
||||||
run: cargo build --release --verbose
|
run: cargo build --release --verbose
|
||||||
- name: Upload artifact
|
- name: Upload artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: uw8-${{ matrix.build }}
|
name: uw8-${{ matrix.build }}
|
||||||
path: target/release/${{ matrix.exe }}
|
path: target/release/${{ matrix.exe }}
|
||||||
Generated
+427
-337
File diff suppressed because it is too large.
Load diff
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "uw8"
|
name = "uw8"
|
||||||
version = "0.4.1"
|
version = "0.3.1"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
@@ -28,4 +28,4 @@ tokio-stream = { version = "0.1.15", features = ["sync"], optional = true }
|
|||||||
webbrowser = { version = "0.8.13", optional = true }
|
webbrowser = { version = "0.8.13", optional = true }
|
||||||
ansi_term = "0.12.1"
|
ansi_term = "0.12.1"
|
||||||
cpal = { version = "0.15.3", optional = true }
|
cpal = { version = "0.15.3", optional = true }
|
||||||
rubato = { version = "0.12.0", optional = true }
|
rubato = { version = "0.15.0", optional = true }
|
||||||
@@ -15,9 +15,9 @@ See [here](https://exoticorn.github.io/microw8/) for more information and docs.
|
|||||||
|
|
||||||
## Downloads
|
## Downloads
|
||||||
|
|
||||||
* [Linux](https://github.com/exoticorn/microw8/releases/download/v0.4.1/microw8-0.4.1-linux.tgz)
|
* [Linux](https://github.com/exoticorn/microw8/releases/download/v0.3.0/microw8-0.3.0-linux.tgz)
|
||||||
* [MacOS](https://github.com/exoticorn/microw8/releases/download/v0.4.1/microw8-0.4.1-macos.tgz)
|
* [MacOS](https://github.com/exoticorn/microw8/releases/download/v0.3.0/microw8-0.3.0-macos.tgz)
|
||||||
* [Windows](https://github.com/exoticorn/microw8/releases/download/v0.4.1/microw8-0.4.1-windows.zip)
|
* [Windows](https://github.com/exoticorn/microw8/releases/download/v0.3.0/microw8-0.3.0-windows.zip)
|
||||||
|
|
||||||
The download includes
|
The download includes
|
||||||
|
|
||||||
|
|||||||
Executable
+6
@@ -0,0 +1,6 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
tinygo build -o cart.wasm -target target.json ./main.go
|
||||||
|
uw8 filter-exports cart.wasm cart.wasm && \
|
||||||
|
#wasm-opt -Oz --fast-math --strip-producers -o cart.wasm cart.wasm && \
|
||||||
|
uw8 pack -l 9 cart.wasm cart.uw8
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"math"
|
||||||
|
"unsafe"
|
||||||
|
)
|
||||||
|
|
||||||
|
//go:wasm-module env
|
||||||
|
//export atan2
|
||||||
|
func atan2(x, y float32) float32
|
||||||
|
|
||||||
|
//go:wasm-module env
|
||||||
|
//export time
|
||||||
|
func time() float32
|
||||||
|
|
||||||
|
func sqrt(v float32) float32 {
|
||||||
|
return float32(math.Sqrt(float64(v)))
|
||||||
|
}
|
||||||
|
|
||||||
|
var FRAMEBUFFER = (*[320 * 240]byte)(unsafe.Pointer(uintptr(120)))
|
||||||
|
|
||||||
|
//export upd
|
||||||
|
func upd() {
|
||||||
|
var i int
|
||||||
|
for i < 320*240 {
|
||||||
|
t := time() * 63.0
|
||||||
|
x := float32(i%320 - 160)
|
||||||
|
y := float32(i/320 - 120)
|
||||||
|
d := float32(40000.0) / sqrt(x*x+y*y)
|
||||||
|
u := atan2(x, y) * 512.0 / 3.141
|
||||||
|
c := uint8((int(d+t*2.0) ^ int(u+t)) >> 4)
|
||||||
|
FRAMEBUFFER[i] = c
|
||||||
|
i++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
{
|
||||||
|
"llvm-target": "wasm32--wasi",
|
||||||
|
"build-tags": [ "tinygo.wasm" ],
|
||||||
|
"goos": "js",
|
||||||
|
"goarch": "wasm",
|
||||||
|
"linker": "wasm-ld",
|
||||||
|
"libc": "wasi-libc",
|
||||||
|
"cflags": [
|
||||||
|
"--target=wasm32--wasi",
|
||||||
|
"--sysroot={root}/lib/wasi-libc/sysroot",
|
||||||
|
"-Oz"
|
||||||
|
],
|
||||||
|
"ldflags": [
|
||||||
|
"--no-entry",
|
||||||
|
"--export-all",
|
||||||
|
"--import-memory",
|
||||||
|
"--initial-memory=262144",
|
||||||
|
"--global-base=81920",
|
||||||
|
"-zstack-size=4096",
|
||||||
|
"--strip-all"
|
||||||
|
],
|
||||||
|
"wasm-abi": "js"
|
||||||
|
}
|
||||||
Binary file not shown.
@@ -31,19 +31,19 @@ Examplers for older versions:
|
|||||||
|
|
||||||
## Versions
|
## Versions
|
||||||
|
|
||||||
### v0.4.1
|
### v0.3.0
|
||||||
|
|
||||||
* [Web runtime](../v0.4.1)
|
* [Web runtime](v0.3.0)
|
||||||
* [Linux](https://github.com/exoticorn/microw8/releases/download/v0.4.1/microw8-0.4.1-linux.tgz)
|
* [Linux](https://github.com/exoticorn/microw8/releases/download/v0.3.0/microw8-0.3.0-linux.tgz)
|
||||||
* [MacOS](https://github.com/exoticorn/microw8/releases/download/v0.4.1/microw8-0.4.1-macos.tgz)
|
* [MacOS](https://github.com/exoticorn/microw8/releases/download/v0.3.0/microw8-0.3.0-macos.tgz)
|
||||||
* [Windows](https://github.com/exoticorn/microw8/releases/download/v0.4.1/microw8-0.4.1-windows.zip)
|
* [Windows](https://github.com/exoticorn/microw8/releases/download/v0.3.0/microw8-0.3.0-windows.zip)
|
||||||
|
|
||||||
Changes:
|
Changes:
|
||||||
|
|
||||||
* Windows: fix bad/inconsistent frame rate
|
* add blitSprite and grabSprite API calls
|
||||||
* fix choppy sound on devices with sample rates != 44100 kHz
|
* add support for integer scaling up to 16x for printing text
|
||||||
* add scale mode 'fill' option
|
* fix incompatibility with sound devices only offering 16bit audio formats
|
||||||
|
* add support for br_table instruction in packed carts
|
||||||
|
|
||||||
### Older versions
|
### Older versions
|
||||||
|
|
||||||
|
|||||||
@@ -468,7 +468,6 @@ when using the native runtime:
|
|||||||
* `--no-gpu`: Force old cpu-only window code
|
* `--no-gpu`: Force old cpu-only window code
|
||||||
* `--filter FILTER`: Select an upscale filter at startup
|
* `--filter FILTER`: Select an upscale filter at startup
|
||||||
* `--fullscreen`: Start in fullscreen mode
|
* `--fullscreen`: Start in fullscreen mode
|
||||||
* `--scale-fill`: Scale to fill whole screen, potentially cropping parts of the frame buffer.
|
|
||||||
|
|
||||||
Note that the cpu-only window does not support fullscreen nor upscale filters.
|
Note that the cpu-only window does not support fullscreen nor upscale filters.
|
||||||
|
|
||||||
@@ -485,7 +484,7 @@ The upscale filter options are:
|
|||||||
5, auto_crt (default) : ss_crt below 960x720, chromatic_crt otherwise
|
5, auto_crt (default) : ss_crt below 960x720, chromatic_crt otherwise
|
||||||
```
|
```
|
||||||
|
|
||||||
You can switch the upscale filter at any time using the keys 1-5. You can toggle fullscreen with F. You can toggle between scale modes 'fit' and 'fill' with M.
|
You can switch the upscale filter at any time using the keys 1-5. You can toggle fullscreen with F.
|
||||||
|
|
||||||
## `uw8 pack`
|
## `uw8 pack`
|
||||||
|
|
||||||
@@ -595,7 +594,7 @@ a base module provided by MicroW8.
|
|||||||
|
|
||||||
You can generate this base module yourself using
|
You can generate this base module yourself using
|
||||||
`uw8-tool`. As a quick summary, it provides all function
|
`uw8-tool`. As a quick summary, it provides all function
|
||||||
types with up to 7 parameters (i32 or f32) where the
|
types with up to 5 parameters (i32 or f32) where the
|
||||||
`f32` parameters always preceed the `i32` parameters.
|
`f32` parameters always preceed the `i32` parameters.
|
||||||
Then it includes all imports that MicroW8 provides,
|
Then it includes all imports that MicroW8 provides,
|
||||||
a function section with a single function of type
|
a function section with a single function of type
|
||||||
|
|||||||
@@ -2,33 +2,6 @@
|
|||||||
description = "Versions"
|
description = "Versions"
|
||||||
+++
|
+++
|
||||||
|
|
||||||
### v0.4.1
|
|
||||||
|
|
||||||
* [Web runtime](../v0.4.1)
|
|
||||||
* [Linux](https://github.com/exoticorn/microw8/releases/download/v0.4.1/microw8-0.4.1-linux.tgz)
|
|
||||||
* [MacOS](https://github.com/exoticorn/microw8/releases/download/v0.4.1/microw8-0.4.1-macos.tgz)
|
|
||||||
* [Windows](https://github.com/exoticorn/microw8/releases/download/v0.4.1/microw8-0.4.1-windows.zip)
|
|
||||||
|
|
||||||
Changes:
|
|
||||||
|
|
||||||
* Windows: fix bad/inconsistent frame rate
|
|
||||||
* fix choppy sound on devices with sample rates != 44100 kHz
|
|
||||||
* add scale mode 'fill' option
|
|
||||||
|
|
||||||
### v0.4.0
|
|
||||||
|
|
||||||
* [Web runtime](../v0.4.0)
|
|
||||||
* [Linux](https://github.com/exoticorn/microw8/releases/download/v0.4.0/microw8-0.4.0-linux.tgz)
|
|
||||||
* [MacOS](https://github.com/exoticorn/microw8/releases/download/v0.4.0/microw8-0.4.0-macos.tgz)
|
|
||||||
* [Windows](https://github.com/exoticorn/microw8/releases/download/v0.4.0/microw8-0.4.0-windows.zip)
|
|
||||||
|
|
||||||
Changes:
|
|
||||||
|
|
||||||
* add support for sound on mono- and surround-only devices
|
|
||||||
* update wasmtime dependency to fix performance regression in 0.3.0
|
|
||||||
* add frame counter since module start at location 72
|
|
||||||
* add 6 and 7 parameter function types to base module
|
|
||||||
|
|
||||||
### v0.3.0
|
### v0.3.0
|
||||||
|
|
||||||
* [Web runtime](../v0.3.0)
|
* [Web runtime](../v0.3.0)
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
<!doctype html><html><head><meta charset="utf8"><title>MicroW8</title><link href="https://fonts.googleapis.com/css2?family=Josefin+Sans:wght@500&display=swap" rel="stylesheet"><style>html,body,canvas{margin:0;padding:0}html{color:#808070;background-color:#202024;height:100%;font-family:Josefin Sans,Verdana,Arial Black,sans-serif}body{grid-template-rows:1fr 0fr;height:100%;display:grid}#uw8{position:absolute}#uw8 a{font-size:130%}#centered{place-self:center}a{color:#303630}a:hover{color:#405040}.screen{image-rendering:pixelated;background-color:#202428;border:4px solid #303040;width:320px;height:240px;margin-bottom:8px;box-shadow:5px 5px 20px #000}#screen{cursor:none}#start{font-size:150%}#timer:before{content:"";background-color:red;border-radius:6px;width:12px;height:12px;margin-right:3px;display:inline-block}#message{margin-bottom:8px}.error{color:#e04030}button{color:#808070;background-color:#303440;border:1px solid #404040;border-radius:4px;padding:4px;font-family:inherit}button:hover{background-color:#202010}button:active{background-color:#504450}@media (width>=680px) and (height>=620px){.screen{width:640px;height:480px}}@media (width>=1000px) and (height>=800px){.screen{width:960px;height:720px}}@media (width:640px) and (height:480px){.screen{border:0;width:640px;height:480px;margin:0}body{overflow:hidden}}</style></head><body> <div id="uw8"> <a href="https://exoticorn.github.io/microw8">MicroW8</a> 0.4.0 </div> <div id="centered"> <canvas class="screen" id="screen" width="320" height="240"> </canvas> <button class="screen" id="start" style="display:none">Click to start</button> <div id="timer" hidden></div> <div id="message"></div> <button id="cartButton" style="visibility:hidden">Load cart...</button> </div> <div id="footer"> <a href="http://unlicense.org/" ref="license">Unlicense</a> </div> </body><script type="module">function e(e){return e&&e.__esModule?e.default:e}var t={};t="data:application/wasm;base64,AGFzbQEAAAABFQRgAX8Bf2ACf38Bf2ADf39%2FAGAAAAIPAQNlbnYGbWVtb3J5AgAEAwkIAAABAgEAAAMGEAN%2FAUEAC38BQQALfwFBAAsHGQIIbG9hZF91dzgAAAp1bmNvbXByZXNzAAQIAQcKngUIxwEBB39BAC0AAEEBayIBQQBIBEAgAA8LQYDABy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9M%2FPIsO1a%2F4bjFd0Uuru95ilanB4yFg4tk9FRqP2zJPk0T4LAzWMXzSX8%2F0VBgOogv%2BniB0XHFmaXv%2BG0PqGrx2sDO2N%2Fi98A3DdQyry%2Fs1%2Bb8mid6w7g5mptwhx561baq1syBSrGSJLqcDAutTh8uXZYvVXbFVzmxfLpAxsR898NHK51FkzqvkxeaNnYbCkC19jhJaslZ1E0vdpidtMzv1uwHCp986mNDT3qK4nWbwOpG52kVtkmac18T9g428D%2BeyJW82GG1hJmGV%2F39FlEB5hxbyFZINNLLAfNwG08itW25ATJ7QxZ%2FAX8zoz%2FT7oLugeHUeMBtvBF%2Bt40Wh2n%2FvjehShTKyMYUvlDZTTzBq34hcaBhCNCHTEHV8bRzoBK3%2Fx0qmeTW2l8vG7KCizhl8VoxALJiY84Isnu1OAS8vKw35FHVUWXDfXLUJw0WooJ%2BdxHnwkxlGBfeNGdWY0zJyRe3CgvsBiGlxC5nABF4pFYBMEOIGR6ev%2F3rrkXL34LdvKr2PkRuMr1gjvb8gGszxhBS40uxdOoWZLRyLA5OZ07W5nHTFbL5l6wKfJrIbrl8ZRamKdD5IXHETRJZq%2BlF3KOS0Jug3R8cjVTtBWYH4QDRXEym7uWNetxnlA5tTOlLine truncated
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
<!doctype html><html><head><meta charset="utf8"><title>MicroW8</title><link href="https://fonts.googleapis.com/css2?family=Josefin+Sans:wght@500&display=swap" rel="stylesheet"><style>html,body,canvas{margin:0;padding:0}html{color:#808070;background-color:#202024;height:100%;font-family:Josefin Sans,Verdana,Arial Black,sans-serif}body{grid-template-rows:1fr 0fr;height:100%;display:grid}#uw8{position:absolute}#uw8 a{font-size:130%}#centered{place-self:center}a{color:#303630}a:hover{color:#405040}.screen{image-rendering:pixelated;background-color:#202428;border:4px solid #303040;width:320px;height:240px;margin-bottom:8px;box-shadow:5px 5px 20px #000}#screen{cursor:none}#start{font-size:150%}#timer:before{content:"";background-color:red;border-radius:6px;width:12px;height:12px;margin-right:3px;display:inline-block}#message{margin-bottom:8px}.error{color:#e04030}button{color:#808070;background-color:#303440;border:1px solid #404040;border-radius:4px;padding:4px;font-family:inherit}button:hover{background-color:#202010}button:active{background-color:#504450}@media (width>=680px) and (height>=620px){.screen{width:640px;height:480px}}@media (width>=1000px) and (height>=800px){.screen{width:960px;height:720px}}@media (width:640px) and (height:480px){.screen{border:0;width:640px;height:480px;margin:0}body{overflow:hidden}}</style></head><body> <div id="uw8"> <a href="https://exoticorn.github.io/microw8">MicroW8</a> 0.4.1 </div> <div id="centered"> <canvas class="screen" id="screen" width="320" height="240"> </canvas> <button class="screen" id="start" style="display:none">Click to start</button> <div id="timer" hidden></div> <div id="message"></div> <button id="cartButton" style="visibility:hidden">Load cart...</button> </div> <div id="footer"> <a href="http://unlicense.org/" ref="license">Unlicense</a> </div> </body><script type="module">function e(e){return e&&e.__esModule?e.default:e}var t={};t="data:application/wasm;base64,AGFzbQEAAAABFQRgAX8Bf2ACf38Bf2ADf39%2FAGAAAAIPAQNlbnYGbWVtb3J5AgAEAwkIAAABAgEAAAMGEAN%2FAUEAC38BQQALfwFBAAsHGQIIbG9hZF91dzgAAAp1bmNvbXByZXNzAAQIAQcKngUIxwEBB39BAC0AAEEBayIBQQBIBEAgAA8LQYDAByAAaiECIAFBAXEEQEEBQYHABxAEIQIFQYDAB0EAIAAQAwtBAEGAhA9BCBADQYiEDyEDQQghBEGBwAchBQNAIAUgAkggAyMATiAFLQAAIAMtAABMcnEEQCAEIAQgBRACIgZqIQQgAyMASCAFLQAAIAMtAABGcQRAIAMgAxABaiEDCyAFIAZqIQUMAQsgAyMASARAIAQgBCADEAIiB2ohBCADIAdqIQMMAQsLIAQLPAEEfyAAIQEDQCACIAFBAWoiAS0AACIEQf8AcSADdHIhAiADQQdqIQMgBEEHdQ0ACyABQQFqIABrIAJqCxIBAX8gACABIAEQASICEAMgAgskAANAIAJBAEoEQCAAIAJBAWsiAmogASACai0AADoAAAwBCwsLqQEBBn8g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q34hcaBhCNCHTEHV8bRzoBK3%2Fx0qmeTW2l8vG7KCizhl8VoxALJiY84Isnu1OAS8vKw35FHVUWXDfXLUJw0WooJ%2BdxHnwkxlGBfeNGdWY0zJyRe3CgvsBiGlxC5nABF4pFYBMEOIGR6ev%2F3rrkXL34LdvKr2PkRuMr1gjvb8gGszxhBS40uxdOoWZLRyLA5OZ07W5nHTFbL5l6wKfJrIbrl8ZRamKdD5IXHETRJZq%2BlF3KOS0Jug3R8cjVTtBWYH4QDRXEym7uWNetxnlA5tTOlLine truncated
|
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
<section>
|
<section>
|
||||||
<h1 class="text-center heading-text">A WebAssembly based fantasy console</h1>
|
<h1 class="text-center heading-text">A WebAssembly based fantasy console</h1>
|
||||||
</section>
|
</section>
|
||||||
<a href="v0.4.1">
|
<a href="v0.3.0">
|
||||||
<img class="demonstration-gif" style="width:640px;height:480px;image-rendering:pixelated" src="img/technotunnel.png"></img>
|
<img class="demonstration-gif" style="width:640px;height:480px;image-rendering:pixelated" src="img/technotunnel.png"></img>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
<!doctype html><html><head><meta charset="utf8"><title>uw8-run</title><style>html,body,canvas{background-color:#202024;margin:0;padding:0}html{height:100%}body{grid-template-rows:1fr;height:100%;display:grid}#screen{image-rendering:pixelated;border:4px solid #303040;place-self:center}#message{color:#c64;z-index:2;background-color:#0006;width:calc(100% - 16px);padding:8px;font:700 12pt sans-serif;position:absolute}@media (width>=648px) and (height>=488px){#screen{width:640px;height:480px}}@media (width>=968px) and (height>=728px){#screen{width:960px;height:720px}}</style></head><body> <canvas id="screen" width="320" height="240" tabindex="1"> </canvas> <div id="message"></div> </body><script type="module">function e(e){return e&&e.__esModule?e.default:e}var t={};t="data:application/wasm;base64,AGFzbQEAAAABFQRgAX8Bf2ACf38Bf2ADf39%2FAGAAAAIPAQNlbnYGbWVtb3J5Ag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OdFhrJ6Fj7kX3iuWhGxpXrxiyMP%2BE4ax9UTCBGnvV7Nz1wE1gHFVe%2FN%2FoVjMZqV4vhzuVyf%2FEifKcdy1P4dVr6JG6Dw%2FcYvPlvqTtfCo1Khl5In1IrxmO5Hhq8ytKIKG9vTeeCqFXjVMCR9vfkCGyMi%2FbOdvNj6b%2Bq0ijT%2FyxZEp0kb7RSaN%2BihR75CGv7qkh8fy5qZmNYTNxFB5K%2F95iN70AZ8xZwKmOMJ7qbBzNj4j7fyl2zFz2SBLEWrSxhsGXkGjJ7OJmKJhLv8YQNTZij5u4F%2BUGB8GQhVZxmd381jEs4J2fsfbymks0lLC9BhIuCjK%2FTD28z1r7Kw%2Fnk97YXukMfBrNql3Bgh84neyaijJtxmMtuY6rb3CxPYBBQ0xMF%2FI7y6GqQL3xC9SuH5T0q%2FUjPliNfNsZEPgQ7o33%2BM80WMQELh8YeQsBIagyeql1ifqUUZ7hbSygRpIw76Fi7cVCJtaSZzH%2F8CzuoIjbHHWASBtQfLFB2vboh6UuhkyQB4igq0JskQIpQUMQB3wfXs%2BX4La3LtcQfiLkrMDRuqEn0LBhq8pktJvJZvpDtTShpTWpe0F6N43zx0Tk7lxF1awWFSz%2Bw%2B8PR%2BDd70VPEdaOWGxaSXZfnvo5R5wGccKJl0xsCkCZPuh%2BoK5OSHSOQr4eKb561cvGfpj0oO2dpCuIgaDs0r%2B%2BiDwdP2FQkQjyLZKE%2F4OF%2BuzbR9U47GeWrcF0n%2FBUd1VmNDibVX9Fue6C6ssuz8DeiRfXr1gy1w6MeBFXipcCqPm4tDpLbjyncb1A6tXEpAG4kJff0WFLsALine truncated
|
<!doctype html><html><head><meta charset="utf8"><title>uw8-run</title><style>html,body,canvas{background-color:#202024;margin:0;padding:0}html{height:100%}body{grid-template-rows:1fr;height:100%;display:grid}#screen{image-rendering:pixelated;border:4px solid #303040;place-self:center}#message{color:#c64;z-index:2;background-color:#0006;width:calc(100% - 16px);padding:8px;font:700 12pt sans-serif;position:absolute}@media (width>=648px) and (height>=488px){#screen{width:640px;height:480px}}@media (width>=968px) and (height>=728px){#screen{width:960px;height:720px}}</style></head><body> <canvas id="screen" width="320" height="240" tabindex="1"> </canvas> <div id="message"></div> </body><script type="module">function e(e){return e&&e.__esModule?e.default:e}var t={};t="data:application/wasm;base64,AGFzbQEAAAABFQRgAX8Bf2ACf38Bf2ADf39%2FAGAAAAIPAQNlbnYGbWVtb3J5AgAEAwkIAAABAgEAAAMGEAN%2FAUEAC38BQQALfwFBAAsHGQIIbG9hZF91dzgAAAp1bmNvbXByZXNzAAQIAQcKngUIxwEBB39BAC0AAEEBayIBQQBIBEAgAA8LQYDAByAAaiECIAFBAXEEQEEBQYHABxAEIQIFQYDAB0EAIAAQAwtBAEGAhA9BCBADQYiEDyEDQQghBEGBwAchBQNAIAUgAkggAyMATiAFLQAAIAMtAABMcnEEQCAEIAQgBRACIgZqIQQgAyMASCAFLQAAIAMtAABGcQRAIAMgAxABaiEDCyAFIAZqIQUMAQsgAyMASARAIAQgBCADEAIiB2ohBCADIAdqIQMMAQsLIAQLPAEEfyAAIQEDQCACIAFBAWoiAS0AACIEQf8AcSADdHIhAiADQQdqIQMgBEEHdQ0ACyABQQFqIABrIAJqCxIBAX8gACABIAEQASICEAMgAgskAANAIAJBAEoEQCAAIAJBAWsiAmogASACai0AADoAAAwBCwsLqQEBBn8gACQBQQAkAgNAIANBgAE6AICADyADQQFqIgNBgQNIDQALAkADQEEAEAYiBQRAIAQEf0EBBUGAAhAGCwRAQYECEAVBAWsiAkUNAwtBwQIQBSEGA0AgASABIAJrLQAAOgAAIAFBAWohASAGQQFrIgYNAAsFQQEhBwNAIAdBAXQgBxAGciIHQYACSA0ACyABIAc6AAAgAUEBaiEBCyAFIQQMAAsLIAELNAECfwNAIAAgAmoQBgRAIAEgACACakEgahAGIAJ0ciEBIAJBAWohAgwBCwsgAUEBIAJ0cgtxAQR%2FA0AjAkGAIEgEQCMCQQh0IwEtAAByJAIjAUEBaiQBDAELCy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qlARIYGSYpMTjVXIH8Ax2tshe%2Line truncated
|
||||||
+2
-2
@@ -395,8 +395,8 @@ fn init_sound(
|
|||||||
None
|
None
|
||||||
} else {
|
} else {
|
||||||
let rs = rubato::FftFixedIn::new(44100, sample_rate, 128, 1, 2)?;
|
let rs = rubato::FftFixedIn::new(44100, sample_rate, 128, 1, 2)?;
|
||||||
let input_buffers = rs.input_buffer_allocate();
|
let input_buffers = rs.input_buffer_allocate(true);
|
||||||
let output_buffers = rs.output_buffer_allocate();
|
let output_buffers = rs.output_buffer_allocate(true);
|
||||||
Some(Resampler {
|
Some(Resampler {
|
||||||
resampler: rs,
|
resampler: rs,
|
||||||
input_buffers,
|
input_buffers,
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ impl BaseModule {
|
|||||||
|
|
||||||
let mut types = vec![];
|
let mut types = vec![];
|
||||||
let mut type_map = HashMap::new();
|
let mut type_map = HashMap::new();
|
||||||
for num_params in 0..8 {
|
for num_params in 0..6 {
|
||||||
for num_f32 in 0..=num_params {
|
for num_f32 in 0..=num_params {
|
||||||
for &result in &[None, Some(ValType::I32), Some(ValType::F32)] {
|
for &result in &[None, Some(ValType::I32), Some(ValType::F32)] {
|
||||||
let mut params = vec![];
|
let mut params = vec![];
|
||||||
|
|||||||
Generated
+543
-374
File diff suppressed because it is too large.
Load diff
@@ -6,11 +6,11 @@ edition = "2021"
|
|||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
winit = "0.29.15"
|
||||||
env_logger = "0.11.3"
|
env_logger = "0.11.3"
|
||||||
winit = "0.28.6"
|
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
pico-args = "0.5"
|
pico-args = "0.5"
|
||||||
wgpu = "0.17"
|
wgpu = "0.19.3"
|
||||||
pollster = "0.3.0"
|
pollster = "0.3.0"
|
||||||
bytemuck = { version = "1.15", features = [ "derive" ] }
|
bytemuck = { version = "1.15", features = [ "derive" ] }
|
||||||
anyhow = "1"
|
anyhow = "1"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
use wgpu::util::DeviceExt;
|
use wgpu::util::DeviceExt;
|
||||||
use winit::dpi::PhysicalSize;
|
use winit::dpi::PhysicalSize;
|
||||||
|
|
||||||
use super::{scale_mode::ScaleMode, Filter};
|
use super::Filter;
|
||||||
|
|
||||||
pub struct CrtFilter {
|
pub struct CrtFilter {
|
||||||
uniform_buffer: wgpu::Buffer,
|
uniform_buffer: wgpu::Buffer,
|
||||||
@@ -15,10 +15,9 @@ impl CrtFilter {
|
|||||||
screen: &wgpu::TextureView,
|
screen: &wgpu::TextureView,
|
||||||
resolution: PhysicalSize<u32>,
|
resolution: PhysicalSize<u32>,
|
||||||
surface_format: wgpu::TextureFormat,
|
surface_format: wgpu::TextureFormat,
|
||||||
scale_mode: ScaleMode,
|
|
||||||
) -> CrtFilter {
|
) -> CrtFilter {
|
||||||
let uniforms = Uniforms {
|
let uniforms = Uniforms {
|
||||||
texture_scale: scale_mode.texture_scale_from_resolution(resolution),
|
texture_scale: texture_scale_from_resolution(resolution),
|
||||||
};
|
};
|
||||||
|
|
||||||
let uniform_buffer = device.create_buffer_init(&wgpu::util::BufferInitDescriptor {
|
let uniform_buffer = device.create_buffer_init(&wgpu::util::BufferInitDescriptor {
|
||||||
@@ -113,9 +112,9 @@ impl CrtFilter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Filter for CrtFilter {
|
impl Filter for CrtFilter {
|
||||||
fn resize(&mut self, queue: &wgpu::Queue, new_size: PhysicalSize<u32>, scale_mode: ScaleMode) {
|
fn resize(&mut self, queue: &wgpu::Queue, new_size: PhysicalSize<u32>) {
|
||||||
let uniforms = Uniforms {
|
let uniforms = Uniforms {
|
||||||
texture_scale: scale_mode.texture_scale_from_resolution(new_size),
|
texture_scale: texture_scale_from_resolution(new_size),
|
||||||
};
|
};
|
||||||
queue.write_buffer(&self.uniform_buffer, 0, bytemuck::cast_slice(&[uniforms]));
|
queue.write_buffer(&self.uniform_buffer, 0, bytemuck::cast_slice(&[uniforms]));
|
||||||
}
|
}
|
||||||
@@ -127,6 +126,16 @@ impl Filter for CrtFilter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn texture_scale_from_resolution(res: PhysicalSize<u32>) -> [f32; 4] {
|
||||||
|
let scale = ((res.width as f32) / 160.0).min((res.height as f32) / 120.0);
|
||||||
|
[
|
||||||
|
res.width as f32 / scale,
|
||||||
|
res.height as f32 / scale,
|
||||||
|
2.0 / scale,
|
||||||
|
0.0,
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
#[derive(Debug, Copy, Clone, bytemuck::Pod, bytemuck::Zeroable)]
|
#[derive(Debug, Copy, Clone, bytemuck::Pod, bytemuck::Zeroable)]
|
||||||
struct Uniforms {
|
struct Uniforms {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ fn vs_main(
|
|||||||
let i = in_vertex_index / 3u + in_vertex_index % 3u;
|
let i = in_vertex_index / 3u + in_vertex_index % 3u;
|
||||||
let x = -1.0 + f32(i % 2u) * 322.0;
|
let x = -1.0 + f32(i % 2u) * 322.0;
|
||||||
let y = -1.0 + f32(i / 2u) * 242.0;
|
let y = -1.0 + f32(i / 2u) * 242.0;
|
||||||
out.clip_position = vec4<f32>((vec2<f32>(x, y) - vec2<f32>(160.0, 120.0)) * uniforms.texture_scale.xy, 0.0, 1.0);
|
out.clip_position = vec4<f32>((vec2<f32>(x, y) - vec2<f32>(160.0, 120.0)) / uniforms.texture_scale.xy, 0.0, 1.0);
|
||||||
out.tex_coords = vec2<f32>(x, y);
|
out.tex_coords = vec2<f32>(x, y);
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
@@ -72,4 +72,4 @@ fn fs_main(in: VertexOutput) -> @location(0) vec4<f32> {
|
|||||||
acc = acc + sample_pixel(pixel + vec2<i32>(1, 1), offset_x2 + offset_yr);
|
acc = acc + sample_pixel(pixel + vec2<i32>(1, 1), offset_x2 + offset_yr);
|
||||||
|
|
||||||
return vec4<f32>(acc, 1.0);
|
return vec4<f32>(acc, 1.0);
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
use wgpu::util::DeviceExt;
|
use wgpu::util::DeviceExt;
|
||||||
use winit::dpi::PhysicalSize;
|
use winit::dpi::PhysicalSize;
|
||||||
|
|
||||||
use super::{scale_mode::ScaleMode, Filter};
|
use super::Filter;
|
||||||
|
|
||||||
pub struct FastCrtFilter {
|
pub struct FastCrtFilter {
|
||||||
uniform_buffer: wgpu::Buffer,
|
uniform_buffer: wgpu::Buffer,
|
||||||
@@ -16,10 +16,9 @@ impl FastCrtFilter {
|
|||||||
resolution: PhysicalSize<u32>,
|
resolution: PhysicalSize<u32>,
|
||||||
surface_format: wgpu::TextureFormat,
|
surface_format: wgpu::TextureFormat,
|
||||||
chromatic: bool,
|
chromatic: bool,
|
||||||
scale_mode: ScaleMode,
|
|
||||||
) -> FastCrtFilter {
|
) -> FastCrtFilter {
|
||||||
let uniforms = Uniforms {
|
let uniforms = Uniforms {
|
||||||
texture_scale: scale_mode.texture_scale_from_resolution(resolution),
|
texture_scale: texture_scale_from_resolution(resolution),
|
||||||
};
|
};
|
||||||
|
|
||||||
let uniform_buffer = device.create_buffer_init(&wgpu::util::BufferInitDescriptor {
|
let uniform_buffer = device.create_buffer_init(&wgpu::util::BufferInitDescriptor {
|
||||||
@@ -132,9 +131,9 @@ impl FastCrtFilter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Filter for FastCrtFilter {
|
impl Filter for FastCrtFilter {
|
||||||
fn resize(&mut self, queue: &wgpu::Queue, new_size: PhysicalSize<u32>, scale_mode: ScaleMode) {
|
fn resize(&mut self, queue: &wgpu::Queue, new_size: PhysicalSize<u32>) {
|
||||||
let uniforms = Uniforms {
|
let uniforms = Uniforms {
|
||||||
texture_scale: scale_mode.texture_scale_from_resolution(new_size),
|
texture_scale: texture_scale_from_resolution(new_size),
|
||||||
};
|
};
|
||||||
queue.write_buffer(&self.uniform_buffer, 0, bytemuck::cast_slice(&[uniforms]));
|
queue.write_buffer(&self.uniform_buffer, 0, bytemuck::cast_slice(&[uniforms]));
|
||||||
}
|
}
|
||||||
@@ -146,6 +145,16 @@ impl Filter for FastCrtFilter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn texture_scale_from_resolution(res: PhysicalSize<u32>) -> [f32; 4] {
|
||||||
|
let scale = ((res.width as f32) / 160.0).min((res.height as f32) / 120.0);
|
||||||
|
[
|
||||||
|
scale / res.width as f32,
|
||||||
|
scale / res.height as f32,
|
||||||
|
2.0 / scale,
|
||||||
|
0.0,
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
#[derive(Debug, Copy, Clone, bytemuck::Pod, bytemuck::Zeroable)]
|
#[derive(Debug, Copy, Clone, bytemuck::Pod, bytemuck::Zeroable)]
|
||||||
struct Uniforms {
|
struct Uniforms {
|
||||||
|
|||||||
+99
-116
@@ -1,20 +1,18 @@
|
|||||||
use crate::{Input, WindowConfig, WindowImpl};
|
use crate::{Input, WindowConfig, WindowImpl};
|
||||||
use anyhow::{anyhow, Result};
|
use anyhow::{anyhow, Result};
|
||||||
use scale_mode::ScaleMode;
|
use std::{sync::Arc, time::Instant};
|
||||||
use std::time::Instant;
|
|
||||||
|
|
||||||
use winit::{
|
use winit::{
|
||||||
dpi::PhysicalSize,
|
dpi::PhysicalSize,
|
||||||
event::{Event, VirtualKeyCode, WindowEvent},
|
event::{Event, WindowEvent},
|
||||||
event_loop::{ControlFlow, EventLoop},
|
event_loop::{ControlFlow, EventLoop},
|
||||||
|
keyboard::{Key, KeyCode, NamedKey, PhysicalKey},
|
||||||
|
platform::pump_events::{EventLoopExtPumpEvents, PumpStatus},
|
||||||
window::{Fullscreen, WindowBuilder},
|
window::{Fullscreen, WindowBuilder},
|
||||||
};
|
};
|
||||||
|
|
||||||
use winit::platform::run_return::EventLoopExtRunReturn;
|
|
||||||
|
|
||||||
mod crt;
|
mod crt;
|
||||||
mod fast_crt;
|
mod fast_crt;
|
||||||
pub mod scale_mode;
|
|
||||||
mod square;
|
mod square;
|
||||||
|
|
||||||
use crt::CrtFilter;
|
use crt::CrtFilter;
|
||||||
@@ -23,7 +21,7 @@ use square::SquareFilter;
|
|||||||
|
|
||||||
pub struct Window {
|
pub struct Window {
|
||||||
_instance: wgpu::Instance,
|
_instance: wgpu::Instance,
|
||||||
surface: wgpu::Surface,
|
surface: wgpu::Surface<'static>,
|
||||||
_adapter: wgpu::Adapter,
|
_adapter: wgpu::Adapter,
|
||||||
device: wgpu::Device,
|
device: wgpu::Device,
|
||||||
queue: wgpu::Queue,
|
queue: wgpu::Queue,
|
||||||
@@ -31,18 +29,17 @@ pub struct Window {
|
|||||||
surface_config: wgpu::SurfaceConfiguration,
|
surface_config: wgpu::SurfaceConfiguration,
|
||||||
filter: Box<dyn Filter>,
|
filter: Box<dyn Filter>,
|
||||||
event_loop: EventLoop<()>,
|
event_loop: EventLoop<()>,
|
||||||
window: winit::window::Window,
|
window: Arc<winit::window::Window>,
|
||||||
gamepads: [u8; 4],
|
gamepads: [u8; 4],
|
||||||
next_frame: Instant,
|
next_frame: Instant,
|
||||||
is_fullscreen: bool,
|
is_fullscreen: bool,
|
||||||
is_open: bool,
|
is_open: bool,
|
||||||
scale_mode: ScaleMode,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Window {
|
impl Window {
|
||||||
pub fn new(window_config: WindowConfig) -> Result<Window> {
|
pub fn new(window_config: WindowConfig) -> Result<Window> {
|
||||||
async fn create(window_config: WindowConfig) -> Result<Window> {
|
async fn create(window_config: WindowConfig) -> Result<Window> {
|
||||||
let event_loop = EventLoop::new();
|
let event_loop = EventLoop::new()?;
|
||||||
let window = WindowBuilder::new()
|
let window = WindowBuilder::new()
|
||||||
.with_inner_size(PhysicalSize::new(
|
.with_inner_size(PhysicalSize::new(
|
||||||
(320. * window_config.scale).round() as u32,
|
(320. * window_config.scale).round() as u32,
|
||||||
@@ -59,8 +56,10 @@ impl Window {
|
|||||||
|
|
||||||
window.set_cursor_visible(false);
|
window.set_cursor_visible(false);
|
||||||
|
|
||||||
|
let window = Arc::new(window);
|
||||||
|
|
||||||
let instance = wgpu::Instance::new(Default::default());
|
let instance = wgpu::Instance::new(Default::default());
|
||||||
let surface = unsafe { instance.create_surface(&window) }?;
|
let surface = instance.create_surface(window.clone())?;
|
||||||
let adapter = instance
|
let adapter = instance
|
||||||
.request_adapter(&wgpu::RequestAdapterOptions {
|
.request_adapter(&wgpu::RequestAdapterOptions {
|
||||||
power_preference: wgpu::PowerPreference::LowPower,
|
power_preference: wgpu::PowerPreference::LowPower,
|
||||||
@@ -93,7 +92,6 @@ impl Window {
|
|||||||
window.inner_size(),
|
window.inner_size(),
|
||||||
surface_config.format,
|
surface_config.format,
|
||||||
window_config.filter,
|
window_config.filter,
|
||||||
window_config.scale_mode,
|
|
||||||
);
|
);
|
||||||
|
|
||||||
surface.configure(&device, &surface_config);
|
surface.configure(&device, &surface_config);
|
||||||
@@ -113,7 +111,6 @@ impl Window {
|
|||||||
next_frame: Instant::now(),
|
next_frame: Instant::now(),
|
||||||
is_fullscreen: window_config.fullscreen,
|
is_fullscreen: window_config.fullscreen,
|
||||||
is_open: true,
|
is_open: true,
|
||||||
scale_mode: window_config.scale_mode,
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -124,103 +121,93 @@ impl Window {
|
|||||||
impl WindowImpl for Window {
|
impl WindowImpl for Window {
|
||||||
fn begin_frame(&mut self) -> Input {
|
fn begin_frame(&mut self) -> Input {
|
||||||
let mut reset = false;
|
let mut reset = false;
|
||||||
self.event_loop.run_return(|event, _, control_flow| {
|
self.event_loop
|
||||||
*control_flow = ControlFlow::WaitUntil(self.next_frame);
|
.set_control_flow(ControlFlow::WaitUntil(self.next_frame));
|
||||||
let mut new_filter = None;
|
while self.is_open {
|
||||||
match event {
|
let timeout = self.next_frame.saturating_duration_since(Instant::now());
|
||||||
Event::WindowEvent { event, .. } => match event {
|
let status = self.event_loop.pump_events(Some(timeout), |event, elwt| {
|
||||||
WindowEvent::Resized(new_size) => {
|
let mut new_filter = None;
|
||||||
self.surface_config.width = new_size.width;
|
match event {
|
||||||
self.surface_config.height = new_size.height;
|
Event::WindowEvent { event, .. } => match event {
|
||||||
self.surface.configure(&self.device, &self.surface_config);
|
WindowEvent::Resized(new_size) => {
|
||||||
self.filter.resize(&self.queue, new_size, self.scale_mode);
|
self.surface_config.width = new_size.width;
|
||||||
}
|
self.surface_config.height = new_size.height;
|
||||||
WindowEvent::CloseRequested => {
|
self.surface.configure(&self.device, &self.surface_config);
|
||||||
self.is_open = false;
|
self.filter.resize(&self.queue, new_size);
|
||||||
*control_flow = ControlFlow::Exit;
|
|
||||||
}
|
|
||||||
WindowEvent::KeyboardInput { input, .. } => {
|
|
||||||
fn gamepad_button(input: &winit::event::KeyboardInput) -> u8 {
|
|
||||||
match input.scancode {
|
|
||||||
44 => 16,
|
|
||||||
45 => 32,
|
|
||||||
30 => 64,
|
|
||||||
31 => 128,
|
|
||||||
_ => match input.virtual_keycode {
|
|
||||||
Some(VirtualKeyCode::Up) => 1,
|
|
||||||
Some(VirtualKeyCode::Down) => 2,
|
|
||||||
Some(VirtualKeyCode::Left) => 4,
|
|
||||||
Some(VirtualKeyCode::Right) => 8,
|
|
||||||
_ => 0,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if input.state == winit::event::ElementState::Pressed {
|
WindowEvent::CloseRequested => {
|
||||||
match input.virtual_keycode {
|
elwt.exit();
|
||||||
Some(VirtualKeyCode::Escape) => {
|
}
|
||||||
self.is_open = false;
|
WindowEvent::KeyboardInput { event, .. } => {
|
||||||
*control_flow = ControlFlow::Exit;
|
fn gamepad_button(input: &winit::event::KeyEvent) -> u8 {
|
||||||
|
match input.physical_key {
|
||||||
|
PhysicalKey::Code(KeyCode::KeyZ) => 16,
|
||||||
|
PhysicalKey::Code(KeyCode::KeyX) => 32,
|
||||||
|
PhysicalKey::Code(KeyCode::KeyA) => 64,
|
||||||
|
PhysicalKey::Code(KeyCode::KeyS) => 128,
|
||||||
|
_ => match input.logical_key {
|
||||||
|
Key::Named(NamedKey::ArrowUp) => 1,
|
||||||
|
Key::Named(NamedKey::ArrowDown) => 2,
|
||||||
|
Key::Named(NamedKey::ArrowLeft) => 4,
|
||||||
|
Key::Named(NamedKey::ArrowRight) => 8,
|
||||||
|
_ => 0,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
Some(VirtualKeyCode::F) => {
|
|
||||||
let fullscreen = if self.window.fullscreen().is_some() {
|
|
||||||
None
|
|
||||||
} else {
|
|
||||||
Some(Fullscreen::Borderless(None))
|
|
||||||
};
|
|
||||||
self.is_fullscreen = fullscreen.is_some();
|
|
||||||
self.window.set_fullscreen(fullscreen);
|
|
||||||
}
|
|
||||||
Some(VirtualKeyCode::M) => {
|
|
||||||
self.scale_mode = match self.scale_mode {
|
|
||||||
ScaleMode::Fit => ScaleMode::Fill,
|
|
||||||
ScaleMode::Fill => ScaleMode::Fit,
|
|
||||||
};
|
|
||||||
self.filter.resize(
|
|
||||||
&self.queue,
|
|
||||||
PhysicalSize {
|
|
||||||
width: self.surface_config.width,
|
|
||||||
height: self.surface_config.height,
|
|
||||||
},
|
|
||||||
self.scale_mode,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
Some(VirtualKeyCode::R) => reset = true,
|
|
||||||
Some(VirtualKeyCode::Key1) => new_filter = Some(1),
|
|
||||||
Some(VirtualKeyCode::Key2) => new_filter = Some(2),
|
|
||||||
Some(VirtualKeyCode::Key3) => new_filter = Some(3),
|
|
||||||
Some(VirtualKeyCode::Key4) => new_filter = Some(4),
|
|
||||||
Some(VirtualKeyCode::Key5) => new_filter = Some(5),
|
|
||||||
_ => (),
|
|
||||||
}
|
}
|
||||||
|
if event.state == winit::event::ElementState::Pressed {
|
||||||
|
match event.logical_key {
|
||||||
|
Key::Named(NamedKey::Escape) => {
|
||||||
|
elwt.exit();
|
||||||
|
}
|
||||||
|
Key::Character(ref c) => match c.as_str() {
|
||||||
|
"f" => {
|
||||||
|
let fullscreen = if self.window.fullscreen().is_some() {
|
||||||
|
None
|
||||||
|
} else {
|
||||||
|
Some(Fullscreen::Borderless(None))
|
||||||
|
};
|
||||||
|
self.is_fullscreen = fullscreen.is_some();
|
||||||
|
self.window.set_fullscreen(fullscreen);
|
||||||
|
}
|
||||||
|
"r" => reset = true,
|
||||||
|
"1" => new_filter = Some(1),
|
||||||
|
"2" => new_filter = Some(2),
|
||||||
|
"3" => new_filter = Some(3),
|
||||||
|
"4" => new_filter = Some(4),
|
||||||
|
"5" => new_filter = Some(5),
|
||||||
|
_ => (),
|
||||||
|
},
|
||||||
|
_ => (),
|
||||||
|
}
|
||||||
|
|
||||||
self.gamepads[0] |= gamepad_button(&input);
|
self.gamepads[0] |= gamepad_button(&event);
|
||||||
} else {
|
} else {
|
||||||
self.gamepads[0] &= !gamepad_button(&input);
|
self.gamepads[0] &= !gamepad_button(&event);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
_ => (),
|
||||||
|
},
|
||||||
_ => (),
|
_ => (),
|
||||||
},
|
|
||||||
Event::RedrawEventsCleared => {
|
|
||||||
if Instant::now() >= self.next_frame
|
|
||||||
// workaround needed on Wayland until the next winit release
|
|
||||||
&& self.window.fullscreen().is_some() == self.is_fullscreen
|
|
||||||
{
|
|
||||||
*control_flow = ControlFlow::Exit
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
if let Some(new_filter) = new_filter {
|
||||||
|
self.filter = create_filter(
|
||||||
|
&self.device,
|
||||||
|
&self.palette_screen_mode.screen_view,
|
||||||
|
self.window.inner_size(),
|
||||||
|
self.surface_config.format,
|
||||||
|
new_filter,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
match status {
|
||||||
|
PumpStatus::Exit(_) => self.is_open = false,
|
||||||
_ => (),
|
_ => (),
|
||||||
}
|
}
|
||||||
if let Some(new_filter) = new_filter {
|
|
||||||
self.filter = create_filter(
|
if Instant::now() >= self.next_frame {
|
||||||
&self.device,
|
break;
|
||||||
&self.palette_screen_mode.screen_view,
|
|
||||||
self.window.inner_size(),
|
|
||||||
self.surface_config.format,
|
|
||||||
new_filter,
|
|
||||||
self.scale_mode,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
Input {
|
Input {
|
||||||
gamepads: self.gamepads,
|
gamepads: self.gamepads,
|
||||||
reset,
|
reset,
|
||||||
@@ -256,10 +243,12 @@ impl WindowImpl for Window {
|
|||||||
b: 0.0,
|
b: 0.0,
|
||||||
a: 1.0,
|
a: 1.0,
|
||||||
}),
|
}),
|
||||||
store: true,
|
store: wgpu::StoreOp::Store,
|
||||||
},
|
},
|
||||||
})],
|
})],
|
||||||
depth_stencil_attachment: None,
|
depth_stencil_attachment: None,
|
||||||
|
timestamp_writes: None,
|
||||||
|
occlusion_query_set: None,
|
||||||
});
|
});
|
||||||
|
|
||||||
self.filter.render(&mut render_pass);
|
self.filter.render(&mut render_pass);
|
||||||
@@ -280,7 +269,6 @@ fn create_filter(
|
|||||||
window_size: PhysicalSize<u32>,
|
window_size: PhysicalSize<u32>,
|
||||||
surface_format: wgpu::TextureFormat,
|
surface_format: wgpu::TextureFormat,
|
||||||
filter: u32,
|
filter: u32,
|
||||||
scale_mode: ScaleMode,
|
|
||||||
) -> Box<dyn Filter> {
|
) -> Box<dyn Filter> {
|
||||||
match filter {
|
match filter {
|
||||||
1 => Box::new(SquareFilter::new(
|
1 => Box::new(SquareFilter::new(
|
||||||
@@ -288,7 +276,6 @@ fn create_filter(
|
|||||||
screen_texture,
|
screen_texture,
|
||||||
window_size,
|
window_size,
|
||||||
surface_format,
|
surface_format,
|
||||||
scale_mode,
|
|
||||||
)),
|
)),
|
||||||
2 => Box::new(FastCrtFilter::new(
|
2 => Box::new(FastCrtFilter::new(
|
||||||
device,
|
device,
|
||||||
@@ -296,14 +283,12 @@ fn create_filter(
|
|||||||
window_size,
|
window_size,
|
||||||
surface_format,
|
surface_format,
|
||||||
false,
|
false,
|
||||||
scale_mode,
|
|
||||||
)),
|
)),
|
||||||
3 => Box::new(CrtFilter::new(
|
3 => Box::new(CrtFilter::new(
|
||||||
device,
|
device,
|
||||||
screen_texture,
|
screen_texture,
|
||||||
window_size,
|
window_size,
|
||||||
surface_format,
|
surface_format,
|
||||||
scale_mode,
|
|
||||||
)),
|
)),
|
||||||
4 => Box::new(FastCrtFilter::new(
|
4 => Box::new(FastCrtFilter::new(
|
||||||
device,
|
device,
|
||||||
@@ -311,20 +296,18 @@ fn create_filter(
|
|||||||
window_size,
|
window_size,
|
||||||
surface_format,
|
surface_format,
|
||||||
true,
|
true,
|
||||||
scale_mode,
|
|
||||||
)),
|
)),
|
||||||
_ => Box::new(AutoCrtFilter::new(
|
_ => Box::new(AutoCrtFilter::new(
|
||||||
device,
|
device,
|
||||||
screen_texture,
|
screen_texture,
|
||||||
window_size,
|
window_size,
|
||||||
surface_format,
|
surface_format,
|
||||||
scale_mode,
|
|
||||||
)),
|
)),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
trait Filter {
|
trait Filter {
|
||||||
fn resize(&mut self, queue: &wgpu::Queue, new_size: PhysicalSize<u32>, scale_mode: ScaleMode);
|
fn resize(&mut self, queue: &wgpu::Queue, new_size: PhysicalSize<u32>);
|
||||||
fn render<'a>(&'a self, render_pass: &mut wgpu::RenderPass<'a>);
|
fn render<'a>(&'a self, render_pass: &mut wgpu::RenderPass<'a>);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -340,11 +323,9 @@ impl AutoCrtFilter {
|
|||||||
screen: &wgpu::TextureView,
|
screen: &wgpu::TextureView,
|
||||||
resolution: PhysicalSize<u32>,
|
resolution: PhysicalSize<u32>,
|
||||||
surface_format: wgpu::TextureFormat,
|
surface_format: wgpu::TextureFormat,
|
||||||
scale_mode: ScaleMode,
|
|
||||||
) -> AutoCrtFilter {
|
) -> AutoCrtFilter {
|
||||||
let small = CrtFilter::new(device, screen, resolution, surface_format, scale_mode);
|
let small = CrtFilter::new(device, screen, resolution, surface_format);
|
||||||
let large =
|
let large = FastCrtFilter::new(device, screen, resolution, surface_format, true);
|
||||||
FastCrtFilter::new(device, screen, resolution, surface_format, true, scale_mode);
|
|
||||||
AutoCrtFilter {
|
AutoCrtFilter {
|
||||||
small,
|
small,
|
||||||
large,
|
large,
|
||||||
@@ -354,9 +335,9 @@ impl AutoCrtFilter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Filter for AutoCrtFilter {
|
impl Filter for AutoCrtFilter {
|
||||||
fn resize(&mut self, queue: &wgpu::Queue, new_size: PhysicalSize<u32>, scale_mode: ScaleMode) {
|
fn resize(&mut self, queue: &wgpu::Queue, new_size: PhysicalSize<u32>) {
|
||||||
self.small.resize(queue, new_size, scale_mode);
|
self.small.resize(queue, new_size);
|
||||||
self.large.resize(queue, new_size, scale_mode);
|
self.large.resize(queue, new_size);
|
||||||
self.resolution = new_size;
|
self.resolution = new_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -569,10 +550,12 @@ impl PaletteScreenMode {
|
|||||||
resolve_target: None,
|
resolve_target: None,
|
||||||
ops: wgpu::Operations {
|
ops: wgpu::Operations {
|
||||||
load: wgpu::LoadOp::Load,
|
load: wgpu::LoadOp::Load,
|
||||||
store: true,
|
store: wgpu::StoreOp::Store,
|
||||||
},
|
},
|
||||||
})],
|
})],
|
||||||
depth_stencil_attachment: None,
|
depth_stencil_attachment: None,
|
||||||
|
timestamp_writes: None,
|
||||||
|
occlusion_query_set: None,
|
||||||
});
|
});
|
||||||
|
|
||||||
render_pass.set_pipeline(&self.pipeline);
|
render_pass.set_pipeline(&self.pipeline);
|
||||||
|
|||||||
@@ -1,28 +0,0 @@
|
|||||||
use winit::dpi::PhysicalSize;
|
|
||||||
|
|
||||||
#[derive(Debug, Copy, Clone)]
|
|
||||||
pub enum ScaleMode {
|
|
||||||
Fit,
|
|
||||||
Fill,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Default for ScaleMode {
|
|
||||||
fn default() -> ScaleMode {
|
|
||||||
ScaleMode::Fit
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl ScaleMode {
|
|
||||||
pub fn texture_scale_from_resolution(&self, res: PhysicalSize<u32>) -> [f32; 4] {
|
|
||||||
let scale = match self {
|
|
||||||
ScaleMode::Fit => ((res.width as f32) / 160.0).min((res.height as f32) / 120.0),
|
|
||||||
ScaleMode::Fill => ((res.width as f32) / 160.0).max((res.height as f32) / 120.0),
|
|
||||||
};
|
|
||||||
[
|
|
||||||
scale / res.width as f32,
|
|
||||||
scale / res.height as f32,
|
|
||||||
2.0 / scale,
|
|
||||||
0.0,
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
use wgpu::util::DeviceExt;
|
use wgpu::util::DeviceExt;
|
||||||
use winit::dpi::PhysicalSize;
|
use winit::dpi::PhysicalSize;
|
||||||
|
|
||||||
use super::{scale_mode::ScaleMode, Filter};
|
use super::Filter;
|
||||||
|
|
||||||
pub struct SquareFilter {
|
pub struct SquareFilter {
|
||||||
uniform_buffer: wgpu::Buffer,
|
uniform_buffer: wgpu::Buffer,
|
||||||
@@ -15,10 +15,9 @@ impl SquareFilter {
|
|||||||
screen: &wgpu::TextureView,
|
screen: &wgpu::TextureView,
|
||||||
resolution: PhysicalSize<u32>,
|
resolution: PhysicalSize<u32>,
|
||||||
surface_format: wgpu::TextureFormat,
|
surface_format: wgpu::TextureFormat,
|
||||||
scale_mode: ScaleMode,
|
|
||||||
) -> SquareFilter {
|
) -> SquareFilter {
|
||||||
let uniforms = Uniforms {
|
let uniforms = Uniforms {
|
||||||
texture_scale: scale_mode.texture_scale_from_resolution(resolution),
|
texture_scale: texture_scale_from_resolution(resolution),
|
||||||
};
|
};
|
||||||
|
|
||||||
let uniform_buffer = device.create_buffer_init(&wgpu::util::BufferInitDescriptor {
|
let uniform_buffer = device.create_buffer_init(&wgpu::util::BufferInitDescriptor {
|
||||||
@@ -127,9 +126,9 @@ impl SquareFilter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Filter for SquareFilter {
|
impl Filter for SquareFilter {
|
||||||
fn resize(&mut self, queue: &wgpu::Queue, new_size: PhysicalSize<u32>, scale_mode: ScaleMode) {
|
fn resize(&mut self, queue: &wgpu::Queue, new_size: PhysicalSize<u32>) {
|
||||||
let uniforms = Uniforms {
|
let uniforms = Uniforms {
|
||||||
texture_scale: scale_mode.texture_scale_from_resolution(new_size),
|
texture_scale: texture_scale_from_resolution(new_size),
|
||||||
};
|
};
|
||||||
queue.write_buffer(&self.uniform_buffer, 0, bytemuck::cast_slice(&[uniforms]));
|
queue.write_buffer(&self.uniform_buffer, 0, bytemuck::cast_slice(&[uniforms]));
|
||||||
}
|
}
|
||||||
@@ -141,6 +140,16 @@ impl Filter for SquareFilter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn texture_scale_from_resolution(res: PhysicalSize<u32>) -> [f32; 4] {
|
||||||
|
let scale = ((res.width as f32) / 160.0).min((res.height as f32) / 120.0);
|
||||||
|
[
|
||||||
|
scale / res.width as f32,
|
||||||
|
scale / res.height as f32,
|
||||||
|
2.0 / scale,
|
||||||
|
0.0,
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
#[derive(Debug, Copy, Clone, bytemuck::Pod, bytemuck::Zeroable)]
|
#[derive(Debug, Copy, Clone, bytemuck::Pod, bytemuck::Zeroable)]
|
||||||
struct Uniforms {
|
struct Uniforms {
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use gpu::scale_mode::ScaleMode;
|
|
||||||
use std::time::Instant;
|
use std::time::Instant;
|
||||||
|
|
||||||
mod cpu;
|
mod cpu;
|
||||||
@@ -74,7 +73,6 @@ pub struct WindowConfig {
|
|||||||
fullscreen: bool,
|
fullscreen: bool,
|
||||||
fps_counter: bool,
|
fps_counter: bool,
|
||||||
scale: f32,
|
scale: f32,
|
||||||
scale_mode: ScaleMode,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for WindowConfig {
|
impl Default for WindowConfig {
|
||||||
@@ -85,7 +83,6 @@ impl Default for WindowConfig {
|
|||||||
fullscreen: false,
|
fullscreen: false,
|
||||||
fps_counter: false,
|
fps_counter: false,
|
||||||
scale: 2.,
|
scale: 2.,
|
||||||
scale_mode: ScaleMode::Fit,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -112,9 +109,6 @@ impl WindowConfig {
|
|||||||
.opt_value_from_str("--scale")
|
.opt_value_from_str("--scale")
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.unwrap_or(self.scale);
|
.unwrap_or(self.scale);
|
||||||
if args.contains("--scale-fill") {
|
|
||||||
self.scale_mode = ScaleMode::Fill;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -10,7 +10,7 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="uw8">
|
<div id="uw8">
|
||||||
<a href="https://exoticorn.github.io/microw8">MicroW8</a> 0.4.1
|
<a href="https://exoticorn.github.io/microw8">MicroW8</a> 0.3.1
|
||||||
</div>
|
</div>
|
||||||
<div id="centered">
|
<div id="centered">
|
||||||
<canvas class="screen" id="screen" width="320" height="240">
|
<canvas class="screen" id="screen" width="320" height="240">
|
||||||
|
|||||||
Reference in new issue
Block a user