If you are still using the old URL (datacrystal.romhacking.net), please update your bookmarks! The old URL may stop working soon.
The current URL is datacrystal.tcrf.net.
The current URL is datacrystal.tcrf.net.
Final Fantasy VI/ROM map/Assembly C39
< Final Fantasy VI | ROM map(Redirected from Final Fantasy VI:ROM map/Assembly C39)
Jump to navigation
Jump to search
This is a sub-page of Final Fantasy VI/ROM map.
C3/901F blank item name
Blanking the item name after it was removed C3/901F: A00D00 LDY #$000D (item name length) C3/9022: A9FF LDA #$FF C3/9024: 8D8021 STA $2180 C3/9027: 88 DEY C3/9028: D0FA BNE $9024 C3/902A: 9C8021 STZ $2180 (end this string) C3/902D: 60 RTS
C3/902E data: window
C3/902E: 8B581C18
C3/9032 unknow
C3/9032: 209390 JSR $9093 C3/9035: 201B91 JSR $911B (something to do with equipping...) C3/9038: A92C LDA #$2C C3/903A: 8529 STA $29 (set text color to blue) C3/903C: A2AEA2 LDX #$A2AE C3/903F: A00400 LDY #$0004 C3/9042: 20BA69 JSR $69BA ("Head," "Body") C3/9045: 204E90 JSR $904E C3/9048: 206E0E JSR $0E6E C3/904B: 4C0F9E JMP $9E0F
C3/904E unknow
C3/904E: A920 LDA #$20 C3/9050: 8529 STA $29 (set text color to white) C3/9052: A2A6A2 LDX #$A2A6 C3/9055: A00800 LDY #$0008 C3/9058: 20BA69 JSR $69BA ("EQUIP," "OPTIMUM," "RMOVE," "EMPTY") C3/905B: 60 RTS
C3/905C unknow
C3/905C: A920 LDA #$20 C3/905E: 8529 STA $29 (set text color to white) C3/9060: A2B2A2 LDX #$A2B2 C3/9063: A00400 LDY #$0004 C3/9066: 20BA69 JSR $69BA ("EQUIP," "REMOVE") C3/9069: 60 RTS
C3/906A unknow
C3/906A: 209390 JSR $9093 C3/906D: 20F293 JSR $93F2 C3/9070: B92300 LDA $0023,Y (accessory slot 1) C3/9073: 85B0 STA $B0 C3/9075: B92400 LDA $0024,Y (accessory slot 2) C3/9078: 85B1 STA $B1 C3/907A: 203191 JSR $9131 C3/907D: A92C LDA #$2C C3/907F: 8529 STA $29 (set text color to blue) C3/9081: A2B6A2 LDX #$A2B6 C3/9084: A00400 LDY #$0004 C3/9087: 20BA69 JSR $69BA ("Relic," "Relic") C3/908A: 205C90 JSR $905C C3/908D: 20ABA6 JSR $A6AB C3/9090: 4C6E0E JMP $0E6E
C3/9093 unknow
C3/9093: 201091 JSR $9110 C3/9096: C220 REP #$20 (16 bit memory/accum.) C3/9098: A90001 LDA #$0100 C3/909B: 8FD09B7E STA $7E9BD0 C3/909F: E220 SEP #$20 (8 bit memory/accum.) C3/90A1: A901 LDA #$01 C3/90A3: 8D0721 STA $2107 C3/90A6: A942 LDA #$42 C3/90A8: 8D0921 STA $2109 C3/90AB: 200C96 JSR $960C C3/90AE: 20286A JSR $6A28 C3/90B1: 202D6A JSR $6A2D C3/90B4: A07F94 LDY #$947F C3/90B7: 204103 JSR $0341 (draw window that holds stats, before you select Equip, Remove, or Empty) C3/90BA: A08394 LDY #$9483 C3/90BD: 204103 JSR $0341 (draw window that holds current equipment, before you select Equip, Remove, or Empty) C3/90C0: A08794 LDY #$9487 C3/90C3: 204103 JSR $0341 (draw window that holds Equip, Optimum, Remove, and Empty) C3/90C6: A08B94 LDY #$948B C3/90C9: 204103 JSR $0341 (draw window that holds stats, after you select Equip, Remove, or Empty) C3/90CC: A08F94 LDY #$948F C3/90CF: 204103 JSR $0341 (draw window that holds current equipment, after you select Equip, Remove, or Empty) C3/90D2: A09394 LDY #$9493 C3/90D5: 204103 JSR $0341 (draw window that holds equipment option, after you select Equip, Remove, or Empty) C3/90D8: 20520E JSR $0E52 C3/90DB: 20156A JSR $6A15 C3/90DE: 20196A JSR $6A19 C3/90E1: 20280E JSR $0E28 C3/90E4: 20360E JSR $0E36 C3/90E7: 203C6A JSR $6A3C C3/90EA: 20416A JSR $6A41 C3/90ED: 20E593 JSR $93E5 (display character name in equip screen) C3/90F0: 20B261 JSR $61B2 C3/90F3: A92C LDA #$2C C3/90F5: 8529 STA $29 (set text color to blue) C3/90F7: A24DA3 LDX #$A34D C3/90FA: A01C00 LDY #$001C C3/90FD: 20BA69 JSR $69BA (display strings for equip screen) C3/9100: A92C LDA #$2C C3/9102: 8529 STA $29 (set text color to blue) C3/9104: A269A3 LDX #$A369 C3/9107: A00800 LDY #$0008 C3/910A: 20BA69 JSR $69BA (display strings for equip screen) C3/910D: 4C6E0E JMP $0E6E
C3/9110 unknow
C3/9110: 7B TDC C3/9111: A528 LDA $28 C3/9113: AA TAX C3/9114: B569 LDA $69,X C3/9116: 220600C2 JSL $C20006 ("Equipment check function," enforces stat caps, etc) C3/911A: 60 RTS
C3/911B unknow
C3/911B: 207599 JSR $9975 C3/911E: A920 LDA #$20 C3/9120: 8529 STA $29 (set text color to white) C3/9122: 203E91 JSR $913E C3/9125: 202D92 JSR $922D C3/9128: 20FC93 JSR $93FC C3/912B: 203594 JSR $9435 C3/912E: 4C4394 JMP $9443
C3/9131 unknow
C3/9131: A920 LDA #$20 C3/9133: 8529 STA $29 (set text color to white) C3/9135: 203E91 JSR $913E C3/9138: 205194 JSR $9451 C3/913B: 4C5F94 JMP $945F
C3/913E unknow
C3/913E: 201091 JSR $9110 C3/9141: 20F293 JSR $93F2 C3/9144: 20E899 JSR $99E8 C3/9147: 200792 JSR $9207 C3/914A: 8B PHB C3/914B: A97E LDA #$7E C3/914D: 48 PHA C3/914E: AB PLB C3/914F: 20C491 JSR $91C4 C3/9152: AD0630 LDA $3006 C3/9155: 20E004 JSR $04E0 C3/9158: A2B77C LDX #$7CB7 (position of the current "Vigor" stat in the equip screen) C3/915B: 20C004 JSR $04C0 C3/915E: AD0430 LDA $3004 C3/9161: 20E004 JSR $04E0 C3/9164: A2377D LDX #$7D37 (position of the current "Speed" stat in the equip screen) C3/9167: 20C004 JSR $04C0 C3/916A: AD0230 LDA $3002 C3/916D: 20E004 JSR $04E0 C3/9170: A2B77D LDX #$7DB7 (position of the current "Stamina" stat in the equip screen) C3/9173: 20C004 JSR $04C0 C3/9176: AD0030 LDA $3000 C3/9179: 20E004 JSR $04E0 C3/917C: A2377E LDX #$7E37 (position of the current "Magic" stat in the equip screen) C3/917F: 20C004 JSR $04C0 C3/9182: 20AB93 JSR $93AB C3/9185: A6F1 LDX $F1 C3/9187: 86F3 STX $F3 C3/9189: 202E05 JSR $052E C3/918C: A2B77E LDX #$7EB7 (position of the current "Battle power" stat in the equip screen) C3/918F: 208604 JSR $0486 C3/9192: AD1A30 LDA $301A C3/9195: 20E004 JSR $04E0 C3/9198: A2377F LDX #$7F37 (position of the current "Defense" stat in the equip screen) C3/919B: 20C004 JSR $04C0 C3/919E: AD0830 LDA $3008 C3/91A1: 20E004 JSR $04E0 C3/91A4: A2B77F LDX #$7FB7 (position of the current "Evade" stat in the equip screen) C3/91A7: 20C004 JSR $04C0 C3/91AA: AD1B30 LDA $301B C3/91AD: 20E004 JSR $04E0 C3/91B0: A23780 LDX #$8037 (position of the current "Magic defense" stat in the equip screen) C3/91B3: 20C004 JSR $04C0 C3/91B6: AD0A30 LDA $300A C3/91B9: 20E004 JSR $04E0 C3/91BC: A2B780 LDX #$80B7 (position of the current "Magic evade" stat in the equip screen) C3/91BF: 20C004 JSR $04C0 C3/91C2: AB PLB C3/91C3: 60 RTS
C3/91C4 unknow
C3/91C4: 20F293 JSR $93F2 C3/91C7: AF32307E LDA $7E3032 C3/91CB: 20EC91 JSR $91EC C3/91CE: AD3430 LDA $3034 C3/91D1: 2901 AND #$01 C3/91D3: D007 BNE $91DC C3/91D5: B91500 LDA $0015,Y (status byte 4) C3/91D8: 2901 AND #$01 (rage set?) C3/91DA: F00F BEQ $91EB (branch if not) C3/91DC: AD3430 LDA $3034 C3/91DF: 18 CLC C3/91E0: 2901 AND #$01 C3/91E2: 85E0 STA $E0 C3/91E4: 6A ROR A C3/91E5: 6A ROR A C3/91E6: 05E0 ORA $E0 C3/91E8: 991500 STA $0015,Y (save new status byte 4) C3/91EB: 60 RTS
C3/91EC unknow
C3/91EC: 2925 AND #$25 C3/91EE: 49FF EOR #$FF (flip all bits) C3/91F0: 85E1 STA $E1 C3/91F2: B91400 LDA $0014,Y (Statuses) C3/91F5: 25E1 AND $E1 C3/91F7: 991400 STA $0014,Y (Statuses) C3/91FA: 60 RTS
C3/91FB unknow
C3/91FB: 18 CLC C3/91FC: 2901 AND #$01 C3/91FE: 6A ROR A C3/91FF: 6A ROR A C3/9200: 191500 ORA $0015,Y (Statuses) C3/9203: 991500 STA $0015,Y (Statuses) C3/9206: 60 RTS
C3/9207 unknow
C3/9207: A600 LDX $00 C3/9209: C220 REP #$20 (16 bit memory/accum.) C3/920B: BDA011 LDA $11A0,X C3/920E: 9F00307E STA $7E3000,X C3/9212: E8 INX C3/9213: E8 INX C3/9214: BDA011 LDA $11A0,X C3/9217: 9F00307E STA $7E3000,X C3/921B: E8 INX C3/921C: E8 INX C3/921D: E04000 CPX #$0040 C3/9220: D0E9 BNE $920B C3/9222: E220 SEP #$20 (8 bit memory/accum.) C3/9224: A5A1 LDA $A1 C3/9226: 85A0 STA $A0 C3/9228: A5CD LDA $CD C3/922A: 85CE STA $CE C3/922C: 60 RTS C3/922D: 60 RTS
C3/922E unknow
C3/922E: A92C LDA #$2C C3/9230: 8529 STA $29 C3/9232: 60 RTS
C3/9233 unknow
C3/9233: AF899D7E LDA $7E9D89 C3/9237: F005 BEQ $923E C3/9239: 20429A JSR $9A42 C3/923C: B003 BCS $9241 C3/923E: 4C879C JMP $9C87
C3/9241 unknow
C3/9241: 20F293 JSR $93F2 C3/9244: A525 LDA $25 C3/9246: C902 CMP #$02 C3/9248: F004 BEQ $924E C3/924A: C8 INY C3/924B: C8 INY C3/924C: C8 INY C3/924D: C8 INY C3/924E: C221 REP #$21 (16 bit accumulator, clear carry) C3/9250: 98 TYA C3/9251: E220 SEP #$20 (8 bit memory/accum.) C3/9253: 655F ADC $5F C3/9255: A8 TAY C3/9256: 7B TDC C3/9257: A54B LDA $4B C3/9259: AA TAX C3/925A: BF8A9D7E LDA $7E9D8A,X C3/925E: AA TAX C3/925F: B91F00 LDA $001F,Y C3/9262: 8564 STA $64 C3/9264: BD6918 LDA $1869,X (Items currently in inventory) C3/9267: 991F00 STA $001F,Y C3/926A: 5A PHY C3/926B: 201091 JSR $9110 C3/926E: 20F293 JSR $93F2 C3/9271: 20E899 JSR $99E8 C3/9274: 202093 JSR $9320 C3/9277: ADA611 LDA $11A6 C3/927A: 20E004 JSR $04E0 C3/927D: A2BF7C LDX #$7CBF (position of the modified "Vigor" stat in the equip screen) C3/9280: AF40307E LDA $7E3040 C3/9284: 8529 STA $29 C3/9286: 20C004 JSR $04C0 C3/9289: ADA411 LDA $11A4 C3/928C: 20E004 JSR $04E0 C3/928F: A23F7D LDX #$7D3F (position of the modified "Speed" stat in the equip screen) C3/9292: AF41307E LDA $7E3041 C3/9296: 8529 STA $29 C3/9298: 20C004 JSR $04C0 C3/929B: ADA211 LDA $11A2 C3/929E: 20E004 JSR $04E0 C3/92A1: A2BF7D LDX #$7DBF (position of the modified "Stamina" stat in the equip screen) C3/92A4: AF42307E LDA $7E3042 C3/92A8: 8529 STA $29 C3/92AA: 20C004 JSR $04C0 C3/92AD: ADA011 LDA $11A0 C3/92B0: 20E004 JSR $04E0 C3/92B3: A23F7E LDX #$7E3F (position of the modified "Magic" stat in the equip screen) C3/92B6: AF43307E LDA $7E3043 C3/92BA: 8529 STA $29 C3/92BC: 20C004 JSR $04C0 C3/92BF: 207193 JSR $9371 C3/92C2: 202E05 JSR $052E C3/92C5: A2BF7E LDX #$7EBF (position of the modified "Battle power" stat in the equip screen) C3/92C8: AF48307E LDA $7E3048 C3/92CC: 8529 STA $29 C3/92CE: 208604 JSR $0486 C3/92D1: ADBA11 LDA $11BA C3/92D4: 20E004 JSR $04E0 C3/92D7: A23F7F LDX #$7F3F (position of the modified "Defense" stat in the equip screen) C3/92DA: AF44307E LDA $7E3044 C3/92DE: 8529 STA $29 C3/92E0: 20C004 JSR $04C0 C3/92E3: ADA811 LDA $11A8 C3/92E6: 20E004 JSR $04E0 C3/92E9: A2BF7F LDX #$7FBF (position of the modified "Evade" stat in the equip screen) C3/92EC: AF45307E LDA $7E3045 C3/92F0: 8529 STA $29 C3/92F2: 20C004 JSR $04C0 C3/92F5: ADBB11 LDA $11BB C3/92F8: 20E004 JSR $04E0 C3/92FB: A23F80 LDX #$803F (position of the modified "Magic defense" stat in the equip screen) C3/92FE: AF46307E LDA $7E3046 C3/9302: 8529 STA $29 C3/9304: 20C004 JSR $04C0 C3/9307: ADAA11 LDA $11AA C3/930A: 20E004 JSR $04E0 C3/930D: A2BF80 LDX #$80BF (position of the modified "Magic evade" stat in the equip screen) C3/9310: AF47307E LDA $7E3047 C3/9314: 8529 STA $29 C3/9316: 20C004 JSR $04C0 C3/9319: 7A PLY C3/931A: A564 LDA $64 C3/931C: 991F00 STA $001F,Y C3/931F: 60 RTS
C3/9320 unknow
C3/9320: 8B PHB C3/9321: A97E LDA #$7E C3/9323: 48 PHA C3/9324: AB PLB C3/9325: 7B TDC C3/9326: AA TAX C3/9327: BF6993C3 LDA $C39369,X C3/932B: DA PHX C3/932C: AA TAX C3/932D: BFA01100 LDA $0011A0,X (no need for long mode here) C3/9331: DD0030 CMP $3000,X C3/9334: F006 BEQ $933C C3/9336: 9008 BCC $9340 C3/9338: A928 LDA #$28 C3/933A: 8006 BRA $9342 C3/933C: A920 LDA #$20 C3/933E: 8002 BRA $9342 C3/9340: A924 LDA #$24 C3/9342: FA PLX C3/9343: 9D4030 STA $3040,X C3/9346: E8 INX C3/9347: E00800 CPX #$0008 C3/934A: D0DB BNE $9327 C3/934C: 207193 JSR $9371 C3/934F: 20AB93 JSR $93AB C3/9352: A4F3 LDY $F3 C3/9354: C4F1 CPY $F1 C3/9356: F006 BEQ $935E C3/9358: 9008 BCC $9362 C3/935A: A928 LDA #$28 C3/935C: 8006 BRA $9364 C3/935E: A920 LDA #$20 C3/9360: 8002 BRA $9364 C3/9362: A924 LDA #$24 C3/9364: 8D4830 STA $3048 C3/9367: AB PLB C3/9368: 60 RTS
C3/9369 data
C3/9369: 06 C3/936A: 04 C3/936B: 02 C3/936C: 00 C3/936D: 1A C3/936E: 08 C3/936F: 1B C3/9370: 0A
C3/9371 unknow
C3/9371: A5A1 LDA $A1 C3/9373: F016 BEQ $938B C3/9375: AFAC1100 LDA $0011AC C3/9379: F006 BEQ $9381 C3/937B: 8FAD1100 STA $0011AD C3/937F: 8019 BRA $939A C3/9381: AFAD1100 LDA $0011AD C3/9385: 8FAC1100 STA $0011AC C3/9389: 800F BRA $939A C3/938B: A5CD LDA $CD C3/938D: D00B BNE $939A C3/938F: AFAC1100 LDA $0011AC C3/9393: F005 BEQ $939A C3/9395: 7B TDC C3/9396: 8FAD1100 STA $0011AD C3/939A: AFAC1100 LDA $0011AC C3/939E: 18 CLC C3/939F: 6FAD1100 ADC $0011AD C3/93A3: 85F3 STA $F3 C3/93A5: 7B TDC C3/93A6: 6900 ADC #$00 C3/93A8: 85F4 STA $F4 C3/93AA: 60 RTS
C3/93AB unknow
C3/93AB: A5A0 LDA $A0 C3/93AD: F016 BEQ $93C5 C3/93AF: AF0C307E LDA $7E300C C3/93B3: F006 BEQ $93BB C3/93B5: 8F0D307E STA $7E300D C3/93B9: 8019 BRA $93D4 C3/93BB: AF0D307E LDA $7E300D C3/93BF: 8F0C307E STA $7E300C C3/93C3: 800F BRA $93D4 C3/93C5: A5CE LDA $CE C3/93C7: D00B BNE $93D4 C3/93C9: AF0C307E LDA $7E300C C3/93CD: F005 BEQ $93D4 C3/93CF: 7B TDC C3/93D0: 8F0D307E STA $7E300D C3/93D4: AF0C307E LDA $7E300C C3/93D8: 18 CLC C3/93D9: 6F0D307E ADC $7E300D C3/93DD: 85F1 STA $F1 C3/93DF: 7B TDC C3/93E0: 6900 ADC #$00 C3/93E2: 85F2 STA $F2 C3/93E4: 60 RTS
C3/93E5 unknow
C3/93E5: 20F293 JSR $93F2 C3/93E8: A920 LDA #$20 C3/93EA: 8529 STA $29 (set text color to white) C3/93EC: A0B77B LDY #$7BB7 (position of character name in equip screen) C3/93EF: 4CCF34 JMP $34CF
C3/93F2 unknow
C3/93F2: 7B TDC C3/93F3: A528 LDA $28 C3/93F5: 0A ASL A C3/93F6: AA TAX C3/93F7: B46D LDY $6D,X C3/93F9: 8467 STY $67 C3/93FB: 60 RTS
C3/93FC unknow
C3/93FC: 201D94 JSR $941D C3/93FF: A21B7A LDX #$7A1B (position of the R-hand slot) C3/9402: 206D94 JSR $946D C3/9405: B91F00 LDA $001F,Y C3/9408: 20E18F JSR $8FE1 C3/940B: 20D97F JSR $7FD9 C3/940E: 201D94 JSR $941D C3/9411: A29B7A LDX #$7A9B (position of the L-hand slot) C3/9414: 206D94 JSR $946D C3/9417: B92000 LDA $0020,Y C3/941A: 4C7994 JMP $9479
C3/941D unknow
C3/941D: 20F293 JSR $93F2 C3/9420: B91F00 LDA $001F,Y C3/9423: C9FF CMP #$FF (if nothing is equipped, insert "Empty"?) C3/9425: D00B BNE $9432 C3/9427: B92000 LDA $0020,Y C3/942A: C9FF CMP #$FF (if nothing is equipped, insert "Empty"?) C3/942C: D004 BNE $9432 C3/942E: 85E0 STA $E0 C3/9430: 8002 BRA $9434 C3/9432: 64E0 STZ $E0 C3/9434: 60 RTS
C3/9435 unknow
C3/9435: A21B7B LDX #$7B1B (position of helmet slot) C3/9438: 206D94 JSR $946D C3/943B: 64E0 STZ $E0 C3/943D: B92100 LDA $0021,Y C3/9440: 4C7994 JMP $9479
C3/9443 unknow
C3/9443: A29B7B LDX #$7B9B (position of armor slot) C3/9446: 206D94 JSR $946D C3/9449: 64E0 STZ $E0 C3/944B: B92200 LDA $0022,Y C3/944E: 4C7994 JMP $9479
C3/9451 unknow
C3/9451: A21B7B LDX #$7B1B (accessory, slot 1) C3/9454: 206D94 JSR $946D C3/9457: 64E0 STZ $E0 C3/9459: B92300 LDA $0023,Y C3/945C: 4C7994 JMP $9479
C3/945F unknow
C3/945F: A29B7B LDX #$7B9B (accessory, slot 2) C3/9462: 206D94 JSR $946D C3/9465: 64E0 STZ $E0 C3/9467: B92400 LDA $0024,Y C3/946A: 4C7994 JMP $9479
C3/946D unknow
C3/946D: C220 REP #$20 (16 bit memory/accum.) C3/946F: 8A TXA C3/9470: 8F899E7E STA $7E9E89 C3/9474: E220 SEP #$20 (8 bit memory/accum.) C3/9476: 4CF293 JMP $93F2
C3/9479 unknow
C3/9479: 20E18F JSR $8FE1 C3/947C: 4CD97F JMP $7FD9
C3/947F data: windows
C3/947F: 4B5B1C0D (window that holds stats, before you select Equip, Remove, or Empty) C3/9483: 0B591C07 (window that holds current equipment, before you select Equip, Remove, or Empty) C3/9487: 8B581C02 (window that holds Equip, Optimum, Remove, and Empty) C3/948B: 4B631C0D (window that holds stats, after you select Equip, Remove, or Empty) C3/948F: 0B611C07 (window that holds current equipment, after you select Equip, Remove, or Empty) C3/9493: B7600602 (window that holds selected equipment option, after you select Equip, Remove, or Empty)
C3/9497 unknow
C3/9497: A902 LDA #$02 (from C3/1C35, C3/AA14) C3/9499: 8D5043 STA $4350 C3/949C: A90E LDA #$0E C3/949E: 8D5143 STA $4351 (register address becomes $210E) C3/94A1: A0D895 LDY #$95D8 C3/94A4: 8C5243 STY $4352 (set address) C3/94A7: A9C3 LDA #$C3 C3/94A9: 8D5443 STA $4354 (set bank, C3/95D8) C3/94AC: A9C3 LDA #$C3 C3/94AE: 8D5743 STA $4357 C3/94B1: A920 LDA #$20 C3/94B3: 0443 TSB $43 (eventually enable channel 5 of HDMA) C3/94B5: 60 RTS
C3/94B6 unknow
C3/94B6: A902 LDA #$02 (from C3/1BCB, C3/9E63) C3/94B8: 8D5043 STA $4350 C3/94BB: A912 LDA #$12 C3/94BD: 8D5143 STA $4351 (register address becomes $2112) C3/94C0: A0D895 LDY #$95D8 C3/94C3: 8C5243 STY $4352 (set address) C3/94C6: A9C3 LDA #$C3 C3/94C8: 8D5443 STA $4354 (set bank, C3/95D8) C3/94CB: A9C3 LDA #$C3 C3/94CD: 8D5743 STA $4357 C3/94D0: A920 LDA #$20 C3/94D2: 0443 TSB $43 (eventually enable channel 5 of HDMA) C3/94D4: 202095 JSR $9520 C3/94D7: A600 LDX $00 C3/94D9: BF6495C3 LDA $C39564,X C3/94DD: 9FC99B7E STA $7E9BC9,X C3/94E1: E8 INX C3/94E2: E00D00 CPX #$000D C3/94E5: D0F2 BNE $94D9 C3/94E7: A902 LDA #$02 C3/94E9: 8D6043 STA $4360 C3/94EC: A90D LDA #$0D C3/94EE: 8D6143 STA $4361 (register address becomes $210D) C3/94F1: A0C99B LDY #$9BC9 C3/94F4: 8C6243 STY $4362 (set address) C3/94F7: A97E LDA #$7E C3/94F9: 8D6443 STA $4364 (set bank, 7E/9BC9) C3/94FC: A97E LDA #$7E C3/94FE: 8D6743 STA $4367 C3/9501: A902 LDA #$02 C3/9503: 8D7043 STA $4370 C3/9506: A90E LDA #$0E C3/9508: 8D7143 STA $4371 (register address becomes $210E) C3/950B: A04998 LDY #$9849 C3/950E: 8C7243 STY $4372 (set address) C3/9511: A97E LDA #$7E C3/9513: 8D7443 STA $4374 (set bank, 7E/9849) C3/9516: A97E LDA #$7E C3/9518: 8D7743 STA $4377 C3/951B: A9C0 LDA #$C0 C3/951D: 0443 TSB $43 (eventually enable channels 6 and 7 of HDMA) C3/951F: 60 RTS
C3/9520 unknow
C3/9520: A600 LDX $00 C3/9522: BF7195C3 LDA $C39571,X C3/9526: 9F49987E STA $7E9849,X C3/952A: E8 INX C3/952B: E01200 CPX #$0012 C3/952E: D0F2 BNE $9522 C3/9530: BF7195C3 LDA $C39571,X C3/9534: 9F49987E STA $7E9849,X C3/9538: E8 INX C3/9539: 7B TDC C3/953A: A549 LDA $49 C3/953C: 0A ASL A C3/953D: 0A ASL A C3/953E: 0A ASL A C3/953F: 0A ASL A C3/9540: 29FF AND #$FF C3/9542: C221 REP #$21 C3/9544: 7F7195C3 ADC $C39571,X C3/9548: 9F49987E STA $7E9849,X C3/954C: E220 SEP #$20 (8 bit memory/accum.) C3/954E: E8 INX C3/954F: E8 INX C3/9550: E06300 CPX #$0063 C3/9553: D0DB BNE $9530 C3/9555: BF7195C3 LDA $C39571,X C3/9559: 9F49987E STA $7E9849,X C3/955D: E8 INX C3/955E: E06700 CPX #$0067 C3/9561: D0F2 BNE $9555 C3/9563: 60 RTS
C3/9564 unknow
C3/9564: 2700 AND [$00] C3/9566: 013C ORA ($3C,X) C3/9568: 0001 BRK #$01 C3/956A: 6C0000 JMP ($0000) C3/956D: 1E0001 ASL $0100,X C3/9570: 003F BRK #$3F C3/9572: 0000 BRK #$00 C3/9574: 0C0400 TSB $0004 C3/9577: 0C0800 TSB $0008 C3/957A: 0A ASL A C3/957B: 0C0001 TSB $0100 C3/957E: 0C0001 TSB $0100 C3/9581: 0C0004 TSB $0400 C3/9584: A0FF04 LDY #$04FF C3/9587: A0FF04 LDY #$04FF C3/958A: A0FF04 LDY #$04FF C3/958D: A4FF LDY $FF C3/958F: 04A4 TSB $A4 C3/9591: FF04A4FF SBC $FFA404,X C3/9595: 04A8 TSB $A8 C3/9597: FF04A8FF SBC $FFA804,X C3/959B: 04A8 TSB $A8 C3/959D: FF04ACFF SBC $FFAC04,X C3/95A1: 04AC TSB $AC C3/95A3: FF04ACFF SBC $FFAC04,X C3/95A7: 04B0 TSB $B0 C3/95A9: FF04B0FF SBC $FFB004,X C3/95AD: 04B0 TSB $B0 C3/95AF: FF04B4FF SBC $FFB404,X C3/95B3: 04B4 TSB $B4 C3/95B5: FF04B4FF SBC $FFB404,X C3/95B9: 04B8 TSB $B8 C3/95BB: FF04B8FF SBC $FFB804,X C3/95BF: 04B8 TSB $B8 C3/95C1: FF04BCFF SBC $FFBC04,X C3/95C5: 04BC TSB $BC C3/95C7: FF04BCFF SBC $FFBC04,X C3/95CB: 04C0 TSB $C0 C3/95CD: FF04C0FF SBC $FFC004,X C3/95D1: 04C0 TSB $C0 C3/95D3: FF1E1000 SBC $00101E,X C3/95D7: 00
C3/95D8 data: hdma transfer table
C3/95D8: 0F0000 C3/95DB: 0C0400 C3/95DE: 0C0800 C3/95E1: 0C0C00 C3/95E4: 0C1000 C3/95E7: 0C1400 C3/95EA: 0C1800 C3/95ED: 0C1C00 C3/95F0: 0C2000 C3/95F3: 0C2400 C3/95F6: 0C2800 C3/95F9: 0C2C00 C3/95FC: 0C3000 C3/95FF: 0C3400 C3/9602: 0C3800 C3/9605: 0C3C00 C3/9608: 0C4000 C3/960B: 00 (end)
C3/960c unknow
C3/960C: 205D96 JSR $965D C3/960F: A400 LDY $00 C3/9611: 8439 STY $39 C3/9613: 60 RTS
C3/9614 unknow
C3/9614: 205D96 JSR $965D C3/9617: A00001 LDY #$0001 C3/961A: 8439 STY $39 C3/961C: A92C LDA #$2C C3/961E: 8529 STA $29 C3/9620: 60 RTS
DP $26 is #$36 - sustain the equipment menu C3/9621: 200C96 JSR $960C C3/9624: 204E90 JSR $904E C3/9627: 20568E JSR $8E56 C3/962A: A508 LDA $08 C3/962C: 8980 BIT #$80 (is A being pressed?) C3/962E: F005 BEQ $9635 (branch if not) C3/9630: 20B20E JSR $0EB2 (makes the click sound) C3/9633: 802F BRA $9664 C3/9635: A509 LDA $09 C3/9637: 8980 BIT #$80 (is B being pressed?) C3/9639: F00D BEQ $9648 (branch if not) C3/963B: 20A90E JSR $0EA9 C3/963E: 201091 JSR $9110 C3/9641: A904 LDA #$04 C3/9643: 8527 STA $27 C3/9645: 6426 STZ $26 C3/9647: 60 RTS C3/9648: A935 LDA #$35 C3/964A: 85E0 STA $E0 C3/964C: 4C2220 JMP $2022 C3/964F: A009A3 LDY #$A309 C3/9652: 20F902 JSR $02F9 ("EQUIP") C3/9655: 60 RTS C3/9656: A011A3 LDY #$A311 C3/9659: 20F902 JSR $02F9 ("REMOVE") C3/965C: 60 RTS C3/965D: A0EAA2 LDY #$A2EA C3/9660: 20F902 JSR $02F9 (" ") C3/9663: 60 RTS
C3/9664 code and jump table
C3/9664: 7B TDC C3/9665: A54B LDA $4B C3/9667: 0A ASL A C3/9668: AA TAX C3/9669: 7C6C96 JMP ($966C,X) Appear to be pointers for the Equip screen (Equip, Optimum, Remove, Empty, and it's also a total guess) C3/966C: 7496 C3/966E: 8596 C3/9670: 8E96 C3/9672: 9F96
C3/9674 unknow
C3/9674: 201496 JSR $9614 C3/9677: 204F96 JSR $964F C3/967A: 206C8E JSR $8E6C C3/967D: 20758E JSR $8E75 C3/9680: A955 LDA #$55 C3/9682: 8526 STA $26 C3/9684: 60 RTS
C3/9685 unknow
C3/9685: 20F096 JSR $96F0 (Optimum command - fully equips standard equipment) C3/9688: 201B91 JSR $911B C3/968B: 644D STZ $4D C3/968D: 60 RTS
C3/968E unknow
C3/968E: 201496 JSR $9614 C3/9691: 205696 JSR $9656 C3/9694: 206C8E JSR $8E6C C3/9697: 20758E JSR $8E75 C3/969A: A956 LDA #$56 C3/969C: 8526 STA $26 C3/969E: 60 RTS
C3/969F unknow
C3/969F: 20A896 JSR $96A8 (Empty command - Removes standard equipment) C3/96A2: 201B91 JSR $911B C3/96A5: 644D STZ $4D C3/96A7: 60 RTS
C3/96A8 empty command of equip screen
C3/96A8: 20F293 JSR $93F2 C3/96AB: B91F00 LDA $001F,Y C3/96AE: 205E9D JSR $9D5E (Put item into inventory) C3/96B1: B92000 LDA $0020,Y C3/96B4: 205E9D JSR $9D5E (Put item into inventory) C3/96B7: B92100 LDA $0021,Y C3/96BA: 205E9D JSR $9D5E (Put item into inventory) C3/96BD: B92200 LDA $0022,Y C3/96C0: 205E9D JSR $9D5E (Put item into inventory) C3/96C3: A9FF LDA #$FF C3/96C5: 991F00 STA $001F,Y C3/96C8: 992000 STA $0020,Y C3/96CB: 992100 STA $0021,Y C3/96CE: 992200 STA $0022,Y C3/96D1: 60 RTS
C3/96D2 unknow
Starts in C0/C6BC (which is called by event command $9C), which jumps to C3/0015, then here C3/96D2: 201569 JSR $6915 C3/96D5: 7B TDC C3/96D6: AA TAX C3/96D7: AD0102 LDA $0201 (load character to equip) C3/96DA: D569 CMP $69,X (compare it with current party member) C3/96DC: F008 BEQ $96E6 (branch if character is in the party) C3/96DE: E8 INX C3/96DF: E00400 CPX #$0004 (member wasn't in party, increment...) C3/96E2: D0F6 BNE $96DA (...and try again) C3/96E4: 80FE BRA $96E4 (if the character isn't in the party, the game will freeze right here) C3/96E6: 8A TXA C3/96E7: 8528 STA $28 C3/96E9: 201091 JSR $9110 (Checks equipment by jumping to C2/0E77, there is no need to call this here) C3/96EC: 20F096 JSR $96F0 (Optimum command - fully equips standard equipment) C3/96EF: 6B RTL
C3/96F0 optimum command
C3/96F0: 201091 JSR $9110 (Checks equipment by jumping to C2/0E77) C3/96F3: 20A896 JSR $96A8 (Empty command - Removes standard equipment) C3/96F6: 20F293 JSR $93F2 (get character index) C3/96F9: 84F3 STY $F3 (store character index) C3/96FB: ADD811 LDA $11D8 C3/96FE: 2908 AND #$08 (Check "attack with 2 hands" bit) C3/9700: F018 BEQ $971A (if not set, do one weapon) C3/9702: 644B STZ $4B C3/9704: 20599B JSR $9B59 (Get item's type and stats) C3/9707: 209597 JSR $9795 (Check for equippable characters) C3/970A: 2050A1 JSR $A150 (Get the battle power/defensive power) C3/970D: 203F98 JSR $983F (Check for excluded items) C3/9710: A4F3 LDY $F3 (load character index) C3/9712: 991F00 STA $001F,Y (Store to first hand) C3/9715: 20979D JSR $9D97 (Remove item from inventory) C3/9718: 8051 BRA $976B (move to the helmet slot) C3/971A: 644B STZ $4B C3/971C: 20599B JSR $9B59 (Get weapon's type and stats) C3/971F: 209597 JSR $9795 (Check for weapon's equippable characters) C3/9722: 2050A1 JSR $A150 (Get the battle power/defensive power) C3/9725: A4F3 LDY $F3 (load character index) C3/9727: 201998 JSR $9819 (Check for excluded items) C3/972A: 991F00 STA $001F,Y (Store to first hand) C3/972D: 20979D JSR $9D97 (Remove item from inventory) C3/9730: ADD811 LDA $11D8 C3/9733: 2910 AND #$10 (Check "can equip a weapon in each hand" bit) C3/9735: D01A BNE $9751 (branch if set) C3/9737: A901 LDA #$01 C3/9739: 854B STA $4B C3/973B: 20599B JSR $9B59 (Get shield's type and stats) C3/973E: 20D797 JSR $97D7 (Check for sheild's equippable characters) C3/9741: 2050A1 JSR $A150 (Get the battle power/defensive power) C3/9744: A4F3 LDY $F3 (load character index) C3/9746: 201998 JSR $9819 (Check for excluded items) C3/9749: 992000 STA $0020,Y (Store to second hand) C3/974C: 20979D JSR $9D97 (Remove item from inventory) C3/974F: 801A BRA $976B (do the helmet slot now) C3/9751: A901 LDA #$01 C3/9753: 854B STA $4B (you are here only if you can equip a weapon in both hands) C3/9755: 20599B JSR $9B59 (Get item's type and stats) C3/9758: 209597 JSR $9795 (Check for equippable characters) C3/975B: 2050A1 JSR $A150 (Get the battle power/defensive power) C3/975E: A4F3 LDY $F3 (load character index) C3/9760: 201998 JSR $9819 (Check for excluded items) C3/9763: 992000 STA $0020,Y (Store to second hand) C3/9766: 20979D JSR $9D97 (Remove item from inventory) C3/9769: 8000 BRA $976B (Stupid auto-generated stuff....) C3/976B: A902 LDA #$02 C3/976D: 854B STA $4B (set slot as helmet) C3/976F: 20599B JSR $9B59 (Get head item's type and stats) C3/9772: 2050A1 JSR $A150 (Get the battle power/defensive power) C3/9775: A4F3 LDY $F3 (load character index) C3/9777: 201998 JSR $9819 (Check for excluded items) C3/977A: 992100 STA $0021,Y (Store to head) C3/977D: 20979D JSR $9D97 (Remove item from inventory) C3/9780: A903 LDA #$03 C3/9782: 854B STA $4B (set slot as body armor) C3/9784: 20599B JSR $9B59 (Get body item's type and stats) C3/9787: 2050A1 JSR $A150 (Get the battle power/defensive power) C3/978A: A4F3 LDY $F3 (load character index) C3/978C: 201998 JSR $9819 (Check for excluded items) C3/978F: 992200 STA $0022,Y (Store to body) C3/9792: 4C979D JMP $9D97 (Remove item from inventory)
C3/9795 unknow
C3/9795: 202A9C JSR $9C2A (from C3/9707, C3/971F, C3/9758) C3/9798: 20419C JSR $9C41 C3/979B: A600 LDX $00 C3/979D: 9B TXY C3/979E: 7B TDC C3/979F: B96918 LDA $1869,Y (Load inventory item Y) C3/97A2: C9FF CMP #$FF (Is it the "empty" item?) C3/97A4: F022 BEQ $97C8 (If so, branch -> do the next item) C3/97A6: 202183 JSR $8321 (Otherwise, multiply index by 30) C3/97A9: AE3421 LDX $2134 (Let X get the result) C3/97AC: BF0050D8 LDA $D85000,X (Load item X type) C3/97B0: 2907 AND #$07 (Zero out the upper nibble) C3/97B2: C901 CMP #$01 (Is it a weapon [item type 1]?) C3/97B4: D012 BNE $97C8 (If not, branch -> do the next item) C3/97B6: C220 REP #$20 (16 bit memory/accum.) C3/97B8: BF0150D8 LDA $D85001,X (Load equippable chars for X) C3/97BC: 24E7 BIT $E7 C3/97BE: F008 BEQ $97C8 C3/97C0: E220 SEP #$20 (8 bit memory/accum.) C3/97C2: 98 TYA C3/97C3: 8D8021 STA $2180 C3/97C6: E6E0 INC $E0 C3/97C8: E220 SEP #$20 (8 bit memory/accum.) C3/97CA: C8 INY C3/97CB: C0FF00 CPY #$00FF C3/97CE: D0CE BNE $979E C3/97D0: A5E0 LDA $E0 C3/97D2: 8F899D7E STA $7E9D89 C3/97D6: 60 RTS
C3/97D7 unknow
C3/97D7: 202A9C JSR $9C2A C3/97DA: 20419C JSR $9C41 C3/97DD: A600 LDX $00 C3/97DF: 9B TXY C3/97E0: 7B TDC C3/97E1: B96918 LDA $1869,Y (Items currently in inventory) C3/97E4: C9FF CMP #$FF (Is it the "empty" item?) C3/97E6: F022 BEQ $980A C3/97E8: 202183 JSR $8321 (Multiplies the index by 30) C3/97EB: AE3421 LDX $2134 (Load X with the result) C3/97EE: BF0050D8 LDA $D85000,X (Load item type) C3/97F2: 2907 AND #$07 (Zero out the upper nibble) C3/97F4: C903 CMP #$03 (Is it a shield [item type 3]?) C3/97F6: D012 BNE $980A C3/97F8: C220 REP #$20 (16 bit memory/accum.) C3/97FA: BF0150D8 LDA $D85001,X (Load equippable chars for X) C3/97FE: 24E7 BIT $E7 C3/9800: F008 BEQ $980A C3/9802: E220 SEP #$20 (8 bit memory/accum.) C3/9804: 98 TYA C3/9805: 8D8021 STA $2180 C3/9808: E6E0 INC $E0 C3/980A: E220 SEP #$20 (8 bit memory/accum.) C3/980C: C8 INY C3/980D: C0FF00 CPY #$00FF C3/9810: D0CE BNE $97E0 C3/9812: A5E0 LDA $E0 C3/9814: 8F899D7E STA $7E9D89 C3/9818: 60 RTS
C3/9819 unknow
C3/9819: 5A PHY C3/981A: 8B PHB C3/981B: A97E LDA #$7E C3/981D: 48 PHA C3/981E: AB PLB C3/981F: 7B TDC (set all 16 bits of A to 0) C3/9820: A8 TAY (Y = 0) C3/9821: 7B TDC (...again?) C3/9822: AA TAX (X = 0) C3/9823: DA PHX (save X) C3/9824: 7B TDC (probably to clear the upper 8 bits on looping) C3/9825: B98A9D LDA $9D8A,Y (list of slots of items) C3/9828: AA TAX C3/9829: BD6918 LDA $1869,X (Items currently in inventory) C3/982C: FA PLX C3/982D: DFE482ED CMP $ED82E4,X (Items excluded from "Optimum" selection) C3/9831: F009 BEQ $983C (if item matched, branch to do something...) C3/9833: E8 INX C3/9834: E00A00 CPX #$000A (have we checked the 10 items to exclude?) C3/9837: D0EA BNE $9823 (branch if not) C3/9839: AB PLB C3/983A: 7A PLY C3/983B: 60 RTS C3/983C: C8 INY (increment Y, and that's it?) C3/983D: 80E2 BRA $9821 (branch and loop again)
C3/983F unknow
C3/983F: AF899D7E LDA $7E9D89 C3/9843: F03C BEQ $9881 (if 0, branch to equip nothing?) C3/9845: 85CB STA $CB C3/9847: 64CC STZ $CC C3/9849: 7B TDC (set all 16 bits of A to 0) C3/984A: A8 TAY (Y = 0) C3/984B: 7B TDC (...again?) C3/984C: AA TAX (X = 0) C3/984D: DA PHX (save X) C3/984E: 7B TDC (probably to clear the upper 8 bits on looping) C3/984F: BB TYX (transfer Y = 0 to X = 0...wait, although it has looping purposes) C3/9850: BF8A9D7E LDA $7E9D8A,X (if this is item slots, there's only 6, so I'm not sure what this is grabbing) C3/9854: AA TAX C3/9855: BD6918 LDA $1869,X (Items currently in inventory) C3/9858: FA PLX C3/9859: DFE482ED CMP $ED82E4,X (Items excluded from "Optimum" selection) C3/985D: F019 BEQ $9878 (if item matched, branch meaning to not equip it) C3/985F: E8 INX C3/9860: E00A00 CPX #$000A (have we checked the 10 items to exclude?) C3/9863: D0E8 BNE $984D (branch if not) C3/9865: 85C9 STA $C9 C3/9867: 202183 JSR $8321 (Multiplies A by 30) C3/986A: AE3421 LDX $2134 (Load X with the result) C3/986D: BF1350D8 LDA $D85013,X (Load weapon/item properties X) C3/9871: 2940 AND #$40 (does weapon have "2-handed" capability?) C3/9873: F003 BEQ $9878 (branch if not) C3/9875: A5C9 LDA $C9 C3/9877: 60 RTS
C3/9878 unknow
C3/9878: C8 INY (increment Y) C3/9879: C4CB CPY $CB (compare it to something...) C3/987B: D0CE BNE $984B (if they don't match, branch and continue) C3/987D: 201998 JSR $9819 (otherwise run the other "items excluded from optimum" routine) C3/9880: 60 RTS C3/9881: A9FF LDA #$FF C3/9883: 60 RTS
C3/9884 unknow
C3/9884: 20728E JSR $8E72 C3/9887: 207599 JSR $9975 C3/988A: A508 LDA $08 C3/988C: 8980 BIT #$80 (is A being pressed?) C3/988E: F024 BEQ $98B4 (branch if not, BPL...) C3/9890: 20B20E JSR $0EB2 (makes the click sound) C3/9893: A54E LDA $4E C3/9895: 855F STA $5F C3/9897: A957 LDA #$57 C3/9899: 8526 STA $26 C3/989B: 20599B JSR $9B59 C3/989E: 2050A1 JSR $A150 C3/98A1: 20EB9A JSR $9AEB C3/98A4: A955 LDA #$55 C3/98A6: 8527 STA $27 C3/98A8: 203392 JSR $9233 C3/98AB: 20156A JSR $6A15 C3/98AE: 206813 JSR $1368 (trigger NMI) C3/98B1: 4CAC9C JMP $9CAC
C3/98B4 unknow
C3/98B4: A509 LDA $09 C3/98B6: 8980 BIT #$80 (is B being pressed?) C3/98B8: F00E BEQ $98C8 (branch if not, BPL...) C3/98BA: 20A90E JSR $0EA9 C3/98BD: 20508E JSR $8E50 C3/98C0: 20598E JSR $8E59 C3/98C3: A936 LDA #$36 C3/98C5: 8526 STA $26 C3/98C7: 60 RTS
C3/98C8 unknow
C3/98C8: A97E LDA #$7E C3/98CA: 85E0 STA $E0 C3/98CC: 4C2220 JMP $2022
C3/98CF unknow
C3/98CF: 20728E JSR $8E72 C3/98D2: A508 LDA $08 C3/98D4: 8980 BIT #$80 (is A being pressed?) C3/98D6: F01C BEQ $98F4 (branch if not) C3/98D8: 20B20E JSR $0EB2 (makes the click sound) C3/98DB: 20F293 JSR $93F2 C3/98DE: C221 REP #$21 C3/98E0: 98 TYA C3/98E1: E220 SEP #$20 (8 bit memory/accum.) C3/98E3: 654B ADC $4B C3/98E5: A8 TAY C3/98E6: B91F00 LDA $001F,Y C3/98E9: 205E9D JSR $9D5E (Put item into inventory) C3/98EC: A9FF LDA #$FF C3/98EE: 991F00 STA $001F,Y C3/98F1: 201B91 JSR $911B C3/98F4: A509 LDA $09 C3/98F6: 8980 BIT #$80 (is B being pressed?) C3/98F8: F00E BEQ $9908 (branch if not) C3/98FA: 20A90E JSR $0EA9 C3/98FD: 20508E JSR $8E50 C3/9900: 20598E JSR $8E59 C3/9903: A936 LDA #$36 C3/9905: 8526 STA $26 C3/9907: 60 RTS
C3/9908 unknow
C3/9908: A97F LDA #$7F C3/990A: 85E0 STA $E0 C3/990C: 4C2220 JMP $2022
C3/990F unknow
C3/990F: 20D39A JSR $9AD3 C3/9912: 203392 JSR $9233 C3/9915: A508 LDA $08 C3/9917: 8980 BIT #$80 C3/9919: F029 BEQ $9944 C3/991B: 20429A JSR $9A42 C3/991E: 904E BCC $996E C3/9920: 20B20E JSR $0EB2 (makes the click sound) C3/9923: B91F00 LDA $001F,Y C3/9926: C9FF CMP #$FF C3/9928: F003 BEQ $992D C3/992A: 205E9D JSR $9D5E (Put item into inventory) C3/992D: 7B TDC C3/992E: A54B LDA $4B C3/9930: AA TAX C3/9931: BF8A9D7E LDA $7E9D8A,X C3/9935: AA TAX C3/9936: BD6918 LDA $1869,X (Items currently in inventory) C3/9939: 991F00 STA $001F,Y C3/993C: 20979D JSR $9D97 (Remove item from inventory) C3/993F: 201B91 JSR $911B C3/9942: 8009 BRA $994D
C3/9944 unknow
C3/9944: A509 LDA $09 C3/9946: 8980 BIT #$80 C3/9948: F023 BEQ $996D C3/994A: 20A90E JSR $0EA9 C3/994D: 20879C JSR $9C87 C3/9950: C220 REP #$20 (16 bit memory/accum.) C3/9952: A90001 LDA #$0100 C3/9955: 8FD09B7E STA $7E9BD0 C3/9959: E220 SEP #$20 (8 bit memory/accum.) C3/995B: A9C1 LDA #$C1 C3/995D: 1446 TRB $46 C3/995F: 206C8E JSR $8E6C C3/9962: A55F LDA $5F C3/9964: 854E STA $4E C3/9966: 20758E JSR $8E75 C3/9969: A955 LDA #$55 C3/996B: 8526 STA $26 C3/996D: 60 RTS
C3/996E unknow
C3/996E: 20C00E JSR $0EC0 (makes the buzzer sound) C3/9971: 205D30 JSR $305D C3/9974: 60 RTS
C3/9975 unknow
C3/9975: ADD811 LDA $11D8 C3/9978: 2908 AND #$08 (Is "attack with 2 hands" set for this?) C3/997A: F013 BEQ $998F (If not, branch) C3/997C: 20F293 JSR $93F2 C3/997F: B91F00 LDA $001F,Y (Check right hand) C3/9982: C9FF CMP #$FF (Is it the "empty" item?) C3/9984: F020 BEQ $99A6 (Branch if so) C3/9986: B92000 LDA $0020,Y (Check left hand) C3/9989: C9FF CMP #$FF (Is it the "empty" item?) C3/998B: F03D BEQ $99CA (Branch if so) C3/998D: 8000 BRA $998F (--this is a pointless branch--) (You reach this point if either: attack with 2 hands isn't set, both hands are empty, both hands have an item, or one of the hands' items lacks the 2-hand bit) C3/998F: A92C LDA #$2C C3/9991: 8529 STA $29 (set text color to blue) C3/9993: 209899 JSR $9998 C3/9996: 8007 BRA $999F C3/9998: A0BAA2 LDY #$A2BA C3/999B: 20F902 JSR $02F9 ("R-hand", also JMP fool!) C3/999E: 60 RTS C3/999F: A0C3A2 LDY #$A2C3 C3/99A2: 20F902 JSR $02F9 ("L-hand", also JMP fool!) C3/99A5: 60 RTS
C3/99A6 ckeck for left hand with 2-handed weapons
C3/99A6: B92000 LDA $0020,Y (Check left hand) C3/99A9: C9FF CMP #$FF (Is it the "empty" item?) C3/99AB: D002 BNE $99AF (Branch if not) C3/99AD: 80E0 BRA $998F (If it was, both hands are empty [note that these two lines could be optimized], so branch) C3/99AF: 202183 JSR $8321 (Multiplies A by 30) C3/99B2: AE3421 LDX $2134 (Load X with the result) C3/99B5: BF1350D8 LDA $D85013,X (Load weapon properties X) C3/99B9: 2940 AND #$40 (Check the "2-hand" bit) C3/99BB: F0D2 BEQ $998F (Branch if it's clear) C3/99BD: A924 LDA #$24 C3/99BF: 8529 STA $29 C3/99C1: 209899 JSR $9998 C3/99C4: A92C LDA #$2C C3/99C6: 8529 STA $29 C3/99C8: 80D5 BRA $999F
C3/99CA check for right hand with 2-handed weapons
C3/99CA: B91F00 LDA $001F,Y C3/99CD: 202183 JSR $8321 (Multiplies A by 30) C3/99D0: AE3421 LDX $2134 (Load X with the result) C3/99D3: BF1350D8 LDA $D85013,X (Load weapon properties X) C3/99D7: 2940 AND #$40 (Check the "2-hand" bit) C3/99D9: F0B4 BEQ $998F (Branch if it's clear) C3/99DB: A92C LDA #$2C C3/99DD: 8529 STA $29 C3/99DF: 209899 JSR $9998 C3/99E2: A924 LDA #$24 C3/99E4: 8529 STA $29 C3/99E6: 80B7 BRA $999F
C3/99E8 unknow
C3/99E8: 64CD STZ $CD C3/99EA: ADD811 LDA $11D8 C3/99ED: 2910 AND #$10 C3/99EF: F002 BEQ $99F3 C3/99F1: E6CD INC $CD C3/99F3: 64A1 STZ $A1 C3/99F5: ADD811 LDA $11D8 C3/99F8: 2908 AND #$08 C3/99FA: F010 BEQ $9A0C C3/99FC: B91F00 LDA $001F,Y C3/99FF: C9FF CMP #$FF C3/9A01: F00B BEQ $9A0E C3/9A03: B92000 LDA $0020,Y C3/9A06: C9FF CMP #$FF C3/9A08: F021 BEQ $9A2B C3/9A0A: 8000 BRA $9A0C C3/9A0C: 38 SEC C3/9A0D: 60 RTS
C3/9A0E unknow
C3/9A0E: B92000 LDA $0020,Y C3/9A11: C9FF CMP #$FF C3/9A13: D002 BNE $9A17 C3/9A15: 80F5 BRA $9A0C C3/9A17: 202183 JSR $8321 (Multiplies A by 30) C3/9A1A: AE3421 LDX $2134 (Load X with the result) C3/9A1D: BF1350D8 LDA $D85013,X (Load weapon/item properties X) C3/9A21: 2940 AND #$40 C3/9A23: F0E7 BEQ $9A0C C3/9A25: 18 CLC C3/9A26: A901 LDA #$01 C3/9A28: 85A1 STA $A1 C3/9A2A: 60 RTS
C3/9A2B unknow
C3/9A2B: B91F00 LDA $001F,Y C3/9A2E: 202183 JSR $8321 (Multiplies A by 30) C3/9A31: AE3421 LDX $2134 (Load X with the result) C3/9A34: BF1350D8 LDA $D85013,X (Load weapon/item properties X) C3/9A38: 2940 AND #$40 C3/9A3A: F0D0 BEQ $9A0C C3/9A3C: 18 CLC C3/9A3D: A901 LDA #$01 C3/9A3F: 85A1 STA $A1 C3/9A41: 60 RTS
C3/9A42 unknow
C3/9A42: 204A9A JSR $9A4A C3/9A45: 7B TDC C3/9A46: A54B LDA $4B C3/9A48: 800C BRA $9A56
C3/9A4A unknow
C3/9A4A: 20F293 JSR $93F2 C3/9A4D: C221 REP #$21 C3/9A4F: 98 TYA C3/9A50: E220 SEP #$20 (8 bit memory/accum.) C3/9A52: 655F ADC $5F C3/9A54: A8 TAY C3/9A55: 60 RTS
C3/9A56 unknow
C3/9A56: 5A PHY C3/9A57: AA TAX C3/9A58: BF8A9D7E LDA $7E9D8A,X C3/9A5C: AA TAX C3/9A5D: BD6918 LDA $1869,X (Get index of inventory item X) C3/9A60: 202183 JSR $8321 (Multiply the index by 30) C3/9A63: AE3421 LDX $2134 (Load X with the result) C3/9A66: BF0050D8 LDA $D85000,X (Load item type X) C3/9A6A: 2907 AND #$07 C3/9A6C: 85F6 STA $F6 C3/9A6E: 7A PLY C3/9A6F: A55F LDA $5F C3/9A71: C902 CMP #$02 C3/9A73: B05A BCS $9ACF C3/9A75: C901 CMP #$01 C3/9A77: F02C BEQ $9AA5 C3/9A79: B92000 LDA $0020,Y C3/9A7C: C9FF CMP #$FF C3/9A7E: F017 BEQ $9A97 C3/9A80: 202183 JSR $8321 (Multiply the index by 30) C3/9A83: AE3421 LDX $2134 (Load X with the result) C3/9A86: BF0050D8 LDA $D85000,X (Load item type X) C3/9A8A: 2907 AND #$07 (Zero out upper nibble) C3/9A8C: C903 CMP #$03 (Is it a shield? [Item type 3]) C3/9A8E: F009 BEQ $9A99 C3/9A90: ADD811 LDA $11D8 C3/9A93: 2910 AND #$10 C3/9A95: F002 BEQ $9A99 C3/9A97: 38 SEC C3/9A98: 60 RTS
C3/9A99 unknow
C3/9A99: BF0050D8 LDA $D85000,X (Load item type X) C3/9A9D: 2907 AND #$07 C3/9A9F: C5F6 CMP $F6 C3/9AA1: F02E BEQ $9AD1 C3/9AA3: 38 SEC C3/9AA4: 60 RTS
C3/9AA5 unknow
C3/9AA5: B91E00 LDA $001E,Y C3/9AA8: C9FF CMP #$FF C3/9AAA: F017 BEQ $9AC3 C3/9AAC: 202183 JSR $8321 (Multiply the index by 30) C3/9AAF: AE3421 LDX $2134 (Load X with the result) C3/9AB2: BF0050D8 LDA $D85000,X (Load item type X) C3/9AB6: 2907 AND #$07 (Zero out upper nibble) C3/9AB8: C903 CMP #$03 (Is it a shield? [Item type 3]) C3/9ABA: F009 BEQ $9AC5 C3/9ABC: ADD811 LDA $11D8 C3/9ABF: 2910 AND #$10 C3/9AC1: F002 BEQ $9AC5 C3/9AC3: 38 SEC C3/9AC4: 60 RTS
C3/9AC5 unknow
C3/9AC5: BF0050D8 LDA $D85000,X (Load item type X) C3/9AC9: 2907 AND #$07 C3/9ACB: C5F6 CMP $F6 C3/9ACD: F002 BEQ $9AD1 C3/9ACF: 38 SEC C3/9AD0: 60 RTS C3/9AD1: 18 CLC C3/9AD2: 60 RTS
C3/9AD3 unknow
C3/9AD3: AF899D7E LDA $7E9D89 C3/9AD7: C90A CMP #$0A C3/9AD9: B003 BCS $9ADE C3/9ADB: 4C9D8E JMP $8E9D
C3/9ADE unknow
C3/9ADE: A905 LDA #$05 C3/9AE0: 852A STA $2A C3/9AE2: 20641F JSR $1F64 C3/9AE5: B003 BCS $9AEA C3/9AE7: 4C8E8E JMP $8E8E C3/9AEA: 60 RTS
C3/9AEB unknow
C3/9AEB: AF899D7E LDA $7E9D89 C3/9AEF: F01B BEQ $9B0C C3/9AF1: C90A CMP #$0A C3/9AF3: B011 BCS $9B06 C3/9AF5: 20C49D JSR $9DC4 C3/9AF8: 644A STZ $4A C3/9AFA: 20978E JSR $8E97 C3/9AFD: AF899D7E LDA $7E9D89 C3/9B01: 8554 STA $54 C3/9B03: 4CA08E JMP $8EA0
C3/9B06 unknow
C3/9B06: 20C49D JSR $9DC4 C3/9B09: 200D9B JSR $9B0D C3/9B0C: 60 RTS
C3/9B0D unknow
C3/9B0D: 644A STZ $4A C3/9B0F: 203309 JSR $0933 (set arrow initial positions for equip screen) C3/9B12: C220 REP #$20 (16 bit memory/accum.) C3/9B14: A96000 LDA #$0060 C3/9B17: 9FCA347E STA $7E34CA,X C3/9B1B: A90060 LDA #$6000 C3/9B1E: 8D0442 STA $4204 C3/9B21: E220 SEP #$20 (8 bit memory/accum.) C3/9B23: AF899D7E LDA $7E9D89 C3/9B27: 38 SEC C3/9B28: E909 SBC #$09 C3/9B2A: 8D0642 STA $4206 C3/9B2D: EA NOP C3/9B2E: EA NOP C3/9B2F: EA NOP C3/9B30: EA NOP C3/9B31: EA NOP C3/9B32: C220 REP #$20 (16 bit memory/accum.) C3/9B34: AD1442 LDA $4214 C3/9B37: 9F4A357E STA $7E354A,X C3/9B3B: E220 SEP #$20 (8 bit memory/accum.) C3/9B3D: A400 LDY $00 C3/9B3F: 844F STY $4F C3/9B41: 20888E JSR $8E88 C3/9B44: 20918E JSR $8E91 C3/9B47: AF899D7E LDA $7E9D89 C3/9B4B: 38 SEC C3/9B4C: E909 SBC #$09 C3/9B4E: 855C STA $5C C3/9B50: A909 LDA #$09 C3/9B52: 855A STA $5A C3/9B54: A901 LDA #$01 C3/9B56: 855B STA $5B C3/9B58: 60 RTS
C3/9B59 unknow
C3/9B59: 202A9C JSR $9C2A C3/9B5C: 20419C JSR $9C41 (Setup equippability word) C3/9B5F: A920 LDA #$20 C3/9B61: 8529 STA $29 (set text color to white) C3/9B63: A54B LDA $4B (load something) C3/9B65: C902 CMP #$02 (is it a hat type?) C3/9B67: F049 BEQ $9BB2 (branch if so) C3/9B69: C903 CMP #$03 (is it body armor?) C3/9B6B: F002 BEQ $9B6F (branch if so) C3/9B6D: 8003 BRA $9B72 (otherwise, assume weapon?!) C3/9B6F: 4CEE9B JMP $9BEE
C3/9B72 discovery if weapon or shield is equippable
C3/9B72: A600 LDX $00 C3/9B74: 9B TXY C3/9B75: 7B TDC C3/9B76: B96918 LDA $1869,Y (Load inventory item Y) C3/9B79: C9FF CMP #$FF (Is it the "empty" item?) C3/9B7B: F026 BEQ $9BA3 (If so, branch -> do the next item) C3/9B7D: 202183 JSR $8321 (Otherwise, do this function (multiplies by 30)) C3/9B80: AE3421 LDX $2134 (Load X with the result of index * 30) C3/9B83: BF0050D8 LDA $D85000,X (Load item type X) C3/9B87: 2907 AND #$07 (Zero out the upper nibble) C3/9B89: C901 CMP #$01 (Is it a weapon [item type 1]?) C3/9B8B: F004 BEQ $9B91 (If so, branch -> check equippable chars) C3/9B8D: C903 CMP #$03 (Otherwise, is it a shield [item type 3]?) C3/9B8F: D012 BNE $9BA3 (If not, branch -> do the next item) C3/9B91: C220 REP #$20 (Ok, we have a weapon or shield, so set 16 bit memory/accum.) C3/9B93: BF0150D8 LDA $D85001,X (Load equippable chars for item X) C3/9B97: 24E7 BIT $E7 C3/9B99: F008 BEQ $9BA3 C3/9B9B: E220 SEP #$20 (8 bit memory/accum.) C3/9B9D: 98 TYA C3/9B9E: 8D8021 STA $2180 C3/9BA1: E6E0 INC $E0 C3/9BA3: E220 SEP #$20 (8 bit memory/accum.) C3/9BA5: C8 INY C3/9BA6: C0FF00 CPY #$00FF C3/9BA9: D0CA BNE $9B75 C3/9BAB: A5E0 LDA $E0 C3/9BAD: 8F899D7E STA $7E9D89 C3/9BB1: 60 RTS
C3/9BB2 get equippable chars for hat
C3/9BB2: A600 LDX $00 (Load X with $00) C3/9BB4: 9B TXY (Copy X to Y) C3/9BB5: 7B TDC (Clear A) C3/9BB6: B96918 LDA $1869,Y (Load inventory item Y) C3/9BB9: C9FF CMP #$FF (Is it the "empty" item?) C3/9BBB: F022 BEQ $9BDF (If so, branch -> do the next item) C3/9BBD: 202183 JSR $8321 (Otherwise, do this function (multiplies by 30)) C3/9BC0: AE3421 LDX $2134 (Load up X with the result [index * 30]) C3/9BC3: BF0050D8 LDA $D85000,X (Load item type X) C3/9BC7: 2907 AND #$07 (Zero out the upper nibble) C3/9BC9: C904 CMP #$04 (Is it a hat? [type 4 item]) C3/9BCB: D012 BNE $9BDF (If not, branch -> do the next item) C3/9BCD: C220 REP #$20 (16 bit memory/accum.) C3/9BCF: BF0150D8 LDA $D85001,X (Load equippable chars X) C3/9BD3: 24E7 BIT $E7 C3/9BD5: F008 BEQ $9BDF C3/9BD7: E220 SEP #$20 (8 bit memory/accum.) C3/9BD9: 98 TYA C3/9BDA: 8D8021 STA $2180 C3/9BDD: E6E0 INC $E0 C3/9BDF: E220 SEP #$20 (8 bit memory/accum.) C3/9BE1: C8 INY C3/9BE2: C0FF00 CPY #$00FF C3/9BE5: D0CE BNE $9BB5 C3/9BE7: A5E0 LDA $E0 C3/9BE9: 8F899D7E STA $7E9D89 C3/9BED: 60 RTS
C3/9BEE get equippable chars for armor
C3/9BEE: A600 LDX $00 (Load X with $00) C3/9BF0: 9B TXY (Copy X to Y) C3/9BF1: 7B TDC (Clear A) C3/9BF2: B96918 LDA $1869,Y (Load inventory item Y) C3/9BF5: C9FF CMP #$FF (Is it the "empty" item?) C3/9BF7: F022 BEQ $9C1B (If it is, branch -> do the next item) C3/9BF9: 202183 JSR $8321 (Else, multiply index by 30) C3/9BFC: AE3421 LDX $2134 (Get the result) C3/9BFF: BF0050D8 LDA $D85000,X (Load item type X) C3/9C03: 2907 AND #$07 (Zero out upper nibble) C3/9C05: C902 CMP #$02 (Is it an armor? [type 2 item]) C3/9C07: D012 BNE $9C1B (If not, branch -> do the next item) C3/9C09: C220 REP #$20 (16 bit memory/accum.) C3/9C0B: BF0150D8 LDA $D85001,X (Load equippable chars X) C3/9C0F: 24E7 BIT $E7 C3/9C11: F008 BEQ $9C1B C3/9C13: E220 SEP #$20 (8 bit memory/accum.) C3/9C15: 98 TYA C3/9C16: 8D8021 STA $2180 C3/9C19: E6E0 INC $E0 C3/9C1B: E220 SEP #$20 (8 bit memory/accum.) C3/9C1D: C8 INY C3/9C1E: C0FF00 CPY #$00FF C3/9C21: D0CE BNE $9BF1 C3/9C23: A5E0 LDA $E0 C3/9C25: 8F899D7E STA $7E9D89 C3/9C29: 60 RTS
C3/9C2A unknow
C3/9C2A: A600 LDX $00 C3/9C2C: A9FF LDA #$FF C3/9C2E: 9F8A9D7E STA $7E9D8A,X C3/9C32: E8 INX C3/9C33: E00900 CPX #$0009 C3/9C36: D0F6 BNE $9C2E (output nine FFs to the list. we'll default to those if there are no valid equipment options, or if all the valid equipment isn't compatible with Optimum [Atma Weapon is one example]. note that FF means we'll be using item *slot* #255, which SHOULD hold the Empty item #255.) (but there are ten items incompatible with Optimum.. why not output 11 FFs, you ask? my guess is that because 3 of the incompatible items are Helmets/Armor, we'll never be outputting more than 7 such items to a single list [that figure can be reached in the routine that outputs both Weapons and Shields to the list]. if 9+ pieces of equipment get output to this list, we'll lose our fallback FFhs. however, we don't care, because we'll also *know* that there are at least 2 pieces of equippable gear [9 - 7 = 2] compatible with Optimum.) C3/9C38: A28A9D LDX #$9D8A C3/9C3B: 8E8121 STX $2181 C3/9C3E: 64E0 STZ $E0 C3/9C40: 60 RTS
C3/9C41 setup equippability word
C3/9C41: 20F293 JSR $93F2 C3/9C44: 7B TDC C3/9C45: B90000 LDA $0000,Y (character ID) C3/9C48: 0A ASL A C3/9C49: AA TAX C3/9C4A: C220 REP #$20 (16 bit memory/accum.) C3/9C4C: BF679CC3 LDA $C39C67,X (A <- 2^X) C3/9C50: 85E7 STA $E7 (Store this value to $E7) C3/9C52: E220 SEP #$20 (8 bit memory/accum.) C3/9C54: ADD811 LDA $11D8 C3/9C57: 2920 AND #$20 (Check the "heavy equipment" bit) C3/9C59: F00B BEQ $9C66 (Exit if it's not set) C3/9C5B: C220 REP #$20 (16 bit memory/accum.) C3/9C5D: A5E7 LDA $E7 (Load $E7) C3/9C5F: 090080 ORA #$8000 (Set the high bit (heavy equipment bit)) C3/9C62: 85E7 STA $E7 (Update $E7) C3/9C64: E220 SEP #$20 (8 bit memory/accum.) C3/9C66: 60 RTS
C3/9C67 data
C3/9C67: 0100 C3/9C69: 0200 C3/9C6B: 0400 C3/9C6D: 0800 C3/9C6F: 1000 C3/9C71: 2000 C3/9C73: 4000 C3/9C75: 8000 C3/9C77: 0001 C3/9C79: 0002 C3/9C7B: 0004 C3/9C7D: 0008 C3/9C7F: 0010 C3/9C81: 0020 C3/9C83: 0040 C3/9C85: 0080
C3/9C87 clear out "preview" stats for equip screen
C3/9C87: 7B TDC (set A to 0) C3/9C88: AA TAX (set X to 0) C3/9C89: A00900 LDY #$0009 (9 stats to do) C3/9C8C: C220 REP #$20 (16 bit memory/accum.) C3/9C8E: 9FBF7C7E STA $7E7CBF,X (clear out hundreds digit) C3/9C92: E8 INX C3/9C93: E8 INX C3/9C94: 9FBF7C7E STA $7E7CBF,X (clear out tens digit) C3/9C98: E8 INX C3/9C99: E8 INX C3/9C9A: 9FBF7C7E STA $7E7CBF,X (clear out ones digit) C3/9C9E: E8 INX C3/9C9F: E8 INX C3/9CA0: 8A TXA C3/9CA1: 18 CLC C3/9CA2: 697A00 ADC #$007A (next row, after all of the increments 0x80 will have been added total) C3/9CA5: AA TAX C3/9CA6: 88 DEY C3/9CA7: D0E5 BNE $9C8E (branch if we haven't done all 9 stats) C3/9CA9: E220 SEP #$20 (8 bit memory/accum.) C3/9CAB: 60 RTS
C3/9CAC unknow
C3/9CAC: AF899D7E LDA $7E9D89 C3/9CB0: F02B BEQ $9CDD C3/9CB2: 20F783 JSR $83F7 C3/9CB5: 7B TDC C3/9CB6: AF899D7E LDA $7E9D89 C3/9CBA: C909 CMP #$09 C3/9CBC: 9002 BCC $9CC0 C3/9CBE: A909 LDA #$09 C3/9CC0: A8 TAY C3/9CC1: 5A PHY C3/9CC2: 20E29C JSR $9CE2 C3/9CC5: E6E5 INC $E5 C3/9CC7: A5E6 LDA $E6 C3/9CC9: 1A INC A C3/9CCA: 1A INC A C3/9CCB: 291F AND #$1F C3/9CCD: 85E6 STA $E6 C3/9CCF: 7A PLY C3/9CD0: 88 DEY C3/9CD1: D0EE BNE $9CC1 C3/9CD3: C220 REP #$20 (16 bit memory/accum.) C3/9CD5: 7B TDC C3/9CD6: 8FD09B7E STA $7E9BD0 C3/9CDA: E220 SEP #$20 (8 bit memory/accum.) C3/9CDC: 60 RTS C3/9CDD: A527 LDA $27 C3/9CDF: 8526 STA $26 C3/9CE1: 60 RTS
C3/9CE2 unknow
C3/9CE2: 204A9A JSR $9A4A C3/9CE5: 7B TDC C3/9CE6: A5E5 LDA $E5 C3/9CE8: 20569A JSR $9A56 C3/9CEB: B004 BCS $9CF1 C3/9CED: A928 LDA #$28 C3/9CEF: 8002 BRA $9CF3 C3/9CF1: A920 LDA #$20 C3/9CF3: 8529 STA $29 C3/9CF5: A5E6 LDA $E6 C3/9CF7: 1A INC A C3/9CF8: A20200 LDX #$0002 C3/9CFB: 209F80 JSR $809F C3/9CFE: C220 REP #$20 (16 bit memory/accum.) C3/9D00: 8A TXA C3/9D01: 8F899E7E STA $7E9E89 C3/9D05: E220 SEP #$20 (8 bit memory/accum.) C3/9D07: 7B TDC C3/9D08: A5E5 LDA $E5 C3/9D0A: A8 TAY C3/9D0B: 20119D JSR $9D11 C3/9D0E: 4CD97F JMP $7FD9
C3/9D11 unknow
C3/9D11: A28B9E LDX #$9E8B C3/9D14: 8E8121 STX $2181 C3/9D17: AD1242 LDA $4212 C3/9D1A: 2940 AND #$40 (are we in H-blank?) C3/9D1C: F0F9 BEQ $9D17 (branch if not) C3/9D1E: BB TYX C3/9D1F: 7B TDC C3/9D20: BF8A9D7E LDA $7E9D8A,X C3/9D24: A8 TAY C3/9D25: B96918 LDA $1869,Y (Items currently in inventory) C3/9D28: C9FF CMP #$FF (Is it the "empty" item?) C3/9D2A: F023 BEQ $9D4F C3/9D2C: 8D1B21 STA $211B C3/9D2F: 9C1B21 STZ $211B C3/9D32: A90D LDA #$0D C3/9D34: 8D1C21 STA $211C C3/9D37: 8D1C21 STA $211C C3/9D3A: AE3421 LDX $2134 C3/9D3D: A00D00 LDY #$000D (in equip screen, when manually equipping) C3/9D40: BF00B3D2 LDA $D2B300,X (item name) C3/9D44: 8D8021 STA $2180 C3/9D47: E8 INX C3/9D48: 88 DEY C3/9D49: D0F5 BNE $9D40 C3/9D4B: 9C8021 STZ $2180 (end this string) C3/9D4E: 60 RTS
C3/9D4F unknow
C3/9D4F: A00D00 LDY #$000D (write 13 blank spaces) C3/9D52: A9FF LDA #$FF C3/9D54: 8D8021 STA $2180 C3/9D57: 88 DEY C3/9D58: D0FA BNE $9D54 C3/9D5A: 9C8021 STZ $2180 (end this string) C3/9D5D: 60 RTS
C3/9D5E add item to inventory
C3/9D5E: 5A PHY C3/9D5F: 85E0 STA $E0 C3/9D61: A400 LDY $00 (Start at zeroth item) C3/9D63: D96918 CMP $1869,Y (Is it this same as an item currently in inventory?) C3/9D66: F022 BEQ $9D8A (If so, branch -> check quantity) C3/9D68: C9FF CMP #$FF (Is it the "empty" item?) C3/9D6A: F029 BEQ $9D95 (If so, branch -> exit) C3/9D6C: C8 INY (Move to the next index) C3/9D6D: C00001 CPY #$0100 (Is it 256 yet?) C3/9D70: D0F1 BNE $9D63 (If not, branch -> do the next item) C3/9D72: A400 LDY $00 (Otherwise, put 0 into Y to start anew) C3/9D74: B96918 LDA $1869,Y (Get this item, currently in inventory, that is correct) C3/9D77: C9FF CMP #$FF (Is it the "empty" item?) C3/9D79: F003 BEQ $9D7E (If so, we got a whole new item) C3/9D7B: C8 INY (Otherwise, increase the index) C3/9D7C: 80F6 BRA $9D74 (And always try again, since we were wrong) C3/9D7E: A901 LDA #$01 (Take a 1) C3/9D80: 996919 STA $1969,Y (And put it into the quantity of items) C3/9D83: A5E0 LDA $E0 C3/9D85: 996918 STA $1869,Y (Items currently in inventory) C3/9D88: 800B BRA $9D95 (Always exit) C3/9D8A: B96919 LDA $1969,Y (Get the quantity of this item) C3/9D8D: C963 CMP #$63 (Is it 99?) C3/9D8F: F004 BEQ $9D95 (If so, branch -> exit) C3/9D91: 1A INC A (Otherwise, increase it by 1) C3/9D92: 996919 STA $1969,Y (Overwrite quantity of items) C3/9D95: 7A PLY C3/9D96: 60 RTS
C3/9D97 remove item from inventory
C3/9D97: 5A PHY C3/9D98: 85E0 STA $E0 C3/9D9A: A400 LDY $00 (Start at zeroth item) C3/9D9C: D96918 CMP $1869,Y (Is this the item?) C3/9D9F: F008 BEQ $9DA9 (If it is, branch -> Decrememnt the quantity) C3/9DA1: C8 INY (Otherwise, go to the next item) C3/9DA2: C00001 CPY #$0100 (Is it 256 yet?) C3/9DA5: D0F5 BNE $9D9C (If not, branch -> do the next item) C3/9DA7: 7A PLY C3/9DA8: 60 RTS
C3/9DA9 decrease item quantity by one
C3/9DA9: B96919 LDA $1969,Y (Load the quantity of item) C3/9DAC: C901 CMP #$01 (Is it the last one?) C3/9DAE: F009 BEQ $9DB9 (If so, branch) C3/9DB0: B96919 LDA $1969,Y (Load quantity of item) C3/9DB3: 3A DEC A (Decrease it by one) C3/9DB4: 996919 STA $1969,Y (Store updated quantity of item) C3/9DB7: 8009 BRA $9DC2 (Branch to exit) C3/9DB9: 7B TDC (Set A to zero) C3/9DBA: 996919 STA $1969,Y (Store that as the updated quantity of item) C3/9DBD: A9FF LDA #$FF (Load the "empty" item) C3/9DBF: 996918 STA $1869,Y (Store it as an items currently in inventory) C3/9DC2: 7A PLY C3/9DC3: 60 RTS
C3/9DC4 unknow
C3/9DC4: A902 LDA #$02 C3/9DC6: A0DD9D LDY #$9DDD C3/9DC9: 207311 JSR $1173 (put C3/9DDD in the queue) C3/9DCC: C220 REP #$20 (16 bit memory/accum.) C3/9DCE: A555 LDA $55 C3/9DD0: 9FCA337E STA $7E33CA,X C3/9DD4: A557 LDA $57 C3/9DD6: 9F4A347E STA $7E344A,X C3/9DDA: E220 SEP #$20 (8 bit memory/accum.) C3/9DDC: 60 RTS
C3/9DDD code and jump table
C3/9DDD: AA TAX C3/9DDE: 7CE19D JMP ($9DE1,X) C3/9DE1: E59D C3/9DE3: 009E
C3/9DE5 unknow
C3/9DE5: A62D LDX $2D C3/9DE7: A901 LDA #$01 C3/9DE9: 0446 TSB $46 C3/9DEB: C220 REP #$20 (16 bit memory/accum.) C3/9DED: A98D08 LDA #$088D C3/9DF0: 9DC932 STA $32C9,X (save as pointer to OAM data) C3/9DF3: E220 SEP #$20 (8 bit memory/accum.) C3/9DF5: A9C3 LDA #$C3 C3/9DF7: 9DCA35 STA $35CA,X (save bank pointer to OAM data) C3/9DFA: 200612 JSR $1206 C3/9DFD: FE4936 INC $3649,X (execute the next entry in this queue's jump table) C3/9E00: A546 LDA $46 C3/9E02: 8901 BIT #$01 C3/9E04: F007 BEQ $9E0D C3/9E06: A62D LDX $2D C3/9E08: 202112 JSR $1221 (draw the sprites!) C3/9E0B: 38 SEC (not done with this queue yet) C3/9E0C: 60 RTS C3/9E0D: 18 CLC (this queue can be removed) C3/9E0E: 60 RTS
C3/9E0F unknow
C3/9E0F: 20239E JSR $9E23 C3/9E12: 8023 BRA $9E37 C3/9E14: 20379E JSR $9E37 C3/9E17: AD1E02 LDA $021E (load 0-60 frame count) C3/9E1A: 2901 AND #$01 (are we on an odd frame? LSR A...) C3/9E1C: F002 BEQ $9E20 (branch if not, BCC...) C3/9E1E: 8003 BRA $9E23 C3/9E20: 4C91A9 JMP $A991
C3/9E23 unknow
C3/9E23: A00040 LDY #$4000 C3/9E26: 841B STY $1B C3/9E28: A04978 LDY #$7849 C3/9E2B: 841D STY $1D C3/9E2D: A97E LDA #$7E C3/9E2F: 851F STA $1F C3/9E31: A08008 LDY #$0880 C3/9E34: 8419 STY $19 C3/9E36: 60 RTS
C3/9E37 unknow
C3/9E37: A00000 LDY #$0000 (LDY $00...) C3/9E3A: 8414 STY $14 C3/9E3C: A04938 LDY #$3849 C3/9E3F: 8416 STY $16 C3/9E41: A97E LDA #$7E C3/9E43: 8518 STA $18 C3/9E45: A00008 LDY #$0800 C3/9E48: 8412 STY $12 C3/9E4A: 60 RTS
C3/9E4B unknow
C3/9E4B: 20509E JSR $9E50 C3/9E4E: 801F BRA $9E6F
C3/9E50 unknow
C3/9E50: 202F35 JSR $352F (fade out screen, disable H/DMA) C3/9E53: 20086A JSR $6A08 C3/9E56: 644A STZ $4A C3/9E58: 6449 STZ $49 C3/9E5A: A910 LDA #$10 C3/9E5C: 0445 TSB $45 C3/9E5E: 6499 STZ $99 C3/9E60: 20991B JSR $1B99 C3/9E63: 20B694 JSR $94B6 C3/9E66: 20BD8E JSR $8EBD C3/9E69: 20C68E JSR $8EC6 C3/9E6C: 4CB007 JMP $07B0 (finger OAM initiating)
C3/9E6F unknow
C3/9E6F: 206A90 JSR $906A C3/9E72: A901 LDA #$01 C3/9E74: 8526 STA $26 C3/9E76: A959 LDA #$59 C3/9E78: 8527 STA $27 (queue up to execute at C3/9EB8) C3/9E7A: 4C4135 JMP $3541
C3/9E7D unknow
C3/9E7D: 20999E JSR $9E99 C3/9E80: 204F96 JSR $964F C3/9E83: 20A89E JSR $9EA8 C3/9E86: A95A LDA #$5A C3/9E88: 4CB39E JMP $9EB3 (BRA...)
C3/9E8B unknow
C3/9E8B: 20999E JSR $9E99 C3/9E8E: 205696 JSR $9656 C3/9E91: 20A89E JSR $9EA8 C3/9E94: A95C LDA #$5C C3/9E96: 4CB39E JMP $9EB3 (BRA...)
C3/9E99 unknow
C3/9E99: 20509E JSR $9E50 C3/9E9C: 206A90 JSR $906A C3/9E9F: 20379E JSR $9E37 C3/9EA2: 20239E JSR $9E23 C3/9EA5: 4C1496 JMP $9614
C3/9EA8 unknow
C3/9EA8: 20D58E JSR $8ED5 C3/9EAB: 20DE8E JSR $8EDE C3/9EAE: A901 LDA #$01 C3/9EB0: 8526 STA $26 C3/9EB2: 60 RTS
C3/9EB3 unknow
C3/9EB3: 8527 STA $27 C3/9EB5: 4C4135 JMP $3541
DP $26 is #$59 - "EQUIP REMOVE" in relic menu C3/9EB8: 20239E JSR $9E23 C3/9EBB: 200C96 JSR $960C C3/9EBE: 205C90 JSR $905C C3/9EC1: 20C38E JSR $8EC3 C3/9EC4: A508 LDA $08 C3/9EC6: 8980 BIT #$80 (is A being pressed?) C3/9EC8: F006 BEQ $9ED0 (branch if not) C3/9ECA: 20B20E JSR $0EB2 (makes the click sound) C3/9ECD: 4CCF9F JMP $9FCF
C3/9ED0 unknow
C3/9ED0: A509 LDA $09 C3/9ED2: 8980 BIT #$80 (is B being pressed?) C3/9ED4: F006 BEQ $9EDC (branch if not) C3/9ED6: 20A90E JSR $0EA9 C3/9ED9: 20EB9E JSR $9EEB C3/9EDC: 20E69E JSR $9EE6 C3/9EDF: A958 LDA #$58 C3/9EE1: 85E0 STA $E0 C3/9EE3: 4C2220 JMP $2022
C3/9EE6 unknow
C3/9EE6: A526 LDA $26 C3/9EE8: 85D1 STA $D1 C3/9EEA: 60 RTS
C3/9EEB unknow
C3/9EEB: 201091 JSR $9110 C3/9EEE: 20F293 JSR $93F2 C3/9EF1: B90000 LDA $0000,Y C3/9EF4: C90D CMP #$0D (Is it Umaro?) C3/9EF6: F007 BEQ $9EFF (branch if so) C3/9EF8: 205C9F JSR $9F5C C3/9EFB: A599 LDA $99 C3/9EFD: D007 BNE $9F06 C3/9EFF: A904 LDA #$04 C3/9F01: 8527 STA $27 (fade out) C3/9F03: 6426 STZ $26 (queue up to execute at C3/1A8A, initiate the main menu) C3/9F05: 60 RTS
C3/9F06 unknow
C3/9F06: A906 LDA #$06 C3/9F08: 1446 TRB $46 C3/9F0A: 20379E JSR $9E37 C3/9F0D: 20239E JSR $9E23 C3/9F10: 201C9F JSR $9F1C C3/9F13: A9F0 LDA #$F0 C3/9F15: 8522 STA $22 C3/9F17: A96C LDA #$6C C3/9F19: 8526 STA $26 (queue up to execute at C3/9FB1) C3/9F1B: 60 RTS
C3/9F1C unknow
C3/9F1C: 205D96 JSR $965D C3/9F1F: A00FA4 LDY #$A40F C3/9F22: 20F902 JSR $02F9 ("Equipment changed") C3/9F25: AD4E1D LDA $1D4E C3/9F28: 2910 AND #$10 C3/9F2A: F018 BEQ $9F44 C3/9F2C: A96E LDA #$6E C3/9F2E: 8527 STA $27 C3/9F30: A5D1 LDA $D1 C3/9F32: C959 CMP #$59 C3/9F34: F007 BEQ $9F3D ("Empty"'s position is different based on the branch) C3/9F36: A0FDA3 LDY #$A3FD C3/9F39: 20F902 JSR $02F9 ("Empty") C3/9F3C: 60 RTS
C3/9F3D unknow
C3/9F3D: A0EBA3 LDY #$A3EB C3/9F40: 20F902 JSR $02F9 ("Empty") C3/9F43: 60 RTS
C3/9F44 unknow
C3/9F44: A96D LDA #$6D C3/9F46: 8527 STA $27 C3/9F48: A5D1 LDA $D1 C3/9F4A: C959 CMP #$59 C3/9F4C: F007 BEQ $9F55 ("Optimum"'s position is different based on the branch) C3/9F4E: A005A4 LDY #$A405 C3/9F51: 20F902 JSR $02F9 ("Optimum") C3/9F54: 60 RTS
C3/9F55 unknow
C3/9F55: A0F3A3 LDY #$A3F3 C3/9F58: 20F902 JSR $02F9 ("Optimum") C3/9F5B: 60 RTS
C3/9F5C unknow
C3/9F5C: 20F293 JSR $93F2 C3/9F5F: B92300 LDA $0023,Y (load accessory slot 1) C3/9F62: C5B0 CMP $B0 C3/9F64: D009 BNE $9F6F C3/9F66: B92400 LDA $0024,Y (load accessory slot 2) C3/9F69: C5B1 CMP $B1 C3/9F6B: D002 BNE $9F6F C3/9F6D: 803A BRA $9FA9 C3/9F6F: A5B0 LDA $B0 C3/9F71: C9D1 CMP #$D1 (is it the Genji Glove?) C3/9F73: F037 BEQ $9FAC (branch if so) C3/9F75: C9D0 CMP #$D0 (is it the Gauntlet?) C3/9F77: F033 BEQ $9FAC (branch if so) C3/9F79: C9DA CMP #$DA (is it the Merit Award?) C3/9F7B: F02F BEQ $9FAC (branch if so) C3/9F7D: A5B1 LDA $B1 C3/9F7F: C9D1 CMP #$D1 (is it the Genji Glove?) C3/9F81: F029 BEQ $9FAC (branch if so) C3/9F83: C9D0 CMP #$D0 (is it the Gauntlet?) C3/9F85: F025 BEQ $9FAC (branch if so) C3/9F87: C9DA CMP #$DA (is it the Merit Award?) C3/9F89: F021 BEQ $9FAC (branch if so) C3/9F8B: B92300 LDA $0023,Y (load accessory slot 1) C3/9F8E: C9D1 CMP #$D1 (is it the Genji Glove?) C3/9F90: F01A BEQ $9FAC (branch if so) C3/9F92: C9D0 CMP #$D0 (is it the Gauntlet?) C3/9F94: F016 BEQ $9FAC (branch if so) C3/9F96: C9DA CMP #$DA (is it the Merit Award?) C3/9F98: F012 BEQ $9FAC (branch if so) C3/9F9A: B92400 LDA $0024,Y (load accessory slot 2) C3/9F9D: C9D1 CMP #$D1 (is it the Genji Glove?) C3/9F9F: F00B BEQ $9FAC (branch if so) C3/9FA1: C9D0 CMP #$D0 (is it the Gauntlet?) C3/9FA3: F007 BEQ $9FAC (branch if so) C3/9FA5: C9DA CMP #$DA (is it the Merit Award?) C3/9FA7: F003 BEQ $9FAC (branch if so) C3/9FA9: 6499 STZ $99 C3/9FAB: 60 RTS
C3/9FAC unknow
C3/9FAC: A901 LDA #$01 C3/9FAE: 8599 STA $99 C3/9FB0: 60 RTS
C3/9FB1 unknow
C3/9FB1: A522 LDA $22 C3/9FB3: D003 BNE $9FB8 C3/9FB5: 6426 STZ $26 C3/9FB7: 60 RTS
C3/9FB8 unknow
C3/9FB8: C622 DEC $22 C3/9FBA: A508 LDA $08 C3/9FBC: 8910 BIT #$10 C3/9FBE: D00C BNE $9FCC C3/9FC0: A508 LDA $08 C3/9FC2: 8920 BIT #$20 C3/9FC4: D006 BNE $9FCC C3/9FC6: A509 LDA $09 C3/9FC8: 8980 BIT #$80 (is B being pressed?) C3/9FCA: F002 BEQ $9FCE (branch if not) C3/9FCC: 6426 STZ $26 C3/9FCE: 60 RTS
C3/9FCF code and jump table
C3/9FCF: 7B TDC C3/9FD0: A54B LDA $4B C3/9FD2: 0A ASL A C3/9FD3: AA TAX C3/9FD4: 7CD79F JMP ($9FD7,X) C3/9FD7: DB9F C3/9FD9: EC9F
C3/9FDB unknow
C3/9FDB: 201496 JSR $9614 C3/9FDE: 204F96 JSR $964F C3/9FE1: 20D58E JSR $8ED5 C3/9FE4: 20DE8E JSR $8EDE C3/9FE7: A95A LDA #$5A C3/9FE9: 8526 STA $26 C3/9FEB: 60 RTS
C3/9FEC unknow
C3/9FEC: 201496 JSR $9614 C3/9FEF: 205696 JSR $9656 C3/9FF2: 20D58E JSR $8ED5 C3/9FF5: 20DE8E JSR $8EDE C3/9FF8: A95C LDA #$5C C3/9FFA: 8526 STA $26 C3/9FFC: 60 RTS