Stephen Ruddy NES driver on VERA PSG

Talk about your programs in progress. Discuss how to implement features, etc.
Forum rules
This section is for testing Commander X16 programs and programs related to the CX16 for other platforms (compilers, data conversion tools, etc.)

Feel free to post works in progress, test builds, prototypes, and tech demos.

Finished works go in the Downloads category. Don't forget to add a hashtag (#) and the version number your program was meant to run on. (ie: #R41).
Post Reply
bansai
Posts: 6
Joined: Sat Feb 10, 2024 10:58 pm

Stephen Ruddy NES driver on VERA PSG

Post by bansai »

I don't know if anyone's done this yet for X16, but at this link:
https://mega.nz/folder/Xs4gTCjQ#iUDu1UmSJWvXky8Gnz-skA
PRG file and reverse-engineered NES source using Tim Follin's Treasure Master as an example. The conversion routines are sloppy unoptimized code, and not what I'd take home to meet Mother, but it's mainly proof of concept. I didn't try this on real hardware: I only have the emulator but wanted to see how X16 would do.

I've done about two dozen such conversions for C64 posted as 2SIDs on DeepSID, mainly to get past the three voice limitation without burning rastertime on stores to $D418.

Not having to fight ADSR makes this a bit easier on X16, VERA can hit higher notes, and the noise LFSR on VERA is more in line with an NES-like sound. This is similar to what Mr. SID did back in 2010 using SID as an output device running original, relocated code. Call NES driver, parse the 2A03 register block at $4000, and convert to the machine's sound chip.

If anyone knows how to make a convincing sounding bass without filters on VERA (I'd like to avoid OPL) let me know, and when I have the time I'll take a shot at porting Journey to Silius over as I know what the digi-frequency mappings are and liked how the SID conversion turned out.

I can do a sourcecode dump as well for the 20 or so reverse engineered drivers (with command sets) I have for anyone interested because the software controlled per-voice volume for NES is completely in line with VERA so NES code archaeology might prove applicable for someone developing players. EDIT: I'll just post a link to them now, so have at it: https://mega.nz/folder/T0YH3LSY#pEacVDT-QlegVNJXXz1adw
bansai
Posts: 6
Joined: Sat Feb 10, 2024 10:58 pm

Re: Stephen Ruddy NES driver on VERA PSG

Post by bansai »

I put some more working examples out there with sourcecode at the first MEGA link. Have fun: Neil Baldwin and Alberto Jose Gonzalez have joined the party.

448:/home/bansai/Downloads/> ls -al total 1700 drwxrwxr-x. 2 bansai bansai 4096 Feb 15 00:39 . drwx------. 15 bansai bansai 12288 Feb 15 00:39 .. -rw-rw-r--. 1 bansai bansai 22553 Feb 15 00:38 asterix.prg -rw-rw-r--. 1 bansai bansai 221456 Feb 15 00:38 asterix.s -rw-rw-r--. 1 bansai bansai 15890 Feb 15 00:38 eriktheviking.prg -rw-rw-r--. 1 bansai bansai 143064 Feb 15 00:38 eriktheviking.s -rw-rw-r--. 1 bansai bansai 264 Feb 15 00:38 README_TO_ASSEMBLE.TXT -rw-rw-r--. 1 bansai bansai 24834 Feb 15 00:38 silversurfer.prg -rw-rw-r--. 1 bansai bansai 247557 Feb 15 00:38 silversurfer.s -rw-rw-r--. 1 bansai bansai 23161 Feb 15 00:38 solstice.prg -rw-rw-r--. 1 bansai bansai 232373 Feb 15 00:38 solstice.s -rw-rw-r--. 1 bansai bansai 17131 Feb 15 00:38 thejunglebook.prg -rw-rw-r--. 1 bansai bansai 171696 Feb 15 00:38 thejunglebook.s -rw-rw-r--. 1 bansai bansai 28770 Feb 15 00:38 treasuremaster.prg -rw-rw-r--. 1 bansai bansai 277504 Feb 15 00:38 treasuremaster.s -rw-rw-r--. 1 bansai bansai 24045 Feb 15 00:38 wolverine.prg -rw-rw-r--. 1 bansai bansai 240844 Feb 15 00:38 wolverine.s
bansai
Posts: 6
Joined: Sat Feb 10, 2024 10:58 pm

Re: Stephen Ruddy NES driver on VERA PSG

Post by bansai »

528:/home/bansai/Downloads/q/x16-emulator/vera_psg_conversions> ls -la journey* -rw-rw-r--. 1 bansai bansai 17960 Feb 20 12:22 journeytosilius.prg -rw-rw-r--. 1 bansai bansai 186671 Feb 20 12:07 journeytosilius.s

Preliminary port of NES's Journey to Silius is at the first link repeated here: https://mega.nz/folder/Xs4gTCjQ#iUDu1UmSJWvXky8Gnz-skA

It's going to sound better on speakers at a distance than headphones. On large speakers the pair of voices used as the bass instrument (PSG voices 4+5) are a bit loud, but that's just a volume tuning issue on source that is a moving target. The main thing historically with triangle used as bass is the upper harmonics drop off and as that's what a PC speaker will play well, triangle at very low frequencies is too quiet on small speakers.

I like the echoing snare drums on some of the songs in Journey to Silius. One thing I did notice is that for the four bytes of PSG regs per voice, the six bits of pulse width field probably should be utilized for each of triangle/sawtooth/noise to convey extra configuration information relevant to the waveform that has been selected. This may have been discussed before: I haven't dug too much into forum history yet.

Anyway, enjoy some really good game tunes. PSG can sound great when voices are constantly modulated and these have only been 1x tunes so far. :-)
m00dawg
Posts: 346
Joined: Wed Jul 08, 2020 12:41 am
Contact:

Re: Stephen Ruddy NES driver on VERA PSG

Post by m00dawg »

Careful when using the register when not using it for PWM. There's an open PR for VERA which enables an XOR mode when using the width field with tri and saw. It adds a significant amount of depth and color options to the PSG but one of the hangups has been folks using the register for things. My $0.02 is if it's undocumented, it's fair game but I do have a rather large bias towards wanting at least the XOR'd triangle option. It can really help make the triangle stand out that way.
Author of Dreamtracker (https://www.dreamtracker.org/)
Check Out My Band: https://music.victimcache.com/
bansai
Posts: 6
Joined: Sat Feb 10, 2024 10:58 pm

Re: Stephen Ruddy NES driver on VERA PSG

Post by bansai »

Thanks for that added info. I'm glad to hear that ideas for improvements are being kicked around, plus it's handy to know that parts of the spec haven't completely been frozen yet and are still in flux.
Post Reply