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
cc4d044f
Verified
Commit
cc4d044f
authored
2 years ago
by
João Magalhães
Browse files
Options
Downloads
Patches
Plain Diff
feat: more generic boot loading
parent
13538290
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/gb.rs
+5
-1
5 additions, 1 deletion
src/gb.rs
src/mmu.rs
+10
-1
10 additions, 1 deletion
src/mmu.rs
with
15 additions
and
2 deletions
src/gb.rs
+
5
−
1
View file @
cc4d044f
...
@@ -124,7 +124,11 @@ impl GameBoy {
...
@@ -124,7 +124,11 @@ impl GameBoy {
}
}
pub
fn
load_boot_default
(
&
mut
self
)
{
pub
fn
load_boot_default
(
&
mut
self
)
{
self
.load_boot_static
(
BootRom
::
DmgBootix
);
self
.load_boot_dmg
();
}
pub
fn
load_boot_dmg
(
&
mut
self
)
{
self
.load_boot_static
(
BootRom
::
Cgb
);
}
}
pub
fn
load_boot_cgb
(
&
mut
self
)
{
pub
fn
load_boot_cgb
(
&
mut
self
)
{
...
...
This diff is collapsed.
Click to expand it.
src/mmu.rs
+
10
−
1
View file @
cc4d044f
use
crate
::{
debugln
,
pad
::
Pad
,
ppu
::
Ppu
,
rom
::
Cartridge
,
timer
::
Timer
};
use
crate
::{
debugln
,
pad
::
Pad
,
ppu
::
Ppu
,
rom
::
Cartridge
,
timer
::
Timer
};
pub
const
BOOT_SIZE
:
usize
=
2
56
;
pub
const
BOOT_SIZE
:
usize
=
2
304
;
pub
const
RAM_SIZE
:
usize
=
8192
;
pub
const
RAM_SIZE
:
usize
=
8192
;
pub
struct
Mmu
{
pub
struct
Mmu
{
...
@@ -30,7 +30,16 @@ pub struct Mmu {
...
@@ -30,7 +30,16 @@ pub struct Mmu {
/// the boot sequence has been finished.
/// the boot sequence has been finished.
boot_active
:
bool
,
boot_active
:
bool
,
/// Buffer to be used to store the boot ROM, this is the code
/// that is going to be executed at the beginning of the Game
/// Boy execution. The buffer effectively used is of 256 bytes
/// for the "normal" Game Boy (MGB) and 2308 bytes for the
/// Game Boy Color (CGB). Note that in the case of the CGB
/// the bios which is 2308 bytes long is in fact only 2048 bytes
/// as the 256 bytes in range 0x100-0x1FF are meant to be
/// overwritten byte the cartridge header.
boot
:
[
u8
;
BOOT_SIZE
],
boot
:
[
u8
;
BOOT_SIZE
],
ram
:
[
u8
;
RAM_SIZE
],
ram
:
[
u8
;
RAM_SIZE
],
}
}
...
...
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