Plot
Oh mighty @zep, a quest for thee: to fix this bug in oh-two-three.
Time's very fabric has been torn, and monsters from the past reborn!
A pumpkin army's impossible roll befouls our once cozy console.
Its humbled clock refunds too much, permitting Cauldron's villain's touch.
Relentlessly they spin and taunt, they dare thee to remove their haunt.
Please help us take our console back and save us from their cycle hack!
Their jeering eyes provide the clue, all stars show what you must do.
A table's count below sixteen, as low as any number's been,
Negate it and they'll mock you more... the wellspring of this wretched flaw!
About
An entry in 1023 chars to the #pico1k jam. See


Hooked on Amstrad Chiptunes - Volume 1 - Dave Rogers
Experience the glory of some of the most revered 80's CPC/ZX chiptunes from the comfort of your PICO-8 console!
- Netherworld
- Zynaps
- Uridium
- Cybernoid
- Cybernoid 2: The Revenge
- Nebulus
- Marauder
- Stormlord
- Stormlord 2: Deliverance
- Anarchy
- Battle Valley
- Herobotix
- Turbo Boat Simulator
- Bear-A-Grudge
Controls
right arrow - next song
left arrow - previous song
Tech
This cart emulates the Amstrad CPC/ZX Spectrum AY-3-8910 audio chip to output chiptunes to PICO-8's 5512Hz 8-bit mono PCM serial buffer. To feed the emulation it contains a sound driver capable of generating AY register inputs across three channels of tone/volume/noise-enable as well as a single shared noise tone.
The sound driver was derived from 13 different CPC games and one ZX game. All these games had their music composed or converted/arranged by (the legendary, in my opinion) J Dave Rogers, who also wrote the sound driver code for the games as was customary for chiptune musicians in the 80's. This common lineage made it reasonable to reverse engineer the Z80 code and generalize the driver to handle all the games' music.
I think it sounds a little better in native PICO-8 rather than on the web player. Understand however that in the CPC the AY chip was clocked at 1,000,000Hz (and 1,773,447Hz on the ZX), and emulators typically default to sample at 44,100Hz. Whereas PICO-8 ticks at 60Hz and the serial buffer samples at 5512Hz. Only so much can be done - the percussion/noise is especially vulnerable to low sampling rates.
The AY emulation code is augmented to support the waveform visualization by tracking zero-crossings - this extra work can be removed if the goal is pure audio.
Without the graphics, the sound driver + AY emulator runs at a consistent 24-25% of frametime on a 60hz cart. This demonstrates that, for the appropriate PICO-8 game, it's reasonable to completely emulate the music and sfx via the serial buffer. Alternatively the sound driver portion could be used to drive PICO-8's sfx/music buffers in real time which would allow a lot more music in the cart with full audio sample rate quality. Or do both and synchronize native sfx/music with generated serial buffer output.
The game logos were compressed with








The pico8 manual states this about SFX instruments:
"SFX instruments are only retriggered when the pitch changes, or the previous note
has zero volume. This is useful for instruments that change more slowly over time.
For example: a bell that gradually fades out. To invert this behaviour, effect 3
(normally 'drop') can be used when triggering the note. All other effect values have
their usual meaning when triggering SFX instruments."
However it seems that adjacent notes (with the same SFX instrument and with the same pitch and non-zero volume) do cause the instrument to be retriggered when the second note is at index zero in a looping sequence. Also, setting the second note's effect to 3 inverts the behavior and the instrument is continued rather than retriggered, but only when the second note is at index zero.
The attached .p8 cart demonstrates this. It has these SFXs:
0: the SFX instrument
1: pattern looping from 0 to 8, with no effect on the note at index 0. The SFX instrument is retriggered at index 0.

