2 Commits

Author SHA1 Message Date
1237cc89eb chore: using aliases from hardware.inc and optimized divisor setup 2024-12-07 06:55:22 -06:00
Amber
808f868344 Merge pull request #12 from amberisvibin/hardware.inc
Setup hardware.inc
2024-12-05 20:59:14 -05:00

View File

@@ -13,25 +13,26 @@
ORG ROM_BASE
RESET
lda #%11000001 ; 8n1 serial, enable DLAB
; 8n1 Serial Enable DLAB
lda #(UARTF_LCR_WLS | UARTF_LCR_DLAB)
sta UART_LCR
lda #$00 ; Set divisor to 12 (9600 baud)
sta UART_DLL
lda #$0C
; REVIEW: Potential endianness hiccough here
ldd #$0C00 ; Set divisor to 12 (9600 baud)
sta UART_DLM
stb UART_DLL
lda #%11000000 ; 8n1 serial, disable DLAB
lda #(UARTF_LCR_WLS) ; 8n1 serial, disable DLAB
sta UART_LCR
lda #%01000000 ; Enable RTS
lda #(UARTF_MCR_RTS) ; Enable Request-to-Send
sta UART_MCR
lda 'H ; send 'H'
lda 'H ; send 'H'
sta UART_BUFR
WAIT
sync ; Wait for interrupts
sync ; Wait for interrupts
nop
bra WAIT