From 39a66085651e01d93f9943a7ee35f069c7b48c68 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jo=C3=A3o=20Magalh=C3=A3es?= <joamag@gmail.com>
Date: Fri, 25 Oct 2024 00:27:05 +0100
Subject: [PATCH] docs: better module docs

---
 src/diag.rs |  6 ++++++
 src/dma.rs  |  3 +++
 src/ppu.rs  |  4 ++++
 src/test.rs | 15 +++++++++++++++
 4 files changed, 28 insertions(+)

diff --git a/src/diag.rs b/src/diag.rs
index 74bdd856..2cc83dac 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 ff839ab5..c89df188 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 16e86c1c..dfed9c25 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 c27e6317..37b8b35c 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::{
-- 
GitLab