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
|
|
|
;c64scr.PLOT(screenx(x), screeny(y)) ; @todo fix argument calculation???!!!
|
|
|
|
|
2018-12-19 02:04:27 +00:00
|
|
|
; @todo unify the type cast functions... "wrd(5)" -> "5 as word"
|
|
|
|
|
2018-12-20 01:52:33 +00:00
|
|
|
; @todo docs: "integer / int will not result in float but is integer floor division." verify this!
|
|
|
|
|
2018-12-19 01:51:22 +00:00
|
|
|
sub toscreenx(float x, float z) -> word {
|
2018-12-20 14:49:31 +00:00
|
|
|
return 42.w as word
|
2018-12-19 01:51:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
asmsub blerp(ubyte x @ A, uword ding @ XY) -> clobbers() -> () {
|
2018-12-20 01:52:33 +00:00
|
|
|
word qq = A as word
|
2018-12-19 01:51:22 +00:00
|
|
|
}
|
|
|
|
|
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
|
|
|
|