Negative Charge
banner
negativecharge.bsky.social
Negative Charge
@negativecharge.bsky.social
290 followers 110 following 100 posts
Retro-musician, 8-Bit, 6502. Mainly creating music drivers, players and conversion tools from 8 & 16-bit sound chips to the BBC Micro’s SN76489 and Acorn Electron’s ULA. ⎍∧∿⩘
Posts Media Videos Starter Packs
I think the best way is to decode the whole file and compare the output with the original, uncompressed version. If I find time I’ll give that a go. Your code is significantly different from DMSC’s original with the use of the buffer offset, so not easy to compare directly.
Ah, okay. I’m using the original code I linked to from DMSC. check_end_song looks correct to me there unless I’m missing something?
Thanks! Trying to locate the issue in the original code. Is your fix the addition of the bne and bcs here?

github.com/dmsc/lzss-sa...
github.com
I've released a beta of the first BBC Micro David Whittaker Music Disk here: www.stardot.org.uk/forums/viewt...

Looking to get some feedback on compatibility with real hardware before I publish the final version to my website. Still may be one or two small bugs to fix.
I now have the ability to use 16kb of main memory if no SWRAM is present on the device, so those without at least get to hear songs that fit into that space and partial songs from those that don't. This also works for songs where you don't have enough SWRAM banks to fit the whole track.
Getting closer to releasing a whole batch of music disks I've put together for the BBC Micro. Spending some time on cycle-optimising the music driver as even two or three cycles make a difference when called in the main play loop. At the moment it requires SWRAM - about to fix that...
Here's a hint where I'm going with this sample sequencer. I've moved the playback loop to zero page and leave the WE (write enable) active which allows output of 16kHz samples (although memory becomes an issue). Need to combine this with my SN76489 conversion of the SID.
It's mightily impressive. Chris is the master. I've something slightly different in mind... sample playback alongside SN playback.
Just a little something I'm working on. This is RLE encoded for fast playback, but I'm sure I can compress the samples better to fit more in memory / SWRAM.
Sound chip you say? 😊

Unlike the BBC Micro, the Acorn Electron has no dedicated sound chip. It simply has a counter built into the system's ULA that can be programmed to drive a speaker as a primitive square wave generator with two volumes - on/off.
Some further progress! The ROM version of Speech! is now working on the Acorn Electron. The speed difference, and hence the quality of the sound, is quite dramatic.

Hopefully that's the whole disk and demo programs converted now. I'll package this up properly and post a link on Stardot.
It really just increases the pitch, so that would need to be adjusted on the SWRAM version if I can get that to work. The audio quality is mostly affected by the 4-bit samples that play on two channels on the Beeb being reduced to a 1-bit threshold on a singlr channel with no volume control.
Yes, I think further change is required to the BBC code. When I get some time I’ll investigate. There’s also no optimisation of the original code except for reducing two delay loops.
Acorn Electron Speech!

Here’s a work in progress build for you all to try on @0xc0de.bsky.social ’s excellent emulator.

Not sure the SWRAM version works yet, so load option 1, then CHAIN “DEMO” or reboot the disk.

0xc0de6502.github.io/electroniq/?...
Electroniq
Acorn Electron emulator
0xc0de6502.github.io
Nice job! Hope the driver wasn’t too painful to work with. I must give the conversion another go at some point. I’m pretty sure I can get it to sound better.
Getting better... here's the official Speech! demo converted to Mode 6 on the Acorn Electron. This is still just using main memory. No speed up from SWRAM yet.
It’s already sounding better in my latest build. The original code contains a delay loop for the sample playback, which when halved sounds a lot better. Still many cycles to reclaim though.
Thanks. No, this is from main memory. Had to relocate it as the Beeb version uses memory close to the start of Mode 7. I’ll compile an SWRAM version soon to see if it makes any difference.
Well... it sort of works 😊

A lot of optimization needed, but I have a full disassembly that compiles to a byte identical binary and is relocatable. Speech! on the BBC Micro uses 4-bit values for attenuation, which I have to reduce to 1-bit on the Acorn Electron so quite a bit of fidelity is lost.
Not tried SWRAM on the Electron yet. Hopefully the code is similar enough to the BBC Micro implementation. I’ll have to research.
A release soon 😊. Still finding uninitialized memory bugs causing random crashes... but getting there...
So, three double sided disks of tracked music conversions to the BBC Micro's SN76489 are ready. Just testing that I've fixed the random crash in the player when switching tracks, and then I'll put them up on my website. Works on both Model B and Master, but requires several banks of SWRAM.
I've always wanted to put together a simple demo effect with some background music. I've never got around to this until now. Probably the most basic Sinus Scroller you'll see, with character based positioning. Hopefully I'll improve this over time and use bitmaps. Might even add a starfield :-)
...and here's an attempt on the Acorn Electron. There are additional timing differences to be resolved, but it's basically working.