Advertisement
glokyfull

roling dot explanation

Feb 19th, 2023
2,409
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. the main algorithm is for displaying at any xStart,yStart in the screen a group of constant point of relative coordinate x,y
  2. on stf
  3. for exemple a circle of dot because i have no imagination
  4.  
  5.  
  6.  
  7. supose you have a set of constant relative x and y
  8. defining an image of dots
  9. after converting x and y to a liste of offset,shift
  10. group them by shift
  11. and do a generated code which is like:
  12.  
  13. ; d0=1
  14. ; GROUP OF BIT 0
  15. OR.W D0,OFFSET(A0)
  16. ...
  17. ADD D0,D0  ; D0 = 2
  18. ; GROUP OF BIT 1
  19. SERIE OF OR.W D0,DEP(A0)
  20.  
  21. REPEATING THIS UNTIL THE GROUP OF BIT 15
  22. END WITH ADD d0,D0 EVEN THERE IS NO OTHER GROUP
  23. AND A RTS
  24. NOW WHEN WE CALL THE GENERATED CODE WITH D0=1 AND A0=SCREEN ADRESS
  25. WE HAVE AT SET OF POINT IN X+0,y+0 since a0 is the start of the screen
  26.  
  27. at this stade we could call the genreated code with any screen+offset
  28. that mean we can move by 160 along the y axis and in x multiple of 16
  29.  
  30. now let's imagine there is no bit 15 14 13 in the offset of the relative x,y
  31. if we start instead with d0=2 then the same amount of dot are displayed on one shift to the left
  32. and since there is no bit 13 14 15 we could also start the routine with d0=4 and d0=8
  33. that's a begining
  34. we can not displaying all the shift and there is severe limitation
  35.  
  36. so if i want to start at bit 5 shift
  37.  
  38. move.w #2=64,d0
  39.  
  40. for the group of bit 0 to 15-5 there is no problem, the pixel are at good position when shifted
  41. so we catch the begining of the group of bit 10
  42. that is not represented in the offset(a0)
  43. and put in offset-8(a0) with a start value of d0 at 1 again (and d0 is 0 at end so you have to set it to 1)
  44. till the end of the rout (rts)
  45.  
  46.  
  47. so, we need at the light of this explanation (well i hope i'm understood)
  48. 16 adresse witch represent each group of bit 0 to 15
  49. to put at (x=0+k*16),y just call the first adress and set d0=1 and off course the absoluteX and absoluteY
  50. converted to acording offset added to a0
  51.  
  52.  
  53. to put at whatever x mod 16 !=0
  54. start with d0 according to shift
  55. but before
  56. we must automofified the code genere to end just before d0 reach 0 (with 32768+32768=0 on word)
  57.  
  58. the (16-x%16)th adress is the end of the first call and the start of the second call with a0=a0-8
  59. and d0=1 again
  60. now there is soup like restore instruction set a call
  61. i use a4 that i set adress acordingly each time with  lea dep(a4),a4
  62.  
  63. this is much faster than jsr rts and also i have not invented this famous optimisation
  64.  
  65. ps: the first version i work use the inverse direction and used lsr #1,d0 instead of add dn,dn
  66. i redo a version with add witch was more speed (1 nop per add)
  67.  
  68.  
  69. soon some listing, i wrote the upper text by memory sorry if there is minor error like it would be
  70. (15-x%16)th adress or whatever
  71. the principle is here
  72.  
  73.  
  74. soon some listing ,but not today because i can't find them for the moment
  75.  
  76. signed: Gloky of atari scene
  77.  
  78. 20 feb 2023
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement