Files
pmd-sky/include/main_0201BA9C.h
cecilarmitais 6f907c680c Decomp eight veneers and wrappers
Decompile from asm:

  PlayBgmByIdVeneer              0x02017B58
  PlayBgmByIdVolumeVeneer        0x02017B64
  PlaySeByIdVolumeWrapper        0x02017C80
  GroupOamAttributesWrapper      0x0201BA9C
  CopyAttributesToOamWrapper     0x0201BAAC
  CopyAndInterleaveWrapper       0x0201BFF0
  SetAnimationControlPausedFlag  0x0201D198
  DeleteWanTableEntryVeneer      0x0201D72C

Most are tail calls the compiler reaches with bx rather than bl, either passing
their arguments through unchanged or supplying one: PlaySeByIdVolumeWrapper
fixes the volume at 0x100, the two Oam wrappers offset their argument by 0x20,
and CopyAndInterleaveWrapper halves its length.

That halving is a shift, not a division. Written as len / 2 the compiler adds the
round-toward-zero correction a signed divide needs; the target has a bare asr #1,
which is what len >> 1 produces.

SetAnimationControlPausedFlag sets or clears bit 0x4000 of the bitfield at the
start of struct animation_control, which already exists in graphics.h.

Two cautions for a reviewer. The callees are all still asm and had no
declarations in the tree, so every prototype here is provisional and declared
beside its caller. And a veneer that only forwards constrains nothing about its
own argument list -- the arguments are already in the right registers, so
declaring none, one or several all produce the same bytes. The parameter lists
are chosen to read sensibly against each callee's name, not read off the target.
The exception is PlaySeByIdVolumeWrapper, whose signature is pinned by an
existing C caller in overlay_25_init.c that passes a single s32.

No comments are added to any pmd-sky file.

Authored by Claude (Opus 5) under human direction. Confirmed by a matching
build: build/pmdsky.us/pmdsky.us.nds: OK.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-16 22:43:20 -07:00

8 lines
150 B
C

#ifndef PMDSKY_MAIN_0201BA9C_H
#define PMDSKY_MAIN_0201BA9C_H
void GroupOamAttributesWrapper(u8* p);
void CopyAttributesToOamWrapper(u8* p);
#endif