Changes

Jump to: navigation, search
/* Source code */
== Conversion ==
To convert a sprite, you can use the converter utility on download the DSK image below which contains a converter utility (to load type RUN”DISC”use RUN"DISC") which or you can be downloaded belowuse the source code provided on this page.
To use the converter utility, you must have first capture captured your standard CPC sprite (you can use the SPRITER utility on the discto do this) which must be 16 x 16 in size (8 bytes wide by 16 lines high). The converter utility will then display the sprites original and convert them converted sprite before saving the converted sprite to the disk.
== Download ==
The source code for the converter (which will assemble in [[WinApe]] and [[Maxam]]) is as follows:
<pre>
<geshi lang=Z80>
;Convert CPC sprite to Plus sprite
ld a,(hl) ;and load data from it into A
bit 7,a ;does bit 0 equal 1? if so, reset Z
ld b,&1 ;pixel 0, bit 0 = &1
call nz,addbit ;add the bit to our pixel
bit 3,a ;does bit 0 equal 1? if so, reset Z
ld b,&2 ;pixel 0, bit 1 (%0010) = &2
call nz,addbit ;add the bit to our pixel
bit 5,a ;does bit 0 equal 1? if so, reset Z
ld b,&4 ;pixel 0, bit 2 (%0100) = &4
call nz,addbit ;add the bit to our pixel
bit 1,a ;does bit 0 equal 1? if so, reset Z
ld b,&8 ;pixel 0, bit 3 (%1000) = &8
call nz,addbit ;add the bit to our pixel
ld a,(hl) ;and load it into A
bit 6,a ;does bit 0 equal 1? if so, reset Z
ld b,&1 ;pixel 1, bit 0 (%0001) = &1
call nz,addbit ;add the bit to our pixel
bit 2,a ;does bit 0 equal 1? if so, reset Z
ld b,&2 ;pixel 1, bit 1 (%0010) = &2
call nz,addbit ;add the bit to our pixel
bit 4,a ;does bit 0 equal 1? if so, reset Z
ld b,&4 ;pixel 1, bit 2 (%0100) = &4
call nz,addbit ;add the bit to our pixel
bit 0,a ;does bit 0 equal 1? if so, reset Z
ld b,&8 ;pixel 1, bit 3 (%1000) = &8
call nz,addbit ;add the bit to our pixel
spraddr: dw &9000 ;address Plus sprite is stored (&100 bytes in length)
</geshi>
</pre>
== See also ==
2,912
edits