diff --git a/libsrc/c16/cpeekchar.s b/libsrc/c16/cpeekchar.s new file mode 100644 index 000000000..5d89570f1 --- /dev/null +++ b/libsrc/c16/cpeekchar.s @@ -0,0 +1,39 @@ + + .export _cpeekchar + .export _cpeekcharxy + + .import _gotoxy + + .include "c16.inc" + + .segment "CODE" + +_cpeekcharxy: + + jsr _gotoxy ; Set cursor + +_cpeekchar: + + ldy CURS_X + lda (SCREEN_PTR),y ; get char + ldx #0 + + and #$7f + + ; 0 - $1f +$40 + ; $20 - $3f + ; $40 - $7e +$80 + + cmp #$1f + bcs @sk1 +;; clc + adc #$40 + rts + +@sk1: + cmp #$40 + bcc @end + clc + adc #$80 +@end: + rts diff --git a/libsrc/c16/cpeekcol.s b/libsrc/c16/cpeekcol.s new file mode 100644 index 000000000..41fed7b9f --- /dev/null +++ b/libsrc/c16/cpeekcol.s @@ -0,0 +1,21 @@ + + .export _cpeekcol + .export _cpeekcolxy + + .import _gotoxy + + .include "c16.inc" + + .segment "CODE" + +_cpeekcolxy: + + jsr _gotoxy ; Set cursor + +_cpeekcol: + + ldy CURS_X + lda (CRAM_PTR),y ; get color + ;and #$0f is this ok? + ldx #0 + rts diff --git a/libsrc/c64/cpeekchar.s b/libsrc/c64/cpeekchar.s new file mode 100644 index 000000000..33d0284e7 --- /dev/null +++ b/libsrc/c64/cpeekchar.s @@ -0,0 +1,39 @@ + + .export _cpeekchar + .export _cpeekcharxy + + .import _gotoxy + + .include "c64.inc" + + .segment "CODE" + +_cpeekcharxy: + + jsr _gotoxy ; Set cursor + +_cpeekchar: + + ldy CURS_X + lda (SCREEN_PTR),y ; get char + ldx #0 + + and #$7f + + ; 0 - $1f +$40 + ; $20 - $3f + ; $40 - $7e +$80 + + cmp #$1f + bcs @sk1 +;; clc + adc #$40 + rts + +@sk1: + cmp #$40 + bcc @end + clc + adc #$80 +@end: + rts diff --git a/libsrc/c64/cpeekcol.s b/libsrc/c64/cpeekcol.s new file mode 100644 index 000000000..60fb45c7b --- /dev/null +++ b/libsrc/c64/cpeekcol.s @@ -0,0 +1,21 @@ + + .export _cpeekcol + .export _cpeekcolxy + + .import _gotoxy + + .include "c64.inc" + + .segment "CODE" + +_cpeekcolxy: + + jsr _gotoxy ; Set cursor + +_cpeekcol: + + ldy CURS_X + lda (CRAM_PTR),y ; get color + and #$0f + ldx #0 + rts diff --git a/libsrc/c64/soft80_cpeekchar.s b/libsrc/c64/soft80_cpeekchar.s new file mode 100644 index 000000000..21a9fc5e7 --- /dev/null +++ b/libsrc/c64/soft80_cpeekchar.s @@ -0,0 +1,113 @@ + + .export _cpeekchar + .export _cpeekcharxy + + .import _gotoxy + .import soft80_hi_charset + .import soft80_lo_charset + + .include "c64.inc" + + .macpack longbranch + + .segment "CODE" + +readdirect: +; sei +; dec $01 ;; assumed = $36 +; dec $01 ;; assumed = $36 + lda (SCREEN_PTR),y +; inc $01 +; inc $01 +; cli + rts + +_cpeekcharxy: + + jsr _gotoxy ; Set cursor + +_cpeekchar: + +;;rts + sei + ;;dec $01 ;; assumed = $36 + ;;dec $01 ;; assumed = $36 + lda #$34 + sta $01 + + lda CURS_X + and #$01 + + jne @l1a + +;; inc $d020 + +;;jmp * + + ldx #0 +@l2aa: + ldy #0 + +;; stx $d020 + + .repeat 8,line +;; jsr readdirect + lda (SCREEN_PTR),y + and #$f0 + sta $e100,y + cmp soft80_hi_charset+(line*$80),x +; cmp #0 + bne @l2b + .if (line < 7) + iny + .endif + .endrepeat + + +@backok: +;inc $d020 +; inc $01 +; inc $01 + lda #$36 + sta $01 + cli + txa + ; sec +; sbc #$20 + ldx #$00 + rts +@l2b: +;jmp * + inx + cpx #$80 + jne @l2aa +@backerr: + ;; inc $01 +;; inc $01 + lda #$36 + sta $01 + cli + ldx #0 + txa + rts + +@l1a: + ldx #0 +@l1aa: + ldy #0 + .repeat 8,line +;; jsr readdirect + lda (SCREEN_PTR),y + and #$0f + eor soft80_lo_charset+(line*$80),x + bne @l2bb + .if line < 7 + iny + .endif + .endrepeat + jmp @backok +@l2bb: + inx + cpx #$80 + bne @l1aa + jmp @backerr diff --git a/libsrc/c64/soft80_cpeekcol.s b/libsrc/c64/soft80_cpeekcol.s new file mode 100644 index 000000000..9891ab28a --- /dev/null +++ b/libsrc/c64/soft80_cpeekcol.s @@ -0,0 +1,21 @@ + + .export _cpeekcol + .export _cpeekcolxy + + .import _gotoxy + + .include "c64.inc" + + .segment "CODE" + +_cpeekcolxy: + + jsr _gotoxy ; Set cursor + +_cpeekcol: + + ldy #0 + lda (CRAM_PTR),y ; get char + and #$0f + ldx #0 + rts diff --git a/libsrc/pet/cpeekchar.s b/libsrc/pet/cpeekchar.s new file mode 100644 index 000000000..c846beb56 --- /dev/null +++ b/libsrc/pet/cpeekchar.s @@ -0,0 +1,39 @@ + + .export _cpeekchar + .export _cpeekcharxy + + .import _gotoxy + + .include "pet.inc" + + .segment "CODE" + +_cpeekcharxy: + + jsr _gotoxy ; Set cursor + +_cpeekchar: + + ldy CURS_X + lda (SCREEN_PTR),y ; get char + ldx #0 + + and #$7f + + ; 0 - $1f +$40 + ; $20 - $3f + ; $40 - $7e +$80 + + cmp #$1f + bcs @sk1 +;; clc + adc #$40 + rts + +@sk1: + cmp #$40 + bcc @end + clc + adc #$80 +@end: + rts diff --git a/libsrc/plus4/cpeekchar.s b/libsrc/plus4/cpeekchar.s new file mode 100644 index 000000000..1d47c6d64 --- /dev/null +++ b/libsrc/plus4/cpeekchar.s @@ -0,0 +1,39 @@ + + .export _cpeekchar + .export _cpeekcharxy + + .import _gotoxy + + .include "plus4.inc" + + .segment "CODE" + +_cpeekcharxy: + + jsr _gotoxy ; Set cursor + +_cpeekchar: + + ldy CURS_X + lda (SCREEN_PTR),y ; get char + ldx #0 + + and #$7f + + ; 0 - $1f +$40 + ; $20 - $3f + ; $40 - $7e +$80 + + cmp #$1f + bcs @sk1 +;; clc + adc #$40 + rts + +@sk1: + cmp #$40 + bcc @end + clc + adc #$80 +@end: + rts diff --git a/libsrc/plus4/cpeekcol.s b/libsrc/plus4/cpeekcol.s new file mode 100644 index 000000000..0f3258eb3 --- /dev/null +++ b/libsrc/plus4/cpeekcol.s @@ -0,0 +1,21 @@ + + .export _cpeekcol + .export _cpeekcolxy + + .import _gotoxy + + .include "plus4.inc" + + .segment "CODE" + +_cpeekcolxy: + + jsr _gotoxy ; Set cursor + +_cpeekcol: + + ldy CURS_X + lda (CRAM_PTR),y ; get color + ;and #$0f is this ok? + ldx #0 + rts diff --git a/libsrc/vic20/cpeekchar.s b/libsrc/vic20/cpeekchar.s new file mode 100644 index 000000000..fae7ec1b4 --- /dev/null +++ b/libsrc/vic20/cpeekchar.s @@ -0,0 +1,39 @@ + + .export _cpeekchar + .export _cpeekcharxy + + .import _gotoxy + + .include "vic20.inc" + + .segment "CODE" + +_cpeekcharxy: + + jsr _gotoxy ; Set cursor + +_cpeekchar: + + ldy CURS_X + lda (SCREEN_PTR),y ; get char + ldx #0 + + and #$7f + + ; 0 - $1f +$40 + ; $20 - $3f + ; $40 - $7e +$80 + + cmp #$1f + bcs @sk1 +;; clc + adc #$40 + rts + +@sk1: + cmp #$40 + bcc @end + clc + adc #$80 +@end: + rts diff --git a/libsrc/vic20/cpeekcol.s b/libsrc/vic20/cpeekcol.s new file mode 100644 index 000000000..59bf057ff --- /dev/null +++ b/libsrc/vic20/cpeekcol.s @@ -0,0 +1,21 @@ + + .export _cpeekcol + .export _cpeekcolxy + + .import _gotoxy + + .include "vic20.inc" + + .segment "CODE" + +_cpeekcolxy: + + jsr _gotoxy ; Set cursor + +_cpeekcol: + + ldy CURS_X + lda (CRAM_PTR),y ; get color + and #$0f + ldx #0 + rts