SFX Expander programming and VICE

classic Classic list List threaded Threaded
57 messages Options
123
Reply | Threaded
Open this post in threaded view
|

SFX Expander programming and VICE

Gábor Lénárt
Hi All,

I'd like to play with the SFX Expander cartridge programming. I don't have
such a cartridge (well, currently), so for now I have the only option to
use an emulator.  It seems VICE can emulate it.  However, if I try, nothing
happens (no sound is produced, emulated SID is working, so it's not a
general sound problem of the emulator/my OS, or such).

Accordint to http://www.floodgap.com/retrobits/ckb/secret/sfx.html
I have to do only this:

     ; load x with register, a with data for that register

        stx $df40               ; select ym3526 register
        nop
        nop
        nop
        nop                     ; wait 12 cycles for register select
        sta $df50               ; write to it
        ldx #4
lup     dex
        nop
        bne lup                 ; wait 36 cycles to do the next write

I've tried vice both with YM3526 and 3812 selected for emulation. My code is
tested on PC (of course the x86 assembly version not the 6510), when 388h
and 389h is used (AdLib ports) since AdLib (and SoundBlasters also contains)
uses the 3812, so I am quite sure that the YM3812 programming itself should
be correct and it should produce sound.  Also, as far I as understand, 3526
should work like 3812 "just" lacking OPL2 features.

Does anybody have experience in SFX Expander programming and/or VICE related
emulation issues (if there is any) about this topic?

Or maybe I should do more than just the included assembly fragment, like
initialization or so?

Any example program (with source if possible) is also welcome, so I can
check if it works at all using VICE as emulator.

Thanks a lot in advance,

- Gábor

       Message was sent through the cbm-hackers mailing list
Reply | Threaded
Open this post in threaded view
|

Re: SFX Expander programming and VICE

Daniel O'Shea
On 25/11/11 22:20, Gábor Lénárt wrote:
> Or maybe I should do more than just the included assembly fragment, like
> initialization or so?

Try using the initialisation parameters shown near the end of this file
under the heading 'Making a Sound':

http://www.floodgap.com/retrobits/ckb/secret/adlib.txt

       Message was sent through the cbm-hackers mailing list
Reply | Threaded
Open this post in threaded view
|

Re: SFX Expander programming and VICE

Gábor Lénárt
On Sat, Nov 26, 2011 at 10:39:47AM +1100, Daniel O'Shea wrote:
> On 25/11/11 22:20, Gábor Lénárt wrote:
> >Or maybe I should do more than just the included assembly fragment, like
> >initialization or so?
>
> Try using the initialisation parameters shown near the end of this
> file under the heading 'Making a Sound':
>
> http://www.floodgap.com/retrobits/ckb/secret/adlib.txt

Thanks for your answer. I've just found sound expander's demodisk, but it
seems it does not produce sound under VICE either ...  Also, my data (which
is basically sequence of register numbers and datas including initialization
- with timing information included) works under DOSBOX with AdLib emulation:
it produces sound nicely.  I've just write a simple "player" to play this
sequence in x86 assembly for DOS and also for C64, but the latter does not
work.  But since the "official" demo disk for the cartridge does not produce
sound in VICE either (yes, VICE is configured correctly for the cartridge
emulation), it seems to be an emulator issue, at least IMHO.

So I guess it can be an emulator issue ... Unfortunately I have no idea how
to get the real hardware (the cartridge) to test it on a real machine ...

       Message was sent through the cbm-hackers mailing list
Reply | Threaded
Open this post in threaded view
|

Re: SFX Expander programming and VICE

rwurttem
On Fri, Nov 25, 2011 at 6:57 PM, Gábor Lénárt <[hidden email]> wrote:
> So I guess it can be an emulator issue ... Unfortunately I have no idea how
> to get the real hardware (the cartridge) to test it on a real machine ...

Hello Gábor,

I have one of the SXF Cartridges and a working-real C64, but I am an
assembly programming beginner. I have learned how to assemble code on
the C64 recently, but I have much to learn.

What can I do to help?

Kind regards,
-=Raj=-

       Message was sent through the cbm-hackers mailing list
Reply | Threaded
Open this post in threaded view
|

Re: SFX Expander programming and VICE

Groepaz
In reply to this post by Gábor Lénárt
On Saturday 26 November 2011, you wrote:

