Discussion:
new Mockingboard demo (KSP theme)
(too old to reply)
v***@pianoman.cluster.toy
2018-02-09 18:22:38 UTC
Permalink
Well after a year of waiting my Mockingboard finally showed up in my mailbox.

I threw together a 6-channel Interrupt-Driven demo of the Kerbal Space
Program theme music just to test it out:



http://www.deater.net/weave/vmwprod/mockingboard/

Vince
Tom Porter
2018-02-09 21:36:16 UTC
Permalink
Great Job Vince! The Mockingboard is a hopping lately.

I see you get your files from *.YM5, interesting! And interrupt driven! I'm working on my own version of that now with Midi conversion (have the 3 voice up and going currently).

If you have a mockingboard, try Vince's software out!
v***@pianoman.cluster.toy
2018-02-09 22:09:58 UTC
Permalink
Post by Tom Porter
Great Job Vince! The Mockingboard is a hopping lately.
yes, funny everyone is working on mockingboard projects now.

My project came out now because it took a year of waiting before
I finally got my hands on actual Mockingboard hardware.
Post by Tom Porter
I see you get your files from *.YM5, interesting! And interrupt
driven! I'm working on my own version of that now with Midi conversion
(have the 3 voice up and going currently).
Yes, I have a Raspberry Pi AY-3-8910 chiptune player I built (basically
a Mockingboard for a Raspberry Pi) and it plays ym5 files so I have a lot
of tools set up for dealing with them.

That includes a horribly simplistic tracker I built myself that I used
to put together the KSP theme from sheet music.

Getting the interrupts working was easier than I thought it would be,
though I have to admit I don't fully understand exactly what all
the values being written to the 6522 timers are doing.

A lot of the best ym5 files I have are way too dense to fit into 64k of
RAM, even with the simplistic compression I am using. I'll have to work
on decompressing them on the fly using LZSS or LZ4.

Vince
f***@hotmail.com
2018-02-10 18:43:17 UTC
Permalink
I just got one in the mail yesterday as well!

Since the mock uses interrupts, you could do disk loads of the songs while they play and just load sections into memory on the fly. Check out "Cybernoid" on Asimov (/images/sound) which runs in the background and lets you continue to use BASIC for an example. Not sure if it would work on a disk ii, but works using mass storage.

Just noticed the french touch page you link to has source code available at the bottom. comments are in french, but easy enough to follow.
http://www.ctrl-pomme-reset.fr/french-touch/

Plasmagoria and (Not so cheap) tunes are faves.

f
v***@pianoman.cluster.toy
2018-02-10 19:23:01 UTC
Permalink
Post by f***@hotmail.com
Since the mock uses interrupts, you could do disk loads of the songs
while they play and just load sections into memory on the fly. Check
out "Cybernoid" on Asimov (/images/sound) which runs in the background
and lets you continue to use BASIC for an example. Not sure if it
would work on a disk ii, but works using mass storage.
Yes, I don't think it's wise trying to have interrupts going while using
a Disk II. Also I know interrupt support was sort of sketchy on older
versions of the II but I have an Apple IIe platinum so in theory I think
it's supposed to be a bit better. I do try to write code that runs on
the older machines (otherwise I would be using the extra 65C02 instructions)
Post by f***@hotmail.com
Just noticed the french touch page you link to has source code available at the bottom. comments are in french, but easy enough to follow.
http://www.ctrl-pomme-reset.fr/french-touch/
Yes, I based my Mockingboard detection code on code I found there from the
PureNoise demo, it was a big help.

