2024-01-04 14:02:21 +00:00
|
|
|
%import textio
|
2024-01-06 23:01:00 +00:00
|
|
|
%import math
|
2023-12-31 00:02:33 +00:00
|
|
|
%zeropage basicsafe
|
2024-01-03 23:30:20 +00:00
|
|
|
%option no_sysinit
|
2023-12-31 00:02:33 +00:00
|
|
|
|
2023-10-15 20:44:34 +00:00
|
|
|
main {
|
2023-12-30 03:34:07 +00:00
|
|
|
sub start() {
|
2024-01-04 19:44:46 +00:00
|
|
|
|
2024-01-06 23:01:00 +00:00
|
|
|
ubyte @shared bb = 255
|
|
|
|
txt.print_w((bb as byte) as word) ; should print -1 !
|
|
|
|
txt.nl()
|
|
|
|
txt.print_w((bb as word)) ; should print 255 !
|
|
|
|
txt.nl()
|
|
|
|
txt.nl()
|
|
|
|
|
|
|
|
bb= 30
|
|
|
|
word @shared offset=1000
|
|
|
|
cx16.r2s = (math.sin8u(bb) as word) + offset ; 1213
|
|
|
|
txt.print_w(cx16.r2s)
|
|
|
|
txt.nl()
|
|
|
|
txt.nl()
|
|
|
|
|
|
|
|
; expected results:
|
|
|
|
; -96
|
|
|
|
; -96
|
|
|
|
; 947
|
|
|
|
; 947
|
|
|
|
|
|
|
|
word @shared wcosa = 1111
|
|
|
|
word @shared wsinb = -22
|
|
|
|
|
|
|
|
txt.print_w(wcosa*wsinb / 256)
|
|
|
|
txt.nl()
|
|
|
|
txt.print_w((wcosa*wsinb) >>8)
|
|
|
|
txt.nl()
|
|
|
|
|
|
|
|
word[] rotatedz = [-11111,-12222,-13333,-14444,-15555]
|
|
|
|
|
|
|
|
word @shared persp1 = 1000 + rotatedz[2]/256
|
|
|
|
txt.print_w(persp1)
|
|
|
|
txt.nl()
|
|
|
|
persp1 = 1000 + (rotatedz[2]>>8)
|
|
|
|
txt.print_w(persp1)
|
|
|
|
txt.nl()
|
|
|
|
|
|
|
|
|
|
|
|
; ubyte[3] cycle_reverseflags
|
|
|
|
;
|
|
|
|
; ubyte @shared flags=2
|
|
|
|
; bool @shared b1
|
|
|
|
; bool @shared b2
|
|
|
|
;
|
|
|
|
; cycle_reverseflags[1]= b1 and b2 ; flags & 2 != 0 as bool
|
2024-01-06 20:47:59 +00:00
|
|
|
|
2023-12-26 21:01:49 +00:00
|
|
|
}
|
2023-12-19 21:59:01 +00:00
|
|
|
}
|