scene.org File Archive

File download

<root>­/­parties­/­2022­/­vccc22­/­christmas_star_challenge/frostbyte_c64_kickass_vc3-2022.zip

File size:
250 301 bytes (244.43K)
File date:
2022-12-30 11:32:13
Download count:
all-time: 3

Preview

  • __MACOSX/ dir
  • __MACOSX/._file_id.diz 268B
  • __MACOSX/._frostbyte_parms_triangles_sys931.asm 178B
  • __MACOSX/._frostbyte_parms_triangles_sys931.png 178B
  • __MACOSX/._frostbyte_parms_triangles_sys931.prg 234B
  • __MACOSX/._frostbyte_parms_triangles_sys931_commented.asm 234B
  • __MACOSX/._frostbyte_parms_triangles_sys931_source.png 625B
  • file_id.diz 2.70K
  • frostbyte_parms_triangles_sys931.asm 347B
  • frostbyte_parms_triangles_sys931.png 2.74K
  • frostbyte_parms_triangles_sys931.prg 56B
  • frostbyte_parms_triangles_sys931_commented.asm 1.07K
  • frostbyte_parms_triangles_sys931_source.png 340.90K

file_id.diz

VCCC2022 Frostie's Parallelograms'n'Triangles Drawer

Author: Frostbyte / Artline Designs
Category: Christmas Challenge
System:   C64
Language: KickAssembler v5.24
Len source code: Many
Len exe file:    56 bytes
Len code only:   54 bytes
Instructions:
Load as usual on your C64 or your favourite emulator like Vice.
Start with SYS 931.
Description:
This routine draws four overlapping objects (two parallelograms and two
triangles) to form the star.
Triangles are drawn like this:
|\ /|
| X |
|/ \|
|\ /|
| X |
|/ \|
The left triangle is drawn simply with y indexed loop per line, while increasing
Y from 1 to 9 and then decreasing back to 1. For the right triangle, start
position is also decreased and then increased to mirror the triangle.
Parallelograms are drawn like this (one from bottom left to top right, other
from bottom right to top left):
________
\  /\  /
 \/  \/
 /\  /\
/  \/  \
‾‾‾‾‾‾‾‾
Drawing them is very simple: 9 chars each on a line, and starting point is
increased for left->right parallelogram and decreased for right->left
parallelogram for next line. The 1->9->1 Y counter used for triangles is also
used to toggle drawing parallelograms only on lines where Y > 4.
The following tricks have been used to shave a few bytes off the drawing routine:
1) Star is being drawn line by line to the top of the screen, while Kernal
routine at $e981 is used to scroll screen contents down after each line drawn.
2) Code is loaded to a specific location in the tape buffer area in mem. In
conjunction with the aforementioned scroll down routine which always sets Y to
$84, we can use the tape buffer pointer at address $b2 on zero page to point to
the draw address of 2nd triangle in our code ($033c + $84 = $03c0). This pointer
is then used to decrease/increase the 2nd triangle drawing location. As DEC/INC
do not support indirect-indexed addressing, we use unintended opcodes DCP and
ISC instead.
3) Pointer to BASIC area (default, $0801) on ZP at $2b-$2c is used as the start
value of 9-counter (from $08 to minus) and value of Y in the drawing loop ($01
to 9 and back to 1).
Comments:
The tricks to locate code in the tape buffer and to use kernal's scrolldown
routine have been learned from a post-deadline contribution to VCCC2021
(http://www.sizecoding.org/wiki/Christmas_Tree#34_bytes_version_for_C64). You
guys rock!
Special thanks to Logiker for patiently and thoroughly answering my many
requests for clarifications re. rules, and for organising such challenge in the
first place. The goal was to have fun, and I sure did!
Shoutouts to Serato/FIG and Superogue/MQD for promoting this challenge in
Sizecoding discord, as well as Rolex/ALD for sparking even more excitement in me
by getting excited about the challenge too. :)Mac OS X        	2ÚATTRÈDÈ*$com.apple.metadata:_kMDItemUserTagsòcom.dropbox.attrsbplist00 	

›@“Š¹/d¼›5©²•