> On Sat, Nov 26, 2011 at 10:39:47AM +1100, Daniel O'Shea wrote:
> > On 25/11/11 22:20, Gábor Lénárt wrote:
> > >Or maybe I should do more than just the included assembly fragment, like
> > >initialization or so?
> >
> > Try using the initialisation parameters shown near the end of this
> > file under the heading 'Making a Sound':
> >
> > http://www.floodgap.com/retrobits/ckb/secret/adlib.txt
>
> Thanks for your answer. I've just found sound expander's demodisk, but it
> seems it does not produce sound under VICE either ...  Also, my data (which
> is basically sequence of register numbers and datas including
> initialization - with timing information included) works under DOSBOX with
> AdLib emulation: it produces sound nicely.  I've just write a simple
> "player" to play this sequence in x86 assembly for DOS and also for C64,
> but the latter does not work.  But since the "official" demo disk for the
> cartridge does not produce sound in VICE either (yes, VICE is configured
> correctly for the cartridge emulation), it seems to be an emulator issue,
> at least IMHO.
>
> So I guess it can be an emulator issue ... Unfortunately I have no idea how
> to get the real hardware (the cartridge) to test it on a real machine ...

if you manage to come up with a small test program (that works on the real
thing) - PLEASE post a bug on the vice bugtracker :) soundexpander/sampler are
both kinda hard to test with the original software.


       Message was sent through the cbm-hackers mailing list
Reply | Threaded
Open this post in threaded view
|

Re: SFX Expander programming and VICE

Gábor Lénárt
On Sat, Nov 26, 2011 at 02:12:20AM +0100, Groepaz wrote:
[...]
> if you manage to come up with a small test program (that works on the real
> thing) - PLEASE post a bug on the vice bugtracker :) soundexpander/sampler are
> both kinda hard to test with the original software.

http://invitel.hu/lgb/c64_play

This is a quite large C64 prg file. It is only large because of the included
"song". Also if it produces any sound somehow (it should, but it does not
work for me with VICE) it may sounds poor, since the timing information is
not so correct yet. Anyway, if I ever can make it hearable, I would clean
the rest of the program and give the source, just first I like to make sure
it works at all: at this point I am not 100% sure if it is my fault that
it does not work or not. Unfortunately I have no real hardware (I have C64,
but not the cartridge) that's why I would need VICE to test.

The heart of the code is just this:

loop:
 [...]
 STA $DF40 ; YM register select, register number in A now
 [...]
 STA $DF50 ; write the register data, data in A now
 [...]
 Looping ...

There are enough instructions between the two STAs and between do the
looping, so the needed minimal delay after YM register select/data write is
provided in this way.



       Message was sent through the cbm-hackers mailing list
Reply | Threaded
Open this post in threaded view
|

Re: SFX Expander programming and VICE

Gábor Lénárt
In reply to this post by rwurttem
Hi,

On Fri, Nov 25, 2011 at 07:58:13PM -0500, Raj Wurttemberg wrote:

> On Fri, Nov 25, 2011 at 6:57 PM, Gábor Lénárt <[hidden email]> wrote:
> > So I guess it can be an emulator issue ... Unfortunately I have no idea how
> > to get the real hardware (the cartridge) to test it on a real machine ...
>
> Hello Gábor,
>
> I have one of the SXF Cartridges and a working-real C64, but I am an
> assembly programming beginner. I have learned how to assemble code on
> the C64 recently, but I have much to learn.
>
> What can I do to help?

Thanks for your answer. Well, if you have the possibility and time, I would
be happy to hear from you, what this does on the real thing:

http://invitel.hu/lgb/c64_play

It's a standard C64 program file. If you can run this on a real C64 with the
cartridge, please tell me, if it makes any sound, or not ...

Thanks in advance!

       Message was sent through the cbm-hackers mailing list
Reply | Threaded
Open this post in threaded view
|

Re: SFX Expander programming and VICE

Daniel O'Shea
In reply to this post by Gábor Lénárt
Your PRG file worked for me under WinVICE (and sounds great!) but was
silent under VICE on linux?

On 26/11/11 21:31, Gábor Lénárt wrote:

