Advertisement
Guest User

Untitled

a guest
Oct 14th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. draw4ColumnsNormal:
  2. {
  3.             ; get bitmap pointer
  4.             ldx ImageXPosInBytes
  5.             ldy ImageYPos
  6.             lda YCoordTableLo,y
  7.             clc
  8.             adc XCoordTableLo,x
  9.             sta BitmapPtr
  10.                    
  11.             lda YCoordTableHi,y
  12.             adc XCoordTableHi,x
  13.             ldx CurrentPage
  14.             adc BitmapHiByteForPage,x
  15.             sta BitmapPtr+1
  16.            
  17.             ldx #$00
  18.             {
  19.                 ldy #$00
  20.                 lda (BitmapPtr),y       ; read from bitmap
  21.                 ldy BgImageBuffer+2,x   ; read byte from image
  22.                 and MaskTable,y     ; get masking outline of image byte and clear covered bits in bitmap
  23.                 ora BgImageBuffer+2,x   ; now or the image bytes on top of the background
  24.                 ldy #$00
  25.                 sta (BitmapPtr),y       ; and store in bitmap
  26.                 inx
  27.  
  28.                 ldy #$08
  29.                 lda (BitmapPtr),y       ; read from bitmap
  30.                 ldy BgImageBuffer+2,x   ; read byte from image
  31.                 and MaskTable,y     ; get masking outline of image byte and clear covered bits in bitmap
  32.                 ora BgImageBuffer+2,x   ; now or the image bytes on top of the background
  33.                 ldy #$08
  34.                 sta (BitmapPtr),y       ; and store in bitmap
  35.                 inx
  36.  
  37.                 ldy #$10
  38.                 lda (BitmapPtr),y       ; read from bitmap
  39.                 ldy BgImageBuffer+2,x   ; read byte from image
  40.                 and MaskTable,y     ; get masking outline of image byte and clear covered bits in bitmap
  41.                 ora BgImageBuffer+2,x   ; now or the image bytes on top of the background
  42.                 ldy #$10
  43.                 sta (BitmapPtr),y       ; and store in bitmap
  44.                 inx
  45.  
  46.                 ldy #$18
  47.                 lda (BitmapPtr),y       ; read from bitmap
  48.                 ldy BgImageBuffer+2,x   ; read byte from image
  49.                 and MaskTable,y     ; get masking outline of image byte and clear covered bits in bitmap
  50.                 ora BgImageBuffer+2,x   ; now or the image bytes on top of the background
  51.                 ldy #$18
  52.                 sta (BitmapPtr),y       ; and store in bitmap
  53.                 inx
  54.  
  55.                 lda BitmapPtr
  56.                 and #$07
  57.                 beq oneRowUp               
  58.                
  59.                 dec BitmapPtr
  60.                 dec BlockImageVisibleHeight
  61.                 bne _cont
  62.                 jmp endDraw
  63.                
  64. oneRowUp:              
  65.                 lda BitmapPtr               ; move one char row up
  66.                 sec
  67.                 sbc #$39
  68.                 sta BitmapPtr
  69.                
  70.                 lda BitmapPtr+1
  71.                 sbc #$01
  72.                 sta BitmapPtr+1
  73.            
  74.                 dec BlockImageVisibleHeight
  75.                 bne _cont
  76.             }
  77.  
  78.             jmp endDraw
  79. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement