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
5c6a4225
Verified
Commit
5c6a4225
authored
5 months ago
by
João Magalhães
Browse files
Options
Downloads
Patches
Plain Diff
chore: new pedantic improvements
parent
8943f0d7
No related branches found
No related tags found
1 merge request
!62
New PPU asserts for pedantic mode
Pipeline
#5112
passed
5 months ago
Stage: build
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/macros.rs
+6
-1
6 additions, 1 deletion
src/macros.rs
src/state.rs
+5
-0
5 additions, 0 deletions
src/state.rs
with
11 additions
and
1 deletion
src/macros.rs
+
6
−
1
View file @
5c6a4225
...
...
@@ -34,7 +34,12 @@ macro_rules! infoln {
macro_rules!
warnln
{
(
$
(
$rest:tt
)
*
)
=>
{
{
$crate
::
panic_gb!
(
$
(
$rest
)
*
);
if
unsafe
{
$crate
::
diag
::
PEDANTIC
}
{
$crate
::
panic_gb!
(
$
(
$rest
)
*
);
}
else
{
std
::
print!
(
"[WARNING] "
);
std
::
println!
(
$
(
$rest
)
*
);
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
src/state.rs
+
5
−
0
View file @
5c6a4225
...
...
@@ -25,6 +25,7 @@ use std::{
};
use
crate
::{
disable_pedantic
,
enable_pedantic
,
gb
::{
GameBoy
,
GameBoyDevice
,
GameBoyMode
,
GameBoySpeed
},
info
::
Info
,
ppu
::{
DISPLAY_HEIGHT
,
DISPLAY_WIDTH
,
FRAME_BUFFER_SIZE
},
...
...
@@ -1647,6 +1648,7 @@ impl Serialize for BessCore {
impl
State
for
BessCore
{
fn
from_gb
(
gb
:
&
mut
GameBoy
)
->
Result
<
Self
,
Error
>
{
disable_pedantic!
();
let
mut
core
=
Self
::
new
(
Self
::
bess_model
(
gb
),
gb
.cpu_i
()
.pc
(),
...
...
@@ -1665,6 +1667,7 @@ impl State for BessCore {
// https://github.com/LIJI32/SameBoy/blob/7e6f1f866e89430adaa6be839aecc4a2ccabd69c/Core/save_state.c#L673
gb
.mmu
()
.read_many_raw
(
0xff00
,
128
)
.try_into
()
.unwrap
(),
);
enable_pedantic!
();
core
.ram
.fill_buffer
(
gb
.mmu
()
.ram
());
core
.vram
.fill_buffer
(
gb
.ppu
()
.vram_device
());
core
.mbc_ram
.fill_buffer
(
gb
.rom_i
()
.ram_data
());
...
...
@@ -1703,7 +1706,9 @@ impl State for BessCore {
// The registers should be handled in a more manual manner
// to avoid unwanted side effects
// https://github.com/LIJI32/SameBoy/blob/7e6f1f866e89430adaa6be839aecc4a2ccabd69c/Core/save_state.c#L1003
disable_pedantic!
();
gb
.mmu
()
.write_many
(
0xff00
,
&
self
.io_registers
);
enable_pedantic!
();
gb
.mmu
()
.set_ram
(
self
.ram.buffer
.to_vec
());
gb
.ppu
()
.set_vram
(
&
self
.vram.buffer
);
...
...
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