Start

heckmeck!

Nerd content and
cringe since 1999
Alexander Grupe
Losso/AttentionWhore

Arrr512

A 512 byte intro for Nordlicht 2022 (party theme: “Yarr, Matey! — Celebrate our 10th anniversary with us!”), where it ranked 2nd place in the competition.

This time, it’s 512 bytes uncompressed, i.e. raw code – which means 476 usable bytes on Amiga systems, as 36 bytes are required to have a valid executable file.

Uses the fact that you can easily open windows under AmigaDOS by using special file names like CON:10/20/64/32 (containg window position and size) to create a really coarse pixel grid. I thought all the tiny windows looked funny, too.

After opening, the windows are filled using ANSI escape sequences which can overwrite the window borders under AmigaDOS.

  dc.b	$9b,'43m'  ; background color 3
  dc.b	$9b,'0x'   ; absolute left X = 0
  dc.b	$9b,'0y'   ; absolute top Y = 0
  dc.b	$9b,'4t'   ; 4 rows
  dc.b	$9b,'8u'   ; 8 columns
  dc.b	$9b,'0 p'  ; switch cursor off
  dc.b	$0c        ; ASCII form feed, clears and fills
                   ; with background color

Sadly, these escape sequences are Kickstart 1.x only. The newer console.device implementations require a special command to set the background color used for filling and won’t let you overwrite the window border all the way.

Different skull designs; the “high-res” one with 16×20 windows/pixels wasn’t possible as the OS would crash somewhere around the 150th window.

I did not have space for sound data or to generate waveforms, so I simply used the chipram at address 0 for both channels. With a sample length of 64 words, it sounds like a sawtooth oscillator, and with a length of 32, it kind-of sounds like an organ – what a lucky coincidence!

Typical memory contents under Kickstart 1.3 from position 0: 4 bytes Guru marker (would contain 'HELP' instead of $00000000 when a software failure occurs), 4 bytes exec base and the CPU exception vector table addresses with 4 bytes each.

00000000 0000 0000 00C0 0276 00FC 0818 00FC 081A  .......v........
00000010 00FC 081C 00FC 081E 00FC 0820 00FC 0822  ........... ..."
00000020 00FC 090E 00FC 0826 00FC 0828 00FC 082A  .......&...(...*
00000030 00FC 082C 00FC 082E 00FC 0830 00FC 0832  ...,.......0...2
00000040 00FC 0834 00FC 0834 00FC 0834 00FC 0834  ...4...4...4...4
00000050 00FC 0834 00FC 0834 00FC 0834 00FC 0834  ...4...4...4...4
00000060 00FC 0834 00FC 0C8E 00FC 0CE2 00FC 0D14  ...4............
00000070 00FC 0D6C 00FC 0DFA 00FC 0E40 00FC 0E86  ...l.......@....

As waveforms, in action:

On top of that, Monkey Island always works!

Size-coding hack: The skull is drawn by exclusive-or-ing the background color with the current pixel color in the ANSI escape sequence written to all the windows. After the skull is fully drawn, the intro keeps iterating over the skull endlessly, but self-modifies itself to only draw into the first window (bottom-right) with different strings (outputting the parrot and ArrrTW) and applies the exclusive-or to the parrot’s beak now; the character $3c = '<' then is either unchanged (color 0) or gets modified to $3d, yielding a '=' and thus opening and closing the beak (<, =, etc.) – nice arrangement of the character codes there! :)

   _,       _,       _,
  (·<      (·=      (·<
 ()~)     ()~)     ()~)
¯//"¯¯   ¯//"¯¯   ¯//"¯¯ 

Since this 512 byte intro is uncompressed, we can directly study the anatomy of the binary:

OS overhead

Amiga executable hunk structure

Code

68000 machine code

Music data

Three bytes per record: position, voice 1 frequency, voice 2 frequency

Strings

Escape sequences, the parrot and window file name format string. exec.library’s RawDoFmt is used to format CON:%d/%d/64/32/ into CON:0/0/64/32/ etc.

Skull bitmap

