home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / alt / sys / amiga / demos / 2082 < prev    next >
Encoding:
Internet Message Format  |  1993-01-01  |  4.4 KB

  1. Path: sparky!uunet!pipex!demon!althera.demon.co.uk!comradej
  2. Newsgroups: alt.sys.amiga.demos
  3. From: comradej@althera.demon.co.uk (comradej)
  4. Subject: Source Code
  5. Date: Fri, 1 Jan 1993 12:16:21 +0000
  6. Message-ID: <3037@althera.demon.co.uk>
  7. Sender: usenet@demon.co.uk
  8. Lines: 130
  9.  
  10. R:930101/1216z 3037@demon.co.uk
  11.  
  12. Seeing as amiga.physik.unizh.ch is unavailable at the moment, here
  13. is some working 68000 setup code for all you coders... Read
  14. howtocode3.txt for more information (howtocode4.txt coming soon....)
  15.  
  16. *
  17. * Startup.asm  - A working tested version of startup from Howtocode3.txt
  18. *
  19. * CJ - 31/12/92 (Happy new year) [comradej@althera.demon.co.uk]
  20. *
  21. * This code sets up one of two copperlists (one for PAL and one for NTSC)
  22. * machines. It shows something to celebrate 3(?) years since the Berlin
  23. * wall came down :-) Press left mouse button to return to normality.
  24. * Tested on Amiga 3000 (ECS/V39 Kickstart) and Amiga 1200 (AGA/V39)
  25. * Read Howtocode3.txt for information on this source!
  26. *
  27.  
  28.  
  29.                 opt    l-                      ; auto link
  30.  
  31.                 section mycode,code            ; need not be in chipram
  32.  
  33.         incdir "include:"
  34.                 include "exec/types.i"
  35.                 include "exec/funcdef.i"       ; keep code simple and
  36.                 include "exec/exec_lib.i"      ; easy to read - use
  37.                 include "graphics/gfxbase.i"   ; the includes!
  38.                 include "graphics/graphics_lib.i"
  39.  
  40.                 include "misc/easystart.i"     ; Allows startup from
  41.                                                ; icon
  42.  
  43.  
  44. StartCopper:
  45.                 move.l  4.w,a6          ; get ExecBase
  46.         lea    gfxname,a1    ; graphics name
  47.                 moveq    #0,d0        ; any version
  48.         jsr    _LVOOpenLibrary(a6)
  49.         tst.l    d0
  50.         beq     End         ; failed to open? Then quit
  51.         move.l  d0,gfxbase
  52.         move.l    d0,a6
  53.         move.l  gb_ActiView(a6),wbview
  54.                     ; store current view address
  55.                                         ; gb_ActiView = 32
  56.  
  57.                 move.w    #0,a1        ; clears full long-word
  58.         jsr     _LVOLoadView(a6) ; Flush View to nothing
  59.                 jsr    _LVOWaitTOF(a6) ; Wait once
  60.         jsr    _LVOWaitTOF(a6) ; Wait again.
  61.  
  62.             move.w    $dff07c,d0
  63.         cmp.b    #$f8,d0
  64.         bne.s    .notaga
  65.  
  66.         move.w  #0,$dff1fc    ; reset sprites (fix V39 bug)
  67.  
  68. notaga
  69.                             ; Now you can hit the copper!
  70.         move.l    4.w,a6
  71.                 jsr    _LVOForbid(a6)  ; Suspend multitasking!
  72.  
  73.  
  74.                 cmp.b    #50,VBlankFrequency(a6) ; Am I *running* PAL?
  75.         bne.s    .ntsc
  76.  
  77.         move.l    #mycopper,$dff080     ; bang it straight in.
  78.                 bra.s    .lp
  79.  
  80. ntsc       move.l    #mycopperntsc,$dff080
  81.  
  82.  
  83. lp         btst    #6,$bfe001
  84.             bne.s    .lp
  85.  
  86.  
  87. CloseDown:    move.l    4.w,a6
  88.             jsr    _LVOPermit(a6)     ; Enable multitasking
  89.  
  90.         move.l    wbview,a1
  91.         move.l    gfxbase,a6
  92.         jsr    _LVOLoadView(a6) ; Fix view
  93.  
  94.         move.l    gb_copinit(a6),$dff080     ; Kick it into life
  95.                                                ; copinit = 36
  96.         move.l    a6,a1
  97.             move.l    4.w,a6
  98.         jsr    _LVOCloseLibrary(a6) ; EVERYONE FORGETS THIS!!!!
  99.  
  100. End:        rts
  101.  
  102.         section mydata,data_c    ; keep data & code seperate!
  103.  
  104. mycopper        dc.w    $100,$0200    ; otherwise no display!
  105.                 dc.w    $180,$00
  106.                 dc.w    $8107,$fffe     ; wait for $8107,$fffe
  107.                 dc.w    $180,$f00       ; background red
  108.         dc.w    $d607,$fffe    ; wait for $d607,$fffe
  109.         dc.w    $180,$ff0       ; background yellow
  110.                 dc.w    $ffff,$fffe
  111.                 dc.w    $ffff,$fffe     ; Copper end
  112.  
  113. mycopperntsc    dc.w    $100,$0200    ; otherwise no display!
  114.                 dc.w    $180,$00
  115.                 dc.w    $6e07,$fffe     ; wait for $6e07,$fffe
  116.                 dc.w    $180,$f00       ; background red
  117.         dc.w    $b007,$fffe    ; wait for $b007,$fffe
  118.         dc.w    $180,$ff0       ; background yellow
  119.                 dc.w    $ffff,$fffe
  120.                 dc.w    $ffff,$fffe     ; Copper end 
  121.  
  122.  
  123. wbview      dc.l    0
  124. gfxbase     dc.l    0
  125. gfxname     dc.b    "graphics.library",0
  126.  
  127.  
  128.  
  129. CJ
  130. +------------------------------------------------------------------+
  131. | comradej@althera.demon.co.uk                                     |
  132. +------------------------------------------------------------------+
  133. | Comrade J of Share and Enjoy (Retired). Ex-Demo Hacker and 68000 |
  134. | maniac. Author of Amazing Tunes I, Amazing Tunes II and Amazing  |
  135. | Tunes CDTV, the first Amiga CD-ROM demo ever with 1000 modules!  |
  136. +------------------------------------------------------------------+
  137. | ps. No. I don't want to join your group.                         |
  138. +------------------------------------------------------------------+
  139.  
  140.