> On Sat, Nov 26, 2011 at 02:12:20AM +0100, Groepaz wrote:
> [...]
>> if you manage to come up with a small test program (that works on the real
>> thing) - PLEASE post a bug on the vice bugtracker :) soundexpander/sampler are
>> both kinda hard to test with the original software.
>
> http://invitel.hu/lgb/c64_play
>
> This is a quite large C64 prg file. It is only large because of the included
> "song". Also if it produces any sound somehow (it should, but it does not
> work for me with VICE) it may sounds poor, since the timing information is
> not so correct yet. Anyway, if I ever can make it hearable, I would clean
> the rest of the program and give the source, just first I like to make sure
> it works at all: at this point I am not 100% sure if it is my fault that
> it does not work or not. Unfortunately I have no real hardware (I have C64,
> but not the cartridge) that's why I would need VICE to test.
>
> The heart of the code is just this:
>
> loop:
>   [...]
>   STA $DF40 ; YM register select, register number in A now
>   [...]
>   STA $DF50 ; write the register data, data in A now
>   [...]
>   Looping ...
>
> There are enough instructions between the two STAs and between do the
> looping, so the needed minimal delay after YM register select/data write is
> provided in this way.

       Message was sent through the cbm-hackers mailing list
Reply | Threaded
Open this post in threaded view
|

Re: SFX Expander programming and VICE

Anders Carlsson
Daniel O'Shea wrote:

> Your PRG file worked for me under WinVICE (and sounds great!)
> but was silent under VICE on linux?

Strange. I just tried it as well. With 3526 emulation enabled, I get
no sound at all from WinVICE 2.3. When I try to enable 3812 emulation,
I get unexpected error, signal 11 and x64 crashes completely.

Btw, it might be easier if the file on the web server was put inside
a Zip archive or so to ensure it won't get mangled when downloaded.
I had to try three different browsers + Emacs until I found a solution
where it could be safely downloaded.

Best regards

--
Anders Carlsson

       Message was sent through the cbm-hackers mailing list
Reply | Threaded
Open this post in threaded view
|

Re: SFX Expander programming and VICE

Richard Atkinson
In reply to this post by Gábor Lénárt
Hi Gábor,

Could you zip that up or put a file extension like .prg on it? My browsers
seem determined to download it in text mode.

I have a few Sound Expander programs I've written in CBM BASIC to play with
the registers on the YM3526 or YM3812. That file of yours looks like it
might be a port of Dune music, is that right? My BASIC programs let you
experiment with different register settings for the voices and also show
what 2 or 3 detuned versions of the same voice sound like.

Richard

--------------------------------------------------
From: "Gábor Lénárt" <[hidden email]>
Sent: Saturday, November 26, 2011 10:32 AM
To: <[hidden email]>
Subject: Re: SFX Expander programming and VICE

> Hi,
>
> On Fri, Nov 25, 2011 at 07:58:13PM -0500, Raj Wurttemberg wrote:
>> On Fri, Nov 25, 2011 at 6:57 PM, Gábor Lénárt <[hidden email]> wrote:
>> > So I guess it can be an emulator issue ... Unfortunately I have no idea
>> > how
>> > to get the real hardware (the cartridge) to test it on a real machine
>> > ...
>>
>> Hello Gábor,
>>
>> I have one of the SXF Cartridges and a working-real C64, but I am an
>> assembly programming beginner. I have learned how to assemble code on
>> the C64 recently, but I have much to learn.
>>
>> What can I do to help?
>
> Thanks for your answer. Well, if you have the possibility and time, I
> would
> be happy to hear from you, what this does on the real thing:
>
> http://invitel.hu/lgb/c64_play
>
> It's a standard C64 program file. If you can run this on a real C64 with
> the
> cartridge, please tell me, if it makes any sound, or not ...
>
> Thanks in advance!
>
>       Message was sent through the cbm-hackers mailing list


       Message was sent through the cbm-hackers mailing list
Reply | Threaded
Open this post in threaded view
|

Re: SFX Expander programming and VICE

Gábor Lénárt
Hi Richard & others too,

On Sat, Nov 26, 2011 at 04:33:46PM -0000, Richard Atkinson wrote:
> Hi Gábor,
>
> Could you zip that up or put a file extension like .prg on it? My
> browsers seem determined to download it in text mode.