Half a byte (nibble) per color index of each cell in the 10×8 raster.

The colors are read backwards when drawing, and only the last 70 nibbles are included in the binary.

The skull bitmap starts with ten 0-colored blocks and we cheekily assume that the memory region after our binary is filled with zeroes. This way, we can start reading from 5 bytes (10 nibbles) beyond our data to draw the first ten cells with a color of 0.

00000000: 0000 03f3 0000 0000 0000 0001 0000 0000  ................
00000010: 0000 0000 4000 0078 0000 03e9 0000 0077  ....@..x.......w
00000020: 2a78 0004 4ded 017a 2c56 206e 000a 0c10  *x..M..z,V n....
00000030: 0064 66f4 49ef f448 7c09 7e07 41fa 018a  .df.I..H|.~.A...
00000040: 43ec fe00 45fa 00ec 264c 3606 ed4b 3283  C...E...&L6..K2.
00000050: 3607 eb4b 3343 0002 4ead fdf6 220c 343c  6..K3C..N...".4<
00000060: 03ee 4eae ffe2 28c0 51cf ffd2 51ce ffcc  ..N...(.Q...Q...
00000070: 45fa 018d 49ef f448 7a01 7630 7c50 3e3c  E...I..Hz.v0|P><
00000080: 008f 4bfa 00b2 47f9 00df f000 42ab 00c0  ..K...G.....B...
00000090: 42ab 00d0 377c 0040 00d4 377c 0020 00c4  B...7|.@..7|. ..
000000a0: 377c 800c 0096 be15 6616 524d 7000 101d  7|......f.RMp...
000000b0: 4840 101d d080 3740 00c6 4840 3740 00d6  H@....7@..H@7@..
000000c0: 5346 6c2e 762f 5245 49ef f448 45fa 0131  SFl.v/REI..HE..1
000000d0: 7c4f 377c 0000 00c8 377c 0014 00d8 357c  |O7|....7|....5|
000000e0: 0040 fed5 257c 0020 2214 ff0f 357c 0001  .@..%|. "...5|..
000000f0: ff05 47fa 00a4 1212 0806 0000 6604 534a  ..G.........f.SJ
00000100: e849 c27c 000f 022b 00f0 0002 b32b 0002  .I.|...+.....+..
00000110: 221c 0805 0000 6606 7608 47fa 0074 240b  ".....f.v.G..t$.
00000120: 4eae ffd0 7204 4eae ff3a 51cf ff5a 6000  N...r.N..:Q..Z`.
00000130: ff4e 16c0 4e75 8f8e 4787 b44b 7fa9 5479  .N..Nu..G..K..Ty
00000140: a947 77a9 4b75 a954 73be 5f6f d654 618e  .Gw.Ku.Ts._o.Ta.
00000150: 5f5d 8e6b 5b8e 7159 8e5f 578e 6b53 7f6b  _].k[.qY._W.kS.k
00000160: 4fa9 713f a954 39a9 4737 be4b 35be 5433  O.q?.T9.G7.K5.T3
00000170: be5f 2fd6 5421 d64b 1f8e 4717 7f3f 0fbe  ._/.T!.K..G..?..
00000180: 4b09 be47 07be 4b05 be54 03be 5f01 be4b  K..G..K..T.._..K
00000190: 0c0a 4172 7272 5457 9b34 336d 9b30 789b  ..ArrrTW.43m.0x.
000001a0: 3079 9b34 749b 3875 9b30 2070 9b30 3b34  0y.4t.8u.0 p.0;4
000001b0: 485f 2c0a 2020 28b7 3c20 0a20 2829 7e29  H_,.  (.< . ()~)
000001c0: 0aaf 2f2f 22af af0c 434f 4e3a 2564 2f25  ..//"...CON:%d/%
000001d0: 642f 3634 2f33 322f 0011 1000 0112 1100  d/64/32/........
000001e0: 0112 1000 1111 1101 1122 1001 1122 1101  ........."..."..
000001f0: 1111 1011 1110 0110 0111 0100 0000 03f2  ................
previous next close
eie