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
660f2295
Verified
Commit
660f2295
authored
8 months ago
by
João Magalhães
Browse files
Options
Downloads
Patches
Plain Diff
chore: new register comparison
parent
e87caa01
No related branches found
No related tags found
No related merge requests found
Pipeline
#4478
passed
8 months ago
Stage: build
Stage: test
Stage: deploy
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/consts.rs
+1
-0
1 addition, 0 deletions
src/consts.rs
src/ppu.rs
+6
-4
6 additions, 4 deletions
src/ppu.rs
src/test.rs
+3
-2
3 additions, 2 deletions
src/test.rs
with
10 additions
and
6 deletions
src/consts.rs
+
1
−
0
View file @
660f2295
...
@@ -14,6 +14,7 @@ pub const SCY_ADDR: u16 = 0xff42;
...
@@ -14,6 +14,7 @@ pub const SCY_ADDR: u16 = 0xff42;
pub
const
SCX_ADDR
:
u16
=
0xff43
;
pub
const
SCX_ADDR
:
u16
=
0xff43
;
pub
const
LY_ADDR
:
u16
=
0xff44
;
pub
const
LY_ADDR
:
u16
=
0xff44
;
pub
const
LYC_ADDR
:
u16
=
0xff45
;
pub
const
LYC_ADDR
:
u16
=
0xff45
;
pub
const
BGP_ADDR
:
u16
=
0xff47
;
// DMA registers
// DMA registers
pub
const
DMA_ADDR
:
u16
=
0xff46
;
pub
const
DMA_ADDR
:
u16
=
0xff46
;
...
...
This diff is collapsed.
Click to expand it.
src/ppu.rs
+
6
−
4
View file @
660f2295
...
@@ -15,7 +15,7 @@ use crate::{
...
@@ -15,7 +15,7 @@ use crate::{
rgb888_to_rgb565_u16
,
Pixel
,
PixelAlpha
,
RGB1555_SIZE
,
RGB565_SIZE
,
RGB888_SIZE
,
RGB_SIZE
,
rgb888_to_rgb565_u16
,
Pixel
,
PixelAlpha
,
RGB1555_SIZE
,
RGB565_SIZE
,
RGB888_SIZE
,
RGB_SIZE
,
XRGB8888_SIZE
,
XRGB8888_SIZE
,
},
},
consts
::{
LCDC_ADDR
,
LYC_ADDR
,
LY_ADDR
,
SCX_ADDR
,
SCY_ADDR
,
STAT_ADDR
},
consts
::{
BGP_ADDR
,
LCDC_ADDR
,
LYC_ADDR
,
LY_ADDR
,
SCX_ADDR
,
SCY_ADDR
,
STAT_ADDR
},
gb
::{
GameBoyConfig
,
GameBoyMode
},
gb
::{
GameBoyConfig
,
GameBoyMode
},
mmu
::
BusComponent
,
mmu
::
BusComponent
,
util
::
SharedThread
,
util
::
SharedThread
,
...
@@ -807,9 +807,10 @@ impl Ppu {
...
@@ -807,9 +807,10 @@ impl Ppu {
SCY_ADDR
=>
self
.scy
,
SCY_ADDR
=>
self
.scy
,
SCX_ADDR
=>
self
.scx
,
SCX_ADDR
=>
self
.scx
,
LY_ADDR
=>
self
.ly
,
LY_ADDR
=>
self
.ly
,
// 0xFF45 — LYC
: LY compare
// 0xFF45 — LYC
LYC_ADDR
=>
self
.lyc
,
LYC_ADDR
=>
self
.lyc
,
0xff47
=>
self
.palettes
[
0
],
// 0xFF47 — BGP: BG palette data (Non-CGB Mode only)
BGP_ADDR
=>
self
.palettes
[
0
],
0xff48
=>
self
.palettes
[
1
],
0xff48
=>
self
.palettes
[
1
],
0xff49
=>
self
.palettes
[
2
],
0xff49
=>
self
.palettes
[
2
],
0xff4a
=>
self
.wy
,
0xff4a
=>
self
.wy
,
...
@@ -892,7 +893,8 @@ impl Ppu {
...
@@ -892,7 +893,8 @@ impl Ppu {
SCX_ADDR
=>
self
.scx
=
value
,
SCX_ADDR
=>
self
.scx
=
value
,
// 0xFF45 — LYC: LY compare
// 0xFF45 — LYC: LY compare
LYC_ADDR
=>
self
.lyc
=
value
,
LYC_ADDR
=>
self
.lyc
=
value
,
0xff47
=>
{
// 0xFF47 — BGP: BG palette data (Non-CGB Mode only)
BGP_ADDR
=>
{
if
value
==
self
.palettes
[
0
]
{
if
value
==
self
.palettes
[
0
]
{
return
;
return
;
}
}
...
...
This diff is collapsed.
Click to expand it.
src/test.rs
+
3
−
2
View file @
660f2295
...
@@ -79,8 +79,8 @@ pub fn run_image_test(
...
@@ -79,8 +79,8 @@ pub fn run_image_test(
mod
tests
{
mod
tests
{
use
crate
::{
use
crate
::{
consts
::{
consts
::{
DIV_ADDR
,
DMA_ADDR
,
IF_ADDR
,
LCDC_ADDR
,
LYC_ADDR
,
LY_ADDR
,
SCX_ADDR
,
SCY_ADDR
,
BGP_ADDR
,
DIV_ADDR
,
DMA_ADDR
,
IF_ADDR
,
LCDC_ADDR
,
LYC_ADDR
,
LY_ADDR
,
SCX_ADDR
,
STAT_ADDR
,
TAC_ADDR
,
TIMA_ADDR
,
TMA_ADDR
,
SCY_ADDR
,
STAT_ADDR
,
TAC_ADDR
,
TIMA_ADDR
,
TMA_ADDR
,
},
},
data
::
BootRom
,
data
::
BootRom
,
};
};
...
@@ -119,6 +119,7 @@ mod tests {
...
@@ -119,6 +119,7 @@ mod tests {
assert_eq!
(
result
.ppu
()
.read
(
SCX_ADDR
),
0x00
);
assert_eq!
(
result
.ppu
()
.read
(
SCX_ADDR
),
0x00
);
assert_eq!
(
result
.ppu
()
.read
(
LY_ADDR
),
0x99
);
assert_eq!
(
result
.ppu
()
.read
(
LY_ADDR
),
0x99
);
assert_eq!
(
result
.ppu
()
.read
(
LYC_ADDR
),
0x00
);
assert_eq!
(
result
.ppu
()
.read
(
LYC_ADDR
),
0x00
);
assert_eq!
(
result
.ppu
()
.read
(
BGP_ADDR
),
0xfc
);
assert_eq!
(
result
.ppu
()
.read
(
DMA_ADDR
),
0xff
);
assert_eq!
(
result
.ppu
()
.read
(
DMA_ADDR
),
0xff
);
}
}
...
...
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