Ah, sorry, as I am a Linux/UNIX user and system administrator I mainly use
CLI when it's possible so I simply tested the download with wget command
line tool, and it hasn't got such a problems :) :) "Extensions" are only
remainments of the ancient CP/M systems, Unix does not have this notion (and
btw: I've just got a CP/M cartridge for C64, with original box, disks and
book: so this is not off-topic here either then ha-ha).

Maybe this one is better for you, then:

http://invitel.hu/lgb/c64_play.zip

I am not sure how is OK to post attachments directly here onto the list, as
some mailing lists have the policy not to do it. That was the reason I
uploaded it and I gave only the URL.


> I have a few Sound Expander programs I've written in CBM BASIC to
> play with the registers on the YM3526 or YM3812. That file of yours
> looks like it might be a port of Dune music, is that right? My BASIC

Not actually a port, but a grab (I mean grab of the music itself, not the
code I wrote for it) :) But indeed, it's the music of the intro
of DUNE I. DOS game.  It's a feature of DOSBOX that it can capture the OPL2
register events (with timing informations) from any running DOS application.
Thankfully the grabbed file format (called DRO) is very simple to "parse" so
I simply wrote a program which "plays" the grabbed music.  First it was a
DOS only attempt, but after I realized that heart of the AdLib is also
working with C64 (the YM3812 chip: if it's built with that, since there is
3526 based ones too) I became curious that I can port my really simply
player to play DRO files with C64 using YM3812 in the form of using SFX
Sound Expander cartridge, or at least the emulation (in VICE).  In theory
that play can play any DRO (v2.0 format) files, just now it's only a compile
time option to include the DRO stream.  This is also the reason that the
program file is long: it includes the whole DRO file as-is, with headers
etc.

So in nutshell: of course the acutal tune included (Dune I intro) is just an
example to test the player code, it can be anything other too ...

> programs let you experiment with different register settings for the
> voices and also show what 2 or 3 detuned versions of the same voice
> sound like.

       Message was sent through the cbm-hackers mailing list
Reply | Threaded
Open this post in threaded view
|

Re: SFX Expander programming and VICE

Gábor Lénárt
In reply to this post by Daniel O'Shea
On Sat, Nov 26, 2011 at 10:07:05PM +1100, Daniel O'Shea wrote:
> Your PRG file worked for me under WinVICE (and sounds great!) but
> was silent under VICE on linux?

Ahaa ... Odd. I don't have any Windows at all, so I can't test that.
Actually I get signal 11 if I try to configure Vice x64 for the cartridge
emulation, so I used command line options to start for testing this way:

x64 -sfxse -sfxsetype 3812 -autostart c64_play

This way not signal 11, etc, but not sound at all, and not only with my
code, but also not with the official sound expander demo disk's program
either ...

Does anybody want to donate a 3812 equipped sound expander cartridge for me?
:) :) :)

 

> On 26/11/11 21:31, Gábor Lénárt wrote:
> >On Sat, Nov 26, 2011 at 02:12:20AM +0100, Groepaz wrote:
> >[...]
> >>if you manage to come up with a small test program (that works on the real
> >>thing) - PLEASE post a bug on the vice bugtracker :) soundexpander/sampler are
> >>both kinda hard to test with the original software.
> >
> >http://invitel.hu/lgb/c64_play
> >
> >This is a quite large C64 prg file. It is only large because of the included
> >"song". Also if it produces any sound somehow (it should, but it does not
> >work for me with VICE) it may sounds poor, since the timing information is
> >not so correct yet. Anyway, if I ever can make it hearable, I would clean
> >the rest of the program and give the source, just first I like to make sure
> >it works at all: at this point I am not 100% sure if it is my fault that
> >it does not work or not. Unfortunately I have no real hardware (I have C64,
> >but not the cartridge) that's why I would need VICE to test.
> >
> >The heart of the code is just this:
> >
> >loop:
> >  [...]
> >  STA $DF40 ; YM register select, register number in A now
> >  [...]
> >  STA $DF50 ; write the register data, data in A now
> >  [...]
> >  Looping ...
> >
> >There are enough instructions between the two STAs and between do the
> >looping, so the needed minimal delay after YM register select/data write is
> >provided in this way.
>
>       Message was sent through the cbm-hackers mailing list

       Message was sent through the cbm-hackers mailing list
Reply | Threaded
Open this post in threaded view
|

Re: SFX Expander programming and VICE

