Embed fox32rom into the main fox32 executable, prepare for 1st release

This commit is contained in:
Ry 2022-07-31 16:59:18 -07:00
parent 2d6730bb0b
commit 881b9c1620
4 changed files with 21 additions and 11 deletions

View File

@ -13,6 +13,13 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Download latest fox32rom artifact
uses: dawidd6/action-download-artifact@v2
with:
repo: fox32-arch/fox32rom
workflow: fox32rom-unstable.yml
workflow_conclusion: success
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:

View File

@ -13,6 +13,13 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Download latest fox32rom artifact
uses: dawidd6/action-download-artifact@v2
with:
repo: fox32-arch/fox32rom
workflow: fox32rom-unstable.yml
workflow_conclusion: success
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:

View File

@ -10,17 +10,17 @@
**Note: This software is still very much in an early stage, and is currently more focused towards developers rather than end-users.**
Prebuilt binaries are available on the [GitHub Actions page](https://github.com/fox32-arch/fox32/actions).
Stable releases are available on the [Releases page](https://github.com/fox32-arch/fox32/releases).
Prebuilt binaries of the latest commit are also available on the [GitHub Actions page](https://github.com/fox32-arch/fox32/actions).
### Building
Simply run `cargo build --release`. The resulting binary will be saved as `target/release/fox32`. You can also run `cargo run --release` if you want to run it directly.
Download the latest release of [**fox32rom**](https://github.com/fox32-arch/fox32rom/releases). Create a folder in the root of this repo called `fox32.rom`, and place the downloaded `fox32.rom` file into that directory. Then simply run `cargo build --release`. The resulting binary will be saved as `target/release/fox32`. You can also run `cargo run --release` if you want to run it directly.
### Usage
**fox32** attempts to read its ROM (called **fox32rom**) from a file called `fox32.rom` in the current directory. If this file isn't found then it falls back to `../fox32rom/fox32.rom`, and if this file isn't found then it exits. **fox32rom** can be found [here](https://github.com/fox32-arch/fox32rom).
Passing files as arguments will mount those files as disks, in the order that the arguments were passed.
Passing files as arguments will mount those files as disks, in the order that the arguments were passed. The most common use case is passing the [**fox32os**](https://github.com/fox32-arch/fox32os) disk image as the first argument: `fox32 fox32os.img`
See [encoding.md](docs/encoding.md) for information about the instruction set.

View File

@ -58,9 +58,9 @@ pub struct Overlay {
fn read_rom() -> Vec<u8> {
read("fox32.rom").unwrap_or_else(|_| {
println!("fox32.rom not found, attempting to open ../fox32rom/fox32.rom instead");
read("../fox32rom/fox32.rom").unwrap_or_else(|_| {
error("fox32.rom not found!");
println!("fox32.rom file not found, using embedded ROM");
include_bytes!("../fox32.rom/fox32.rom").to_vec()
})
})
}
@ -79,10 +79,6 @@ fn main() {
println!("{}", version_string);
let args: Vec<String> = env::args().collect();
/*if args.len() != 2 {
println!("fox32\nUsage: {} <binary>", &args[0]);
exit(1);
}*/
let mut display = Display::new();
let keyboard = Arc::new(Mutex::new(Keyboard::new()));