diff --git a/libsrc/atari/cpeekchar.s b/libsrc/atari/cpeekchar.s index 6697ce230..c895059db 100644 --- a/libsrc/atari/cpeekchar.s +++ b/libsrc/atari/cpeekchar.s @@ -1,41 +1,35 @@ - .export _cpeekchar - .export _cpeekcharxy + .export _cpeekchar - .import _gotoxy - .import mul40 - .importzp ptr4 + .import mul40 + .importzp ptr4 - .include "atari.inc" + .include "atari.inc" - .segment "CODE" - -_cpeekcharxy: - - jsr _gotoxy ; Set cursor + .segment "CODE" _cpeekchar: - lda ROWCRS - jsr mul40 ; destroys tmp4 - clc - adc SAVMSC ; add start of screen memory - sta ptr4 - txa - adc SAVMSC+1 - sta ptr4+1 + lda ROWCRS + jsr mul40 ; destroys tmp4 + clc + adc SAVMSC ; add start of screen memory + sta ptr4 + txa + adc SAVMSC+1 + sta ptr4+1 - ldy COLCRS - lda (ptr4),y ; get char - tax + ldy COLCRS + lda (ptr4),y ; get char + tax - ;; convert to asc + ;; convert to asc - ;; ugly hack here to make tetris fx work :=P - lda #' ' - cpx #0 + ;; FIXME: ugly hack here to make tetris fx work :=P + lda #' ' + cpx #0 beq @l - lda #0 + lda #0 @l: ldx #0 - rts + rts diff --git a/libsrc/atmos/cpeekchar.s b/libsrc/atmos/cpeekchar.s index a1d6d4474..a03bdb6a7 100644 --- a/libsrc/atmos/cpeekchar.s +++ b/libsrc/atmos/cpeekchar.s @@ -1,36 +1,31 @@ - .include "atmos.inc" + .include "atmos.inc" -.import _gotoxy -.export _cpeekchar,_cpeekcharxy - -_cpeekcharxy: - - jsr _gotoxy ; Will pop x parameter + .export _cpeekchar _cpeekchar: - ldy CURS_Y - ldx ScrTabLo,y - stx @l+1 - ldx ScrTabHi,y - stx @l+2 - ldx CURS_X + ldy CURS_Y + ldx ScrTabLo,y + stx @l+1 + ldx ScrTabHi,y + stx @l+2 + ldx CURS_X @l: - lda $bb80,x -;; inc COORDX_TEXT - ldx #0 - rts + lda $bb80,x +;; inc COORDX_TEXT + ldx #0 + rts - ; FIXME: is that table available elsewhere? + ; FIXME: is that table available elsewhere? .rodata ScrTabLo: - .repeat 28, Line - .byte <(SCREEN + Line * 40) - .endrep + .repeat 28, Line + .byte <(SCREEN + Line * 40) + .endrep ScrTabHi: - .repeat 28, Line - .byte >(SCREEN + Line * 40) - .endrep + .repeat 28, Line + .byte >(SCREEN + Line * 40) + .endrep diff --git a/libsrc/nes/cpeekchar.s b/libsrc/nes/cpeekchar.s index 292a4591f..995e01bc1 100644 --- a/libsrc/nes/cpeekchar.s +++ b/libsrc/nes/cpeekchar.s @@ -1,40 +1,34 @@ - .export _cpeekchar - .export _cpeekcharxy + .export _cpeekchar - .import _gotoxy - .import ppubuf_waitempty + .import ppubuf_waitempty - .include "nes.inc" + .include "nes.inc" - .segment "CODE" - -_cpeekcharxy: - - jsr _gotoxy ; Set cursor + .segment "CODE" _cpeekchar: - ; wait until all console data has been written - jsr ppubuf_waitempty + ; wait until all console data has been written + jsr ppubuf_waitempty + + ldy SCREEN_PTR+1 + ldx SCREEN_PTR - ldy SCREEN_PTR+1 - ldx SCREEN_PTR - ; waiting for vblank is incredibly slow :// vwait: -; lda $2002 ;wait -; bpl vwait +; lda $2002 ;wait +; bpl vwait - lda #0 - sty $2006 + lda #0 + sty $2006 stx $2006 - ldy $2007 ; first read is invalid - ldy $2007 ; get data + ldy $2007 ; first read is invalid + ldy $2007 ; get data sta $2006 sta $2006 tya - and #$7f ; ?!?! - rts + and #$7f ; ?!?! + rts