summaryrefslogtreecommitdiff
path: root/asm/macros/gfx.inc
blob: 3d6aef1c1173fac23d0988baf233c15efbfb2158 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
	.ifndef GUARD_ASM_MACROS_GFX_INC
	.set GUARD_ASM_MACROS_GFX_INC, 1

    .macro gfx_raw src:req, unknown=0, dest=0, size=0, compressed=0, terminator=0
        .4byte (!(\terminator) << 0x1F) + \src+ \unknown * 0x1000000, \dest, \size + (\compressed << 0x1F)
    .endm

    .macro palette_set palette:req, offset=0, count=0, terminator=0
        .2byte \palette
        .byte \offset, \count & 0xf + (!\terminator*0x80)
    .endm

    .macro sprite_frame first_tile_index:req, num_tiles=0, unknown=0
        .byte \num_tiles, \unknown
        .2byte \first_tile_index
    .endm

    .macro keyframe frame_index:req, duration=0, bitfield=0, bitfield2=0
        .byte \frame_index, \duration, \bitfield, \bitfield2
    .endm

    .macro fixed_gfx src:req, size=0, compressed=0
        .4byte \src + \compressed + (\size/0x200 << 24)
    .endm

    .macro extra_offset x:req, y:req
        .byte \x, \y
    .endm

    .macro obj x:req, y:req, bitfield=0, bitfield2=0
        .byte \x, \y, \bitfield
        .2byte \bitfield2
    .endm

	.endif @ GUARD_ASM_MACROS_GFX_INC