BIOSF UPLOAD

From NeoGeo Development Wiki
Revision as of 20:15, 15 May 2024 by Iq 132 (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The BIOSF_UPLOAD ($C00546) call copies data to the NeoGeo CD DRAM.

The parameters are:

BIOS_UPSRC ($10FEF8 ) (longword): Data source address

BIOS_UPDEST ($10FEF4 ) (longword): Data destination address

BIOS_UPSIZE ($10FEFC ) (longword): Data size

BIOS_UPZONE ($10FEDA ) (byte): Zone/method, see below

BIOS_UPBANK ($10FEDB ) (byte): DRAM bank

When the call returns, BIOS_UPDEST points to the end of the copied data, allowing multiple consecutive uploads without setting the destination address again.

Banks

Some DRAM zones have banks: SPR has 4 banks (each 1MiB), PCM has 2 banks (each 512KiB).

Zones/methods

$00: Copy PRG words (DMA)

Loads word copy DMA microcode.

$01: Copy Fix graphics bytes (DMA)

Loads byte copy DMA microcode. Dest = Dest + Size * 2.

$02: Copy Sprite graphics words (DMA)

Loads word copy DMA microcode. Copies over 1MiB are possible, the bank is incremented automatically.

$03: Copy Z80 program bytes (DMA)

Loads byte copy DMA microcode.

The destination address must be multiplied by 2 (8bit bus) ? Size doesn't have to be multiplied, but has to be an even number ?

$04: Copy PCM bytes (CPU)

Loads byte copy DMA microcode.

The destination address must be multiplied by 2 (8bit bus). Size doesn't have to be multiplied, but has to be an even number. Copies over 1MiB are possible, the bank is incremented automatically.

$05: Install PAT file

Notes:

  • 10F736.l=((Bank*$10000)+Dest)/256
  • 10F736+Address/2

$06: Copy palette words (DMA)

Loads word copy DMA microcode.

$07: Copy compressed sprite graphics (CPU)

The first longword's value indicates the size of the compressed data, BIOS_UPSIZE isn't used. When a longword zero is copied, the following longword indicates how many zero longwords to insert.

This method allows compression of large transparent zones. Is it ever used by games ?

$08: Copy PRG words (DMA)

Same as method $00.

$10: Copy PRG longwords (CPU)

Size must be a multiple of 4.

$11: Copy Fix graphics words (CPU)

The destination address must be multiplied by 2 (8bit bus). Size doesn't have to be multiplied, but has to be an even number.

$12: Copy Sprite graphics longwords (CPU)

Size must be a multiple of 4.

$13: Copy Z80 program bytes (CPU)

The destination address must be multiplied by 2 (8bit bus). Size doesn't have to be multiplied, but has to be an even number.

$14: Copy PCM bytes (CPU)

The destination address must be multiplied by 2 (8bit bus). Size doesn't have to be multiplied, but has to be an even number. Copies over 1MiB are possible, the bank is incremented automatically.

Difference with $04 ?

$15: Install PAT file

Same as method $05.

$16: Copy palette longwords (CPU)

Size must be a multiple of 4.

$17: Copy compressed sprite graphics (CPU)

Same as method $07.

$18: Copy PRG longwords (CPU)

Same as method $10.