diff --git a/src/diag.rs b/src/diag.rs index 74bdd85693a8c15caa30f486ca4072cc7993d61b..2cc83dac3bd46d948669d90ca1ca118e8070ea2f 100644 --- a/src/diag.rs +++ b/src/diag.rs @@ -1,3 +1,9 @@ +//! Low-level diagnostic utilities for debugging purposes. +//! +//! Some of the implementations make use of unsafe code to store +//! a global instance of the emulator, which is going to be used +//! in panic diagnostics + use std::ptr::null; use crate::gb::GameBoy; diff --git a/src/dma.rs b/src/dma.rs index ff839ab5a43de31a8e3830cd5d69afda340929ff..c89df1880add12b0ac8d9e38949b97069e48d8c3 100644 --- a/src/dma.rs +++ b/src/dma.rs @@ -1,4 +1,7 @@ //! DMA (Direct Memory Access) functions and structures. +//! +//! Contains implementation of both DMA (Direct Memory Access) and +//! HDMA (HBlank Direct Memory Access). use std::{ fmt::{self, Display, Formatter}, diff --git a/src/ppu.rs b/src/ppu.rs index 16e86c1c4db6483c5c110297684b15ecc0d3db55..dfed9c252e7dfa2dc7399e713ab861a0fd97d179 100644 --- a/src/ppu.rs +++ b/src/ppu.rs @@ -1,4 +1,8 @@ //! PPU (Picture Processing Unit) functions and structures. +//! +//! The Game Boy's Picture Processing Unit (PPU) is responsible for rendering +//! graphics on the handheld's screen. It handles the drawing of sprites and +//! backgrounds using tile-based graphics. use boytacean_common::{ data::{read_into, read_u16, read_u8, write_bytes, write_u16, write_u8}, diff --git a/src/test.rs b/src/test.rs index c27e631714f17cebf765cfde91179b8d86b518b4..37b8b35cbc45f5ac57d2afb415b6bb29f808ef05 100644 --- a/src/test.rs +++ b/src/test.rs @@ -1,3 +1,18 @@ +//! Interactive testing building blocks and scripts. +//! +//! This module provides functions to run tests on the emulator +//! +//! The tests can be run in different modes, such as running the +//! emulator for a fixed number of cycles, or stepping through +//! the emulator until a specific address is reached. +//! +//! The tests can also be run with different options, such as enabling or +//! disabling the PPU, APU, DMA, timer, etc.. +//! +//! Most of the test execution is built on top of a simple plain text +//! based serial protocol that can be used to communicate with the emulator +//! and obtain the results of the tests. + use boytacean_common::error::Error; use crate::{