Gábor Lénárt
In reply to this post by Daniel O'Shea
On Sat, Nov 26, 2011 at 10:07:05PM +1100, Daniel O'Shea wrote:
> Your PRG file worked for me under WinVICE (and sounds great!) but
> was silent under VICE on linux?

It seems. What is the version of WinVice on your PC?

And thanks for the feedback, nice to know that it works at least especially
because I had no possibility to test if it works at all :)
 

> On 26/11/11 21:31, Gábor Lénárt wrote:
> >On Sat, Nov 26, 2011 at 02:12:20AM +0100, Groepaz wrote:
> >[...]
> >>if you manage to come up with a small test program (that works on the real
> >>thing) - PLEASE post a bug on the vice bugtracker :) soundexpander/sampler are
> >>both kinda hard to test with the original software.
> >
> >http://invitel.hu/lgb/c64_play
> >
> >This is a quite large C64 prg file. It is only large because of the included
> >"song". Also if it produces any sound somehow (it should, but it does not
> >work for me with VICE) it may sounds poor, since the timing information is
> >not so correct yet. Anyway, if I ever can make it hearable, I would clean
> >the rest of the program and give the source, just first I like to make sure
> >it works at all: at this point I am not 100% sure if it is my fault that
> >it does not work or not. Unfortunately I have no real hardware (I have C64,
> >but not the cartridge) that's why I would need VICE to test.
> >
> >The heart of the code is just this:
> >
> >loop:
> >  [...]
> >  STA $DF40 ; YM register select, register number in A now
> >  [...]
> >  STA $DF50 ; write the register data, data in A now
> >  [...]
> >  Looping ...
> >
> >There are enough instructions between the two STAs and between do the
> >looping, so the needed minimal delay after YM register select/data write is
> >provided in this way.
>
>       Message was sent through the cbm-hackers mailing list

       Message was sent through the cbm-hackers mailing list
Reply | Threaded
Open this post in threaded view
|

Re: SFX Expander programming and VICE

rwurttem
In reply to this post by Gábor Lénárt
On Sat, Nov 26, 2011 at 5:32 AM, Gábor Lénárt <[hidden email]> wrote:
> Thanks for your answer. Well, if you have the possibility and time, I would
> be happy to hear from you, what this does on the real thing:
>
> It's a standard C64 program file. If you can run this on a real C64 with the
> cartridge, please tell me, if it makes any sound, or not ...
>

Works perfectly and sounds great on a real C64 with a Sound Expander
attached. I can't immagine the time it took to compose that soung.

/Zapped/

       Message was sent through the cbm-hackers mailing list
Reply | Threaded
Open this post in threaded view
|

Re: SFX Expander programming and VICE

Gábor Lénárt
On Sat, Nov 26, 2011 at 04:18:37PM -0500, Raj Wurttemberg wrote:

> On Sat, Nov 26, 2011 at 5:32 AM, Gábor Lénárt <[hidden email]> wrote:
> > Thanks for your answer. Well, if you have the possibility and time, I would
> > be happy to hear from you, what this does on the real thing:
> >
> > It's a standard C64 program file. If you can run this on a real C64 with the
> > cartridge, please tell me, if it makes any sound, or not ...
> >
>
> Works perfectly and sounds great on a real C64 with a Sound Expander
> attached. I can't immagine the time it took to compose that soung.

Hopefully you've read my mail here on the list already, that it is not my
song of course, it's the intro of the DOS Dune 1 game. My work was only the
code and the idea to play DRO music format which can be captured by DOSBOX
from any DOS software which produces AdLib music. Thanks for the testing!
Now I should get a sound expander cartridge somehow :)

Is someone interested about the source code? I may release it after some
serious clean-ups some time ...

       Message was sent through the cbm-hackers mailing list
Reply | Threaded
Open this post in threaded view
|

Re: SFX Expander programming and VICE

Marko Mäkelä
In reply to this post by Gábor Lénárt
On Sat, Nov 26, 2011 at 08:27:41PM +0100, Gábor Lénárt wrote:
>"Extensions" are only remainments of the ancient CP/M systems, Unix
>does not have this notion

Sorry, I could not resist the off-topic.

