Advertisement
Nightseeker

Sonic 1 prototype collision source code fragment

Apr 10th, 2020
1,718
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; https://tcrf.net/Prerelease:Sonic_the_Hedgehog_(Genesis)#Sonic_initial_development_site.Sega_R.26D_news_footage_of_Feb_1990.
  2.  
  3.     cd_walk equ 0*2
  4.  
  5.     cd_jump equ 1*2
  6.  
  7.     cd_up equ 2*2
  8.  
  9.     cd_down equ 3*2
  10.  
  11. updotmax equ -4 downdotmax equ 4 jumpdotmax equ 8
  12.  
  13. sprvo equ $1c
  14. sprho equ $1d
  15. sprvs equ $1e
  16. sprhs equ $1f
  17. ------------------------------------------------------------------------
  18. foot colition
  19. col
  20.  
  21. move.w yposi(a0),d4 move.b sprvo(a0),d1 add.b sprvs(a0),d1 ext.w d1 add.w d1,d4 move.w xposi(a0),d5 move.b sprho(a0),d1 ext.w d1 add.w d1,d5 move.w xspeed(a0),scrhithz ?loop: move.w d4,d2 move.w d5,d3 moveq #0,d0 move.b sprhs(a0),d0 tst.w xspeed(a0) bpl.b ?jump
  22.  
  23.     btst.b #cd_right,cddot(a0)
  24.     beq.b ?jump
  25.  
  26. neg.w d0 ?jump: add.w d0,d3 bsr.w scdchk tst.w d1 beq.b ?end bpl.b ?down ?up: cmp.w #updotmax,d1 blt.b ?nomove add.w d1,yposi(a0) ?end: rts ?nomove: bsr.b hoseihsub bra.b ?loop move.w #0,xspeed(a0) rts ?down: move.w d1,d6 swap d6 ?down2: move.w d4,d2 move.w d6,d3 moveq #0,d0 move.b sprhs(a0),d0 tst.w xspeed(a0) bpl.b ?jump3
  27.  
  28.     btst #cd_left,cddot(a0)
  29.     bne.s ?jump3
  30.  
  31. neg.w d0 ?jump3: add.w d0,d3 bsr.w scdchk tst.w d1 beq.b ?end2 bpl.b ?down1 ?up2: cmp.w #updotmax,d1 blt.b ?nomove2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement