From 2c64a987bf6b70b0f274fcff2550061c5c6c5ed1 Mon Sep 17 00:00:00 2001 From: alloncm Date: Fri, 1 Nov 2024 13:36:56 +0200 Subject: [PATCH 1/2] Add behavior of the HDMA HBlank mode in halt mode --- src/CGB_Registers.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/CGB_Registers.md b/src/CGB_Registers.md index 4ec35db9..73005eba 100644 --- a/src/CGB_Registers.md +++ b/src/CGB_Registers.md @@ -79,7 +79,10 @@ the program execution continues during the "spaces" between each data block. Note that the program should not change the Destination VRAM bank (FF4F), or the Source ROM/RAM bank (in case data is transferred from bankable memory) until the transfer has completed! (The transfer should -be paused as described below while the banks are switched) +be paused as described below while the banks are switched). + +Upon halting the CPU (using the [halt instruction](<#Using the HALT Instruction>)), +the transfer will also be halted and will be resumed only when the CPU resumes execution. Reading from Register FF55 returns the remaining length (divided by $10, minus 1), a value of $FF indicates that the transfer has completed. It From 6e4e320fa7ce0a952c58597351a95d8ca1284dfe Mon Sep 17 00:00:00 2001 From: alloncm Date: Mon, 4 Nov 2024 00:25:34 +0200 Subject: [PATCH 2/2] Add test rom for HDMA HBlank halt behaviour --- src/CGB_Registers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CGB_Registers.md b/src/CGB_Registers.md index 73005eba..c6ea289c 100644 --- a/src/CGB_Registers.md +++ b/src/CGB_Registers.md @@ -82,7 +82,7 @@ bankable memory) until the transfer has completed! (The transfer should be paused as described below while the banks are switched). Upon halting the CPU (using the [halt instruction](<#Using the HALT Instruction>)), -the transfer will also be halted and will be resumed only when the CPU resumes execution. +the transfer will also be halted and will be resumed only when the CPU resumes execution ([test rom](https://github.com/alloncm/MagenTests?tab=readme-ov-file#vram-dma-hblank-mode) exhibiting this behaviour). Reading from Register FF55 returns the remaining length (divided by $10, minus 1), a value of $FF indicates that the transfer has completed. It