added fixed files for c64/c16/plus4/vic20/pet

This commit is contained in:
mrdudz
2017-06-17 03:46:53 +02:00
parent b523f070f3
commit dd14f15f94
11 changed files with 413 additions and 0 deletions

39
libsrc/c16/cpeekchar.s Normal file
View File

@@ -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

21
libsrc/c16/cpeekcol.s Normal file
View File

@@ -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

39
libsrc/c64/cpeekchar.s Normal file
View File

@@ -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

21
libsrc/c64/cpeekcol.s Normal file
View File

@@ -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

View File

@@ -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

View File

@@ -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

39
libsrc/pet/cpeekchar.s Normal file
View File

@@ -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

39
libsrc/plus4/cpeekchar.s Normal file
View File

@@ -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

21
libsrc/plus4/cpeekcol.s Normal file
View File

@@ -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

39
libsrc/vic20/cpeekchar.s Normal file
View File

@@ -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

21
libsrc/vic20/cpeekcol.s Normal file
View File

@@ -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