prog8/compiler/examples/test.p8

49 lines
926 B
Plaintext
Raw Normal View History

%import c64utils
2018-12-26 03:51:21 +00:00
%option enable_floats
2018-10-16 00:26:35 +00:00
~ main {
2018-11-11 17:19:08 +00:00
;@todo implement the various byte/word division routines.
;c64scr.PLOT(screenx(x), screeny(y)) ; @todo fix argument calculation of parameters ???!!!
2018-12-26 03:51:21 +00:00
const uword width = 320
const uword height = 200
sub screenx(float x) -> word {
;return ((x/4.1* (width as float)) + 160.0) as word ;width // 2 ; @todo fix calculation
float wf = width
return (x/4.1* wf + wf / 2.0) as word
}
2018-12-26 03:51:21 +00:00
sub start() {
2018-12-20 22:28:03 +00:00
c64scr.print(" X=")
c64scr.print_ub(X)
c64.CHROUT('\n')
2018-12-26 03:51:21 +00:00
c64scr.print(" X=")
c64scr.print_ub(X)
c64.CHROUT('\n')
2018-12-26 03:51:21 +00:00
}
2018-12-21 22:10:45 +00:00
2018-12-26 03:51:21 +00:00
}
2018-12-21 22:10:45 +00:00
2018-12-26 03:51:21 +00:00
~ irq {
2018-12-18 00:43:04 +00:00
2018-12-26 03:51:21 +00:00
sub irq() {
memory ubyte[256] screenarray = $0400
memory ubyte firstscreenchar = $0400
2018-12-18 00:43:04 +00:00
2018-12-26 03:51:21 +00:00
screenarray[0]++ ; @todo incorrect code generated?
firstscreenchar++ ; ... this is okay
c64.EXTCOL++
}
2018-12-12 00:13:13 +00:00
2018-12-26 03:51:21 +00:00
}