Skip to content

Commit

Permalink
Run wasm in vite
Browse files Browse the repository at this point in the history
  • Loading branch information
choffmann committed Jan 2, 2024
1 parent 2a30862 commit 21dcf77
Show file tree
Hide file tree
Showing 44 changed files with 611 additions and 126 deletions.
6 changes: 3 additions & 3 deletions .idea/gameboy.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

111 changes: 83 additions & 28 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 16 additions & 2 deletions gameboy-bin/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,23 @@
extern crate gameboy;

use gameboy::GameBoy;
use gameboy::memory::observer::Event;


fn main() {
let boot_rom = load_boot_rom();
boot_rom.iter().for_each(|n|println!("{:x}", n));
gameboy::start_gameboy(boot_rom);
let mut gameboy: GameBoy = GameBoy::new();
let mut memory = &mut gameboy.cpu.memory;

memory.events().subscribe(Event::Write, |subject| {
println!("[MEM] Writing value: 0x{:x}: 0x{:x}", subject.address, subject.value)
});

memory.events().subscribe(Event::Read, |subject| {
println!("[MEM] Reading value: 0x{:x}: 0x{:x}", subject.address, subject.value)
});

gameboy.start_gameboy(boot_rom);
}

fn load_boot_rom() -> Vec<u8> {
Expand Down
8 changes: 0 additions & 8 deletions gameboy-frontend.iml

This file was deleted.

12 changes: 0 additions & 12 deletions gameboy-frontend/vite.config.ts

This file was deleted.

116 changes: 116 additions & 0 deletions gameboy-lib/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions gameboy-lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,8 @@ edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[features]
wasm = ["wasm-bindgen"]

[dependencies]
wasm-bindgen = { version = "0.2.84", optional = true}
Loading

0 comments on commit 21dcf77

Please sign in to comment.