General Category > Programming

Example Z80 assembly programs (was:ASM source code)

<< < (2/35) > >>

redbox:

--- Quote from: arnoldemu on 23:29, 19 April 10 ---Source shows the type of sprites used in Mission Genocide, Ghosts and Goblins, Bubble Bobble, Ghouls and Ghosts.

--- End quote ---

That's a really cool example, will have a play around with it.

arnoldemu:

--- Quote from: redbox on 20:05, 21 April 10 ---That's a really cool example, will have a play around with it.

--- End quote ---

:) remember it is not optimised!

The sprite drawing and erase loops could be unrolled to speed it up for example.
Also i use the firmware for checking keys pressed, this could be changed for direct hardware reading.
So there is scope to improve it.

arnoldemu:
New source:

http://www.cpctech.org.uk/source/maskspr.asm

An example that shows a mode 0 sprite over a background. Pen 0 of sprite is transparent, leaving 15 pens for use with the sprite.
Background can use any of the 16 colours. Sprite is masked when it is drawn to screen.
Background behind sprite is stored in a buffer.

Sprite x movement is by the byte (so 2 pixels at a time in X).
Sprite y movement is by the line (1 pixel in Y).

Again, the code is not optimised.

Code also shows use of a 256-byte aligned mask table, how to create it and how to use it to mask the sprite.

NOTE: Background from internet at a site that claims that the picture is free for use.
Sprite is my own ;)

Devilmarkus:
Cool...
Your asm codes really help me to improve JavaCPC's Z80 assembler ;)
The source for rotosprites compiles well after I found a missing command ;)

arnoldemu:

--- Quote from: Devilmarkus on 23:55, 21 April 10 ---Cool...
Your asm codes really help me to improve JavaCPC's Z80 assembler ;)
The source for rotosprites compiles well after I found a missing command ;)

--- End quote ---

:) helping everyone :)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version
Powered by SMFPacks Reactions Mod
Powered by SMFPacks Alerts Pro Mod
Powered by SMFPacks Mentions Pro Mod