Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
boytacean
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
João Magalhães
boytacean
Commits
429e85da
Verified
Commit
429e85da
authored
1 year ago
by
João Magalhães
Browse files
Options
Downloads
Patches
Plain Diff
chore: better ram data handling
parent
f947e377
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!31
System state save
Pipeline
#3239
failed
1 year ago
Stage: build
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/state.rs
+6
-4
6 additions, 4 deletions
src/state.rs
with
6 additions
and
4 deletions
src/state.rs
+
6
−
4
View file @
429e85da
...
...
@@ -99,7 +99,7 @@ impl Serialize for BeesState {
data
.seek
(
SeekFrom
::
Start
(
self
.footer.start_offset
as
u64
))
.unwrap
();
// @TODO we need to soft code this loading process to make it
// @TODO
:
we need to soft code this loading process to make it
// more flexible and able to handle a random sequence of blocks
// as we never know which blocks are we going to find
self
.name
.load
(
data
);
...
...
@@ -572,7 +572,7 @@ impl Serialize for BeesCore {
impl
State
for
BeesCore
{
fn
from_gb
(
gb
:
&
mut
GameBoy
)
->
Self
{
let
mut
core
=
Self
::
new
(
String
::
from
(
"GD "
),
String
::
from
(
"GD "
),
// @TODO: use the proper string
gb
.cpu_i
()
.pc
(),
gb
.cpu_i
()
.af
(),
gb
.cpu_i
()
.bc
(),
...
...
@@ -582,10 +582,12 @@ impl State for BeesCore {
gb
.cpu_i
()
.ime
(),
gb
.mmu_i
()
.ie
,
0
,
// @TODO: these registers cannot be totally retrieved
gb
.mmu
()
.read_many
(
0xff00
,
128
)
.try_into
()
.unwrap
(),
);
core
.ram
.fill_buffer
(
gb
.mmu
()
.ram
());
core
.vram
.fill_buffer
(
&
gb
.mmu
()
.read_many
(
0x8000
,
0x2000
));
core
.mbc_ram
.fill_buffer
(
gb
.rom_i
()
.ram_data
());
core
.oam
.fill_buffer
(
&
gb
.mmu
()
.read_many
(
0xfe00
,
0x00a0
));
core
.hram
.fill_buffer
(
&
gb
.mmu
()
.read_many
(
0xff80
,
0x007f
));
core
...
...
@@ -604,9 +606,9 @@ impl State for BeesCore {
gb
.mmu
()
.write_many
(
0xff00
,
&
self
.io_registers
);
gb
.mmu
()
.set_ram
(
self
.ram.buffer
.
clone
());
gb
.mmu
()
.set_ram
(
self
.ram.buffer
.
to_vec
());
gb
.mmu
()
.write_many
(
0x8000
,
&
self
.vram.buffer
);
//@TODO the MBC is missing
gb
.rom
()
.set_ram_data
(
&
self
.mbc_ram.buffer
);
gb
.mmu
()
.write_many
(
0xfe00
,
&
self
.oam.buffer
);
gb
.mmu
()
.write_many
(
0xff80
,
&
self
.hram.buffer
);
//@TODO the background palettes are missing - CGB only
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment