Christmas Diamonds
stars.s Author: Nesu Category: Christmas Challenge System: Amstrad CPC Language: Assembler, using firmware calls (SDCC assembler, as used in CPCtelera) Len source code: 1034 bytes (commented code) Len exe file: 27 bytes + header info Len code only: 27 bytes Instructions: -Normal loading: Insert the provided dsk file in any emulator and type: memory&2a06:load"stars",&2a06:cls:call&2a06 -Easy loading: Previous command is included in a provided basic loader, just type: run"loader -Detailed loading: In order to properly work, the routine must be placed at adress &2a06. However, by default Basic prevents us from using this address, so first we have to use the memory command: memory &2a06 Then we can normally load the code into memory: load "stars",&2a06 The program does not clear the screen before drawing, so before calling the program it is recommended to scroll down until the "Ready" message disappears from screen. Then the program can be called with: call &2a06 Description: Stars in paralel lines of stars (lines going up or lines going down) are at a constant horizontal distance distance of 6 units one from another. So the program simply decrements by 6 the X coordinate to get the next star position. When the end of the line is reached, the horizontal value is fixed and line is decremented, exiting the program if there are no more lines remaining. In each star position a star is placed and a vertically mirrored star is also placed. Then the process repeats. Comments: In order to save bytes the program draws each star 128 times, so it takes about 50 seconds to complete the drawing.
[ back to the prod ]