2018-12-11 23:15:05 +00:00
|
|
|
%import c64utils
|
2018-12-19 01:51:22 +00:00
|
|
|
%import mathlib
|
2018-12-13 00:19:43 +00:00
|
|
|
%option enable_floats
|
2018-10-16 00:26:35 +00:00
|
|
|
|
2018-12-04 21:30:35 +00:00
|
|
|
~ main {
|
2018-11-11 17:19:08 +00:00
|
|
|
|
2018-12-19 01:51:22 +00:00
|
|
|
c64.TIME_HI=1 ; @todo WARNING about 'free' statements in main
|
|
|
|
c64.TIME_MID=0
|
|
|
|
c64.TIME_LO=0
|
|
|
|
|
|
|
|
;c64scr.PLOT(screenx(x), screeny(y)) ; @todo fix argument calculation???!!!
|
|
|
|
|
|
|
|
sub toscreenx(float x, float z) -> word {
|
|
|
|
return 42
|
|
|
|
}
|
|
|
|
|
|
|
|
asmsub blerp(ubyte x @ A, uword ding @ XY) -> clobbers() -> () {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2018-12-17 14:52:37 +00:00
|
|
|
sub start() {
|
2018-12-18 00:43:04 +00:00
|
|
|
|
2018-12-19 01:51:22 +00:00
|
|
|
word x = toscreenx(1.22, 3.22)
|
|
|
|
blerp(4, 555)
|
2018-12-18 00:43:04 +00:00
|
|
|
|
|
|
|
|
2018-12-19 01:51:22 +00:00
|
|
|
; const byte width=20
|
|
|
|
; word w1
|
|
|
|
; byte b1
|
|
|
|
; ubyte ub1
|
|
|
|
; float x = 3.45
|
|
|
|
; b1 = fintb(x * flt(width)/4.2) + width//2
|
|
|
|
; c64scr.print_byte(b1)
|
|
|
|
; c64.CHROUT('\n')
|
|
|
|
; b1 = fintb(x/4.2 * flt(width)) + width//2
|
|
|
|
; c64scr.print_byte(b1)
|
|
|
|
; c64.CHROUT('\n')
|
|
|
|
; ub1 = b2ub(fintb(x * flt(width)/4.2) + width//2)
|
|
|
|
; c64scr.print_ubyte(ub1)
|
|
|
|
; c64.CHROUT('\n')
|
|
|
|
; ub1 = b2ub(fintb(x/4.2 * flt(width)) + width//2)
|
|
|
|
; c64scr.print_ubyte(ub1)
|
|
|
|
; c64.CHROUT('\n')
|
|
|
|
; w1 = fintw(x * flt(width)/4.2) + width//2
|
|
|
|
; c64scr.print_word(w1)
|
|
|
|
; c64.CHROUT('\n')
|
|
|
|
; w1 = fintw(x/4.2 * flt(width)) + width//2
|
|
|
|
; c64scr.print_word(w1)
|
|
|
|
; c64.CHROUT('\n')
|
|
|
|
;uw1 = w2uw(fintw(x * flt(width)/4.2) + width//2) ; @todo w2uw
|
2018-12-18 00:43:04 +00:00
|
|
|
|
2018-12-04 21:30:35 +00:00
|
|
|
}
|
2018-10-16 20:49:19 +00:00
|
|
|
}
|
2018-12-12 00:13:13 +00:00
|
|
|
|