Skip to content

Commit

Permalink
Applying zoneanim macros to Anim_SonicMilesBG, and moving zoneanim ma…
Browse files Browse the repository at this point in the history
…cros

The macros had to be moved to make them 'visible' to Anim_SonicMilesBG.
It might be worth renaming them, since they're not exclusively used to
animate level art
  • Loading branch information
Clownacy committed Aug 1, 2015
1 parent 501e545 commit 74851de
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 34 deletions.
45 changes: 11 additions & 34 deletions s2.asm
Original file line number Diff line number Diff line change
Expand Up @@ -10973,19 +10973,18 @@ Text2P_Blank: menutxt " " ; byte_87C1:
; MENU ANIMATION SCRIPT
; ------------------------------------------------------------------------
;word_87C6:
Anim_SonicMilesBG:
dc.w 0
; Sonic/Miles animated background
dc.l $FF<<24|ArtUnc_MenuBack
dc.w $20
dc.b 6
dc.b $A
Anim_SonicMilesBG: zoneanimstart
; Sonic/Miles animated background
zoneanimdecl -1, ArtUnc_MenuBack, 1, 6, $A
dc.b 0,$C7
dc.b $A, 5 ; 2
dc.b $14, 5 ; 4
dc.b $1E,$C7 ; 6
dc.b $14, 5 ; 8
dc.b $A, 5 ; 10
dc.b $A, 5
dc.b $14, 5
dc.b $1E,$C7
dc.b $14, 5
dc.b $A, 5
even

zoneanimend

; off_87DC:
TwoPlayerResultsPointers:
Expand Down Expand Up @@ -82196,28 +82195,6 @@ loc_3FF30:
; otherwise the subroutine would spend so much time waiting for the art to be
; decompressed that the VBLANK window would close before all the animating was done.

zoneanimstart macro {INTLABEL}
__LABEL__ label *
zoneanimcount := 0
zoneanimcur := "__LABEL__"
dc.w zoneanimcount___LABEL__ ; Number of scripts for a zone (-1)
endm

zoneanimend macro
zoneanimcount_{"\{zoneanimcur}"} = zoneanimcount-1
endm

zoneanimdeclanonid := 0

zoneanimdecl macro duration,artaddr,vramaddr,numentries,numvramtiles
zoneanimdeclanonid := zoneanimdeclanonid + 1
start:
dc.l (duration&$FF)<<24|artaddr
dc.w tiles_to_bytes(vramaddr)
dc.b numentries, numvramtiles
zoneanimcount := zoneanimcount + 1
endm

; zoneanimdecl -1, ArtUnc_Flowers1, ArtTile_ArtUnc_Flowers1, 6, 2
; -1 Global frame duration. If -1, then each frame will use its own duration, instead
; ArtUnc_Flowers1 Source address
Expand Down
23 changes: 23 additions & 0 deletions s2.macros.asm
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,29 @@ subObjData macro mappings,vram,renderflags,priority,width,collision
dc.b renderflags,priority,width,collision
endm

; macros for defining animated PLC script lists
zoneanimstart macro {INTLABEL}
__LABEL__ label *
zoneanimcount := 0
zoneanimcur := "__LABEL__"
dc.w zoneanimcount___LABEL__ ; Number of scripts for a zone (-1)
endm

zoneanimend macro
zoneanimcount_{"\{zoneanimcur}"} = zoneanimcount-1
endm

zoneanimdeclanonid := 0

zoneanimdecl macro duration,artaddr,vramaddr,numentries,numvramtiles
zoneanimdeclanonid := zoneanimdeclanonid + 1
start:
dc.l (duration&$FF)<<24|artaddr
dc.w tiles_to_bytes(vramaddr)
dc.b numentries, numvramtiles
zoneanimcount := zoneanimcount + 1
endm

; macros to convert from tile index to art tiles, block mapping or VRAM address.
make_art_tile function addr,pal,pri,((pri&1)<<15)|((pal&3)<<13)|(addr&tile_mask)
make_art_tile_2p function addr,pal,pri,((pri&1)<<15)|((pal&3)<<13)|((addr&tile_mask)>>1)
Expand Down

0 comments on commit 74851de

Please sign in to comment.