Welcome to Data Crystal's new home! Data Crystal is now part of the TCRF family (sort of).
The wiki has recently moved; please report any issues in Discord. Pardon the dust.

EarthBound/ASM/VRAM DMA Transfer Routines: Difference between revisions

From Data Crystal
Jump to navigation Jump to search
(→‎$C085B7-$C08615: Transfer memory to VRAM in batches: Document batched transfer routine)
Line 10: Line 10:
* <tt>$0e..$10</tt>: Memory address long pointer
* <tt>$0e..$10</tt>: Memory address long pointer


==<tt>$C08616-$C0865A</tt>: Transfer memory to VRAM==
==<tt>$C08616-$C0865A</tt>: Memory/VRAM transfer==
Prepares memory (see [[EarthBound:VRAM_DMA_memory|VRAM DMA memory]]) and sets Data Bank and Data Page to zero. Then calls [[#$C0865F|<tt>$C0865F</tt>]] to perform the DMA transfer.
 
Subroutine has multiple entry points.
 
===Entry point <tt>$C08616</tt>===
Setup including long pointer for memory address
 
====Inputs====
* <tt>accumulator</tt>: Transfer style. Pointer into [[EarthBound:VRAM_DMA_Transfer_Style_Table|VRAM DMA Transfer Style Table]]
* <tt>x</tt>: Transfer size (bytes)
* <tt>y</tt>: VRAM address (word)
* <tt>$0e..$10</tt>: Memory address long pointer
 
===Entry point <tt>$C0862E</tt>===
Setup including separated address/bank for memory address
 
====Inputs====
* <tt>accumulator</tt>: Transfer style. Pointer into [[EarthBound:VRAM_DMA_Transfer_Style_Table|VRAM DMA Transfer Style Table]]
* <tt>x</tt>: Transfer size (bytes)
* <tt>y</tt>: Memory address
* <tt>$0e</tt>: Memory address bank
* <tt>$10</tt>: VRAM address (word)
 
===Entry point <tt>$C08643</tt><span class="anchor" id="$C08643"></span>===
Set up only Data Bank and Data Page registers. Used when [[EarthBound:VRAM_DMA_memory|VRAM DMA memory]] has already been prepared separately.


==<tt>$C0865B-$C0865E</tt>: Perform DMA transfer (<tt>JSL</tt>)==
==<tt>$C0865B-$C0865E</tt>: Perform DMA transfer (<tt>JSL</tt>)==

Revision as of 20:48, 14 June 2023

This is a sub-page of EarthBound/ASM.

$C085B7-$C08615: Batched memory/VRAM transfer

Batched transfers between main memory (ROM/WRAM) and VRAM. Makes the transfers using multiple calls to $C08643 for batches of 0x1200 bytes, with a final transfer of the remainder up to 0x1201 bytes. Before each batch, spins on $7E0099, waiting for the value to become #$0000.

Inputs

  • a: Transfer style. Pointer into VRAM DMA Transfer Style Table
  • x: Transfer size (bytes)
  • y: VRAM address (word)
  • $0e..$10: Memory address long pointer

$C08616-$C0865A: Memory/VRAM transfer

Prepares memory (see VRAM DMA memory) and sets Data Bank and Data Page to zero. Then calls $C0865F to perform the DMA transfer.

Subroutine has multiple entry points.

Entry point $C08616

Setup including long pointer for memory address

Inputs

  • accumulator: Transfer style. Pointer into VRAM DMA Transfer Style Table
  • x: Transfer size (bytes)
  • y: VRAM address (word)
  • $0e..$10: Memory address long pointer

Entry point $C0862E

Setup including separated address/bank for memory address

Inputs

  • accumulator: Transfer style. Pointer into VRAM DMA Transfer Style Table
  • x: Transfer size (bytes)
  • y: Memory address
  • $0e: Memory address bank
  • $10: VRAM address (word)

Entry point $C08643

Set up only Data Bank and Data Page registers. Used when VRAM DMA memory has already been prepared separately.

$C0865B-$C0865E: Perform DMA transfer (JSL)

Trivial JSL wrapper around a call to $C0865F.

$C0865F-$C086DD: Perform DMA transfer (JSR)

So very stubbly.
This page is rather stubbly and could use some expansion.
Are you a bad enough dude to rescue this article?