2020-09-20 21:49:36 +00:00
|
|
|
%import textio
|
2020-12-22 02:35:00 +00:00
|
|
|
%import diskio
|
2020-12-21 23:59:07 +00:00
|
|
|
;%import floats
|
|
|
|
;%import graphics
|
2020-11-15 14:04:23 +00:00
|
|
|
%zeropage basicsafe
|
2020-11-20 21:15:14 +00:00
|
|
|
%import test_stack
|
2020-12-08 00:02:38 +00:00
|
|
|
%option no_sysinit
|
|
|
|
|
2020-12-08 21:54:20 +00:00
|
|
|
main {
|
2020-12-21 23:59:07 +00:00
|
|
|
|
|
|
|
;romsub $ff14 = FB_set_8_pixels_opaque(ubyte pattern @R0, ubyte mask @A, ubyte color1 @X, ubyte color2 @Y) clobbers(A,X,Y)
|
|
|
|
;romsub $ff14 = FB_set_8_pixels_opaque_OLD(ubyte mask @A, ubyte color1 @X, ubyte color2 @Y) clobbers(A,X,Y)
|
|
|
|
|
|
|
|
asmsub set_8_pixels_opaque(ubyte pattern @R0, ubyte mask @A, ubyte color1 @X, ubyte color2 @Y) clobbers(A,X,Y) {
|
|
|
|
|
|
|
|
%asm {{
|
|
|
|
sta _a
|
|
|
|
stx _x
|
|
|
|
sty _y
|
|
|
|
|
|
|
|
lda _a
|
|
|
|
jsr txt.print_ub
|
|
|
|
lda #13
|
|
|
|
jsr c64.CHROUT
|
|
|
|
lda _x
|
|
|
|
jsr txt.print_ub
|
|
|
|
lda #13
|
|
|
|
jsr c64.CHROUT
|
|
|
|
lda _y
|
|
|
|
jsr txt.print_ub
|
|
|
|
lda #13
|
|
|
|
jsr c64.CHROUT
|
|
|
|
lda cx16.r0
|
|
|
|
ldy cx16.r0+1
|
|
|
|
jsr txt.print_uw
|
|
|
|
lda #13
|
|
|
|
jsr c64.CHROUT
|
|
|
|
rts
|
|
|
|
|
|
|
|
_a .byte 0
|
|
|
|
_x .byte 0
|
|
|
|
_y .byte 0
|
|
|
|
}}
|
|
|
|
}
|
|
|
|
|
|
|
|
asmsub set_8_pixels_opaque_OLD(ubyte mask @A, ubyte color1 @X, ubyte color2 @Y) clobbers(A,X,Y) {
|
|
|
|
%asm {{
|
|
|
|
sta _a
|
|
|
|
stx _x
|
|
|
|
sty _y
|
|
|
|
|
|
|
|
lda _a
|
|
|
|
jsr txt.print_ub
|
|
|
|
lda #13
|
|
|
|
jsr c64.CHROUT
|
|
|
|
lda _x
|
|
|
|
jsr txt.print_ub
|
|
|
|
lda #13
|
|
|
|
jsr c64.CHROUT
|
|
|
|
lda _y
|
|
|
|
jsr txt.print_ub
|
|
|
|
lda #13
|
|
|
|
jsr c64.CHROUT
|
|
|
|
rts
|
|
|
|
|
|
|
|
_a .byte 0
|
|
|
|
_x .byte 0
|
|
|
|
_y .byte 0
|
|
|
|
}}
|
|
|
|
}
|
|
|
|
|
2020-12-22 04:43:02 +00:00
|
|
|
asmsub withasm(uword foo @R0, ubyte arg1 @A, ubyte arg2 @Y) clobbers(X) -> ubyte @A {
|
|
|
|
%asm {{
|
|
|
|
sty P8ZP_SCRATCH_REG
|
|
|
|
clc
|
|
|
|
adc P8ZP_SCRATCH_REG
|
|
|
|
rts
|
|
|
|
}}
|
|
|
|
}
|
|
|
|
|
|
|
|
sub derp(uword aa)-> uword {
|
|
|
|
return 9999+aa
|
|
|
|
}
|
2020-12-22 02:35:00 +00:00
|
|
|
|
2020-12-22 04:43:02 +00:00
|
|
|
sub start () {
|
2020-12-22 05:13:14 +00:00
|
|
|
txt.print_ub(target())
|
2020-12-22 03:52:46 +00:00
|
|
|
txt.chrout('\n')
|
2020-12-22 02:35:00 +00:00
|
|
|
|
2020-12-21 23:59:07 +00:00
|
|
|
; cx16.r0 = 65535
|
|
|
|
; set_8_pixels_opaque_OLD(111,222,33)
|
|
|
|
; txt.chrout('\n')
|
2020-12-22 02:35:00 +00:00
|
|
|
; ;ubyte qq=c64.CHKIN(3) ;; TODO fix compiler crash "can't translate zero return values in assignment"
|
|
|
|
;
|
|
|
|
; test_stack.test()
|
|
|
|
; ubyte bb = 44
|
|
|
|
; set_8_pixels_opaque(bb,111,222,33)
|
|
|
|
; txt.chrout('\n')
|
|
|
|
; test_stack.test()
|
|
|
|
;
|
|
|
|
; set_8_pixels_opaque(c64.CHRIN(),111,222,33)
|
|
|
|
; txt.chrout('\n')
|
2020-12-21 22:22:02 +00:00
|
|
|
|
2020-12-21 23:59:07 +00:00
|
|
|
test_stack.test()
|
2020-12-03 17:39:32 +00:00
|
|
|
}
|
2020-08-27 17:47:50 +00:00
|
|
|
}
|