18 users online:  Alex, AppleBoy54321, BeyondJon, brickblock369, DanMario24YT, Easy Difficulty, Firstnamebutt, Fullcannon, Green, h.carrell, Humpty Dumpty Magazine,  idol, MrInfinite, NGB, Oskise, Skye, Sonikado br1500, Soul - Guests: 89 - Bots: 193
Users: 62,720 (2,509 active)
Latest user: Wasthistaken2

$00D2CD - Calculation of index

CODE_00D76B:        AD E1 13      LDA.W $13E1               ;>Slope status
CODE_00D76E: 4A LSR ;>Adjust it (right shift)
CODE_00D76F: A8 TAY ;>Transfer shifted slope into Y
CODE_00D770: 4A LSR ;>a double-right shift
CODE_00D771: AA TAX ;>Into X
CODE_00D772: A5 7B LDA RAM_MarioSpeedX ;\Player moves by slope
CODE_00D774: 38 SEC ;|
CODE_00D775: FD CA D5 SBC.W DATA_00D5CA,X ;|
CODE_00D778: 10 02 BPL CODE_00D77C ;/>if positive, thats normal value
CODE_00D77A: C8 INY ;\Adjust part of the slope index
CODE_00D77B: C8 INY ;/
CODE_00D77C: AD 93 14 LDA.W $1493 ;>If completing a level
CODE_00D77F: 05 72 ORA RAM_IsFlying ;>Or if in midair
CODE_00D781: C2 20 REP #$20 ; Accum (16 bit)
CODE_00D783: D0 07 BNE CODE_00D78C ;>Go somewhere else
CODE_00D785: B9 09 D3 LDA.W DATA_00D309,Y ;>Load data based on slope
CODE_00D788: 24 85 BIT RAM_IsWaterLevel ;\Check negative flag of water flag
CODE_00D78A: 30 03 BMI CODE_00D78F ;/
CODE_00D78C: B9 CD D2 LDA.W DATA_00D2CD,Y ;\Decelerate mario's x speed (happens by
CODE_00D78F: 18 CLC ;|being on ground, pressing left or right
CODE_00D790: 65 7A ADC $7A ;|while going faster than max x speeds (both walk and run)
CODE_00D792: 85 7A STA $7A ;/in midair)
CODE_00D794: 38 SEC ;\
CODE_00D795: FD C9 D5 SBC.W DATA_00D5C9,X ;>autoslide slope speeds
CODE_00D798: 59 CD D2 EOR.W DATA_00D2CD,Y ;>Decelerate x speeds
CODE_00D79B: 30 05 BMI CODE_00D7A2 ;>If negative, don't set x speed at all (leave it be).
CODE_00D79D: BD C9 D5 LDA.W DATA_00D5C9,X ;>autoslide slope speeds
CODE_00D7A0: 85 7A STA $7A ;>Set speed
CODE_00D7A2: E2 20 SEP #$20 ; Accum (8 bit)
Return00D7A4: 60 RTS ; Return