As far as I understand, CP/M copied the file name conventions (except
subdirectories and file versions) from Digital VAX/VMS, which was
supposed to replace the archaic *nix systems. If OpenVMS did not die in
the hands of HP yet, theoretically it could still win. :-) BTW, VMS
distinguished binary and ASCII files, too. AFAIR, CP/M does not really
distinguish them, but it does not store exact file lengths either. You
will only know how many blocks the file is, not how many bytes.

I guess it would be somewhat funny if you ported the sound to Commodore
128 CP/M, or maybe even the Commodore 64 CP/M. The latter would probably
be a hardware challenge too. In later editions of the Commodore 64
Programmer's Reference Guide, the pages about the CP/M cartridge were
made blank.

        Marko

       Message was sent through the cbm-hackers mailing list
Reply | Threaded
Open this post in threaded view
|

Re: SFX Expander programming and VICE

Groepaz
In reply to this post by Gábor Lénárt
On Saturday 26 November 2011, you wrote:

> On Sat, Nov 26, 2011 at 04:18:37PM -0500, Raj Wurttemberg wrote:
> > On Sat, Nov 26, 2011 at 5:32 AM, Gábor Lénárt <[hidden email]> wrote:
> > > Thanks for your answer. Well, if you have the possibility and time, I
> > > would be happy to hear from you, what this does on the real thing:
> > >
> > > It's a standard C64 program file. If you can run this on a real C64
> > > with the cartridge, please tell me, if it makes any sound, or not ...
> >
> > Works perfectly and sounds great on a real C64 with a Sound Expander
> > attached. I can't immagine the time it took to compose that soung.
>
> Hopefully you've read my mail here on the list already, that it is not my
> song of course, it's the intro of the DOS Dune 1 game. My work was only the
> code and the idea to play DRO music format which can be captured by DOSBOX
> from any DOS software which produces AdLib music. Thanks for the testing!
> Now I should get a sound expander cartridge somehow :)
>
> Is someone interested about the source code? I may release it after some
> serious clean-ups some time ...

with source it would be a nice addition to the vice test-programs repository
at least :)

--

http://www.hitmen-console.org    http://magicdisk.untergrund.net
http://www.pokefinder.org        http://ftp.pokefinder.org

History, I believe, furnishes no example of a priest-ridden people maintaining
a free civil government. This marks the lowest grade of ignorance of which
their civil as well as religious leaders will always avail themselves for
their own purposes.
<Thomas Jefferson>


       Message was sent through the cbm-hackers mailing list
Reply | Threaded
Open this post in threaded view
|

Re: SFX Expander programming and VICE

Daniel O'Shea
In reply to this post by Gábor Lénárt
On 27/11/11 06:47, Gábor Lénárt wrote:
> On Sat, Nov 26, 2011 at 10:07:05PM +1100, Daniel O'Shea wrote:
>> Your PRG file worked for me under WinVICE (and sounds great!) but
>> was silent under VICE on linux?
>
> It seems. What is the version of WinVice on your PC?
>
> And thanks for the feedback, nice to know that it works at least especially
> because I had no possibility to test if it works at all :)

This is the version I am using:

http://www.zimmers.net/anonftp/pub/cbm/crossplatform/emulators/VICE/WinVICE-2.2-x86.zip

I did have the same problem though, with only one chip version working
and the other one crashing WinVICE altogether...

       Message was sent through the cbm-hackers mailing list
Reply | Threaded
Open this post in threaded view
|

Re: SFX Expander programming and VICE

Daniel O'Shea
In reply to this post by Gábor Lénárt
On 27/11/11 08:41, Gábor Lénárt wrote:
> Is someone interested about the source code? I may release it after some
> serious clean-ups some time ...

Yes please!

       Message was sent through the cbm-hackers mailing list
Reply | Threaded
Open this post in threaded view
|

Re: SFX Expander programming and VICE

Daniel O'Shea
In reply to this post by Richard Atkinson
On 27/11/11 03:33, Richard Atkinson wrote:
> I have a few Sound Expander programs I've written in CBM BASIC to play
> with the registers on the YM3526 or YM3812. That file of yours looks
> like it might be a port of Dune music, is that right? My BASIC programs
> let you experiment with different register settings for the voices and
> also show what 2 or 3 detuned versions of the same voice sound like.
>
> Richard

I'd love to be able to experiment with your BASIC programs Richard?

       Message was sent through the cbm-hackers mailing list
123