Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- the main algorithm is for displaying at any xStart,yStart in the screen a group of constant point of relative coordinate x,y
- on stf
- for exemple a circle of dot because i have no imagination
- supose you have a set of constant relative x and y
- defining an image of dots
- after converting x and y to a liste of offset,shift
- group them by shift
- and do a generated code which is like:
- ; d0=1
- ; GROUP OF BIT 0
- OR.W D0,OFFSET(A0)
- ...
- ADD D0,D0 ; D0 = 2
- ; GROUP OF BIT 1
- SERIE OF OR.W D0,DEP(A0)
- REPEATING THIS UNTIL THE GROUP OF BIT 15
- END WITH ADD d0,D0 EVEN THERE IS NO OTHER GROUP
- AND A RTS
- NOW WHEN WE CALL THE GENERATED CODE WITH D0=1 AND A0=SCREEN ADRESS
- WE HAVE AT SET OF POINT IN X+0,y+0 since a0 is the start of the screen
- at this stade we could call the genreated code with any screen+offset
- that mean we can move by 160 along the y axis and in x multiple of 16
- now let's imagine there is no bit 15 14 13 in the offset of the relative x,y
- if we start instead with d0=2 then the same amount of dot are displayed on one shift to the left
- and since there is no bit 13 14 15 we could also start the routine with d0=4 and d0=8
- that's a begining
- we can not displaying all the shift and there is severe limitation
- so if i want to start at bit 5 shift
- move.w #2⁵=64,d0
- for the group of bit 0 to 15-5 there is no problem, the pixel are at good position when shifted
- so we catch the begining of the group of bit 10
- that is not represented in the offset(a0)
- 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)
- till the end of the rout (rts)
- so, we need at the light of this explanation (well i hope i'm understood)
- 16 adresse witch represent each group of bit 0 to 15
- to put at (x=0+k*16),y just call the first adress and set d0=1 and off course the absoluteX and absoluteY
- converted to acording offset added to a0
- to put at whatever x mod 16 !=0
- start with d0 according to shift
- but before
- we must automofified the code genere to end just before d0 reach 0 (with 32768+32768=0 on word)
- the (16-x%16)th adress is the end of the first call and the start of the second call with a0=a0-8
- and d0=1 again
- now there is soup like restore instruction set a call
- i use a4 that i set adress acordingly each time with lea dep(a4),a4
- this is much faster than jsr rts and also i have not invented this famous optimisation
- ps: the first version i work use the inverse direction and used lsr #1,d0 instead of add dn,dn
- i redo a version with add witch was more speed (1 nop per add)
- soon some listing, i wrote the upper text by memory sorry if there is minor error like it would be
- (15-x%16)th adress or whatever
- the principle is here
- soon some listing ,but not today because i can't find them for the moment
- signed: Gloky of atari scene
- 20 feb 2023
Advertisement
Advertisement