Page 2 of 2
Running The Emulator On Linux Command Line Only
Posted: Tue Nov 02, 2021 4:38 am
by john_e79
Since we're talking about Ubuntu here, I set up Ubuntu 64-bit today on a NUC i5.
The apt packages for cc65 were not recognizing cx16 as a system so I downloaded sources from github and it works now.
I was able to compile Matt Heffernan's demos, and the tiles demo works fine in the X16 emulator at 60fps. ?
However, lesson 17 the YM2151 demo outputs no sound. ?
Lesson 13 PIANO.PRG and PSG.PRG the VERA PSG sounds do work though. ?
This isn't an issue on my Windows 10 laptop only on Linux.
It did the same on me last time I tried to run on a RPi4, PSG would work but not YM2151. It was also slow with the tiles demo on a RPi4B it looked like. ?
If I try to run x16emu with sudo it starts complaining about can't open ALSA no such file or directory so I just run as a normal user.
Anyone get YM2151 working on Linux X16 emulator and have some ideas?
Running The Emulator On Linux Command Line Only
Posted: Tue Nov 02, 2021 11:05 am
by kliepatsch
This is really strange. From what I can tell, the different audio sources are treated equally. Look at the following line of code, which mixes the VERA PCM, VERA PSG and YM2151:
https://github.com/commanderx16/x16-emulator/blob/master/src/audio.c#L170 I can only report that for me everything works, and I seem to have the same setup as you: Ubuntu 20.04, cc65 cloned and compiled from git (I put the path to its binary into .profile so I can type cc65 in any directory), cloned the demos from Matt Heffernan's github, ran the build.sh, and there is sound for the YM2151 demo. No sudo needed. Oh, and I am using the official x16emu binary, and I am guessing that is what you are also doing...
Sorry, I have no ideas what might be going on
?
Running The Emulator On Linux Command Line Only
Posted: Tue Nov 02, 2021 7:59 pm
by john_e79
On 11/2/2021 at 6:05 AM, kliepatsch said:
This is really strange. From what I can tell, the different audio sources are treated equally. Look at the following line of code, which mixes the VERA PCM, VERA PSG and YM2151:
https://github.com/commanderx16/x16-emulator/blob/master/src/audio.c#L170 I can only report that for me everything works, and I seem to have the same setup as you: Ubuntu 20.04, cc65 cloned and compiled from git (I put the path to its binary into .profile so I can type cc65 in any directory), cloned the demos from Matt Heffernan's github, ran the build.sh, and there is sound for the YM2151 demo. No sudo needed. Oh, and I am using the official x16emu binary, and I am guessing that is what you are also doing...
Sorry, I have no ideas what might be going on
?
Nope, I built the x16 emu from github sources, that may be my issue, if that's the case there might be a regression bug somewhere.
Also ZeroByte's Sonic demo works fine on Ubuntu and plays sound, just not Matt Heffernan's Lesson 17, I asked him about it on YouTube and he doesn't know.
Yep, that's the issue. Just tried from the release build and it works fine. It's not working when built from github sources for some reason.
EDIT: Talked to Matt Heffernan and he let me know the YM2151 registers were changing in the next version so now it all makes sense.
Running The Emulator On Linux Command Line Only
Posted: Wed Nov 03, 2021 7:31 am
by TomXP411
On 11/2/2021 at 12:59 PM, john_e79 said:
Yep, that's the issue. Just tried from the release build and it works fine. It's not working when built from github sources for some reason.
EDIT: Talked to Matt Heffernan and he let me know the YM2151 registers were changing in the next version so now it all makes sense.
Yeah, the emulator is in a bad place right now - some registers and memory addresses have changed, but Mike never released a new version, so people are still coding against the last officially released one. This means you can't actually build from GitHub and expect it to work right. The emulator
does work with the latest ROMs, when also built from source, but most of the software on the forum here will only run correctly on the last officially released emulator version.
Running The Emulator On Linux Command Line Only
Posted: Thu Nov 04, 2021 4:53 pm
by ZeroByte
I submitted a PR to Matt's XCI engine repo for x16.inc which includes a conditional define from the commandline that allows you to use R38 or R39 values for the constants having to do with BANK addresses and YM2151 addresses.
if you build with the cmdline argument --asm-define REV=39 it will use the R39+ values, else it will use R38 values.
It creates a definition: EMU_VERSION X16_VERSION which is equal to 38 or 39 as well, so your project can also use conditional building.