Advertisement
yugorin

8x16 scroll gravity 2017

May 17th, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #import "helpers.asm"
  2. BasicUpstart2(mainProg)
  3.  
  4. .const scrollLine = $0400+23*40
  5.  
  6.             *=$1000
  7.  
  8. mainProg:   {                          
  9.             sei
  10.  
  11.             lda $d018
  12.             ora #%00001110
  13.             sta $d018
  14.  
  15.             // Wait for line $f2 and set d016  
  16. loop1:      lda #$e9                           
  17.             cmp $d012
  18.             bne loop1
  19.             jsr setScrollD016
  20.            
  21.  
  22. loop2:      lda #$ff                           
  23.             cmp $d012
  24.             bne loop2
  25.             lda #$c8
  26.             sta $d016
  27.             jsr moveScroll
  28.            
  29.             jmp loop1
  30. }
  31. //----------------------------------------------------
  32. //          Scroll Routines
  33. //----------------------------------------------------
  34.  
  35. setScrollD016:  {
  36. value:      lda #0                                 
  37.             and #$07
  38.             ora #$c0
  39.             sta $d016
  40.             rts        
  41. }
  42.  
  43. moveScroll: {
  44.             // Step d016
  45.             dec setScrollD016.value+1              
  46.             lda setScrollD016.value+1
  47.             and #$07
  48.             cmp #$07
  49.             bne exit
  50.            
  51.             // Move screen chars
  52.             ldx #0
  53. loop1:      lda scrollLine+1,x                 
  54.             sta scrollLine,x
  55.             inx
  56.             clc
  57.             adc #64
  58.             sta scrollLine+39,x
  59.             cpx #39
  60.             bne loop1
  61.            
  62.             // Print new char
  63. count:      ldx #0
  64.             lda text,x
  65.             sta scrollLine+39  
  66.             inx
  67.             lda text,x
  68.             cmp #$ff
  69.             bne over1
  70.             ldx #0
  71. over1:      stx count+1
  72.            
  73. exit:       rts
  74.            
  75. text:       .text "scroll zrobiony na gravity 2017 wsrod krwiozerczych atarowcow. michal dlubie gre o zebrach a ja mam 8x16 font scroll.... umiem wyswietlac i skrolowac duze fonty!!! huraaaa                          "
  76.             .byte $ff
  77. }
  78.  
  79.  
  80. .pc = $3800 "Font 1"
  81. .import c64 "8x16font
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement