WYZ lib or AYFX integration
WYZ lib or AYFX integration
It's my Santa Claus desire: an easy integration of FX and AY into our games.
It's a real pain point to integrate any library
https://www.z88dk.org/forum/viewtopic.php?id=11166
They are all using some custom assembler code (from pasmo or whatever), and require very high technical knowldge of assembly just for integration on our code.
Could you please please please integrate it into the z88dk?
It's a real pain point to integrate any library
https://www.z88dk.org/forum/viewtopic.php?id=11166
They are all using some custom assembler code (from pasmo or whatever), and require very high technical knowldge of assembly just for integration on our code.
Could you please please please integrate it into the z88dk?
That seems like a sensible idea and very neatly ties into an old issue that was raised on GitHub. I think it should be possible to pull in WYZ without too many problems. The issue can be found here: https://github.com/z88dk/z88dk/issues/184
My current opinion is that it may be easier to be on top of z88dk first, because of the many different varieties of music players and the different machines, because while many have the same AY chip, they are all accessed differently. But if you want to tie it into z88dk I don't have problems with it.
Also I'm not sure which tracker player we should be using, yet. On the Spectrum I'd probably use beepola and the compiled beeper engines. But AY is important too and I feel like I might need to port a tracker to both ZX as well as MSX this year anyway.
But I guess the first main thing to do is to clean up a tracker code to be useable as normal regular z80 code, and perhaps without self-modifying code. I don't think it's hard to do but I do lack the time right now.
Also I'm not sure which tracker player we should be using, yet. On the Spectrum I'd probably use beepola and the compiled beeper engines. But AY is important too and I feel like I might need to port a tracker to both ZX as well as MSX this year anyway.
But I guess the first main thing to do is to clean up a tracker code to be useable as normal regular z80 code, and perhaps without self-modifying code. I don't think it's hard to do but I do lack the time right now.
Also, here are 2 related links on playing music on the Spectrum wiht z88dk in the forums:
https://www.z88dk.org/forum/viewtopic.php?id=9634
https://www.z88dk.org/forum/viewtopic.php?id=5088
https://www.z88dk.org/forum/viewtopic.php?id=9634
https://www.z88dk.org/forum/viewtopic.php?id=5088
I'm taking a look at the wyz player first of all - it "looks" like the easiest one to wrap in a C API and a machine dependent backend API.
Hopefully I'll have something working by the weekend - I can now understand some of the problems people have been having - to start with, I've no idea where the REPRODUCE_EFECTO label comes from!
Hopefully I'll have something working by the weekend - I can now understand some of the problems people have been having - to start with, I've no idea where the REPRODUCE_EFECTO label comes from!
I've now got WYZPlayer baked into Classic for MSX and ZX so I'd really appreciate some feedback on it.
There's some docs located here: https://github.com/z88dk/z88dk/wiki/Classic-WYZ-Player which are hopefully easy to follow. There needs to be a bit of manipulation of the .asm file that is generated by WYZTracker. This basically works around z80asm currently lacking the db, dw directives and additionally wraps up the instrument/effects tables into something that can be easily accessed by C code.
I've given an example program for setting up interrupts for both ZX and MSX (ROM target).
There's some docs located here: https://github.com/z88dk/z88dk/wiki/Classic-WYZ-Player which are hopefully easy to follow. There needs to be a bit of manipulation of the .asm file that is generated by WYZTracker. This basically works around z80asm currently lacking the db, dw directives and additionally wraps up the instrument/effects tables into something that can be easily accessed by C code.
I've given an example program for setting up interrupts for both ZX and MSX (ROM target).
I've installed a WYZTracker and generated with deafult parameters, a file quezesto.mus.asm and quezesto.mus (from the included songs).
Then I've downloaded the latest nightly and managed to compile both versions.
The Spectrum version works but the MSX version doesn't. And I did got the port error warning in the emulator, as I said in the other thread.
If you want the package I could post it somewhere.
Then I've downloaded the latest nightly and managed to compile both versions.
The Spectrum version works but the MSX version doesn't. And I did got the port error warning in the emulator, as I said in the other thread.
If you want the package I could post it somewhere.
Thanks a lot for the hint. I've tracked down the MSX problem to an issue with different interrupt timing on emulators and some buggy code that issued a reti before the interrupt routine had finished. I'll push an update this evening - I'm guessing in the past I'd not noticed it since the ISRs I was testing with were fast to execute.
Which emulator/how do I show the problems with the PSG? The generic player code for the MSX and ZX is identical and it looks like register 7 is protected
Which emulator/how do I show the problems with the PSG? The generic player code for the MSX and ZX is identical and it looks like register 7 is protected
The MSX interrupt is also complicated, but different than the ZX version. I need to look it up but there are several tricky stuff there. I'll ask around more, but that is likely something I can fix in the application level (in my game code, for example).dom wrote:Thanks a lot for the hint. I've tracked down the MSX problem to an issue with different interrupt timing on emulators and some buggy code that issued a reti before the interrupt routine had finished. I'll push an update this evening - I'm guessing in the past I'd not noticed it since the ISRs I was testing with were fast to execute.
According to https://www.msx.org/forum/msx-talk/emul ... msx?page=4, it says: "Just ensure that ?10? is written in the top two bits of register 7." (although I saw bits of assembly code where I saw all your port+7 was set with "10", so I wonder why).Which emulator/how do I show the problems with the PSG? The generic player code for the MSX and ZX is identical and it looks like register 7 is protected
On page 1 of that thread, there is this text: "When running the same game in the OpenMSX emulator I noticed that it gives a warning about unsafe PSG settings exactly at the same moment. As the Red Book says, if both 6th and 7th bits of PSG register 7 are set to one, this may damage the older machines with the real PSG chip." Yes, I use OpenMSX (amongst others).
I'm just tagging in at the appropriate vector in high ram so there's nothing fancy going on in the interrupt routines.
I thought it was openmsx that was being used. I'm not seeing those warnings now I've fixed the interrupt handling - I'm guessing it was a side effect of the interrupt handler being interrupted which is never going to end well.
I'll carry on adding support for other machines most of them are hopefully easier, apart from the dreaded CPC of course.
I thought it was openmsx that was being used. I'm not seeing those warnings now I've fixed the interrupt handling - I'm guessing it was a side effect of the interrupt handler being interrupted which is never going to end well.
I'll carry on adding support for other machines most of them are hopefully easier, apart from the dreaded CPC of course.
Thanks for working on the interrupts part. I understand there is still work on it right now?
Will look into it when it's ready. Is the MSX part finished?
I would like to download again but I don't really want to re-download and re-install the nightly every day, since it's getting large nowadays. (It's nearing 70MB now!)
Will look into it when it's ready. Is the MSX part finished?
I would like to download again but I don't really want to re-download and re-install the nightly every day, since it's getting large nowadays. (It's nearing 70MB now!)
I believe the interrupt code is now correct. No ill effects in any of the emulators I've tried.
I think the size means that I forgot to strip the windows sdcc binaries again, I've just stripped them and the size of sdcc has gone down from 31M to 3M. I've also cranked up compression on the zip files so the next build should be substantially smaller - thanks for letting me know about that.
I think the size means that I forgot to strip the windows sdcc binaries again, I've just stripped them and the size of sdcc has gone down from 31M to 3M. I've also cranked up compression on the zip files so the next build should be substantially smaller - thanks for letting me know about that.
Did you got it from https://sites.google.com/site/wyzplayer/downloadsdom wrote:I'm taking a look at the wyz player first of all - it "looks" like the easiest one to wrap in a C API and a machine dependent backend API.
Hopefully I'll have something working by the weekend - I can now understand some of the problems people have been having - to start with, I've no idea where the REPRODUCE_EFECTO label comes from!
Regards
Wops I didn't read it the rest of the messages. Ignore this one.jordi wrote:Did you got it from https://sites.google.com/site/wyzplayer/downloadsdom wrote:I'm taking a look at the wyz player first of all - it "looks" like the easiest one to wrap in a C API and a machine dependent backend API.
Hopefully I'll have something working by the weekend - I can now understand some of the problems people have been having - to start with, I've no idea where the REPRODUCE_EFECTO label comes from!
Regards
Really appreciate your work!! Thank you, and it was really fastdom wrote:I've now got WYZPlayer baked into Classic for MSX and ZX so I'd really appreciate some feedback on it.
There's some docs located here: https://github.com/z88dk/z88dk/wiki/Classic-WYZ-Player which are hopefully easy to follow. There needs to be a bit of manipulation of the .asm file that is generated by WYZTracker. This basically works around z80asm currently lacking the db, dw directives and additionally wraps up the instrument/effects tables into something that can be easily accessed by C code.
I've given an example program for setting up interrupts for both ZX and MSX (ROM target).
It would be great to also integrate FX parts into the calls, as WYZ supports them
Thanks for the link - I was looking at the WYZTracker GitHub project and couldn't find that sfx.asm file.
I've now added it, wrapped it with a C api, updated the wiki page and more usefully provided an in-tree example that's here: https://github.com/z88dk/z88dk/tree/mas ... /sound/wyz - it was basically my test program so it made sense to add it.
Have fun!
I've now added it, wrapped it with a C api, updated the wiki page and more usefully provided an in-tree example that's here: https://github.com/z88dk/z88dk/tree/mas ... /sound/wyz - it was basically my test program so it made sense to add it.
Have fun!
I've taken the VortexTracker integration by @stefanbylund and added it into classic for MSX and ZX targets.
Using it is similar to WYZ, and there's an example here: https://github.com/z88dk/z88dk/tree/mas ... /sound/vt2
Using it is similar to WYZ, and there's an example here: https://github.com/z88dk/z88dk/tree/mas ... /sound/vt2
What is actually the problem with the CPC playing code provided with the wyz player? Or is it the interrupt part you're having problems with? (No I've never built CPC code myself, and for my next test I'll try out the GB target first.)dom wrote:I'll carry on adding support for other machines most of them are hopefully easier, apart from the dreaded CPC of course.
I noticed the size has reduced by 5M, so that's nice.dom wrote:I think the size means that I forgot to strip the windows sdcc binaries again, I've just stripped them and the size of sdcc has gone down from 31M to 3M. I've also cranked up compression on the zip files so the next build should be substantially smaller - thanks for letting me know about that.
I'd imagine nothing is wrong with it, it's just historically I've not had a good time with the CPC: I've found the firmware very picky and I've got memories of being "scolded" by CPC developers.Timmy wrote:What is actually the problem with the CPC playing code provided with the wyz player? Or is it the interrupt part you're having problems with? (No I've never built CPC code myself, and for my next test I'll try out the GB target first.)
I'd expected more, but I guess debug information compresses well! I should start removing targets rather than adding them: that would reduce the download size!Timmy wrote:I noticed the size has reduced by 5M, so that's nice.
I'm trying to bring some noise management in effects from pOpE (so effects become more powerful), but not fully succeeded
My pull request is there, any clue will be great.
https://github.com/z88dk/z88dk/pull/1430/files
My pull request is there, any clue will be great.
https://github.com/z88dk/z88dk/pull/1430/files
Re: WYZ lib or AYFX integration
I saw this discussion in msx.org, they are probably talking about new versions of WYZ formats and tracker and (probably) a 50/60 Hz identifier.
Probably interesting to follow.
https://www.msx.org/forum/msx-talk/deve ... ile-format
Probably interesting to follow.
https://www.msx.org/forum/msx-talk/deve ... ile-format