Sqijer v1.0 is a quick'n'dirty converter which takes a png image and turns it into ASM code which you can assemble and load into your speccy to get the image anywhere on screen (even from BASIC).
It's very basic. The image should be monocrhome, with black = PAPER and any colour = INK, with width and height multiple of 8. The thing is about drawing your image, convert it into code, modify that code with an ORG to tell it where to assemble, assemble it (with pasmo, for example), and go! The converter utility has been compiled for Windows, but the source code is included so you can compile it yourself (using freebasic) for linux, etc.
To explain how it works, we better show an example...
Tutorial
First of all we should draw a monochromatic image. I've drawn a robot sized 48x64 pixels (6x8 chars): Then we convert this image into code using sqijer.exe from the command line:
Código: Seleccionar todo
> sqijer robor.png robor.asm 6 8 roborSo we get robor.asm. We just have to decide where to put it in memory. For example, $C000, that is, 49152. To achieve that, we edit our new robor.asm file and add this line at the beginning:
Código: Seleccionar todo
org 49152Código: Seleccionar todo
> pasmo robor.asm robor.bin robor-map.txtWe fire up our emulator, switch to BASIC, and, before anything, we better issue a...
Código: Seleccionar todo
CLEAR 49151Now we load our binary at 49152 (in Spectaculatir is as easy as dragging and dropping robor.bin to the emulator window and type '49152' into the box that pops out).
Now, if ORG is the address where we have assembled and loaded the binary, the X coordinate is set POKEing it to ORG, the Y coordinate is set POKEing it to ORG+1, the colour to ORG+2, and everything is drawn if we call RANDOMIZE USR (ORG+3). Coordinates are character coordinates (x = 0 to 31, y = 0 to 23, as long as the graphic fits on screen - there's no clipping nor boundary checking, so be careful!). For example, let's paint our robot flashing in colours:
Código: Seleccionar todo
10 LET x=10: LET y=10: LET c=1: LET ORG=49152
20 GOSUB 100
30 LET c=c+1: IF c=8 THEN LET c=1
40 GOTO 20
100 POKE ORG,x: POKE ORG+1,y: POKE ORG+2,c: RANDOMIZE USR (ORG+3): RETURNHere's it. Enjoy. And submit games for the CSSCGC2011! ---
Sqijer v1.0
Sqijer v1.0 es un cutre-conversor que te pilla una imagen en png y te lo transforma en un código fuente ASM que cuando ensambles y cargues en tu Spectrum podrás llamar para imprimir dicha imagen.
Es muy cutre y básico. La imagen debe ser monocroma, con negro = PAPER y cualquier color = INK, y de dimensiones múltiplo de 8. El tema sería tener la imagen, convertirla a código, modificar ese código con un org que indique donde se va a cargar, ensamblarlo con el pasmo (por ejemplo) y listo para usar. La utilidad conversora funciona bajo windows, pero se adjunta el código fuente por si lo quieres compilar (usando freebasic) para linux, dos, etc...
Para ver como funciona, lo haremos con un ejemplo.
Tutorial
Primero dibujamos una imagen monocroma. Yo he dibujado un robor de 48 x 64 píxels (6 x 8 caracteres): Lo primero que tenemos que hacer es transformar esa imagen a código usando la utilidad sqijer.exe desde una ventana de linea de comandos:
Código: Seleccionar todo
> sqijer robor.png robor.asm 6 8 roborObtenemos, pues robor.asm. Solo tenemos que decidir donde lo vamos a colocar en la memoria. Por ejemplo, 49152. Para ello, editamos el archivo robor.asm y añadimos, justo al principio:
Código: Seleccionar todo
org 49152Código: Seleccionar todo
> pasmo robor.asm robor.bin robor-map.txtAhora abrimos nuestro emulador, y, antes que nada, escribimos:
Código: Seleccionar todo
CLEAR 49151Ahora cargamos el binario en 49152 (en Spectaculator es tan sencillo como arrastrar robor.bin a la ventana y escribir 49152 en la caja de texto).
Una vez hecho esto, si ORG es la dirección donde lo hemos ensamblado, definiremos la coordenada X pokeándola en ORG, la Y en ORG+1, el color en ORG+2, y dibujaremos haciendo un RANDOMIZE USR (ORG+3). Por ejemplo, pintemos nuestro robor cambiando de color:
Código: Seleccionar todo
10 LET x=10: LET y=10: LET c=1: LET ORG=49152
20 GOSUB 100
30 LET c=c+1: IF c=8 THEN LET c=1
40 GOTO 20
100 POKE ORG,x: POKE ORG+1,y: POKE ORG+2,c: RANDOMIZE USR (ORG+3): RETURNAquí está el paquetín. Descomprímelo donde más te guste. http://www.youtube.com/watch?v=AnMqElsLpyI