Playing Atari ST Music on the Amiga with Zero CPU(arnaud-carre.github.io) |
Playing Atari ST Music on the Amiga with Zero CPU(arnaud-carre.github.io) |
> AmigaOS was a pre-emptive multitasking OS
Yes, but without memory protection.
> whilst PCs had to wait for Windows NT/95.
While Windows 2 on an 8086 could pre-emptively multitask DOS apps, so long as they all fit into 640 kB at once. Windows/386 could do it in extended memory.
The innovative thing in W95 was doing it to Win32 apps as well.
OS/2 in 1987 or so could multitask OS/2 code on a 286.
One particular example of this experience was that you'd use "raster bars" to time the performance of your routines. If your main loop is synchronized with the vertical retrace, then switching the background color after a piece of code would show up in the margins of your screen.
Animations were tuned to move in constant pixel offsets. All the anti-aliasing in the world cannot bring back the true demoscene spirit :)
"In a way, this feature is similar to the YM2149 ADSR envelope. Not technically, but because both features are mostly ignored by Atari and Amiga programmers! :)"
As an Oric-1/Atmos programmer, this line was especially juicy.
Using PAULA's attached mode is so brilliant, btw. I love it when things of this nature are discovered, decades after the fact. We've had a few such revelations in the Oric world too, none as powerful of course at Orics' 1MHZ, but nevertheless, the shoulders of the Atari/Amiga giants are perilously within reach for the climb ..
EDIT: Oh, COPPER and PAULA, paired at the bits. Such a great hack, this one ..
As an aside, the only code I know that uses Paula's attached mode (where one channel can modulate the volume or pitch of another) is the sound effect used in X-Copy.
It sounds like this: https://youtu.be/2OG2tPx5gnU?t=22
and the code that generates that sound is this:
PLAY_SAMPLE ; a6=_custom, d0=zero for high-pitch sound, nonzero for low-pitch sound
move.w #$F00,d1 ; high pitch: period=$d00-$f00 if d0 == 0
tst.b d0
beq.s .high
move.w #$7700,d1 ; low pitch: period=$7500-$7700 if d0 != 0
.high lea MODULO,a0
move.w #$200-1,d0
.down move.w d1,(a0)+
subq.w #1,d1
dbra d0,.down
move.w #$200-1,d0
.up addq.w #1,d1
move.w d1,(a0)+
dbra d0,.up
; set up channel 2; whatever words this plays will
; be written to the period register of channel 3
move.w adkconr(a6),-(sp) ; save ADKCON state for later
move.w #ADKF_SETCLR!ADKF_USE2P3,adkcon(a6)
move.l #MODULO,aud2+ac_ptr(a6)
move.w #$400,aud2+ac_len(a6)
move.w #0,aud2+ac_vol(a6) ; no volume (no actual sound wanted!)
move.w #$90,aud2+ac_per(a6) ; change period every $90 ticks
lea SAMPLE,a0 ; set up channel 3 to play a simple square wave
move.l #$7f7f8080,(a0) ; square wave: 127 127 -128 -128 ...
move.l a0,aud3+ac_ptr(a6)
move.w #2,aud3+ac_len(a6)
move.w #DMAF_SETCLR!DMAF_AUD2|DMAF_AUD3,dmacon(a6) ; turn on sound DMA
moveq #$40,d2 ; start with volume = 64
.vol move.w d2,aud3+ac_vol(a6) ; write channel 3 volume
move.w #$600-1,d1 ; wait a bit
1$ move.b vhposr(a6),d0
2$ cmp.b vhposr(a6),d0
beq.s 2$
dbra d1,1$
subq #8,d2 ; repeat to fade
bpl.s .vol
moveq #0,d0 ; stop sound
move.w d0,aud2+ac_len(a6)
move.w d0,aud3+ac_vol(a6)
move.w d0,aud3+ac_len(a6)
move.w #DMAF_AUD2!DMAF_AUD3,dmacon(a6)
move.w (sp)+,d0 ; restore ADKCON
btst #ADKB_USE2P3,d0
bne.s .keepon
move.w #ADKF_USE2P3,adkcon(a6)
.keepon rts
section 2,bss,chip
SAMPLE ds.w 2
MODULO ds.w $400However, it's only as a result of reading this article that I realised the chip is only capable of generating square waves and noise, whereas I'd been under the impression it had some slightly more advanced FM synthesis capabilities. That impression must have come from, decades later, listening to what people could squeeze out of the chip on various Spectrum demos on YouTube. Well, that and the fact that after the 48K beeper the 128K was never going to sound less than incredible. I might not even have had it for a year before switching to the (much less prone to go wrong) C64[0].
Anyway, all of this to say: very interesting project, and I enjoyed the neat reversal trick with the attached voice to get the higher quality output out of Paula.
[0] Actually the Spectrum -> C64 switch was more of a mixed bag than you might think - it wasn't, for example, like games on the C64 were all universally better. On the sound front, the C64's SID chip was a significant upgrade over the AY though, and certainly the most capable sound chip amongst 8-bit computers that I'm aware of. I really wish they'd crammed a SID chip into the Amiga alongside Paula. Or maybe even a dual SID with 6 channels for stereo output + Paula, but, alas... I'm sure it would have been cost prohibitive even if Commodore engineers had the idea at the time.
https://www.pouet.net/prod.php?which=104190
.. could it be run on something like PiMiga?
This is something the Apple IIgs had. It had an extremely capable synthesiser with good graphics and performance capped so not to compete with Macs. It was a weird machine, a sharp contrast with the minimalistic Apple IIs that preceded, over complicated and trying to be too many things at once.
For the same reason I prefer the design of the ST over the Amiga’s. Amiga made lots of assumptions about the use that ended up tuning it well to platform games and NTSC video editing, but nothing else.
I think certainly it was used mostly as a games machine by most owners, but then again so was the Atari ST (at least amongst my cohort at school).
As for tuning it well to games and video editing but nothing else... I don't agree.
For a long time an Amiga 500 with 1MB RAM expansion and a 24 pin dot matrix printer was my main and only computer, and I did everything on it: word processing, CAD, music, graphics. It got me through both GCSEs and A-levels: all my coursework was written on it, all my compositions were done with MED and OctaMED, all the code for my maths courseworks was written on it, all the design work for my technology project, every essay, etc., and so it goes on. I was even still using it somewhat at university into the late 1990s as I didn't have the cash for a PC.
You could do a lot with an Amiga, and there was a lot of software available to do all of it, along with plenty of hardware peripherials. The software side of things, well a huge library of applications in every category came within reach for cash strapped users later on when loads of formerly expensive software was being given away on magazine coverdisks. Sadly that also coincided with the decline[0] of the platform.
Of course, I played games as well: who wouldn't?
All of this you could also do on an Atari ST, although I'd argue that the Amiga had the better operating system. Regardless, it was all also basically unthinkable in any really serious sense on (most of) the previous generation of 8-bit machines.
I think people are too quick to write off the 16-bit home machines of the late 80s and early 90s as toys when, in fact, by the standards of the time they were both powerful and affordable general purpose computers.
[0] I won't say death because there's still a hardcore of dedicated users keeping the platform alive, as also for the ST.
Some of the stuff people do with the 48k beeper is incredible though. Tim Follin's tunes for example are basically treating the beeper like a 1-bit DAC, with amazing results. https://www.youtube.com/watch?v=T42WuUpBuHE
It's not to say amazing results from the 48K beeper were impossible, but you had to work pretty hard for them, and you were definitely into wizardry territory.
But, it's also true that the sound capabilities of the 128K machine were a big step up (also worth bearing in mind you had the beeper and the AY chip - you weren't losing the beeper).
Here’s how it sounded on the original ZX Spectrum, equipped with only the beeper: https://www.youtube.com/watch?v=oNDVJLma-W4
The sound chip was so capable it contrasted with the rest of the machine.
> Yes, but without memory protection.
That’s why it was so fast. :) Also surprisingly stable all things considered.
They could have made much simpler “productivity Amigas” with plain VGA-like graphics to leverage its non gaming software market, at the expense of only having minimal graphics and sound support. There was, IIRC, one, made by a third party that lacked the Amiga chipset, but running the Amiga OS. If they could push something as cheap to make as a Mac LC, they’d have a much more attractive offering for businesses.
As I understand it, its custom chips were a brilliantly clever solution to a problem that existed at the time. It couldn't be called a mistake, because they couldn't see into the future. As a games machine, the Amiga ended up hamstrung by those same custom chips because they weren't the right architecture for Doom and all the 3D games that followed it. That made no difference to its productivity software though, did it?
Same, with the dot-matrix printer too. I'd update and print my D&D character page on it. Kickstart 1.2 and 1.3 ROM switch mod. I also had a not-so-common 5"1/4 drive (but not the ultra-rare official Commodore one): just a a 5"1/4 drive used instead of the 3"1/2 stock one. The reasons being: 5"1/4 floppies were so much cheaper than 3"1/2 ones that after something silly like 40 floppies, the drive had paid for itself. And we had many games (sorry, backups). So many backups.
> All of this you could also do on an Atari ST, although I'd argue that the Amiga had the better operating system.
The better OS and the much better co-processors. The ST however had the MIDI port so the cool dudes back then would hook up their MOOG synths to Atari STs, not Amigas.
Also the ST had the game "Sundog: The Frozen Legacy", from FTL (the company that'd then go on and make Dungeon Master). Legends. For whatever reason the Amiga didn't have Sundog: The Frozen Legacy.
I'd do everything on my Amiga except play Sundog (I'd go the neighbors' house for that) and play Ultima IV and Ultima V (the C64 version was much better than the Amiga version, so I had an old C128D to play the Ultimas).
It’s a nice machine, but I find it uninspired, a bit like the C128, which instead of improving the VIC II, added a VDP with garish RGBi colors. Both look like they tried to check all boxes and, in the end, made computers unable to follow on their immediate ancestors legacy. Both disappointed me because they could be so much more.
I like both my IIgs and C128D. They largely serve the function of running everything the earlier machines in their line run, but neither is very exciting for bringing new capabilities to the line. Both suffered from developers being hamstrung by supporting the older machines because the new machines didn't have major adoption. The new features felt to be mostly unused.
At the very least, the two video chips could support overlaying on composite and analog RGB output (because nice colours). The way it ended up was just silly.