Advertisement
Guest User

Untitled

a guest
Sep 29th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.             LDX #Video_RAM     
  2.             LDY #TextScreenBuffer
  3.  
  4. ProcessRowPair
  5.             LDU #8
  6. ; EVEN ROW     
  7. ProcessEvenRow         
  8.             LDA ,X      ; get first chip8 byte
  9.             LDB #Base_Character ; pre-set graphic/color
  10. FirstBit        LSLA            ; pop off first bit/pixel
  11.             BCC SecondBit   ; Not set? ignore
  12.             ORB #00001000b  ; set top left pixel
  13. SecondBit       LSLA            ; pop off second bit/pixel
  14.             BCC DrawPair1   ; not set? ignore and draw
  15.             ORB #00000100b
  16. DrawPair1       STB ,Y+
  17.             LDB #Base_Character
  18. ThirdBit        LSLA
  19.             BCC FourthBit
  20.             ORB #00001000b
  21. FourthBit       LSLA
  22.             BCC DrawPair2
  23.             ORB #00000100b
  24. DrawPair2       STB ,Y+
  25.             LDB #Base_Character
  26. FifthBit        LSLA
  27.             BCC SixthBit
  28.             ORB #00001000b
  29. SixthBit        LSLA
  30.             BCC DrawPair3
  31.             ORB #00000100b
  32. DrawPair3       STB ,Y+
  33.             LDB #Base_Character
  34. SeventhBit      LSLA
  35.             BCC EighthBit
  36.             ORB #00001000b
  37. EighthBit       LSLA
  38.             BCC DrawPair4
  39.             ORB #00000100b
  40. DrawPair4       STB ,Y+
  41.             LDB #Base_Character
  42.            
  43.             LEAX    1,X
  44.             LEAU    -1,U
  45.             CMPU    #0
  46.             BNE ProcessEvenRow
  47.            
  48. ; ODD ROW      
  49.             LDU #8
  50.             LEAY    -32,Y
  51. ProcessOddRow          
  52.             LDA ,X      ; get first chip8 byte
  53.             LDB ,Y      ; pre-set graphic/color
  54. OddFirstBit     LSLA            ; pop off first bit/pixel
  55.             BCC OddSecondBit    ; Not set? ignore
  56.             ORB #00000010b  ; set top left pixel
  57. OddSecondBit        LSLA            ; pop off second bit/pixel
  58.             BCC OddDrawPair1    ; not set? ignore and draw
  59.             ORB #00000001b
  60. OddDrawPair1        STB ,Y+
  61.             LDB ,Y
  62. OddThirdBit     LSLA
  63.             BCC OddFourthBit
  64.             ORB #00000010b
  65. OddFourthBit        LSLA
  66.             BCC OddDrawPair2
  67.             ORB #00000001b
  68. OddDrawPair2        STB ,Y+
  69.             LDB ,Y
  70. OddFifthBit     LSLA
  71.             BCC OddSixthBit
  72.             ORB #00000010b
  73. OddSixthBit     LSLA
  74.             BCC OddDrawPair3
  75.             ORB #00000001b
  76. OddDrawPair3        STB ,Y+
  77.             LDB ,Y
  78. OddSeventhBit       LSLA
  79.             BCC OddEighthBit
  80.             ORB #00000010b
  81. OddEighthBit        LSLA
  82.             BCC OddDrawPair4
  83.             ORB #00000001b
  84. OddDrawPair4        STB ,Y+
  85.             LDB ,Y
  86.            
  87.             LEAX    1,X
  88.             LEAU    -1,U
  89.             CMPU    #0
  90.             BNE ProcessOddRow
  91.            
  92.             CMPX    #Video_RAM+256
  93.             LBNE    ProcessRowPair
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement