Advertisement
ptrOverflow

HAM6

Aug 7th, 2022
876
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     SECTION DEMO,CODE ; Code section - fast ram
  2.  
  3. init:
  4.     move.l  $4.w,a6  ; execbase in a6
  5.     jsr -$78(a6)     ; disable multitasking
  6.     lea gfxname,a1   ; we store the adress of the name in a1
  7.     jsr -$198(a6)    ; open library
  8.  
  9.     move.l d0,gfxbase
  10.     move.l d0,a6
  11.     move.l $26(a6),oldcop ; save old coper
  12.  
  13.  
  14. initpicture:
  15.     move.l  #PIC,d0
  16.     lea BPLPOINTERS,a1
  17.     moveq #5,d1 ; bit planes
  18.  
  19. pointbp:
  20.     move.w d0,6(a1)
  21.     swap d0
  22.     move.w d0,2(a1)
  23.     swap d0
  24.     add.l #40*256,d0
  25.     addq.w #8,a1
  26.     dbra d1,pointbp
  27.  
  28. initcopper:  
  29.     move.l #COPPERLIST,$dff080 ; COP1LC set new copper
  30.     move.w d0,$dff088    
  31.  
  32. default:
  33.     move.w  #0,$dff1fc      ; FMODE - Disattiva l'AGA
  34.     move.w  #$c00,$dff106       ; BPLCON3 - Disattiva l'AGA
  35.  
  36.  
  37. loop:
  38.     btst #6,$bfe001 ; check mouse click
  39.     bne.s loop
  40.  
  41. restore:
  42.     move.l oldcop(PC),$dff080 ; COP1LC
  43.     move.w d0,$dff088         ; COPJMP1
  44.  
  45.     move.l $4.w,a6
  46.     jsr -$7e(a6)            ; enable multitasking
  47.     move.l gfxbase(PC),a1   ; clode library
  48.     jsr -$19e(a6)           ; close library
  49.  
  50.     rts
  51.  
  52.  
  53.  
  54.  
  55. gfxname:
  56.     dc.b    "graphics.library",0,0
  57.  
  58. gfxbase:
  59.     dc.l    0
  60.  
  61. direction:
  62.     dc.b    0,0
  63.  
  64. oldcop:
  65.     dc.l    0 ; old copper
  66.  
  67.     SECTION GRAPHIC,DATA_C
  68.  
  69. COPPERLIST:
  70.  
  71.  
  72.     dc.w    $120,$0000,$122,$0000,$124,$0000,$126,$0000,$128,$0000
  73.     dc.w    $12a,$0000,$12c,$0000,$12e,$0000,$130,$0000,$132,$0000
  74.     dc.w    $134,$0000,$136,$0000,$138,$0000,$13a,$0000,$13c,$0000
  75.     dc.w    $13e,$0000
  76.  
  77.     dc.w    $8e,$2c81   ; DiwStrt   (registri con valori normali)
  78.     dc.w    $90,$2cc1   ; DiwStop
  79.     dc.w    $92,$0038   ; DdfStart
  80.     dc.w    $94,$00d0   ; DdfStop
  81.     dc.w    $102,0      ; BplCon1
  82.     dc.w    $104,0      ; BplCon2
  83.     dc.w    $108,0      ; Bpl1Mod
  84.     dc.w    $10a,0      ; Bpl2Mod
  85.  
  86.  
  87.                 ; 5432109876543210
  88.     dc.w    $100,%0110101000000000  ; bits 13 e 12 accesi!! (6 = %110)
  89.  
  90.  
  91.  
  92. BPLPOINTERS:
  93.     dc.w $e0,$0000,$e2,$0000   
  94.     dc.w $e4,$0000,$e6,$0000   
  95.     dc.w $e8,$0000,$ea,$0000   
  96.     dc.w $ec,$0000,$ee,$0000   
  97.     dc.w $f0,$0000,$f2,$0000   
  98.     dc.w $f4,$0000,$f6,$0000   
  99.     dc.w $FFFF,$FFFE   
  100.  
  101.  
  102.  
  103. PIC:
  104.     incbin "NewTut_320x200x6.raw"
  105.     end
  106.  
  107.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement