|
121 | 121 | .org 0x020379B4 |
122 | 122 | bl @OneScreen_DontResetTopType |
123 | 123 |
|
| 124 | + .org 0x02088174 |
| 125 | + bl @CheckIfEnemGlyphObtained ; Used for the Top Screen enemy status |
| 126 | + |
124 | 127 | .close |
125 | 128 | ;;;;;;;;;;;;;;;;;;;;;;;;;;; |
126 | 129 | .open "ftc/overlay9_0", 0x021DD280 |
|
188 | 191 |
|
189 | 192 | .org 0x0221D6B4 |
190 | 193 | b @CheckAreaDelay |
| 194 | + |
| 195 | + .org 0x0220576C |
| 196 | + mov r2, 0x04 ; Bone Archer glyph flag |
191 | 197 | .close |
192 | 198 | ;;;;;;;;;;;;;;;;;;;;; |
193 | 199 | .open "ftc/overlay9_20", 0x021FFFC0 |
|
375 | 381 | .org 0x02231B74 |
376 | 382 | b 0x02231B88 ; The check for Anna's cat. This just crashes if we're out of the room... |
377 | 383 |
|
| 384 | + .org 0x02231EF4 |
| 385 | + b 0x02231F04 ; The same, for when we're deleting the object |
| 386 | + |
378 | 387 | .org 0x02230048 |
379 | 388 | bl @ClampVillagerGlyphPos |
| 389 | + |
| 390 | + .org 0x02293074 |
| 391 | + mov r3, 0x01 ; Bone Scimitar glyph flag |
| 392 | + |
| 393 | + .org 0x022629EC |
| 394 | + mov r0, 0x02 ; Axe knight glyph flag |
| 395 | + |
| 396 | + .org 0x0224E8B4 |
| 397 | + b @SetNecromancerGlyph |
| 398 | + |
| 399 | + .org 0x0222B09C |
| 400 | + bl @CheckIfEnemGlyphObtained ; Used for the Guide menu |
| 401 | + |
| 402 | + .org 0x0222D260 |
| 403 | + bl @CheckIfEnemGlyphObtained_BestMain ; Used on the Bestiary's top menu |
| 404 | + |
| 405 | + .org 0x0227508C |
| 406 | + bl @SetSpearGuardGlyph |
| 407 | + |
| 408 | + .org 0x0228A464 |
| 409 | + mov r0, |
380 | 410 | |
381 | 411 | .close |
382 | 412 | ;;;;;;;;;;;;;;;;;;;;;; |
|
670 | 700 | .dh 0xE2 |
671 | 701 | .dh 0xE3 |
672 | 702 | .dh 0xE4 |
| 703 | + @ROMTable_EnemyGlyphIndex: ; Indexed list of enemies which have Glyphs attached to them |
| 704 | + .db 0x05 |
| 705 | + .db 0x08 |
| 706 | + .db 0x0B |
| 707 | + .db 0x0C |
| 708 | + .db 0x0D |
| 709 | + .db 0x18 |
| 710 | + .db 0x1A |
| 711 | + .db 0x1E |
| 712 | + .db 0x22 |
| 713 | + .db 0x23 |
| 714 | + .db 0x28 |
| 715 | + .db 0x33 |
| 716 | + .db 0x38 |
| 717 | + .db 0x3B |
| 718 | + .db 0x3C |
| 719 | + .db 0x45 |
| 720 | + .db 0x4C |
| 721 | + .db 0x50 |
| 722 | + .db 0x51 |
| 723 | + .db 0x55 |
| 724 | + .db 0x5A |
| 725 | + .db 0x5E |
| 726 | + .db 0x5F |
| 727 | + .db 0x61 |
| 728 | + .db 0x63 |
| 729 | + .db 0x65 |
| 730 | + .db 0x67 |
| 731 | + .db 0x68 |
| 732 | + .db 0x72 |
| 733 | + .db 0x73 |
| 734 | + .db 0x74 |
| 735 | +.align 4 |
| 736 | + @ROMTable_EnemyGlyphFlags: ; Index of which flag each enemy uses for its Glyph. |
| 737 | + ; TODO! Set flags for these. Up to Sea Demon... |
| 738 | + .dh 0x01 ; Bone Scimitar |
| 739 | + .dh 0x02 ; Axe Knight |
| 740 | + .dh 0x03 ; Necromancer |
| 741 | + .dh 0x04 ; Bone Archer |
| 742 | + .dh 0x08 ; Spear Guard |
| 743 | + .dh 0x09 ; Skull Spider |
| 744 | + |
| 745 | + .dh 0x1A ; Sea Demon |
| 746 | + .dh 0x1E ; Fire Demon |
| 747 | + .dh 0x22 ; Werebat |
| 748 | + .dh 0x23 ; Black Formor |
| 749 | + .dh 0x28 ; Dullahan |
| 750 | + .dh 0x33 ; Miss Murder |
| 751 | + .dh 0x38 ; Lizardman |
| 752 | + .dh 0x3B ; Thunder Demon |
| 753 | + .dh 0x3C ; Owl |
| 754 | + .dh 0x45 ; White Formor |
| 755 | + .dh 0x4C ; Black Panther |
| 756 | + .dh 0x50 ; Polkir |
| 757 | + .dh 0x51 ; Nova Skeleton |
| 758 | + .dh 0x55 ; Red Smasher |
| 759 | + .dh 0x5A ; Hammer Shaker |
| 760 | + .dh 0x5E ; Spectral Sword |
| 761 | + .dh 0x5F ; Automaton ZX27 |
| 762 | + .dh 0x61 ; Gorgon Head |
| 763 | + .dh 0x63 ; Great Knight |
| 764 | + .dh 0x65 ; Winged Skeleton |
| 765 | + .dh 0x67 ; Jiang Shi |
| 766 | + .dh 0x68 ; Demon Lord |
| 767 | + .dh 0x72 ; Albus |
| 768 | + .dh 0x73 ; Barlowe TODO! Portals for Albus and Barlowe if you miss their Glyphs. |
| 769 | + .dh 0x06 ; Wallman |
| 770 | + @EnemGlyphIndex_len equ @ROMTable_EnemyGlyphFlags - @ROMTable_EnemyGlyphIndex |
673 | 771 |
|
674 | 772 | .align 4 |
675 | 773 |
|
|
2864 | 2962 | cmp r1, 0 |
2865 | 2963 | movle r1, 0 ; If less than 0, clamp at 0 |
2866 | 2964 | b 0x0206DDEC |
| 2965 | +;;;;;;;;;;;;;;;;;;; |
| 2966 | +; Necromancer needs to set r3 glyph flag here so it doesn't override other things |
| 2967 | +@SetNecromancerGlyph: |
| 2968 | + mov r3, 0x03 |
| 2969 | + stmfa [r13], r0, r3 |
| 2970 | + b 0x0224E8B8 |
| 2971 | +;;;;;;;;;;;;;;;;;;;; |
| 2972 | +; Checks if we've set the Flag for an enemy's Glyph (obtained it). r6 Enemy ID. returns 1 in r0 if we have. |
| 2973 | +@CheckIfEnemGlyphObtained: |
| 2974 | + ldr r0, = @ROMTable_EnemyGlyphIndex |
| 2975 | + mov r1, 0 |
| 2976 | +@@CheckIndexNext: |
| 2977 | + ldrb r2, [r0, r1] |
| 2978 | + cmp r2, r6 ; Check if the current Index == the current enemy ID |
| 2979 | + beq @@GotEnemyIndex |
| 2980 | + cmp r1, @EnemGlyphIndex_len ; If we've exhausted the whole table... |
| 2981 | + bge @@Exit_SetFail ; Count this as a fail...? Does this code even get run? delete if not |
| 2982 | + add r1, r1, 1 |
| 2983 | + b @@CheckIndexNext |
| 2984 | +@@GotEnemyIndex: |
| 2985 | + ldr r0, = @ROMTable_EnemyGlyphFlags |
| 2986 | + mov r1, r1, lsl 1 ; Shift |
| 2987 | + ldrh r0, [r0, r1] ; use R1 counter value from the previous loop to look up which flag this is |
| 2988 | + push lr |
| 2989 | + bl @CheckLocFlag ; Check if this FLAG is set |
| 2990 | + pop lr ; 0 Is the result of the LOC flag, so we don't need anything else |
| 2991 | + bx lr |
| 2992 | +@@Exit_SetFail: |
| 2993 | + mov r0, 0 ; Force a failure |
| 2994 | + bx lr |
| 2995 | + |
| 2996 | +; Used to determine if an enemie's drops have been 100% collected outside of its bestiary page |
| 2997 | +@CheckIfEnemGlyphObtained_BestMain: |
| 2998 | + push r6, lr |
| 2999 | + add r6, r10, r1 |
| 3000 | + bl @CheckIfEnemGlyphObtained |
| 3001 | + pop r6, lr |
| 3002 | + bx lr |
| 3003 | +;;;;;;;;;;;;;;;;;;;;;; |
| 3004 | +; Set flag r3 |
| 3005 | +@SetSpearGuardGlyph: |
| 3006 | + mov r0, r6 |
| 3007 | + mov r3, 0x08 |
| 3008 | + bx lr |
2867 | 3009 |
|
2868 | 3010 | .pool |
2869 | 3011 | .endarea |
|
0 commit comments