Skip to content
This repository was archived by the owner on Jun 1, 2022. It is now read-only.

Commit 3581cfb

Browse files
committed
Add crlf routine to eeprom, code deduplicate
Also accept both carriage return and line feed in commands loop
1 parent 894112e commit 3581cfb

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

roms/boot.s

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,13 @@ hexprint:
209209
pla
210210
rts
211211

212+
crlf:
213+
lda #$0D
214+
sta $E003
215+
lda #$0A
216+
sta $E003
217+
rts
218+
212219
uuidprint:
213220
; Prints a UUID to the screen
214221
; $00, $01 - Address of UUID
@@ -234,10 +241,7 @@ uuidprint:
234241
sta $E003
235242
bra @loop
236243
@done:
237-
lda #$0d
238-
sta $E003
239-
lda #$0a
240-
sta $E003
244+
jsr crlf
241245
rts
242246

243247
_readlist:
@@ -580,7 +584,9 @@ commands:
580584
sta $E003
581585
dec inputlen
582586
bra @loop
583-
: cmp #$0D ; Return
587+
: cmp #$0D ; Carriage Return
588+
beq @exec
589+
cmp #$0A ; Line Feed
584590
beq @exec
585591
cpx #$80 ; Character
586592
beq @loop
@@ -589,9 +595,7 @@ commands:
589595
inc inputlen
590596
bra @loop
591597
@exec:
592-
sta $E003
593-
lda #$0A
594-
sta $E003
598+
jsr crlf
595599
cpx #$00 ; No Input
596600
beq @setup
597601
; @setup for comparing cmd names
@@ -902,10 +906,7 @@ cmd_list:
902906
bne :+
903907
cpx #$00
904908
bne :+
905-
lda #$0D
906-
sta $E003
907-
lda #$0A
908-
sta $E003
909+
jsr crlf
909910
bra @loop
910911
: lda $D001
911912
sta $E003
0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)