Mercurial > hg > Members > kono > nitros9-code
changeset 3246:be3446f758ca
Updated dwread.asm and dwwrite.asm so that the 6551 routines could have specially defined
flags so that some of the addresses could be overridden by the make files if needed.
author | David Ladd <drencor-xeen@users.sourceforge.net> |
---|---|
date | Sun, 11 Mar 2018 01:30:30 -0600 |
parents | e17533e90076 |
children | 0aaa348afc57 |
files | level1/modules/dwread.asm level1/modules/dwwrite.asm |
diffstat | 2 files changed, 34 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/level1/modules/dwread.asm Fri Mar 09 13:43:06 2018 -0600 +++ b/level1/modules/dwread.asm Sun Mar 11 01:30:30 2018 -0600 @@ -40,6 +40,18 @@ IFNDEF SY6551B SY6551B EQU $FF68 ; Set base address for future use ENDC + IFNDEF SYDATA +SYDATA EQU SY6551B + ENDC + IFNDEF SYCONT +SYCONT EQU SY6551B+3 + ENDC + IFNDEF SYCOMM +SYCOMM EQU SY6551B+2 + ENDC + IFNDEF SYSTAT +SYSTAT EQU SY6551B+1 + ENDC * NOTE: There is no timeout currently on here... DWRead clra ; clear Carry (no framing error) deca ; clear Z flag, A = timeout msb ($ff) @@ -50,10 +62,10 @@ IFEQ NOINTMASK orcc #IntMasks ENDC -loop@ ldb SY6551B+1 +loop@ ldb SYSTAT andb #$08 beq loop@ - ldb SY6551B + ldb SYDATA stb ,u+ abx leay ,-y
--- a/level1/modules/dwwrite.asm Fri Mar 09 13:43:06 2018 -0600 +++ b/level1/modules/dwwrite.asm Sun Mar 11 01:30:30 2018 -0600 @@ -34,20 +34,35 @@ IFNDEF SY6551B SY6551B EQU $FF68 ; Set base address for future use ENDC + IFNDEF SYDATA +SYDATA EQU SY6551B + ENDC + IFNDEF SYCONT +SYCONT EQU SY6551B+3 + ENDC + IFNDEF SYCOMM +SYCOMM EQU SY6551B+2 + ENDC + IFNDEF SYSTAT +SYSTAT EQU SY6551B+1 + ENDC + IFNDEF SYCONSET +SYCONSET EQU $10 ; Default baud rate 115200 + ENDC DWWrite pshs d,cc ; preserve registers IFEQ NOINTMASK orcc #IntMasks ; mask interrupts ENDC - lda #$10 ; Set baud to 115K - sta SY6551B+3 ; write the info to register + lda #SYCONSET ; Set baud to value of SYCONSET + sta SYCONT ; write the info to register lda #$0B ; Set no parity, no irq - sta SY6551B+2 ; write the info to register + sta SYCOMM ; write the info to register txByte - lda SY6551B+1 ; read status register to check + lda SYSTAT ; read status register to check anda #$10 ; if transmit buffer is empty beq txByte ; if not loop back and check again lda ,x+ ; load byte from buffer - sta SY6551B ; and write it to data register + sta SYDATA ; and write it to data register leay -1,y ; decrement byte counter bne txByte ; loop if more to send puls cc,d,pc ; restore registers and return