Hypergammaspaces' assorted ASM


I decided to make a topic for smaller hacks that don’t really need a full post.

Draw Only Used Weapon Ranks (compatible with Modular Stat Screens)

MSS wasn’t compatible with the “display only weapon ranks your unit has” hack, and the original source seems to be lost to time. I had a go at recreating that functionality for MSS.

[details=MSS Page 3 with only active ranks (source)]```assembly
.include “mss_defs.s”


mov r0, r8
push {r5-r7}
mov r5, #0x0 @counter for bar id
mov r7, #0x28 @weapon rank offset (starts at sword)

mov r6, r8 @unit
ldrb r6, [r6, r7]
cmp r6, #0x0 @does unit have rank?
ble NoRank

mov r0, r5 @bar id
mov r1, r5 @tile_x = even 1 odd 9
mov r2, #0x1
and r1, r2
cmp r1, #0x1
beq OddRank
mov r1, #0x1
b SetY
mov r1, #0x9

mov r2, r5 @tile_y = 1 1 3 3 5 5 7 7
lsr r2, r2, #0x1
lsl r2, r2, #0x1 @clear last bit and add 1
add r2, #0x1
mov r3, r7 @weapon id - calculate from currentOffset
sub r3, r3, #0x28
blh DrawWeaponRank, r4 @08087864

add r5, #0x1 @increment bar counter

add r7, #0x1
cmp r7, #0x2F
ble LoopWeapons
b EndRanks


pop {r5-r7}

blh DrawSupports