Vince
Michael J. Mahon
2018-02-10 21:55:56 UTC
Permalink
Post by v***@pianoman.cluster.toy
Post by f***@hotmail.com
Since the mock uses interrupts, you could do disk loads of the songs
while they play and just load sections into memory on the fly. Check
out "Cybernoid" on Asimov (/images/sound) which runs in the background
and lets you continue to use BASIC for an example. Not sure if it
would work on a disk ii, but works using mass storage.
Yes, I don't think it's wise trying to have interrupts going while using
a Disk II. Also I know interrupt support was sort of sketchy on older
versions of the II but I have an Apple IIe platinum so in theory I think
it's supposed to be a bit better. I do try to write code that runs on
the older machines (otherwise I would be using the extra 65C02 instructions)
Interrupts will be disabled during Disk ][ accesses, so the music will stop
until they are re-enabled.
Post by v***@pianoman.cluster.toy
Post by f***@hotmail.com
Just noticed the french touch page you link to has source code available
at the bottom. comments are in french, but easy enough to follow.
http://www.ctrl-pomme-reset.fr/french-touch/
Yes, I based my Mockingboard detection code on code I found there from the
PureNoise demo, it was a big help.
Vince
--
-michael - NadaNet 3.1 and AppleCrate II: http://michaeljmahon.com
Antoine Vignau
2018-02-10 23:49:52 UTC
Permalink
Interrupts are stopped on a Disk II if you not using low-level accesses, like rwts, prodos, smartport. Using $c08c,x and friends directly do not stop interrupts,

av
Steve Nickolas
2018-02-10 20:16:36 UTC
Permalink
Post by f***@hotmail.com
Since the mock uses interrupts, you could do disk loads of the songs
while they play and just load sections into memory on the fly. Check out
"Cybernoid" on Asimov (/images/sound) which runs in the background and
lets you continue to use BASIC for an example. Not sure if it would work
on a disk ii, but works using mass storage.
...Which reminds me I'd still like to see if the game itself could be
coaxed onto the ][, but I don't speak Z80 well enough to try to translate
the original code and don't have source to the C64 port...

-uso.
TomCh
2018-02-14 22:28:25 UTC
Permalink
Post by f***@hotmail.com
I just got one in the mail yesterday as well!
Since the mock uses interrupts, you could do disk loads of the songs while they play and just load sections into memory on the fly. Check out "Cybernoid" on Asimov (/images/sound) which runs in the background and lets you continue to use BASIC for an example. Not sure if it would work on a disk ii, but works using mass storage.
FYI, full source here:
https://github.com/tomcw/Cybernoid

As Michael Mahon says below, (certainly for ProDOS(*)) interrupts get disabled during cycle accurate disk II operations, so the AY will just play a continuous tone until interrupts are re-enabled - so the music will stutter and sound stretched/distorted, eg. during CATALOG.

(*) I don't know how well DOS 3.3 does... and INIT will block the player for a long time!

And don't trust some emulators (eg. AppleWin) to test whether Cybernoid is safe during disk II operations! Its drive emu takes some short-cuts (to improve r/w speeds).

Tom
qkumba
2018-02-15 00:50:32 UTC
Permalink
DOS 3.3 also disables interrupts across the RWTS calls, so for example the entire INIT will have to complete before they are enabled again.
Michael J. Mahon
2018-02-15 01:17:28 UTC
Permalink
Post by TomCh
Post by f***@hotmail.com
I just got one in the mail yesterday as well!
Since the mock uses interrupts, you could do disk loads of the songs
while they play and just load sections into memory on the fly. Check out
"Cybernoid" on Asimov (/images/sound) which runs in the background and
lets you continue to use BASIC for an example. Not sure if it would work
on a disk ii, but works using mass storage.
https://github.com/tomcw/Cybernoid
As Michael Mahon says below, (certainly for ProDOS(*)) interrupts get
disabled during cycle accurate disk II operations, so the AY will just
play a continuous tone until interrupts are re-enabled - so the music
will stutter and sound stretched/distorted, eg. during CATALOG.
(*) I don't know how well DOS 3.3 does... and INIT will block the player for a long time!
And don't trust some emulators (eg. AppleWin) to test whether Cybernoid
is safe during disk II operations! Its drive emu takes some short-cuts
(to improve r/w speeds).
Tom
DOS also disables interrupts during Disk ][ accesses.
--
-michael - NadaNet 3.1 and AppleCrate II: http://michaeljmahon.com
Charlie
2018-02-15 04:35:40 UTC
Permalink
Post by TomCh
Post by f***@hotmail.com
I just got one in the mail yesterday as well!
Since the mock uses interrupts, you could do disk loads of the songs while they play and just load sections into memory on the fly. Check out "Cybernoid" on Asimov (/images/sound) which runs in the background and lets you continue to use BASIC for an example. Not sure if it would work on a disk ii, but works using mass storage.
https://github.com/tomcw/Cybernoid
As Michael Mahon says below, (certainly for ProDOS(*)) interrupts get disabled during cycle accurate disk II operations, so the AY will just play a continuous tone until interrupts are re-enabled - so the music will stutter and sound stretched/distorted, eg. during CATALOG.
Would interrupts need to be disabled while running hard drive driver
code in the $C800 ROM area as well?

Charlie
Post by TomCh
(*) I don't know how well DOS 3.3 does... and INIT will block the player for a long time!
And don't trust some emulators (eg. AppleWin) to test whether Cybernoid is safe during disk II operations! Its drive emu takes some short-cuts (to improve r/w speeds).
Tom
qkumba
2018-02-15 17:43:04 UTC
Permalink
If you are calling driver code directly (i.e. bypassing ProDOS), then you will need to disable interrupts yourself. You cannot rely on the disk driver doing it for you, because it's likely that the driver is relying on the fact that the caller did it.
Access to devices that do not tolerate interruption (which probably covers most storage devices) will need to have interrupts disabled across the call.
Charlie
2018-02-15 19:10:08 UTC
Permalink
Post by qkumba
If you are calling driver code directly (i.e. bypassing ProDOS), then you will need to disable interrupts yourself. You cannot rely on the disk driver doing it for you, because it's likely that the driver is relying on the fact that the caller did it.
Access to devices that do not tolerate interruption (which probably covers most storage devices) will need to have interrupts disabled across the call.
Thanks for the clarification. I will be writing the driver myself. My
intention was to disable the interrupts in the slot ROM before it jumps
to the $C800 ROM area. But if ProDOS or GS/OS disable them then I
should not do that.

Charlie
Michael J. Mahon
2018-02-15 20:22:31 UTC
Permalink
Post by Charlie
Post by qkumba
If you are calling driver code directly (i.e. bypassing ProDOS), then
you will need to disable interrupts yourself. You cannot rely on the
disk driver doing it for you, because it's likely that the driver is
relying on the fact that the caller did it.
Access to devices that do not tolerate interruption (which probably
covers most storage devices) will need to have interrupts disabled across the call.
Thanks for the clarification. I will be writing the driver myself. My
intention was to disable the interrupts in the slot ROM before it jumps
to the $C800 ROM area. But if ProDOS or GS/OS disable them then I
should not do that.
Charlie
Actually, it should be safe to disable, as long as you restore the prior
enablement state when you return.

The standard protocol for disabling interrupts is to push the current
status, then disable. When critical processing is complete, just pop the
saved status back into P and you've left the interrupt status undisturbed.
--
-michael - NadaNet 3.1 and AppleCrate II: http://michaeljmahon.com
Anthony Ortiz
2018-02-10 18:47:27 UTC
Permalink
Post by v***@pianoman.cluster.toy
Post by Tom Porter
Great Job Vince! The Mockingboard is a hopping lately.
yes, funny everyone is working on mockingboard projects now.
My project came out now because it took a year of waiting before
I finally got my hands on actual Mockingboard hardware.
Post by Tom Porter
I see you get your files from *.YM5, interesting! And interrupt
driven! I'm working on my own version of that now with Midi conversion
(have the 3 voice up and going currently).
Yes, I have a Raspberry Pi AY-3-8910 chiptune player I built (basically
a Mockingboard for a Raspberry Pi) and it plays ym5 files so I have a lot
of tools set up for dealing with them.
That includes a horribly simplistic tracker I built myself that I used
to put together the KSP theme from sheet music.
Getting the interrupts working was easier than I thought it would be,
though I have to admit I don't fully understand exactly what all
the values being written to the 6522 timers are doing.
A lot of the best ym5 files I have are way too dense to fit into 64k of
RAM, even with the simplistic compression I am using. I'll have to work
on decompressing them on the fly using LZSS or LZ4.
Vince
Did you make your mockingboard emulator on a barebones Pi or on Raspberian via ALSA drivers?
v***@pianoman.cluster.toy
2018-02-10 19:17:14 UTC
Permalink
Post by Anthony Ortiz
Did you make your mockingboard emulator on a barebones Pi or on
Raspberian via ALSA drivers?
The Pi is running Linux, but the Mockingboard equivelent is implemented
as two AY-3-8910 chips controlled by GPIOs and a few shift registers
that are loaded via SPI.

Full details can be found here:
http://www.deater.net/weave/vmwprod/hardware/ay-3-8910/

Vince
v***@pianoman.cluster.toy
2018-02-10 19:29:14 UTC
Permalink
Post by v***@pianoman.cluster.toy
The Pi is running Linux, but the Mockingboard equivelent is implemented
as two AY-3-8910 chips controlled by GPIOs and a few shift registers
that are loaded via SPI.
and I realized you might have been asking how I drive it from Linux.

It's just a user program that hits the GPOIOs/SPI bus directly. My ym5
player just writes the ym5 register dumps directly over SPI every 50Hz.
It's only approximately 50Hz (not real time) but it's generally close
enough. I'm using the libbcm2835 library which writes directly to the
Pi's registers and bypasses the Linux GPIO/SPI interfaces which were
a bit too slow.

I also have a bunch of i2c LED displays going at the same time which
adds to the fun, but it all seems to work.

Vince
Anthony Ortiz
2018-02-10 19:47:13 UTC
Permalink
Hah, that’s pretty cool! This should be doable via a teensy as well right?
cb meeks
2018-02-12 13:50:48 UTC
Permalink
Post by Anthony Ortiz
Hah, that’s pretty cool! This should be doable via a teensy as well right?
Teensy would easily handle it. I've built AY-3-8910 audio players that stream music from SD card in real time using only an Arduino UNO. Which is much less under-powered than a Teensy.
v***@pianoman.cluster.toy
2018-02-12 15:47:59 UTC
Permalink
Post by cb meeks
Post by Anthony Ortiz
Hah, that’s pretty cool! This should be doable via a teensy as well right?
Teensy would easily handle it. I've built AY-3-8910 audio players
that stream music from SD card in real time using only an Arduino UNO.
Which is much less under-powered than a Teensy.
Yes, I the Pi (and in fact, a Pi2 that I use) is way overkill for this
project.

I mostly used it because I was being lazy and it was easy to quickly
get it coded up through Linux. I originally thought I might have to
go to bare-metal to get the timings right, but I was surprised that
I managed to get it working pretty well despite the Operating System
being in the way.

It's also nice having a music player that I can ssh into so I can change
what song is playing from across the room, as well as update the code
and songs available over the network without having to shuffle SD cards
or reflash anything.

Vince
cb meeks
2018-02-12 15:57:14 UTC
Permalink
Post by v***@pianoman.cluster.toy
It's also nice having a music player that I can ssh into so I can change
what song is playing from across the room, as well as update the code
and songs available over the network without having to shuffle SD cards
or reflash anything.
Vince
I've been "Anti-Pi" here lately (mainly because everybody and his brother are cramming them into different devices but really doing the same thing). But, that's a pretty good idea for a RPi.

But I bet I could still do one using an Arduino clone, WiFi module and an SD shield for about the same price and not have to deal with Linux. I love Linux...but I like dedicated devices better. :-D
Anthony Ortiz
2018-02-12 17:29:33 UTC
Permalink
You keep saying Pi and Linux as if one has to go along with the other, but if that’s the extent of your dislike for all things Pi then let me assure you, you don’t need Linux. I’m using Ultibo for my Pi project and it’s really great; no OS, bare-bones Pi, you go pedal to the metal right away and still have support for threads, file system, graphics, audio, usb, Ethernet, etc...
cb meeks
2018-02-12 18:27:29 UTC
Permalink
Post by Anthony Ortiz
You keep saying Pi and Linux as if one has to go along with the other, but if that’s the extent of your dislike for all things Pi then let me assure you, you don’t need Linux. I’m using Ultibo for my Pi project and it’s really great; no OS, bare-bones Pi, you go pedal to the metal right away and still have support for threads, file system, graphics, audio, usb, Ethernet, etc...
I'm well aware of Ultibo. I don't have a dislike of the RPi or Linux. I am quite experienced in Linux (and FreeBSD) servers, FWIW. I just prefer micro-controllers over RPi. It's not a religious war with me...I just don't get excited (any more) about seeing yet another RPi shoved into a joystick running MAME. Which seems to be the Hello World of RPi.
Loading...