Skip to content

Commit

Permalink
Implement bus conflicts for game genie codes.
Browse files Browse the repository at this point in the history
  • Loading branch information
uglyoldbob committed Nov 16, 2023
1 parent f7a0630 commit 462fc4a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ Repository for emulation of old game systems and other old computing systems
- [x] Create link to recordings folder
- [ ] Slow motion
- [x] Rom ranking system
- [ ] Game genie code support
- [x] Game genie code support
- [x] Full screen support
18 changes: 15 additions & 3 deletions nes/rust/src/cartridge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,23 @@ trait NesMapperTrait {
for code in &cart.volatile.genie {
if code.address() == addr {
if let Some(check) = code.check() {
if a == Some(check) {
a = Some(code.value());
let lv = self.memory_cycle_dump(cart, addr ^ 0x8000);
if let Some(lv) = lv {
if a == Some(check) {
a = Some(lv & code.value());
}
} else {
if a == Some(check) {
a = Some(code.value());
}
}
} else {
a = Some(code.value());
let lv = self.memory_cycle_dump(cart, addr ^ 0x8000);
if let Some(lv) = lv {
a = Some(lv & code.value());
} else {
a = Some(code.value());
}
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions nes/rust/src/windows/genie.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ impl TrackedWindow for Window {
if let Some(code) = delete {
cart.cartridge_volatile_mut().remove_code(&code);
}
if cart.cartridge().volatile.genie.len() > 0 {
ui.separator();
}
ui.label("Enter game genie code");
ui.text_edit_singleline(&mut self.code);
if let Ok(v) = crate::genie::GameGenieCode::from_str(&self.code) {
if ui.button("Add game genie code").clicked() {
Expand Down

0 comments on commit 462fc4a

Please sign in to comment.