Advertisement
Guest User

Untitled

a guest
Nov 15th, 2014
331
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Fast solution 75W per frame
  2. // ***************************
  3.  
  4. .pc=$032c
  5. .byte <init,>init
  6.  
  7. init:
  8.     sei
  9.     lda #<irq
  10.     sta $fffe
  11.     lda #>irq
  12.     sta $ffff      
  13.     lda #$7d        // Enable RAM and count $100-$7d
  14.     sta $01    
  15.        
  16. carryset:
  17.     sec
  18.     nop
  19.     eor (0,x)       // This is done 2 times before using A
  20.     nop
  21.     nop
  22.     nop
  23.     ldy #25
  24. loop:
  25.     brk         // 7
  26. irq:
  27.     bit $d020       // 4
  28.     ldx #89         // 89*5+2-1 => 446
  29.     in1:
  30.         dex
  31.         bne in1
  32.     ldx #227        // 2 => Used on next loop
  33.     dey             // 2   
  34.     bne loop        // 3/2      => 464 [63x7+23]
  35.     out2:           // 227*(2+5*5-1+2+3)-1 => 7036
  36.         ldy #5
  37.         in2:
  38.             dey
  39.             bne in2    
  40.         dex
  41.         bne out2   
  42.     // From now on: 21 cycles till next frame
  43.     // -1+7036+21 => 7056 [112*63] => 7056
  44.     bcc carryset   
  45.     adc #$00
  46.     bcc carryset+2     
  47.     lda #STY_ABS
  48.     sta irq
  49.     bcs carryset+5
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement