begin re-oganization

This commit is contained in:
Lokathor 2018-12-07 17:06:11 -07:00
parent 53f64f2260
commit ad7cac6628
25 changed files with 64 additions and 28 deletions

23
book/src-bak/SUMMARY.md Normal file
View file

@ -0,0 +1,23 @@
# Rust GBA Tutorials
* [Introduction](introduction.md)
* [Ch 0: Development Setup](ch00/index.md)
* [Ch 1: Hello GBA](ch01/index.md)
* [hello1](ch01/hello1.md)
* [Volatile](ch01/volatile.md)
* [IO Registers](ch01/io_registers.md)
* [The Display Control Register](ch01/the_display_control_register.md)
* [Video Memory Intro](ch01/video_memory_intro.md)
* [hello2](ch01/hello2.md)
* [Ch 2: User Input](ch02/index.md)
* [The Key Input Register](ch02/the_key_input_register.md)
* [The VCount Register](ch02/the_vcount_register.md)
* [light_cycle](ch02/light_cycle.md)
* [Ch 3: Memory and Objects](ch03/index.md)
* [GBA Memory Mapping](ch03/gba_memory_mapping.md)
* [Tile Data](ch03/tile_data.md)
* [Regular Backgrounds](ch03/regular_backgrounds.md)
* [Regular Objects](ch03/regular_objects.md)
* [GBA PRNG](ch03/gba_prng.md)
* [memory_game](ch03/memory_game.md)

View file

@ -183,7 +183,7 @@ pub struct RegularScreenblockEntry(u16);
impl RegularScreenblockEntry {
pub const SCREENBLOCK_ENTRY_TILE_ID_MASK: u16 = 0b11_1111_1111;
pub fn from_tile_id(id: u16) -> Self {
pub const fn from_tile_id(id: u16) -> Self {
RegularScreenblockEntry(id & Self::SCREENBLOCK_ENTRY_TILE_ID_MASK)
}
}
@ -243,8 +243,9 @@ the "screen base block" value.
pub struct BackgroundControlSetting(u16);
impl BackgroundControlSetting {
pub fn from_base_block(sbb: u16) -> Self {
BackgroundControlSetting(sbb << 8)
pub const SCREEN_BASE_BLOCK_MASK: u16 = 0b1_1111;
pub const fn from_base_block(sbb: u16) -> Self {
BackgroundControlSetting((sbb & Self::SCREEN_BASE_BLOCK_MASK) << 8)
}
}

View file

Before

Width:  |  Height:  |  Size: 147 KiB

After

Width:  |  Height:  |  Size: 147 KiB

View file

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

View file

@ -1,23 +1,34 @@
# Rust GBA Tutorials
* [Introduction](introduction.md)
* [Ch 0: Development Setup](ch00/index.md)
* [Ch 1: Hello GBA](ch01/index.md)
* [hello1](ch01/hello1.md)
* [Volatile](ch01/volatile.md)
* [IO Registers](ch01/io_registers.md)
* [The Display Control Register](ch01/the_display_control_register.md)
* [Video Memory Intro](ch01/video_memory_intro.md)
* [hello2](ch01/hello2.md)
* [Ch 2: User Input](ch02/index.md)
* [The Key Input Register](ch02/the_key_input_register.md)
* [The VCount Register](ch02/the_vcount_register.md)
* [light_cycle](ch02/light_cycle.md)
* [Ch 3: Memory and Objects](ch03/index.md)
* [GBA Memory Mapping](ch03/gba_memory_mapping.md)
* [Tile Data](ch03/tile_data.md)
* [Regular Backgrounds](ch03/regular_backgrounds.md)
* [Regular Objects](ch03/regular_objects.md)
* [GBA PRNG](ch03/gba_prng.md)
* [memory_game](ch03/memory_game.md)
* Introduction
* Goals Of This Book
* Prerequisites
* Getting Outside Help
* Development Setup
* Hello Magic
* Volatile
* Core Only
* Broad Concepts
* BIOS
* Working RAM
* IO Registers
* Palette RAM
* Video RAM
* Object Attribute Memory
* Game Pak ROM / Flash ROM
* Save RAM
* Video Modes
* RBG15 Color
* Bitmap Modes
* Tiled Modes
* Affine Math
* Special Effects
* Non-Video Hardware
* Buttons
* Timers
* Direct Memory Access
* Sound
* Interrupts
* Network
* Game Pak
* Examples
* for example in example_list

View file

@ -107,7 +107,7 @@ pub struct RegularScreenblockEntry(u16);
impl RegularScreenblockEntry {
pub const SCREENBLOCK_ENTRY_TILE_ID_MASK: u16 = 0b11_1111_1111;
pub fn from_tile_id(id: u16) -> Self {
pub const fn from_tile_id(id: u16) -> Self {
RegularScreenblockEntry(id & Self::SCREENBLOCK_ENTRY_TILE_ID_MASK)
}
}
@ -136,8 +136,9 @@ pub fn checker_screenblock(slot: usize, a_entry: RegularScreenblockEntry, b_entr
pub struct BackgroundControlSetting(u16);
impl BackgroundControlSetting {
pub fn from_base_block(sbb: u16) -> Self {
BackgroundControlSetting(sbb << 8)
pub const SCREEN_BASE_BLOCK_MASK: u16 = 0b1_1111;
pub const fn from_base_block(sbb: u16) -> Self {
BackgroundControlSetting((sbb & Self::SCREEN_BASE_BLOCK_MASK) << 8)
}
}