SHARE
TWEET

manipulationv215sep2019

a guest Sep 15th, 2019 98 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .include "libsfx.i"
  2.  
  3. VRAM_SPRITES_LOC = $0000
  4.  
  5. Main:
  6.   VRAM_memcpy VRAM_SPRITES_LOC, kati, sizeof_kati
  7.     CGRAM_memcpy 128, kapa, sizeof_kapa
  8.     CGRAM_setcolor 0, 23453
  9.    
  10.     lda #tm(OFF, OFF, OFF, OFF, ON)
  11.     sta TM
  12.     RW a8i16
  13.    
  14.     ldx #512 + 32 - 4
  15.   zero_oam:
  16.     stz shadow_oam + 3, x
  17.     dex
  18.     bne zero_oam
  19.    
  20.     ldx #1
  21.     lda #$e0
  22.    
  23.     sweepspritedown:
  24.     sta shadow_oam, x
  25.     inx
  26.     inx
  27.     inx
  28.     inx
  29.     cpx #513
  30.     bne sweepspritedown
  31.        
  32.     ldx #4
  33.     lda #%00110000
  34.    
  35.     sta shadow_oam-1, x
  36.     dex
  37.    
  38.     kanirend:
  39.     lda kafr
  40.     sta shadow_oam-1, x
  41.     dex
  42.     lda kay
  43.     sta shadow_oam-1, x
  44.     dex
  45.     lda kax
  46.     sta shadow_oam-1, x
  47.     dex
  48.     ldx #512
  49.     lda #%00000010
  50.     sta shadow_oam, x
  51.    
  52.     lda #$01
  53.     sta kas
  54.    
  55.     lda #$80 ;force blank
  56.     sta $2100
  57.  
  58.     lda #$0f ;turn on
  59.     sta $2100
  60.    
  61.     VBL_set VerticalDMABeam
  62.     lda #inidisp(ON, DISP_BRIGHTNESS_MAX)
  63.     sta SFX_inidisp
  64.     VBL_on
  65.    
  66. :   wai
  67.     bra :-
  68.    
  69. VerticalDMABeam:
  70.   lda #%10100000
  71.     sta $2101
  72.     lda #%00000010 ;Dear B Bus, 2 bytes to 1 address, increment, From, CPU
  73.     sta $4300
  74.     lda #$04 ;OAM Data Write
  75.     sta $4301
  76.     lda #.bankbyte(shadow_oam)
  77.     sta $4304
  78.     ldx #shadow_oam
  79.     stx $4302
  80.     ldx #544 ;bytes
  81.     stx $4305
  82.     lda #%00000001 ;channel 0
  83.     sta $420B
  84.    
  85.     RW a8i8
  86.     lda #$01
  87.     sta kas
  88.    
  89.     lda SFX_joy1cont + 1
  90.     and #.hibyte(JOY_Y)
  91.     beq :+
  92.    
  93. krf:
  94.     lda #$02
  95.     sta kas
  96.    
  97. :
  98.     lda SFX_joy1cont + 1
  99.     and #.hibyte(JOY_RIGHT)
  100.     beq :+
  101.    
  102. kmr:
  103.     lda kax
  104.     clc
  105.     adc kas
  106.     sta shadow_oam
  107.     sta kax
  108.    
  109. :
  110.     lda SFX_joy1cont + 1
  111.     and #.hibyte(JOY_LEFT)
  112.     beq :+
  113.  
  114. kml:
  115.     lda kax
  116.     sec
  117.     sbc kas
  118.     sta shadow_oam
  119.     sta kax
  120.    
  121. :
  122.     lda SFX_joy1cont + 1
  123.     and #.hibyte(JOY_UP)
  124.     beq :+
  125.    
  126. kmu:
  127.     lda kay
  128.     sec
  129.     sbc kas
  130.     sta shadow_oam + 1
  131.     sta kay
  132.  
  133. :
  134.     lda SFX_joy1cont + 1
  135.     and #.hibyte(JOY_DOWN)
  136.     beq :+
  137.    
  138. kmd:
  139.     lda kay
  140.     clc
  141.     adc kas
  142.     sta shadow_oam + 1
  143.     sta kay
  144.  
  145. :
  146.     lda $2D
  147.     lsr
  148.     lsr
  149.     lsr
  150.     sta mmr
  151.     bit #%00000000
  152.     bne kf1
  153.     bit #%00000001
  154.     bne kf2
  155.     bit #%00000010
  156.     bne kf3
  157.     bit #%00000011
  158.     bne kf2
  159. kf1:
  160.     stz shadow_oam + 2
  161.     bra :+
  162. kf2:
  163.     lda #$80
  164.     sta shadow_oam + 2
  165.     bra :+
  166. kf3:
  167.     lda #$08
  168.     sta shadow_oam + 2
  169. :
  170.  
  171.     RW a8i16
  172.     rtl
  173.    
  174.  
  175. ;--
  176. ;RODATA ROMDATA
  177. .RODATA
  178. incbin  kapa,        "data/karunss.png.palette"
  179. incbin  kati,            "data/karunss.png.tiles"
  180.  
  181. .segment "LORAM"
  182.  
  183. shadow_oam: .res 512+32
  184.  
  185. kax: .res 1
  186. kay: .res 1
  187. kas: .res 1
  188. kafr: .res 1
  189. mmr: .res 1
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top