#819 C-code baseline with CX16 developments

This commit is contained in:
Sven Van de Velde 2023-04-24 05:27:26 +00:00 committed by Jesper Balman Gravgaard
parent 3d03993175
commit 46079f3ec2
280 changed files with 17430 additions and 112505 deletions

18
.gitignore vendored
View File

@ -1,5 +1,6 @@
.project
.tmpdirs
/gen
**/.vscode/*
*/*.mon
*/*.vs
*/*.brk
@ -7,12 +8,13 @@
*/*.sym
*/.tmpdirs
*/bin/
**/.DS_Store
kickc.iml
/.idea/*
/.vscode/*
**/.vscode/*
**/.vscode/*.log
**/target/*
*/workspace.xml
**/.DS_Store
.project
.tmpdirs
**/.vscode/*.log
/.idea/*
kickc.iml
/src/main/fragment/cache
/gen/*
/src/main/fragment/cache

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,2 @@
tsx
sta STACK_BASE+{c1},x

View File

@ -0,0 +1,3 @@
tya
tsx
sta STACK_BASE+{c1},x

View File

@ -0,0 +1,9 @@
ldy {m1}
lda {c1}+3,y
pha
lda {c1}+2,y
pha
lda {c1}+1,y
pha
lda {c1},y
pha

View File

@ -0,0 +1,8 @@
lda #0
pha
lda #0
pha
lda {m1}+1
pha
lda {m1}
pha

View File

@ -1 +1 @@
jmp $e034
jmp (isr_vsync)

View File

@ -0,0 +1,7 @@
lda #<{c1}
cmp {c2}
bne !+
lda #>{c1}
cmp {c2}+1
beq {la1}
!:

View File

@ -0,0 +1,7 @@
lda #<{c1}
cmp #<{c2}
bne !+
lda #>{c1}
cmp #>{c2}
beq {la1}
!:

View File

@ -0,0 +1,8 @@
lda ({z1}),y
cmp #<{c1}
bne !+
iny
lda ({z1}),y
cmp #>{c1}
beq {la1}
!:

View File

@ -0,0 +1,6 @@
lda #<{c1}
cmp {c2}
bne {la1}
lda #>{c1}
cmp {c2}+1
bne {la1}

View File

@ -0,0 +1,4 @@
lda ({z1}),y
sec
sbc #1
sta ({z1}),y

View File

@ -0,0 +1,6 @@
lda {z1}
cmp {c1}
bne {la1}
lda {z1}+1
cmp {c1}+1
bne {la1}

View File

@ -0,0 +1,7 @@
ldy {m1}
lda #{c2}
sta {c1},y
lda #0
sta {c1}+1,y
sta {c1}+2,y
sta {c1}+3,y

View File

@ -0,0 +1,8 @@
ldy {m1}
lda #<{c2}
sta {c1},y
lda #>{c2}
sta {c1}+1,y
lda #0
sta {c1}+2,y
sta {c1}+3,y

View File

@ -0,0 +1,8 @@
lda #<{c2}
sta {c1},y
lda #>{c2}
sta {c1}+1,y
lda #<{c2}>>$10
sta {c1}+2,y
lda #>{c2}>>$10
sta {c1}+3,y

View File

@ -0,0 +1,6 @@
ldy #$00
lda ({z1}),y
sta {c1},x
iny
lda ({z1}),y
sta {c1}+1,x

View File

@ -0,0 +1,10 @@
ldy #0
lda {m1}
sta $fe
lda {m1}+1
sta $ff
lda ($fe),y
sta {m1}
iny
lda ($fe),y
sta {m1}+1

View File

@ -0,0 +1,11 @@
lda #{c1}
tay
clc
lda ({z2}),y
adc #<{c2}
sta {z1}
iny
lda ({z2}),y
adc #>{c2}
sta {z1}+1

View File

@ -0,0 +1,8 @@
ldx #0
!:
lda {c1},x
sta ({z1}),y
iny
inx
cpx #{c2}
bne !-

View File

@ -0,0 +1,8 @@
ldx #0
!:
lda {c1},x
sta ({z1}),y
iny
inx
cpx #{c2}
bne !-

View File

@ -0,0 +1,13 @@
lda {c2},y
sta $ff
clc
adc {c1},x
sta {c1},x
iny
lda $ff
ora #$7f
bmi !+
lda #0
!:
adc {c1}+1,x
sta {c1}+1,x

View File

@ -0,0 +1,7 @@
lda {c1},x
clc
adc {m1}
sta {c1},x
bcc !+
inc {c1}+1,x
!:

View File

@ -0,0 +1,6 @@
ldy {c2}
lda ({z1}),y
sta {c1},x
iny
lda ({z1}),y
sta {c1}+1,x

View File

@ -0,0 +1,13 @@
lda {c2},x
sta $ff
clc
adc {c1},y
sta {c1},y
iny
lda $ff
ora #$7f
bmi !+
lda #0
!:
adc {c1}+1,y
sta {c1}+1,y

View File

@ -0,0 +1,7 @@
lda {c1},y
clc
adc {m1}
sta {c1},y
bcc !+
inc {c1}+1,y
!:

View File

@ -0,0 +1,5 @@
lda {c2}
sta ({z1}),y
iny
lda {c2}+1
sta ({z1}),y

View File

@ -0,0 +1,8 @@
lda {m2}
sta ({z1}),y
ora #$7F
bmi !+
lda #$00
!:
iny
sta ({z1}),y

View File

@ -0,0 +1,5 @@
sta ({z2}),y
sta ({z1}),y
iny
sta ({z2}),y
sta ({z1}),y

View File

@ -0,0 +1,10 @@
iny
lda ({z1}),y
bne !+
dey
lda ({z1}),y
beq !e+
lsr
!:
bpl {la1}
!e:

View File

@ -0,0 +1,10 @@
iny
lda ({z1}),y
cmp #>{c1}
bne !+
dey
lda ({z1}),y
cmp #<{c1}
beq {la1}
!:
bcc {la1}

View File

@ -0,0 +1,8 @@
ldy {m1}
lda {c1},y
sec
sbc {m2}
sta {c1},y
lda {c1}+1,y
sbc {m2}+1
sta {c1}+1,y

View File

@ -0,0 +1,8 @@
ldy {m1}
lda {c1},y
clc
adc {m2}
sta {c1},y
lda {c1}+1,y
adc {m2}+1
sta {c1}+1,y

View File

@ -0,0 +1,6 @@
lda {c1},x
and #<{c2}
sta {c1},x
lda {c1}+1,x
and #>{c2}
sta {c1}+1,x

View File

@ -0,0 +1,6 @@
lda {c1},x
ora #<{c2}
sta {c1},x
lda {c1}+1,x
ora #>{c2}
sta {c1}+1,x

View File

@ -0,0 +1,6 @@
lda {c1},x
eor #<{c2}
sta {c1},x
lda {c1}+1,x
eor #>{c2}
sta {c1}+1,x

View File

@ -0,0 +1,7 @@
lda {c1},x
sec
sbc {m1}
sta {c1},x
lda {c1}+1,x
sbc {m1}+1
sta {c1}+1,x

View File

@ -0,0 +1,7 @@
lda {c1},x
sec
sbc {z1}
sta {c1},x
lda {c1}+1,x
sbc {z1}+1
sta {c1}+1,x

View File

@ -0,0 +1,7 @@
lda {c1},x
clc
adc {m1}
sta {c1},x
lda {c1}+1,x
adc {m1}+1
sta {c1}+1,x

View File

@ -0,0 +1,7 @@
clc
lda {c1},x
adc {z1}
sta {c1},x
lda {c1}+1,x
adc {z1}+1
sta {c1}+1,x

View File

@ -0,0 +1,6 @@
lda {c1},y
and #<{c2}
sta {c1},y
lda {c1}+1,y
and #>{c2}
sta {c1}+1,y

View File

@ -0,0 +1,6 @@
lda {c1},y
ora #<{c2}
sta {c1},y
lda {c1}+1,y
ora #>{c2}
sta {c1}+1,y

View File

@ -0,0 +1,7 @@
lda {c1},y
sec
sbc {m1}
sta {c1},y
lda {c1}+1,y
sbc {m1}+1
sta {c1}+1,y

View File

@ -0,0 +1,7 @@
lda {c1},y
clc
adc {m1}
sta {c1},y
lda {c1}+1,y
adc {m1}+1
sta {c1}+1,y

View File

@ -0,0 +1,6 @@
lda {c1}+1,y
cmp {m1}+1
bne {la1}
lda {c1},y
cmp {m1}
bne {la1}

View File

@ -0,0 +1,8 @@
ldy {z1}
lda {c1},y
sec
sbc {z2}
sta {c1},y
lda {c1}+1,y
sbc {z2}+1
sta {c1}+1,y

View File

@ -0,0 +1,8 @@
ldy {z1}
lda {c1},y
clc
adc {z2}
sta {c1},y
lda {c1}+1,y
adc {z2}+1
sta {c1}+1,y

View File

@ -0,0 +1,9 @@
lda {m1}
sta $fe
lda {m1}+1
sta $ff
lda {m2}
sta ($fe),y
iny
lda {m2}+1
sta ($fe),y

View File

@ -0,0 +1,10 @@
sec
ldy #{c1}
lda ({z1}),y
sbc {m2}
sta ({z1}),y
ldy #{c1}+1
lda ({z1}),y
sbc {m2}+1
sta ({z1}),y

View File

@ -0,0 +1,10 @@
clc
ldy #{c1}
lda ({z1}),y
adc {m2}
sta ({z1}),y
ldy #{c1}+1
lda ({z1}),y
adc {m2}+1
sta ({z1}),y

View File

@ -0,0 +1,8 @@
ldy #{c1}
lda ({z1}),y
ldy #{c1}
sta ({z1}),y
ldy #{c1}+1
lda ({z1}),y
ldy #{c1}+1
sta ({z1}),y

View File

@ -0,0 +1,8 @@
ldy #{c2}
lda ({z1}),y
ldy #{c1}
sta ({z1}),y
ldy #{c2}+1
lda ({z1}),y
ldy #{c1}+1
sta ({z1}),y

View File

@ -0,0 +1,5 @@
lda {c2}
sta ({z1}),y
iny
lda {c2}+1
sta ({z1}),y

View File

@ -0,0 +1,8 @@
ldy {z2}
lda ({z3}),y
and #<{c1}
sta ({z1}),y
iny
lda ({z3}),y
and #>{c1}
sta ({z1}),y

View File

@ -0,0 +1,8 @@
ldy {z2}
lda ({z3}),y
ora #<{c1}
sta ({z1}),y
iny
lda ({z3}),y
ora #>{c1}
sta ({z1}),y

View File

@ -0,0 +1,6 @@
lda {z1}
adc #1
sta {z1}
lda {z1}+1
adc #0
sta {z1}+1

View File

@ -0,0 +1,6 @@
lda {z2}
adc #1
sta {z1}
lda {z2}+1
adc #0
sta {z1}+1

View File

@ -0,0 +1,6 @@
ldy #$00
lda ({z1}),y
sta {c1},x
iny
lda ({z1}),y
sta {c1}+1,x

View File

@ -0,0 +1,6 @@
ldy {c2}
lda ({z1}),y
sta {c1},x
iny
lda ({z1}),y
sta {c1}+1,x

View File

@ -0,0 +1,7 @@
lda {z1}
cmp {c1},x
bne !+
lda {z1}+1
cmp {c1}+1,x
beq {la1}
!:

View File

@ -0,0 +1,7 @@
lda {z1}
cmp {c1},y
bne !+
lda {z1}+1
cmp {c1}+1,y
beq {la1}
!:

View File

@ -0,0 +1,8 @@
clc
lda {z1}
adc #1
sta {z1}
lda {z1}+1
adc #0
sta {z1}+1

View File

@ -0,0 +1,7 @@
clc
lda {z2}
adc #1
sta {z1}
lda {z2}+1
adc #0
sta {z1}+1

View File

@ -0,0 +1,7 @@
ldy #<{c1}
lda ({z1}),y
bne !+
iny
lda ({z1}),y
beq {la1}
!:

View File

@ -0,0 +1,7 @@
ldy #<{c1}
lda ({z1}),y
bne {la1}
iny
lda ({z1}),y
bne {la1}
!:

View File

@ -0,0 +1 @@
pla

View File

@ -0,0 +1,7 @@
cmp #{c1}
bcs !+
lda #0
jmp !e+
!:
lda #1
!e:

View File

@ -0,0 +1,3 @@
cmp #{c1}
lda #0
rol

View File

@ -0,0 +1,7 @@
lda {m2}
sta $fe
lda {m2}+1
sta $ff
lda ($fe),y
and #{c1}
sta {m1}

View File

@ -0,0 +1,2 @@
lda ({m2}),y
sta {m1}

View File

@ -0,0 +1,8 @@
lda {c1},x
sta {m1}
inx
lda {c1},x
sta {m1}+1
lda #0
sta {m1}+2
sta {m1}+3

View File

@ -0,0 +1,8 @@
lda {c1},y
sta {m1}
iny
lda {c1},y
sta {m1}+1
lda #0
sta {m1}+2
sta {m1}+3

View File

@ -0,0 +1,9 @@
ldy #{c1}
lda ({z2}),y
sta {m1}
iny
lda ({z2}),y
sta {m1}+1
lda #0
sta {m1}+2
sta {m1}+3

View File

@ -0,0 +1,5 @@
sta {m1}+1
sta {m1}+3
lda #{c1}
sta {m1}
stx {m1}+2

View File

@ -0,0 +1,5 @@
sta {m1}+1
lda #{c1}
sta {m1}
stx {m1}+2
stx {m1}+3

View File

@ -0,0 +1,5 @@
sta {m1}+1
lda #{c1}
sta {m1}
stx {m1}+2
sty {m1}+3

View File

@ -0,0 +1,13 @@
sec
lda #0
sbc {m1}
sta {m1}
lda #0
sbc {m1}+1
sta {m1}+1
lda #0
sbc {m1}+2
sta {m1}+2
lda #0
sbc {m1}+3
sta {m1}+3

View File

@ -0,0 +1,13 @@
sec
lda #0
sbc {m2}
sta {m1}
lda #0
sbc {m2}+1
sta {m1}+1
lda #0
sbc {m2}+2
sta {m1}+2
lda #0
sbc {m2}+3
sta {m1}+3

View File

@ -0,0 +1,12 @@
lsr {m1}+3
ror {m1}+2
ror {m1}+1
ror {m1}
lsr {m1}+3
ror {m1}+2
ror {m1}+1
ror {m1}
lsr {m1}+3
ror {m1}+2
ror {m1}+1
ror {m1}

View File

@ -0,0 +1,13 @@
sec
lda {m2}
sbc #1
sta {m1}
lda {m2}+1
sbc #0
sta {m1}+1
lda {m2}+2
sbc #0
sta {m1}+2
lda {m2}+3
sbc #0
sta {m1}+3

View File

@ -0,0 +1,13 @@
sec
lda {m2}
sbc {m1}
sta {m1}
lda {m2}+1
sbc {m1}+1
sta {m1}+1
lda {m2}+2
sbc {m1}+2
sta {m1}+2
lda {m2}+3
sbc {m1}+3
sta {m1}+3

View File

@ -15,4 +15,4 @@ rol {m1}+3
asl {m1}
rol {m1}+1
rol {m1}+2
rol {m1}+3
rol {m1}+3

View File

@ -0,0 +1,20 @@
lda {m2}
asl
sta {m1}
lda {m2}+1
rol
sta {m1}+1
lda {m2}+2
rol
sta {m1}+2
lda {m2}+3
rol
sta {m1}+3
asl {m1}
rol {m1}+1
rol {m1}+2
rol {m1}+3
asl {m1}
rol {m1}+1
rol {m1}+2
rol {m1}+3

View File

@ -0,0 +1,16 @@
lda #>{c1}>>$10
cmp {m1}+3
bcc {la1}
bne !+
lda #<{c1}>>$10
cmp {m1}+2
bcc {la1}
bne !+
lda #>{c1}
cmp {m1}+1
bcc {la1}
bne !+
lda #<{c1}
cmp {m1}
bcc {la1}
!:

View File

@ -0,0 +1,17 @@
lda {m1}+3
cmp #>{c1}>>$10
bcc {la1}
bne {la1}
lda {m1}+2
cmp #<{c1}>>$10
bcc {la1}
bne {la1}
lda {m1}+1
cmp #>{c1}
bcc {la1}
bne {la1}
lda {m1}
cmp #<{c1}
bcc {la1}
bne {la1}
!:

View File

@ -0,0 +1,12 @@
lda {m1}+3
cmp {m2}+3
bne {la1}
lda {m1}+2
cmp {m2}+2
bne {la1}
lda {m1}+1
cmp {m2}+1
bne {la1}
lda {m1}
cmp {m2}
bne {la1}

View File

@ -0,0 +1,8 @@
lda {c1},x
sta {z1}
inx
lda {c1},x
sta {z1}+1
lda #0
sta {z1}+2
sta {z1}+3

View File

@ -0,0 +1,8 @@
lda {c1},y
sta {z1}
iny
lda {c1},y
sta {z1}+1
lda #0
sta {z1}+2
sta {z1}+3

View File

@ -0,0 +1,9 @@
ldy #{c1}
lda ({z2}),y
sta {z1}
iny
lda ({z2}),y
sta {z1}+1
lda #0
sta {z1}+2
sta {z1}+3

View File

@ -0,0 +1,8 @@
lda ({z2}),y
clc
adc {c2}
sta {m1}
iny
lda ({z2}),y
adc #0
sta {m1}+1

View File

@ -0,0 +1,11 @@
clc
lda ({z2}),y
adc {m1}
sta {m1}
lda ({z2}),y
ora #$7f
bmi !+
lda #0
!:
adc {m1}+1
sta {m1}+1

View File

@ -0,0 +1,8 @@
ldy {m2}
beq !e+
!:
asl {m1}
rol {m1}+1
dey
bne !-
!e:

View File

@ -0,0 +1,7 @@
beq !e+
!:
asl {m1}
rol {m1}+1
dex
bne !-
!e:

View File

@ -0,0 +1,7 @@
beq !e+
!:
asl {m1}
rol {m1}+1
dey
bne !-
!e:

View File

@ -0,0 +1,7 @@
clc
lda {m2}
adc ({z3}),y
sta {m1}
bcc !+
inc {m1}+1
!:

View File

@ -0,0 +1,12 @@
lda {m2}
sta {m1}
lda {m2}+1
sta {m1}+1
cpx #0
beq !e+
!:
asl {m1}
rol {m1}+1
dex
bne !-
!e:

View File

@ -0,0 +1,12 @@
lda {m2}
sta {m1}
lda {m2}+1
sta {m1}+1
cpy #0
beq !e+
!:
asl {m1}
rol {m1}+1
dey
bne !-
!e:

View File

@ -0,0 +1,2 @@
lda #0
sta {m1}+1

View File

@ -0,0 +1,2 @@
lda {m2}
sta {m1}

View File

@ -0,0 +1,2 @@
lda {m2}+1
sta {m1}

Some files were not shown because too many files have changed in this diff Show More