The trick is obviously to fill the right parts of the screen memory.
I have made my first little experiments with Z88DK, and the speed of the resulting program (compared to Basic) gives me motivation for further work...
an expample for PLOT is here:
https://www.z88dk.org/wiki/doku.php?id= ... 1&s=plot
If you want to plot in HIRES, use the "graphic"-library:
https://www.z88dk.org/wiki/doku.php?id= ... =graphic
Code: Select all
10 FOR X=0 TO 63 20 PLOT X,43 30 PLOT X,0 40 NEXT X 50 FOR Y=1 TO 42 60 PLOT 0,Y 70 PLOT 63,Y 80 NEXT Y
The hires functions in graphics.h look very interesting as well, but I assume that this requires WRX, right?
Yes, your hardware (or EO ) needs to support a HIRES modification. WRX is one of the easiest modifications:
https://www.z88dk.org/wiki/doku.php?id= ... ersion_1.8
I had a look at the source of the Z8048 game, and there the drawGrid() function fills the appropriate parts of the screen memory to display the grid, however using "text mode". Maybe the same can be achieved in low-res graphics?
p.s just re-read previous post.... working on unplot now hahaha
I may seem entirely hopeless, but can anyone please assist me in wrapping this ASM code into a C function? I know that you need to put the ASM code between #asm and #endasm, but everything else regarding ASM in z88dk is currently trial and error for me.
I should have checked the z88dk forums first, because here is a discussion on exactly this PLOT topic. I have tried using the final "CALLEE" function from there, and it compiles ok, but for some reason the plotted blocks just don't appear on the screen. Maybe I will post that later as well.