2018-12-11 23:15:05 +00:00
|
|
|
%import c64utils
|
2018-12-26 03:51:21 +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-22 00:07:43 +00:00
|
|
|
;@todo implement the various byte/word division routines.
|
|
|
|
|
|
|
|
;c64scr.PLOT(screenx(x), screeny(y)) ; @todo fix argument calculation of parameters ???!!!
|
2018-12-19 01:51:22 +00:00
|
|
|
|
2018-12-26 03:51:21 +00:00
|
|
|
|
|
|
|
const uword width = 320
|
|
|
|
const uword height = 200
|
|
|
|
|
|
|
|
|
2018-12-24 23:33:04 +00:00
|
|
|
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-19 02:04:27 +00:00
|
|
|
|
2018-12-26 03:51:21 +00:00
|
|
|
|
2018-12-22 00:07:43 +00:00
|
|
|
sub start() {
|
2018-12-20 01:52:33 +00:00
|
|
|
|
2018-12-20 22:28:03 +00:00
|
|
|
c64scr.print(" X=")
|
|
|
|
c64scr.print_ub(X)
|
|
|
|
c64.CHROUT('\n')
|
2018-12-19 01:51:22 +00:00
|
|
|
|
2018-12-26 03:51:21 +00:00
|
|
|
c64scr.print(" X=")
|
|
|
|
c64scr.print_ub(X)
|
2018-12-22 00:07:43 +00:00
|
|
|
c64.CHROUT('\n')
|
2018-12-19 01:51:22 +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
|
|
|
}
|
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-10-16 20:49:19 +00:00
|
|
|
}
|
2018-12-12 00:13:13 +00:00
|
|
|
|
2018-12-26 03:51:21 +00:00
|
|
|
}
|