Ultima VI: The False Prophet/Notes: Difference between revisions

From Data Crystal
Jump to navigation Jump to search
No edit summary
 
(One intermediate revision by one other user not shown)
Line 57: Line 57:
The render functions append tiles to an array at {{hex|1300}} which is directly copied to OAM later in the frame.
The render functions append tiles to an array at {{hex|1300}} which is directly copied to OAM later in the frame.


[[Ultima_VI:_The_False_Prophet:Sprite_IDs|Sprite IDs]] are associated with a graphics data, palette index, an animation function and a render function, which are described in the [[Ultima_VI:_The_False_Prophet:ROM_map#Sprites|ROM Map]].
[[Ultima VI: The False Prophet:Sprite IDs|Sprite IDs]] are associated with a graphics data, palette index, an animation function and a render function, which are described in the [[Ultima VI: The False Prophet:ROM map#Sprites|ROM Map]].
 
{{Internal Data}}

Latest revision as of 14:25, 24 January 2024

Chip tiny.png The following article is a Notes Page for Ultima VI: The False Prophet.

Frame rules

The main game loop when adventuring spreads each game world update over 16 frames. The frame counter is stored in memory at 42 and is used by the function at 88BE to run a different function for each frame of the cycle.

Frame  Description
-----  -----------
    0  Handles player input (moves, opens menu, etc.)
    1
    2  Updates sprites
    3
    4
    5
    6
    7
    8
    9
    A  Updates sprites
    B
    C
    D
    E  Uploads missing tiles to VRAM
    F

DMA Operations

An array at A00 stores the queued DMA operations to be performed each frame. This is used for updating sprite positions, uploading tile graphics, etc. A pointer to the end of the array is stored in b5. Each item is 8 bytes:

Offset  Length  Description
------  ------  -----------
     0       2  Bytes to copy. 0 means this is the end of the list of DMA operations
     2       2  Destination address in VRAM / 2
     4       3  Source address in RAM
     7       1  DMA transfer mode (copied directly to the SNES.DMAP0 register, usually has value 01)

Mob rendering

An array at 500 stores the mobs to be rendered each frame. This data is later used by sprite render functions to create one or more tiles per mob in OAM to be rendered.

Each item is 8 bytes:

Offset  Length  Description
------  ------  -----------
     0       1  X position
     1       1  Sprite flags (flip, priority, palette)
     2       1  Y position + 1
     3       1
     4       1  Direction/animation data
     5       1  Sprite ID
     6       1  ?? Seems to be related to X position
     7       1  ?? Seems to be related to Y position

The render functions append tiles to an array at 1300 which is directly copied to OAM later in the frame.

Sprite IDs are associated with a graphics data, palette index, an animation function and a render function, which are described in the ROM Map.