From a59424b3ef6aa9280a5b8148bab0ffc77223dcaf Mon Sep 17 00:00:00 2001 From: Trevor Maze Date: Wed, 18 Feb 2026 16:56:16 -0500 Subject: [PATCH] Movement refactor --- plat.nes | Bin 40976 -> 40976 bytes plat.s | 67 +++++++++++++++++++++++++++++++------------------------ 2 files changed, 38 insertions(+), 29 deletions(-) diff --git a/plat.nes b/plat.nes index 83a1aff34be236ea499138421b1b7cef0a852a15..b3b2a42a6366353371ca9beeae53326afe5224eb 100644 GIT binary patch delta 607 zcmbPmfN8=3rVW;i+8yn48CYICP?+#lA);B~W5Y^^R-snml?<&it+EO)8rL!@ER~VS zWNejDm^(Rz@ksssmXi!0IF|}=Hna-(=r%1C(5!D2Sj3>P2_!DCh;gZ4D<4qsU#q}U znN~T4?I2-Mkg(@}kTF0xPDY5_1I7Q=xFEljPqQAVRvbt-T;N*DXYo>? zmCt8F(^5W(Odw0)704t$fu+(X89#8W{MpJ6G+$QX)#SxY%Jmu`%@SEqn99`()UV0k zDlU=Aqsf1iM}T!1*NZkTAL(YGu~`r(!Px*)=gALrnI=C}u>tcku2W0-Pcj(rD|~BF zU}#fV-m2i&>SNOkB%$1IEeR)2OyB^96938*t=yA+nVp^LTO?9NR_%>xTg0l6*s^M` zPkS%B!d_nxnX&4{1Az?Ql$;MP3?$C8h;gZ4D<4qsU#oz^ zYLE~gNC>DHD9Fj!D)4~ugW^&dO~#W97bI6Q9Oe5UEWovt&*G&(8=p^2(^5W(Oo3KD zg?nI~OQlaTe&AU7vz31-$T9a?TBVmx-pwRmuey{^vp^yX0$U}3JpNX3iBuj<{-Zns ztjoAwv~l@xG$SkW{15U2SfwXFkg3TJRc-)OeyWXYDVId5L@U=){*w#_{0gsH6uz`7 z%x+b1YV|Q_29i+jtCob5Cnj)A4rKOrDsGWT6 0, decrement - bpl :+ + lda player_vel_x + and #%10000000 + ; If player_vel_x positive, decrement + bne :+ lda player_vel_x sec sbc #16 - stx player_vel_x + sta player_vel_x jmp @end : ; Else if player_vel_x < 0, increment @@ -603,7 +617,7 @@ movement: bne :+ ; 0: right lda player_vel_x - and #%01110000 + and #%01111111 clc ror clc @@ -612,7 +626,9 @@ movement: ror clc ror - sta var_n ; pixels + clc + adc player_pos_x + sta player_pos_x ; add pixels lda player_vel_x and #%00001111 @@ -633,19 +649,19 @@ movement: : ; 1: left lda player_vel_x - and #%01110000 - clc + sec + ror + sec + ror + sec + ror + sec ror clc - ror - clc - ror - clc - ror - eor #%11111111 - clc - adc #1 - sta var_n ; pixels + ora #%10000000 + adc player_pos_x + sta player_pos_x ; add pixels + lda player_vel_x and #%00001111 @@ -662,17 +678,10 @@ movement: bmi @end_sub_subpos ; so skip if subpos is bigger than result ldx player_pos_x dex - stx player_pos_x + ;stx player_pos_x @end_sub_subpos: : - lda player_pos_x - clc - adc var_n ; add pixels - - - sta player_pos_x - ; load x pos, filter blocks, check up and down