This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.include "macros.s" | |
NEWVIDEO = $c029 | |
BORDERCOLOR = $e0c034 | |
.org $800 | |
main: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scanLineInterruptHandler: | |
.i8 ; Interrupt firmware calls us in 8-bit native mode so make sure assembler knows that | |
.a8 | |
lda $e0c032 ; Clear scanline interrupt source | |
and #%11011111 | |
sta $e0c032 | |
clc | |
rtl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/Library/Frameworks/Python.framework/Versions/3.6/bin/python3 | |
import sys,os,fileinput | |
def main(argv): | |
for line in fileinput.input(): | |
bytes = line.lstrip(".byte ").rstrip('\n').split(',') | |
print(".byte ", end="") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Display test string | |
lda #0 | |
sta PARAM1_L | |
lda #$40 ; Actually address 0, but high bits must be 01 | |
sta PARAM1_H | |
lda #<testString | |
sta PARAM2_L | |
lda #>testString | |
sta PARAM2_H | |
lda #0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ldx #$fc | |
CALL16 graphicsVramWriteByte,$0800 | |
ldx #$84 | |
CALL16 graphicsVramWriteByte,$0801 | |
ldx #$84 | |
CALL16 graphicsVramWriteByte,$0802 | |
ldx #$84 | |
CALL16 graphicsVramWriteByte,$0803 | |
ldx #$fc | |
CALL16 graphicsVramWriteByte,$0804 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.macro CALL16 subroutine,param16 | |
lda #<param16 | |
sta PARAM1_L | |
lda #>param16 | |
sta PARAM1_H | |
jsr subroutine | |
.endmacro | |
ldx #$fc | |
CALL16 graphicsVramWriteByte,$0800 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;;;;;;;;;;;;;;;;;;;;;; | |
; graphicsVramWriteByte | |
; PARAM1 : Destination VRAM address in F18A, high 2 bits must be 01 | |
; X : Byte to write | |
; | |
; Write a single byte to F18A's VRAM | |
; | |
graphicsVramWriteByte: | |
SAVE_AX |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;;;;;;;;;;;;;;;;;;;;;; | |
; graphicsModeText | |
; | |
; Begins text rendering mode | |
; | |
graphicsModeText: | |
SAVE_AX | |
F18AREGW $80,%00000000 ; Set M3 to 0 (dumb, but necessary) | |
F18AREGW $81,%01010000 ; Select Text mode (with M1,M2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;;;;;;;;;;;;;;;;;;;;;; | |
; graphicsVramWriteBlock | |
; PARAM1 : Destination VRAM address in F18A, high 2 bits must be 01 | |
; PARAM2 : Source address in main RAM, must be page-aligned | |
; PARAM3 : Number of bytes to copy | |
; | |
; Write data to F18A's VRAM | |
; | |
; Trashes PARAM2 | |
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Write to an F18A register. High 5 bits of regNum must be 10000 | |
.macro F18AREGW regNum,dataByte | |
lda #dataByte | |
sta F18AREG1 | |
lda #regNum | |
sta F18AREG1 | |
.endmacro |
NewerOlder