-
Notifications
You must be signed in to change notification settings - Fork 6
Create generic storage struct #24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
scifi6546
wants to merge
30
commits into
benkonz:master
Choose a base branch
from
scifi6546:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
bbf19e3
adding dom info struct
scifi6546 3da43e3
can pass struct
scifi6546 4e2700a
removed some packages that are not needed
scifi6546 dddbb05
ran cargo fmt
scifi6546 e90aaab
improved style and cleaned up cargo.toml
scifi6546 f592784
ran cargo fmt
scifi6546 398f750
added debug and cleaned up cargo.toml files
scifi6546 fb173da
interm commit
scifi6546 5617ba4
Refactor
scifi6546 eb843cb
Refactor
scifi6546 48bc820
merged refactor
scifi6546 ebb8e51
Merge branch 'benkonz-master'
scifi6546 e5082f6
removed librs
scifi6546 851c00a
added mapp_err
scifi6546 8828c51
removed extern crate gameboy_opengl_web;
scifi6546 91c64b2
got controller plugged into game
scifi6546 f0f3856
removed commented out code and removed unneeded import
scifi6546 964d231
removed unneded import
scifi6546 ce9bf56
removed get_cartridge_mut
scifi6546 9edd258
got fix working for native gameboy
scifi6546 9286b30
removed get_cartridge
scifi6546 a219f83
refactored load_ram
scifi6546 790ab60
temp commit, working on generic save_type
scifi6546 de9a868
got dyn working
scifi6546 9424942
Merge branch 'master' of https://github.com/benkonz/gameboy_emulator …
scifi6546 c4b20dd
Merge branch 'benkonz-master'
scifi6546 5565efa
fixed merge errors+compiller warnings
scifi6546 e56c581
working on dyn
scifi6546 0d00da0
Merge branch 'save_impl'
scifi6546 3859c0c
Merge branch 'master' into master
benkonz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried doing saving by mapping the ram to a string like this originally, but the problem was that it was just too slow. Some games can have up to 2MB of RAM, so mapping every single byte to a string every frame slows the game down by a lot
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How did you solve the issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heh, my solution is a little hack-y, but has worked well so far. Basically, we maintain a String that is an exact copy of whatever is in the cartridge RAM and whenever it changes, update the String in-place.
This initializes the Ram String to the RAM contents before the emulation starts
This set's up an event listener for whenever the contents of the Cartridge RAM changes
This takes the O(n) Vec to String mapping to a O(1) in-place update, which is a lot faster, but requires a bit more code and unsafe Rust.