You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

305 lines
4.8 KiB
ArmAsm

;
; File generated by cc65 v 2.13.3
;
.fopt compiler,"cc65 v 2.13.3"
.setcpu "65C02"
.smart on
.autoimport on
.case on
.debuginfo off
.importzp sp, sreg, regsave, regbank, tmp1, ptr1, ptr2
.macpack longbranch
.import _rb_enable
.import _rb_set_window
.export _init_tests
.export _print
.export _con
.export _blit
.export _linefeed
.export _cursor
.segment "DATA"
_cursor:
.byte $00
.segment "BSS"
_con:
.res 2,$00
; ---------------------------------------------------------------
; void __near__ init_tests (void)
; ---------------------------------------------------------------
.segment "CODE"
.proc _init_tests: near
.segment "CODE"
ldx #$03
lda #$00
jsr _rb_set_window
ldx #$03
lda #$00
sta _con
stx _con+1
jsr _rb_enable
rts
.endproc
; ---------------------------------------------------------------
; void __near__ print (__near__ unsigned char*)
; ---------------------------------------------------------------
.segment "CODE"
.proc _print: near
.segment "CODE"
lda #$00
jsr pusha
ldy #$02
jsr ldaxysp
ldy #$00
jsr ldauidx
cmp #$00
jsr booleq
jeq L0029
jmp L0045
L0029: lda _con
ldx _con+1
jsr pushax
ldx #$00
lda #$2F
ldy #$00
jsr staspidx
ldx #$00
lda _cursor
cmp #$00
jsr booleq
jeq L002E
jsr _linefeed
L002E: ldy #$02
jsr ldaxysp
jsr pushax
ldy #$02
ldx #$00
lda (sp),y
jsr tosaddax
ldy #$00
jsr ldauidx
cmp #$00
jsr boolne
jeq L0035
ldy #$00
ldx #$00
lda (sp),y
cmp #$80
jsr boolult
jne L0033
L0035: ldx #$00
lda #$00
jeq L0036
L0033: ldx #$00
lda #$01
L0036: jeq L0032
ldy #$02
jsr ldaxysp
jsr pushax
ldy #$02
ldx #$00
lda (sp),y
jsr tosaddax
ldy #$00
jsr ldauidx
cmp #$0A
jsr booleq
jne L0038
ldx #$00
lda _cursor
cmp #$50
jsr booleq
jne L0038
ldx #$00
lda #$00
jeq L003A
L0038: ldx #$00
lda #$01
L003A: jeq L0037
ldx #$00
lda #$00
sta _cursor
jsr _linefeed
jmp L003E
L0037: lda _con
ldx _con+1
ldy #$10
jsr incaxy
jsr pushax
ldx #$00
lda _cursor
jsr tosaddax
jsr pushax
ldy #$04
jsr ldaxysp
jsr pushax
ldy #$04
ldx #$00
lda (sp),y
jsr tosaddax
ldy #$00
jsr ldauidx
ldy #$00
jsr staspidx
ldx #$00
inc _cursor
lda _cursor
L003E: ldy #$00
ldx #$00
clc
lda #$01
adc (sp),y
sta (sp),y
jmp L002E
L0032: ldy #$00
ldx #$00
lda (sp),y
cmp #$80
jsr boolult
jeq L0045
ldx #$00
lda #$00
sta _cursor
L0045: jsr incsp3
rts
.endproc
; ---------------------------------------------------------------
; void __near__ blit (unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char)
; ---------------------------------------------------------------
.segment "CODE"
.proc _blit: near
.segment "CODE"
lda _con
ldx _con+1
jsr pushax
ldy #$07
ldx #$00
lda (sp),y
ldy #$08
jsr staspidx
lda _con
ldx _con+1
jsr pushax
ldy #$06
ldx #$00
lda (sp),y
ldy #$09
jsr staspidx
lda _con
ldx _con+1
jsr pushax
ldy #$05
ldx #$00
lda (sp),y
ldy #$0A
jsr staspidx
lda _con
ldx _con+1
jsr pushax
ldy #$04
ldx #$00
lda (sp),y
ldy #$0B
jsr staspidx
lda _con
ldx _con+1
jsr pushax
ldy #$03
ldx #$00
lda (sp),y
ldy #$0C
jsr staspidx
lda _con
ldx _con+1
jsr pushax
ldy #$02
ldx #$00
lda (sp),y
ldy #$0D
jsr staspidx
lda _con
ldx _con+1
jsr pushax
ldy #$08
ldx #$00
lda (sp),y
ldy #$07
jsr staspidx
L0012: lda _con
ldx _con+1
ldy #$07
jsr ldauidx
cmp #$00
jsr boolne
jeq L0013
jmp L0012
L0013: jsr incsp7
rts
.endproc
; ---------------------------------------------------------------
; void __near__ linefeed (void)
; ---------------------------------------------------------------
.segment "CODE"
.proc _linefeed: near
.segment "CODE"
lda #$03
jsr pusha
lda #$00
jsr pusha
lda #$01
jsr pusha
lda #$00
jsr pusha
lda #$00
jsr pusha
lda #$50
jsr pusha
lda #$2F
jsr pusha
jsr _blit
lda #$01
jsr pusha
lda #$20
jsr pusha
lda #$00
jsr pusha
lda #$00
jsr pusha
lda #$2F
jsr pusha
lda #$50
jsr pusha
lda #$01
jsr pusha
jsr _blit
rts
.endproc