Advertisement
Guest User

1st Anniversary of Lazy Bones

a guest
Feb 7th, 2024
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.63 KB | None | 0 0
  1. This text is written on 28th of April 1994,
  2. 1st Anniversary of Lazy Bones
  3. GOOD NEWS, BAD NEWS
  4.  
  5. 0. Who am I?
  6.  
  7. My name is Coyote and I'm from Lazy Bones. Yes, a Scene member!
  8.  
  9. 1. What is this text about?
  10.  
  11. Well I have discovered some undocumented features of Amiga
  12. hardware. I have an Amiga 500 with ECS Agnus and standard Denise, but one
  13. of these discoveries I checked on ECS Denise and it behaved the same as on
  14. the standard one.
  15.  
  16. Both features I found out almost a year ago, but I haven't spread
  17. the word about it 'cause I thought that someone has already reported these,
  18. should I say bugs, and I didn't want to bore you. Well, after a short
  19. period of searching and inquiring about that kind of information I
  20. concluded that there is possibility that noone has noticed Amiga's strange
  21. behavior. So here are the good and the bad news.
  22.  
  23. 2. Good news :)
  24.  
  25. I discovered this after my search through copper lists on AGA
  26. machine for a proper way of setting colors from 24 bit palette. At that
  27. time I had no knowledge about AGA registers and when I saw that some
  28. registers are among unused registers on standard Amiga I was overcomed with
  29. feeling that there are some 'weird' graphics modes or whatsoever, even on
  30. my standard Denise.
  31.  
  32. Well, I was right ! :D
  33.  
  34. Before I start explaining what I've discovered I must say some
  35. facts. This discovery happened in may 1993 with simple filling Denise
  36. registers and watching the results. It is tested on ECS Denise and it
  37. works fine.
  38.  
  39. Finaly, here it is:
  40.  
  41. When you fill register $dff100 with value which has the number of
  42. bitplanes specified as 7 (lo-res) something strange is going on. On screen
  43. you will notice only 4 bitplanes but further checking has revealed to me
  44. that there are still some differences from usual 4 bitplane mode.
  45.  
  46. When 7 bitplanes are 'opened' color index is 6 bit wide. (It would
  47. be better to say 5 bit wide with halfbright enabled.) First 4 bits of color
  48. index is fetched from BPL1DAT-BPL4DAT ($110 through $116) registers which
  49. are filled through DMA channels. 5th and 6th bit of color index is taken
  50. from BPL5DAT and BPL6DAT which are NOT disturbed by DMA. In other words,
  51. you can put in, i.e. BPL5DAT value $aaaa and you will get at odd pixels on
  52. screen color which is indexed as $10 trough $1f. (Same is with BPL6DAT,
  53. value $aaaa would give you halfbright odd pixels.)
  54.  
  55. The benefit of this is accesing of all colors ($00-$1f) without
  56. loosing speed of copper. Okay, okay, this is maybe not so worth to use
  57. except in 4x4 pixel 4096 color rotators where you can now have 31 instead
  58. 30 colors for columns. Now, you may ask why is my 4096 color rotator in
  59. "B2" (Lazy Bones) using columns of color $01-$0f and non DMA sprites for
  60. columns of color $11-1f. That was before I was sure that this 'trick' with
  61. 7 bitplanes will work on ECS Denise.
  62.  
  63. 3. Bad news :(
  64.  
  65. This information already know some my friends. I told one of them
  66. to put it on some BBS but I don't know if he did it.
  67.  
  68. Prepare yourself to hear some unpleasant bug !
  69.  
  70. This Amiga bug gave me almost whole day of debugging while I was
  71. coding B2. When I explain you how I got in chance to discover it you will
  72. say that I should not code that way, but...
  73.  
  74. I almost always start copper (or change copper lists) with
  75. strobing. I know that its enough to fill COP1LC, and copper will in next
  76. frame execute requested list, but I like to start copper list IN frame, not
  77. in a frame before.
  78.  
  79. Well, in one routine everything was going fine for some time but
  80. then something disturbed copper list. I found out that blitter was writing
  81. over my copper list, and spend quite a time debugging.
  82.  
  83. Finaly I concluded that blitter is changing its destination address
  84. in the middle of the 'blitting'. But I always properly wait for one blit
  85. to end before I start another. What it could be ?
  86.  
  87. As I mentioned before I strobed copper in vertical blank interrupt
  88. to change the screens. Because my routine was longer then 1 frame I put it
  89. in main program and I worked with 3 screens. When I finished one screen I
  90. set my own 'request flag' to tell to interrupt routine that it's time to
  91. change screen. Right after setting flag I started blitter to clear the 3rd
  92. screen. While blitter was bussy vb interrupt happened and routine had
  93. strobed copper to another list.
  94.  
  95. BLITTER THEN CHANGED ITS DESTINATION ADDRESS TO ADDRESS WHICH WAS
  96. IN COP1LC !!!!!
  97.  
  98. I tested this only on few Amigas with Fat Agnus,so I do not know
  99. does Agnus on Amiga 1.2 also have this bug.
  100.  
  101. Hey, you guys with Amiga 1200, try this program... I would really
  102. want to know does the new Amiga act the same.
  103.  
  104. Fortunatly, this bug is not always active.
  105.  
  106. If you are interested look at following program, and read the text
  107. after it.
  108.  
  109.  
  110. run:
  111. lea $dff000,a5
  112. move.w #$7fff,$9a(a5) ;disable interrupts
  113. move.w #$7fff,$96(a5) ;disable DMA channels
  114.  
  115. move.l #copper_list,$80(a5)
  116. move.w #$0000,$88(a5)
  117. move.w #$82c0,$96(a5) ;cop and blt DMA enabled
  118.  
  119. move.l #$01f00000,$40(a5) ;D = A
  120. move.l #$ffffffff,$44(a5)
  121. move.l #$0000,$64(a5)
  122. move.l #blitter,$54(a5)
  123. move.w #$c0de,$74(a5) ;BLTADAT = $c0de
  124. move.w #$1000,$58(a5) ;fill $1000 words
  125.  
  126. REPT 100
  127. move.w #$0000,$88(a5)
  128. ENDR
  129. bltwait:
  130. btst #$06,$002(a5)
  131. bne.s bltwait
  132. illegal ;****ENABLE RESCUE IN YOUR ASSEMBLER****
  133.  
  134. org $50000
  135. copper_list:
  136. dc.w $ffff,$fffe
  137. ; dc.w $0088,$0000 ;read the text below for explanation
  138.  
  139. blk.w $fffc,0
  140.  
  141. org $60000
  142. blitter:
  143. blk.w $1000,0
  144.  
  145. REM
  146. This is proof for those who does not believe it !!
  147.  
  148. Put your copper list in some free memory (you can open a chip
  149. section for it, if you like clean programming).
  150.  
  151. Put $fffffffe in copper list as first instruction. If you start
  152. the blitter to fill some location with i.e. $c0de and then strobe copper a
  153. few times you will notice that blitter did not move its data where it
  154. should have.
  155.  
  156. The data is transferred in copper list ! Look at the location
  157. which blitter was supposed to cover with $c0de... Interesting, isn't it ?
  158.  
  159. Well this happened when copper was executing wait instruction,
  160. blitter was running, and we were strobing copper.
  161.  
  162. If we put the first instruction to be move ($00880000 - this will
  163. also insure that copper will execute only this move on and on), nothing
  164. strange will happen.
  165.  
  166. You will now say:"How can this be ? Blitter is running, copper is
  167. strobing itself, and everything is alright."
  168.  
  169. Well, there is nothing wrong because copper is in move instruction.
  170. When I first tried to prove to myself this "copper-blitter" bug I put $baba
  171. in BLTADAT ("baba" is grandma in croatian) and of course, blitter filled
  172. wrong location. After some time I realized that blitter did not took the
  173. address from COP1LC 100 times in spite the fact that I put 100 copper
  174. strobes in my program. (If it did, there would be transfered just few
  175. words, because blitter BLTDPT would be changed to copper list many times.)
  176.  
  177. Then I made a long copper list consisting only of move
  178. instructions, and blitter did not make a mistake.
  179.  
  180. This also explained how all those programs with copper loops and
  181. blitter scrolls can work. Strobing copper is dangerous only in case that
  182. copper is in wait instruction, and when copper is strobing itself it's
  183. obvious that copper is executing move...
  184.  
  185. What happens when you use more than one blitter channel ? Well,
  186. experiment a little !
  187.  
  188. ENDREM
  189.  
  190.  
  191. 4. My address
  192.  
  193. If you want to contact me for any reason you can write to following
  194. address :
  195.  
  196. Bojan Urosevic (Coyote/Lazy Bones)
  197. Dapci 218A
  198. 43240 Cazma
  199. CROATIA
  200.  
  201. Or you can reach my nearest modem-friend at e-mail address:
  202.  
  203. dalibor...@120.hrfido.fesb.hr
  204.  
  205. ...and he will print and forward message to me!
  206.  
  207. I hope that I helped at least one coder to debug his masterpiece !!
  208.  
  209. Happy coding !! ;)
  210.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement