solid.s 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890
  1. section Solid,Code_C
  2. OPT C-,D+
  3. BPR EQU 64
  4. GRAPHICS_MOD EQU 0
  5. SCREEN_MOD EQU 56
  6. XSIZE EQU 4
  7. YSIZE EQU 36
  8. XDEST EQU 42
  9. YDEST EQU 1
  10. SCROLL_WIDTH EQU 27
  11. NOP EQU 18
  12. NOC EQU 0
  13. CUSTOM EQU $DFF000
  14. BPLCONO EQU $100
  15. BPLCON1 EQU $102
  16. BPLCON2 EQU $104
  17. BPL1MOD EQU $108
  18. DDFSTRT EQU $092
  19. DDFSTOP EQU $094
  20. DIWSTRT EQU $08E
  21. DIWSTOP EQU $090
  22. VPSOR EQU $004
  23. COLOUR0 EQU $180
  24. COLOUR1 EQU $182
  25. COLOUR2 EQU $184
  26. COLOUR3 EQU $186
  27. DMACON EQU $096
  28. COP1LCH EQU $080
  29. COPJMP1 EQU $088
  30. DMAF_BLITTER EQU $0040
  31. DMAF_BLTDONE EQU $4000
  32. DMAF_BLTNZERO EQU $2000
  33. DMAB_BLTDONE EQU 14
  34. bltddat EQU $000
  35. dmaconr EQU $002
  36. vposr EQU $004
  37. vhposr EQU $006
  38. dskdatr EQU $008
  39. joy0dat EQU $00A
  40. joy1dat EQU $00C
  41. clxdat EQU $00E
  42. bltcon0 EQU $040
  43. bltcon1 EQU $042
  44. bltafwm EQU $044
  45. bltalwm EQU $046
  46. bltcpt EQU $048
  47. bltbpt EQU $04C
  48. bltapt EQU $050
  49. bltdpt EQU $054
  50. bltsize EQU $058
  51. bltcmod EQU $060
  52. bltbmod EQU $062
  53. bltamod EQU $064
  54. bltdmod EQU $066
  55. bltcdat EQU $070
  56. bltbdat EQU $072
  57. bltadat EQU $074
  58. dsksync EQU $07E
  59. cop1lc EQU $080
  60. cop2lc EQU $084
  61. bpl2mod EQU $10A
  62. bpldat EQU $110
  63. intreq EQU $09c
  64. intreqr EQU $01e
  65. MODE_OLDFILE EQU 1005
  66. MODE_NEWFILE EQU 1006
  67. start:
  68. move.l 4,a6
  69. move.l #(256*64)*3,d0 ;
  70. move.l #1<<1+1<<16,d1 ;chip and clear
  71. jsr -198(a6) ;try
  72. tst.l d0
  73. bne allocated_mem
  74. rts ;otherwise quit
  75. allocated_mem
  76. move.l d0,Memory_Base
  77. move.l d0,Vector_Plane
  78. add.l #(256*64),d0
  79. move.l d0,Vector_Buffer
  80. add.l #(256*64),d0
  81. move.l d0,blank
  82. move.l 4,a6
  83. jsr -132(A6) ;DISABLE tasking
  84. bsr setup
  85. bsr Main_Demo
  86. QUIT_OUT
  87. MOVE.L 4,A6
  88. JSR -138(A6) ;ENABLE tasking
  89. move.l 4,a6
  90. move.l #(256*64)*3,d0
  91. move.l Memory_Base,a1
  92. jsr -210(a6)
  93. MOVE.L #graf_NAME,A1
  94. MOVEQ #0,D0
  95. JSR -552(A6) ;OPEN GRAPHICS LIBRARY
  96. MOVE.L D0,a4
  97. MOVE.W #$8020,DMACON+$dff000 ; sprites back
  98. move.l 38(a4),$dff080
  99. clr.w $dff088
  100. move.b #$9b,$bfed01
  101. rts
  102. graf_NAME dc.b "graphics.library",0
  103. even
  104. setup
  105. move.l #sinradtable,a0
  106. loopie
  107. move.w (a0),d0
  108. asr.w #2,d0
  109. move.w d0,(a0)+
  110. cmpa.l #endsinrad,a0
  111. blt loopie
  112. LEA CUSTOM,A0
  113. MOVE.W #$1200,BPLCONO(A0)
  114. MOVE.W #0,BPLCON1(A0)
  115. MOVE.W #22,BPL1MOD(A0)
  116. MOVE.W #$0030,DDFSTRT(A0)
  117. MOVE.W #$00D0,DDFSTOP(A0)
  118. MOVE.W #$2C81,DIWSTRT(A0)
  119. MOVE.W #$2CC1,DIWSTOP(A0)
  120. MOVE.W #$0000,COLOUR0(A0)
  121. MOVE.W #$0bbb,COLOUR1(A0)
  122. MOVE.W #$0f02,COLOUR2(A0)
  123. MOVE.W #$0f02,COLOUR3(A0)
  124. MOVE.W #$0a02,$dff188
  125. MOVE.W #$0a02,$dff18a
  126. MOVE.W #$0602,$dff18c
  127. MOVE.W #$0602,$dff18e
  128. MOVE.W #$0000,$dff190
  129. MOVE.W #$0ccc,$dff192
  130. MOVE.W #$0aaa,$dff194
  131. MOVE.W #$0666,$dff196
  132. MOVE.W #$024c,$dff198
  133. MOVE.W #$0444,$dff19A
  134. MOVE.W #$000a,$dff19C
  135. MOVE.W #$008d,$dff19E
  136. MOVE.L #COPPERL,COP1LCH(A0)
  137. MOVE.W COPJMP1(A0),D0
  138. MOVE.W #$8380,DMACON(A0)
  139. move.w #32,dmacon(a0) ; sprites off
  140. move.b #$7f,$bfed01
  141. move.l Blank,d0
  142. move.w d0,Plane2_Lo
  143. move.w d0,Plane3_Lo
  144. move.w d0,Plane4_Lo
  145. move.w d0,Plane5_Lo
  146. move.w d0,Plane6_Lo
  147. swap d0
  148. move.w d0,Plane2_Hi
  149. move.w d0,Plane3_Hi
  150. move.w d0,Plane4_Hi
  151. move.w d0,Plane5_Hi
  152. move.w d0,Plane6_Hi
  153. rts
  154. Main_Demo
  155. move.l #$dff000,a6
  156. bsr vectors
  157. wait btst.b #6,$bfe001
  158. bne.s main_demo
  159. btst.b #10,$dff016
  160. bne.s main_demo
  161. rts
  162. Vectors
  163. move.w $dff006,d0
  164. andi.w #$ff00,d0
  165. cmp.w #$0000,d0
  166. bne.s vectors
  167. move.l Vector_Buffer,d0
  168. move.l Vector_Plane,d1
  169. move.l d1,Vector_Buffer
  170. move.l d0,Vector_Plane
  171. MOVE.W D0,Plane1_Lo
  172. SWAP D0
  173. MOVE.W D0,Plane1_Hi
  174. clear BTST #14,DMACONR(a6)
  175. BNE.s clear
  176. MOVE.W #$00,BLTDDAT(a6)
  177. MOVE.W #$00,BLTADAT(a6)
  178. MOVE.L Vector_Buffer,BLTDPT(a6)
  179. MOVE.W #0,BLTDMOD(a6)
  180. move.l #-1,BLTAFWM(a6)
  181. MOVE.l #$01f00000,BLTCON0(a6)
  182. MOVE.W #clearsize,BLTSIZE(a6)
  183. cmp.w #50,appearance_timer
  184. bhi.s no_fade
  185. move.w #1,start_fade
  186. no_fade
  187. *subi.w #1,Appearance_Timer
  188. bne.s dont_change_object
  189. move.w #2,start_fade
  190. move.l Object_Pointer,A0 ; Current object block
  191. add.l #ParameterSize,A0 ; Next object (nice)
  192. cmp.l #thisisthelastblockmatey,A0
  193. bne.s sodoffresetting
  194. move.l #Parameters_for_3d_images,A0
  195. sodoffresetting
  196. move.l A0,Object_Pointer
  197. move.w 12(A0),rotate1
  198. move.w 14(A0),rotate2
  199. move.w 16(A0),rotate3
  200. move.w 24(A0),Appearance_Timer
  201. move.w 30(a0),oe ;forget ee
  202. move.w 32(a0),$182(a6)
  203. dont_change_object
  204. move.l Object_Pointer,A0
  205. move.l (A0),a3 ;shape data
  206. move.w rotate1,d0 ;rotation factor 0 - x, 1- y, 2 - z
  207. move.w rotate2,d1 ;no of degrees to rotate
  208. move.w rotate3,d2
  209. move.w 8(A0),d5 ;no of points to rotate
  210. btst.b #6,$bfe001
  211. bne.s dont_rotate
  212. add.w #15,oe
  213. add.w 18(a0),d0
  214. add.w 20(a0),d1
  215. add.w 22(a0),d2
  216. dont_rotate
  217. move.w #1,d3 ; lower limits
  218. move.w #360,d4 ; upper limits
  219. cmp.w d3,d0
  220. bge.s test2
  221. add.w d4,d0
  222. bra.s test3
  223. test2
  224. cmp.w d4,d0
  225. ble.s test3
  226. sub.w d4,d0
  227. test3
  228. cmp.w d4,d1
  229. ble.s test4
  230. sub.w d4,d1
  231. bra.s test5
  232. test4
  233. cmp.w d3,d1
  234. bge.s test5
  235. add.w d4,d1
  236. test5
  237. cmp.w d4,d2
  238. ble.s last_test
  239. sub.w d4,d2
  240. bra.s finished_vectors
  241. last_test
  242. cmp.w d3,d2
  243. bge.s finished_vectors
  244. add.w d4,d2
  245. finished_vectors
  246. move.w d0,rotate1
  247. move.w d1,rotate2
  248. move.w d2,rotate3
  249. BSR ROTATE
  250. move.l Object_Pointer,A0
  251. move.l 4(a0),a1 ;shape line connections
  252. move.l #temps,a2 ;shape to plot
  253. move.w 10(a0),d4 ;num of points
  254. bsr plotpoints
  255. move.l Object_Pointer,A0
  256. move.l #temps,a1 ;shape to plot
  257. move.w 10(a0),d4 ;num of pixels
  258. * bsr Remove_Pixels
  259. * Fill the Object
  260. waitfill BTST #14,DMACONR(a6)
  261. BNE.s waitfill
  262. MOVE.W #$00,BLTADAT(a6)
  263. MOVE.W #$00,BLTBDAT(a6)
  264. MOVE.W #$00,BLTCDAT(a6)
  265. MOVE.W #$00,BLTDDAT(a6)
  266. move.l Vector_Buffer,d0
  267. add.l #(64*255)+38,d0
  268. MOVE.L d0,BLTAPT(a6)
  269. MOVE.L d0,BLTBPT(a6)
  270. MOVE.L d0,BLTCPT(a6)
  271. MOVE.L d0,BLTDPT(a6)
  272. MOVE.W #24,BLTAMOD(a6)
  273. MOVE.W #24,BLTBMOD(a6)
  274. MOVE.W #24,BLTCMOD(a6)
  275. MOVE.W #24,BLTDMOD(a6)
  276. move.l #-1,BLTAFWM(a6)
  277. MOVE.l #$09f00012,BLTCON0(a6)
  278. btst #10,$dff016
  279. beq.s dont_fill_now
  280. MOVE.W #256<<6+20,BLTSIZE(a6)
  281. dont_fill_now
  282. rts
  283. ROTATE
  284. subq.w #1,d0
  285. subq.w #1,d1
  286. subq.w #1,d2
  287. asl.w #1,d0
  288. asl.w #1,d1
  289. asl.w #1,d2
  290. lea sinradtable(pc),a4
  291. lea cosradtable(pc),a5
  292. move.w (a4,d0),sin1
  293. move.w (a5,d0),cos1
  294. move.w (a4,d1),sin2
  295. move.w (a5,d1),cos2
  296. move.w (a4,d2),d0
  297. move.w (a5,d2),d1
  298. lea temps,a1
  299. rotate_loop
  300. move.w (a3),(a1) ;store some values in temp
  301. move.w 2(a3),d6 ;num 1 ;calc for x rotation
  302. move.w d6,d4
  303. move.w 4(a3),d7 ;num 2
  304. move.w d7,d2 ;faster than doing another 4(a3) down below
  305. muls cos1(pc),d6 ;num by cos
  306. muls sin1(pc),d7 ;num two by sin
  307. sub.l d7,d6 ;got num 2
  308. asr.l #8,d6
  309. move.w d6,2(a1) ;store num 1
  310. move.w d4,d6 ;faster again than doing another 2(a3)
  311. move.w d2,d7 ;faster
  312. muls sin1(pc),d6 ;num by sin
  313. muls cos1(pc),d7 ;num two by cos
  314. add.l d7,d6 ;got num 1
  315. asr.l #8,d6
  316. move.w d6,d2 ;store result for further action
  317. do_y_rotation
  318. move.w (a1),d7 ;num2
  319. muls cos2(pc),d6 ;d6 contains new z num
  320. muls sin2(pc),d7 ;num two by sin for y
  321. sub.l d7,d6 ;got num
  322. asr.l #8,d6
  323. move.w d2,d4 ;contains old z num
  324. move.w (a1),d7 ;num 2
  325. muls sin2(pc),d4 ;num by sin 2 for y
  326. muls cos2(pc),d7 ;num two by cos 2 for y
  327. add.l d7,d4 ;got num 1
  328. asr.l #8,d4
  329. move.w d6,d2 ;save new z in d2 again
  330. move.w d4,(a1) ;store num 2
  331. do_z_rotation
  332. move.w 2(a1),d7 ;num 2
  333. muls d1,d4 ;num by cos for y
  334. muls d0,d7 ;num two by sin for y
  335. sub.l d7,d4 ;got num 3
  336. asr.l #8,d4
  337. move.w (a1),d6 ;num 1
  338. move.w 2(a1),d7 ;num 3
  339. muls d0,d6 ;num by sin 3 for y
  340. muls d1,d7 ;num two by cos 3 for y
  341. add.l d7,d6 ;got num 1
  342. asr.l #8,d6
  343. move.w d4,(a1) ;store num 1
  344. move.w d6,2(a1) ;store num 2
  345. Perspective_loop
  346. muls #300,d4
  347. add.w oe(pc),d2 -d2 = z
  348. divs d2,d4
  349. move.w d4,d3
  350. muls #300,d6
  351. divs d2,d6 ;got num 1
  352. addi.w #125,d6 ;y - do here rather than twice in plot loop
  353. move.w d6,2(a1) ;store num 2
  354. addi.w #176,d3 ;same as for y
  355. move.w d3,(a1) ;no need to save z as not used for drawing
  356. addq.l #6,a3 ;next set
  357. addq.l #4,a1
  358. dbeq d5,rotate_loop ;phew
  359. rts
  360. PLOTPOINTS
  361. subq.w #1,d4 ;use as counter
  362. move.w d4,d5
  363. asl #2,d5
  364. move.w (a1,d5),d1
  365. move.w 2(a1,d5),d3
  366. asl #2,d1
  367. move.w 2(a2,d1.w),d1 ;
  368. asl #2,d3
  369. move.w 2(a2,d3.w),d3 ;
  370. sub.w d3,d1
  371. move.w d1,store_val
  372. plot_loop
  373. move.w (a1)+,d5
  374. asl #2,d5
  375. move.w (a2,d5),d0 ;point 1
  376. move.w 2(a2,d5),d1 ;point 2
  377. move.w (a1)+,d5
  378. asl #2,d5
  379. move.w (a2,d5),d2 ;point 3
  380. move.w 2(a2,d5),d3 ;point 4
  381. move.l Vector_Buffer,a0 ;current drawing plane
  382. bsr.s DARKLINE
  383. dbra d4,plot_loop
  384. rts
  385. Remove_Pixels
  386. subq.w #1,d4 ;use as counter
  387. pix_loop
  388. move.w d4,d5
  389. lsl.w #2,d5
  390. move.w (a1,d5),d0
  391. move.w 2(a1,d5),d1
  392. move.l Vector_Buffer,a0 ;current drawing plane
  393. moveq.w #0,d2
  394. bsr Write_Pixel_Value
  395. dbra d4,pix_loop
  396. rts
  397. clip_line
  398. DARKLINE
  399. MOVEQ #0,D6
  400. MOVEQ #0,D7
  401. move.w #0,go
  402. cmp.w #gbnumcons-1,d4
  403. bne.s not_first
  404. tst store_val
  405. bne.s not_first
  406. move.w #1,go
  407. bra.s no_bitty_cng
  408. not_first
  409. cmp.w d1,d3
  410. beq forget_it
  411. ble.s testit2
  412. tst.w store_val
  413. bge.s no_bitty_cng
  414. move.w #1,go
  415. bra.s no_bitty_cng
  416. testit2
  417. tst.w store_val
  418. ble.s no_bitty_cng
  419. move.w #1,go
  420. no_bitty_cng
  421. MOVE.W D0,-(SP)
  422. move.w d1,d6
  423. sub.w d3,d6
  424. move.w d6,store_val
  425. MOVE.W D0,D6 ;STORE FOR USE IN CALCING START POS
  426. MOVE.W D1,D7
  427. CALC_OCTANT
  428. moveq.w #0,D5 ;USE TO LOCATE OC
  429. sub.w d1,d3 ;sub y1 from y2
  430. bge.s y2bigger
  431. neg.w d3
  432. bset #2,d5
  433. y2bigger
  434. sub.w d0,d2 ;x1 from x2
  435. bge.s x2bigger
  436. neg.w d2
  437. bset #1,d5
  438. x2bigger
  439. cmp.w d2,d3 ;is deltax smaller than deltay
  440. BGe.s DELTAXSMALLER
  441. BSET #0,D5 ;D5 CONTAINS OCTANT POS
  442. move.w d3,a3
  443. move.w d2,a4
  444. bra.s calc_start
  445. DELTAXSMALLER
  446. move.w d3,a4
  447. move.w d2,a3
  448. CALC_START
  449. ASL.L #6,D7 ;NO OF BYTES DOWN SCREEN
  450. ADD.L D7,A0
  451. asr #3,d6
  452. ADD.L D6,A0 ;START POINT HELD IN A0
  453. MOVEQ #0,D6
  454. move.w a3,d6
  455. asl #1,d6
  456. move.w d6,a3
  457. MOVE.W a4,D2
  458. MOVE.W d2,length
  459. SUB.W D2,D6
  460. asl #1,D2 ;CON LDELTA
  461. MOVE.W a3,D1
  462. SUB.W D2,D1 ;contains xpres2
  463. MOVE.W (SP)+,D0 ;INIT BLTCON0
  464. andi.w #$000f,d0
  465. move.w d0,d3
  466. ROR.W #4,D0
  467. OR.W #$0B58,D0
  468. MOVE.W a3,D7
  469. CMP.W LENGTH,D7
  470. BGe NO_SET
  471. MOVE.W #$40,D7
  472. BRA OR_IN_VAL
  473. NO_SET
  474. MOVE.W #0,D7
  475. OR_IN_VAL
  476. lsl.w #1,d5
  477. LEA TABLE,A5 ;OCTANT
  478. OR.B (A5,D5),D7
  479. BLITTER_IT
  480. BLITQ BTST #14,$002(a6)
  481. BNE.s BLITQ
  482. tst go
  483. beq.s no_cng
  484. neg.w d3
  485. add.w #$f,d3
  486. bchg d3,(a0)
  487. no_cng
  488. MOVE.W masky,$072(a6)
  489. MOVE.L A0,$048(a6) ;START ADDRESS
  490. MOVE.L A0,$054(a6)
  491. MOVE.l d6,$050(a6) ;CONTAINS 2*SDELTA-LDELTA
  492. MOVE.W a3,$062(a6) ;2*SDELTA IN HERE
  493. MOVE.W d1,$064(a6) ;CONTAINS 2*SDELTA-2*LDELTA (xpres2)
  494. MOVE.W #64,$066(a6) ;SCREEN WIDTH IN BYTES
  495. MOVE.W #64,$060(a6)
  496. MOVE.W D0,$040(a6)
  497. bset.l #1,d7
  498. MOVE.W D7,$042(a6)
  499. MOVE.w #$ffff,$044(a6) ;MASK
  500. MOVE.W length,D0
  501. addq.w #1,d0
  502. asl #6,D0
  503. addq.W #2,D0
  504. MOVE.W #$8000,$074(a6) ;MUST BE THIS
  505. MOVE.W D0,$058(a6)
  506. forget_it
  507. * addq.w #1,oe
  508. RTS
  509. Single_Mouse_Press
  510. btst #6,$BFE001
  511. Bne Single_Mouse_Press
  512. not_released
  513. btst #6,$BFE001
  514. Beq not_released
  515. rts
  516. type dc.w 14
  517. masky dc.w $ffff
  518. faders
  519. dc.w $0000,$0000,$0000,$f000,$f000,$f000
  520. dc.w $ff00,$ff00,$ff00,$fff0,$fff0,$fff0
  521. dc.w $ffff,$ffff,$ffff
  522. DELTAX DC.W 0
  523. DELTAY DC.W 0
  524. SDELTA DC.W 0
  525. LDELTA DC.W 0
  526. XPRES DC.l 0
  527. XPRES2 DC.W 0
  528. length dc.w 0
  529. COPPERL
  530. dc.w $1fc,0
  531. DC.W $00E0
  532. Plane1_Hi DC.W 0
  533. DC.W $00E2
  534. Plane1_Lo DC.W 0
  535. DC.W $00E4
  536. Plane2_Hi DC.W 0
  537. DC.W $00E6
  538. Plane2_Lo DC.W 0
  539. DC.W $00E8
  540. Plane3_Hi DC.W 0
  541. DC.W $00Ea
  542. Plane3_Lo DC.W 0
  543. DC.W $00Ec
  544. Plane4_Hi DC.W 0
  545. DC.W $00Ee
  546. Plane4_Lo DC.W 0
  547. DC.W $00f0
  548. Plane5_Hi DC.W 0
  549. DC.W $00f2
  550. Plane5_Lo DC.W 0
  551. DC.W $00f4
  552. Plane6_Hi DC.W 0
  553. DC.W $00f6
  554. Plane6_Lo DC.W 0
  555. DC.W $2cff,$FFFE
  556. TABLE
  557. DC.B 0*4+1,1
  558. DC.B 4*4+1,1
  559. DC.B 2*4+1,1
  560. DC.B 5*4+1,1
  561. DC.B 1*4+1,1
  562. DC.B 6*4+1,1
  563. DC.B 3*4+1,1
  564. DC.B 7*4+1,1
  565. EVEN
  566. Blank Dc.l 0
  567. Vector_Plane
  568. dc.l 0
  569. Vector_Buffer
  570. dc.l 0
  571. Appearance_Timer
  572. dc.w 500
  573. Object_Pointer
  574. DC.L Parameters_for_3d_images
  575. Parameters_for_3d_images
  576. LINEFADE EQU 1
  577. SHRINK EQU 2
  578. COLOURFADE EQU 3
  579. dc.l GB ; Image
  580. dc.l GBcons ; Connections
  581. dc.w GBpoints ; No of points
  582. dc.w GBnumcons ; No of connection lines
  583. dc.w 180 ; Start rotation pos x
  584. dc.w 180 ; Start rotation pos y
  585. dc.w 180 ; Start rotation pos z
  586. dc.w -4 ; Rotation factor x
  587. dc.w 0 ; Rotation factor y
  588. dc.w 0 ; Rotation factor z
  589. dc.w 500 ; Length of appearance
  590. dc.w LINEFADE ; Fading bit
  591. dc.w 3000 ;ee
  592. dc.w 3000 ;oe
  593. dc.w $0f0
  594. ParameterSize EQU *-Parameters_for_3d_images
  595. thisisthelastblockmatey
  596. GB
  597. dc.w -40,200,0
  598. dc.w -40,-200,0
  599. dc.w 40,-200,0
  600. dc.w 40,200,0
  601. dc.w -240,280,0
  602. dc.w 240,280,0
  603. dc.w 240,200,0
  604. dc.w 160,200,0
  605. dc.w 160,-200,0
  606. dc.w 240,-200,0
  607. dc.w 240,-280,0
  608. dc.w -240,-280,0
  609. dc.w -240,-200,0
  610. dc.w -160,-200,0
  611. dc.w -160,200,0
  612. dc.w -240,200,0
  613. GBpoints EQU (*-GB)/6
  614. GBcons
  615. *must overlap lines properly to remove end line points
  616. dc.w 3,0,0,1,1,2,2,3
  617. dc.w 4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12
  618. dc.w 12,13,13,14,14,15,15,4
  619. GBnumcons EQU (*-GBcons)/4
  620. sinradtable
  621. DC.W 17,35,53,71,89,107,124,142,160,177
  622. DC.W 195,212,230,247,265,282,299,316,333,350
  623. DC.W 366,383,400,416,432,448,464,480,496,511
  624. DC.W 527,542,557,572,587,601,616,630,644,658
  625. DC.W 671,685,698,711,724,736,748,760,772,784
  626. DC.W 795,806,817,828,838,848,858,868,877,886
  627. DC.W 895,904,912,920,928,935,942,949,955,962
  628. DC.W 968,973,979,984,989,993,997,1001,1005,1008
  629. DC.W 1011,1014,1016,1018,1020,1021,1022,1023,1023,1024
  630. DC.W 1023,1023,1022,1021,1020,1018,1016,1014,1011,1008
  631. DC.W 1005,1001,997,993,989,984,979,973,968,962
  632. DC.W 955,949,942,935,928,920,912,904,895,886
  633. DC.W 877,868,858,848,838,828,817,806,795,784
  634. DC.W 772,760,748,736,724,711,698,685,671,658
  635. DC.W 644,630,616,601,587,572,557,542,527,512
  636. DC.W 496,480,464,448,432,416,400,383,366,350
  637. DC.W 333,316,299,282,265,247,230,212,195,177
  638. DC.W 160,142,124,107,89,71,53,35,17,0
  639. DC.W -18,-36,-54,-72,-90,-108,-125,-143,-161,-178
  640. DC.W -196,-213,-231,-248,-266,-283,-300,-317,-334,-351
  641. DC.W -367,-384,-401,-417,-433,-449,-465,-481,-497,-512
  642. DC.W -528,-543,-558,-573,-588,-602,-617,-631,-645,-659
  643. DC.W -672,-686,-699,-712,-725,-737,-749,-761,-773,-785
  644. DC.W -796,-807,-818,-829,-839,-849,-859,-869,-878,-887
  645. DC.W -896,-905,-913,-921,-929,-936,-943,-950,-956,-963
  646. DC.W -969,-974,-980,-985,-990,-994,-998,-1002,-1006,-1009
  647. DC.W -1012,-1015,-1017,-1019,-1021,-1022,-1023,-1024,-1024,-1025
  648. DC.W -1024,-1024,-1023,-1022,-1021,-1019,-1017,-1015,-1012,-1009
  649. DC.W -1006,-1002,-998,-994,-990,-985,-980,-974,-969,-963
  650. DC.W -956,-950,-943,-936,-929,-921,-913,-905,-896,-887
  651. DC.W -878,-869,-859,-849,-839,-829,-818,-807,-796,-785
  652. DC.W -773,-761,-749,-737,-725,-712,-699,-686,-672,-659
  653. DC.W -645,-631,-617,-602,-588,-573,-558,-543,-528,-513
  654. DC.W -497,-481,-465,-449,-433,-417,-401,-384,-367,-351
  655. DC.W -334,-317,-300,-283,-266,-248,-231,-213,-196,-178
  656. DC.W -161,-143,-125,-108,-90,-72,-54,-36,-18,0
  657. cosradtable
  658. DC.W 1023,1023,1022,1021,1020,1018,1016,1014,1011,1008
  659. DC.W 1005,1001,997,993,989,984,979,973,968,962
  660. DC.W 955,949,942,935,928,920,912,904,895,886
  661. DC.W 877,868,858,848,838,828,817,806,795,784
  662. DC.W 772,760,748,736,724,711,698,685,671,658
  663. DC.W 644,630,616,601,587,572,557,542,527,511
  664. DC.W 496,480,464,448,432,416,400,383,366,350
  665. DC.W 333,316,299,282,265,247,230,212,195,177
  666. DC.W 160,142,124,107,89,71,53,35,17,0
  667. DC.W -18,-36,-54,-72,-90,-108,-125,-143,-161,-178
  668. DC.W -196,-213,-231,-248,-266,-283,-300,-317,-334,-351
  669. DC.W -367,-384,-401,-417,-433,-449,-465,-481,-497,-513
  670. DC.W -528,-543,-558,-573,-588,-602,-617,-631,-645,-659
  671. DC.W -672,-686,-699,-712,-725,-737,-749,-761,-773,-785
  672. DC.W -796,-807,-818,-829,-839,-849,-859,-869,-878,-887
  673. DC.W -896,-905,-913,-921,-929,-936,-943,-950,-956,-963
  674. DC.W -969,-974,-980,-985,-990,-994,-998,-1002,-1006,-1009
  675. DC.W -1012,-1015,-1017,-1019,-1021,-1022,-1023,-1024,-1024,-1025
  676. DC.W -1024,-1024,-1023,-1022,-1021,-1019,-1017,-1015,-1012,-1009
  677. DC.W -1006,-1002,-998,-994,-990,-985,-980,-974,-969,-963
  678. DC.W -956,-950,-943,-936,-929,-921,-913,-905,-896,-887
  679. DC.W -878,-869,-859,-849,-839,-829,-818,-807,-796,-785
  680. DC.W -773,-761,-749,-737,-725,-712,-699,-686,-672,-659
  681. DC.W -645,-631,-617,-602,-588,-573,-558,-543,-528,-512
  682. DC.W -497,-481,-465,-449,-433,-417,-401,-384,-367,-351
  683. DC.W -334,-317,-300,-283,-266,-248,-231,-213,-196,-178
  684. DC.W -161,-143,-125,-108,-90,-72,-54,-36,-18,0
  685. DC.W 17,35,53,71,89,107,124,142,160,177
  686. DC.W 195,212,230,247,265,282,299,316,333,350
  687. DC.W 366,383,400,416,432,448,464,480,496,511
  688. DC.W 527,542,557,572,587,601,616,630,644,658
  689. DC.W 671,685,698,711,724,736,748,760,772,784
  690. DC.W 795,806,817,828,838,848,858,868,877,886
  691. DC.W 895,904,912,920,928,935,942,949,955,962
  692. DC.W 968,973,979,984,989,993,997,1001,1005,1008
  693. DC.W 1011,1014,1016,1018,1020,1021,1022,1023,1023,1024
  694. ENDSINRAD
  695. sin1 dc.w 0
  696. sin2 dc.w 0
  697. cos1 dc.w 0
  698. cos2 dc.w 0
  699. xvect dc.w 160
  700. yvect dc.w 127
  701. ee dc.w 300
  702. oe dc.w 690
  703. temps ds.w 300 ;safe not sorry said the vicar to the
  704. temp1 dc.w 0 ;pork pie which had a rather off
  705. rotate1 dc.w 180 ;brown crust and looked a bit
  706. rotate2 dc.w 180 ;green so he gave it to an old begger
  707. rotate3 dc.w 180 ;who kindly accepted it ate it and died the next day
  708. clearsize equ 256<<6+32 ; of motorola. Suddenly as if it were
  709. Memory_Base dc.l 0
  710. start_fade dc.w 0
  711. Write_Pixel_Value
  712. movem.l d0/d1/d3/a0,-(sp)
  713. mulu.w #BPR,d1
  714. add.l d1,a0
  715. move.w d0,d3
  716. lsr.w #3,d0 ; get bytes
  717. andi.b #%111,d3 ; pixel bits
  718. moveq #7,d1
  719. sub.b d3,d1
  720. btst #0,d2
  721. beq.s SetZero
  722. bset.b d1,(a0,d0.w) ;
  723. bra.s SetOne
  724. SetZero
  725. bclr.b d1,(a0,d0.w) ;
  726. SetOne
  727. movem.l (sp)+,d0/d1/d3/a0
  728. rts
  729. go
  730. dc.w 0
  731. store_val
  732. dc.w 0