fork of 9front i guess
Go to file
Michael Forney e502abe001 games/gb: various HDMA fixes
H-blank DMA should only transfer 16 bytes per h-blank, rather than
waiting for the first h-blank and then transferring the whole size.

HDMAC should read 0xff when the transfer is finished, and 0 in the
high bit when the transfer is ongoing. Also, if 0 is written in the
high bit, the current transfer should be aborted.

Introduce two flags, DMAREADY and DMAHBLANK rather than special
constants 1 and -1. If dma is non-zero, there is an ongoing DMA. If
DMAREADY is set, the next chunk is ready to transfer.

Reference: https://gbdev.io/pandocs/#ff55-hdma5-cgb-mode-only-new-dma-length-mode-start

Tested with pokemon crystal.

What was happening is that when the game was loading N background tiles
into vram (each 16 bytes, so one per h-blank), it did something like
this:
- start an hdma transfer for N+1 tiles
- after the Nth tile is transferred, it would read HDMA5, clear the
high bit, then write it back to abort the transfer.

games/gb would instead transfer all N+1 tiles at once, overwriting one
extra tile with whatever was 1 past the end of the source array, and
then would interpret the cancel request as the start of a new transfer
of 16 bytes, which would copy an additional tile past the end. The end
result is that every transfer would end up copying N+2 tiles instead
of just N, overwriting certain tiles with whatever was after the end
of the source data.
2021-02-08 04:58:41 +01:00
386 ape: unify math.h copies 2021-01-01 21:40:00 -08:00
68000
68020 ape: unify math.h copies 2021-01-01 21:40:00 -08:00
acme win: fix window recreation command 2020-09-16 12:41:24 +02:00
adm/timezone timezones: change DST timezone string for South Australia 2019-11-20 11:49:16 +10:30
amd64 ape: unify math.h copies 2021-01-01 21:40:00 -08:00
arm ape: unify math.h copies 2021-01-01 21:40:00 -08:00
arm64 ape: unify math.h copies 2021-01-01 21:40:00 -08:00
lib /lib/keyboard: Anführungszeichen uten (danke sirjofri) 2020-12-01 09:23:16 +01:00
mips add va_copy macro, conforming to c99 7.15.1.2 2020-03-22 17:31:39 -07:00
power ape: unify math.h copies 2021-01-01 21:40:00 -08:00
power64
rc 9fs: bell labs is very dead 2021-01-15 19:32:02 +01:00
sparc ape: unify math.h copies 2021-01-01 21:40:00 -08:00
sparc64 ape: unify math.h copies 2021-01-01 21:40:00 -08:00
spim add signed fixed size integer typedefs 2018-05-12 19:19:52 +02:00
sys games/gb: various HDMA fixes 2021-02-08 04:58:41 +01:00
.hgignore hgignore: ignore section 9 manpage indices, ignore init, kernels and bootloader binaries 2020-03-07 12:28:49 +01:00