øAslickproductions.org/forum/index.php?PHPSESSID=b8kdninhiou1d2es8m2voveje7&topic=1555.0e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/indexf987.htmlslickproductions.org/forum/index.php?board=13.260e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/indexf987.html.zx)fg^ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÈ1^MOKtext/htmlISO-8859-1gzip8:ÖMÿÿÿÿÿÿÿÿTue, 10 Mar 2020 10:20:48 GMT0ó°° ®0®P®€§²ð®(fg^3M DMA Transfer routine to VRAM

Author Topic: DMA Transfer routine to VRAM  (Read 1270 times)

Displacer

  • FF4 Hacker
  • *
  • Posts: 27
    • View Profile
DMA Transfer routine to VRAM
« on: February 28, 2011, 12:34:25 PM »
The DMA transfer routine is in bank $15, specifically $15CA8B. If you set a breakpoint here you can see what screens are being loaded to VRAM and where the data is coming from. Here's the routine with some comments:

Code: [Select]
15/CA8B: A9 80        LDA #$80       ;Set VRAM transfer mode to word-access, increment by 1
15/CA8D: 8D 15 21     STA $2115      ;VRAM Address Increment Value
15/CA90: 9C 0B 42     STZ $420B      ;DMA Control Register
15/CA93: A9 01        LDA #$01       ;
15/CA95: 8D 00 43     STA $4300      ;Transfer type
15/CA98: A9 18        LDA #$18       ;($2118?)
15/CA9A: 8D 01 43     STA $4301      ;DMA Channel Destination
15/CA9D: A5 3C        LDA $3C        ;Bank for Data
15/CA9F: 8D 04 43     STA $4304      ;
15/CAA2: A6 47        LDX $47        ;
15/CAA4: 8E 16 21     STX $2116      ;Address for VRAM Read/Write
15/CAA7: A6 3D        LDX $3D        ;Source address offset
15/CAA9: 8E 02 43     STX $4302
15/CAAC: A6 45        LDX $45        ;Number of bytes to copy
15/CAAE: 8E 05 43     STX $4305
15/CAB1: A9 01        LDA #$01
15/CAB3: 8D 0B 42     STA $420B
15/CAB6: 6B           RTL

Note the zero page data was set up by the caller. This is for FFIIus v1.1