Skip to content

Commit

Permalink
cleanup ascii2screencode routine
Browse files Browse the repository at this point in the history
  • Loading branch information
hpingel committed Sep 5, 2023
1 parent 0e2ce37 commit da4b16e
Showing 1 changed file with 8 additions and 21 deletions.
29 changes: 8 additions & 21 deletions sktp2wic.asm
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ endOfNODOLOMsg:

printDLURLChar:
jsr read_byte
; jsr printstrlp
; jsr ascii2screencode
jsr $ffd2
dec sktpChunkType
bne printDLURLChar
Expand Down Expand Up @@ -383,7 +383,7 @@ handleCharRepeatChunk: ; chunk type #1
jsr prepareStuff

jsr read_byte ; char
jsr printstrlp
jsr ascii2screencode
tax
ldy #00
charRepeat:
Expand Down Expand Up @@ -438,7 +438,7 @@ handleNormalChunk: ; chunk type 0
chunk0_loop:
jsr read_byte
;convert ascii to screencode
jsr printstrlp
jsr ascii2screencode
tax
;check if reverse flag is set, if so, modify petscii values
lda sktpChunkColor
Expand Down Expand Up @@ -1147,24 +1147,14 @@ doread:
rts

;--------------------------------------------
;ascii to screencode

printstrlp:
cmp #160 ;uppercase on mixed case
ascii2screencode:
;--------------------------------------------
cmp #160 ;uppercase on mixed case
bcs conv
cmp #96 ;uppercase on mixed case
cmp #96 ;uppercase on mixed case
bcs uppconv
cmp #64 ;lowercase on mixed case
cmp #64 ;lowercase on mixed case
bcs conv
cmp #32 ;' ' character
beq noconv
cmp #33 ;: character
beq noconv
cmp #58 ;: character
beq noconv
cmp #42 ;* character
beq noconv
cmp #48 ;numbers 0-9
jmp noconv
conv:
secv
Expand All @@ -1175,9 +1165,6 @@ uppconv:
noconv:
clc
rts
numconv:
bcc noconv
jmp conv

;---------------------------------

Expand Down

0 comments on commit da4b16e

Please sign in to comment.