Skip to content

Commit

Permalink
Embed fox32rom into the main fox32 executable, prepare for 1st release
Browse files Browse the repository at this point in the history
  • Loading branch information
ry755 committed Aug 1, 2022
1 parent 2d6730b commit 881b9c1
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 11 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/fox32-unstable-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/fox32-unstable-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
8 changes: 2 additions & 6 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
})
})
}
Expand All @@ -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()));
Expand Down

0 comments on commit 881b9c1

Please sign in to comment.