Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- LDX #Video_RAM
- LDY #TextScreenBuffer
- ProcessRowPair
- LDU #8
- ; EVEN ROW
- ProcessEvenRow
- LDA ,X ; get first chip8 byte
- LDB #Base_Character ; pre-set graphic/color
- FirstBit LSLA ; pop off first bit/pixel
- BCC SecondBit ; Not set? ignore
- ORB #00001000b ; set top left pixel
- SecondBit LSLA ; pop off second bit/pixel
- BCC DrawPair1 ; not set? ignore and draw
- ORB #00000100b
- DrawPair1 STB ,Y+
- LDB #Base_Character
- ThirdBit LSLA
- BCC FourthBit
- ORB #00001000b
- FourthBit LSLA
- BCC DrawPair2
- ORB #00000100b
- DrawPair2 STB ,Y+
- LDB #Base_Character
- FifthBit LSLA
- BCC SixthBit
- ORB #00001000b
- SixthBit LSLA
- BCC DrawPair3
- ORB #00000100b
- DrawPair3 STB ,Y+
- LDB #Base_Character
- SeventhBit LSLA
- BCC EighthBit
- ORB #00001000b
- EighthBit LSLA
- BCC DrawPair4
- ORB #00000100b
- DrawPair4 STB ,Y+
- LDB #Base_Character
- LEAX 1,X
- LEAU -1,U
- CMPU #0
- BNE ProcessEvenRow
- ; ODD ROW
- LDU #8
- LEAY -32,Y
- ProcessOddRow
- LDA ,X ; get first chip8 byte
- LDB ,Y ; pre-set graphic/color
- OddFirstBit LSLA ; pop off first bit/pixel
- BCC OddSecondBit ; Not set? ignore
- ORB #00000010b ; set top left pixel
- OddSecondBit LSLA ; pop off second bit/pixel
- BCC OddDrawPair1 ; not set? ignore and draw
- ORB #00000001b
- OddDrawPair1 STB ,Y+
- LDB ,Y
- OddThirdBit LSLA
- BCC OddFourthBit
- ORB #00000010b
- OddFourthBit LSLA
- BCC OddDrawPair2
- ORB #00000001b
- OddDrawPair2 STB ,Y+
- LDB ,Y
- OddFifthBit LSLA
- BCC OddSixthBit
- ORB #00000010b
- OddSixthBit LSLA
- BCC OddDrawPair3
- ORB #00000001b
- OddDrawPair3 STB ,Y+
- LDB ,Y
- OddSeventhBit LSLA
- BCC OddEighthBit
- ORB #00000010b
- OddEighthBit LSLA
- BCC OddDrawPair4
- ORB #00000001b
- OddDrawPair4 STB ,Y+
- LDB ,Y
- LEAX 1,X
- LEAU -1,U
- CMPU #0
- BNE ProcessOddRow
- CMPX #Video_RAM+256
- LBNE ProcessRowPair
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement