Anyone to convert a Z80 music player?

GFA, ASM, STOS, ...

Moderators: simonsunnyboy, Mug UK, Zorro 2, Moderator Team

User avatar
ggn
Atari God
Atari God
Posts: 1202
Joined: Sat Dec 28, 2002 4:49 pm

Re: Anyone to convert a Z80 music player?

Postby ggn » Fri May 18, 2018 5:56 am

Eero Tamminen wrote:
ggn wrote:I just managed to do some measurements using gwEm's CPU measurer (is that even a word? anyway).


Hatari profiler can measure an exact amount of cycles for you, for any part of your code.

Probably easiest way to do that is adding symbol for start and end of the part of code you want to measure before starting profiling.


Image
is 73 Falcon patched atari games enough ? ^^

User avatar
ggn
Atari God
Atari God
Posts: 1202
Joined: Sat Dec 28, 2002 4:49 pm

Re: Anyone to convert a Z80 music player?

Postby ggn » Fri May 18, 2018 7:31 am

Targhan wrote:Cool, only twice slower than raw YM and much, much much, more memory-efficient!
Do you consider your player finished? If possible, I'd like a version to be integrated to the Arkos Tracker 2 package. Do you think it is a good idea, or do you prefer only having a repository? I like somehow having the AT2 package fully useable "stand-alone", but having to update it whenever you change a comment is quite bothersome :).


Well, the core player is pretty much finished. I think I'd like to send you a "stable" (or "reference") version so it can be included in the tracker package and have a link in the sources to the repository. That way people can get something running without much fuss and if they want any advanced features (like SID or whatever else we come up with) they can check out the repository.

So I think I'll clean up the sources a bit and send you an archive soon!
is 73 Falcon patched atari games enough ? ^^

User avatar
dma
Atari Super Hero
Atari Super Hero
Posts: 845
Joined: Wed Nov 20, 2002 11:22 pm
Location: France
Contact:

Re: Anyone to convert a Z80 music player?

Postby dma » Fri May 18, 2018 9:24 am

ggn: Amazing to see how you went from "i have a look but it's just a little try", to "releasing a stable version".
Still the cool demo-scene way of doing things! :D

Targhan
Atari nerd
Atari nerd
Posts: 44
Joined: Thu Mar 23, 2017 2:18 pm

Re: Anyone to convert a Z80 music player?

Postby Targhan » Fri May 18, 2018 11:29 am

@ggn Awesome, thanks!

wietze
Captain Atari
Captain Atari
Posts: 216
Joined: Fri Mar 01, 2013 10:52 pm

Re: Anyone to convert a Z80 music player?

Postby wietze » Fri May 18, 2018 12:14 pm

Profiler support in Steem Boiler v3.2.2, what is this black magic?!

User avatar
Showaddywaddy
Atari Super Hero
Atari Super Hero
Posts: 670
Joined: Thu Jun 06, 2002 12:01 pm
Location: Montreal, Quebec
Contact:

Re: Anyone to convert a Z80 music player?

Postby Showaddywaddy » Sat May 19, 2018 1:09 pm

wietze wrote:Profiler support in Steem Boiler v3.2.2, what is this black magic?!


Indeed it is...... very dark godly watery magic.

Shw

wietze
Captain Atari
Captain Atari
Posts: 216
Joined: Fri Mar 01, 2013 10:52 pm

Re: Anyone to convert a Z80 music player?

Postby wietze » Wed May 23, 2018 6:35 am

Am I right that the site (http://www.julien-nevo.com/arkostracker ... /download/) does not offer a 2.0.0.3a version (latest I rpesume) build for Mac OSX? If so, would you be willing and able to make a latest build?

Targhan
Atari nerd
Atari nerd
Posts: 44
Joined: Thu Mar 23, 2017 2:18 pm

Re: Anyone to convert a Z80 music player?

Postby Targhan » Thu May 24, 2018 10:47 pm

I guess you are the person who asked for the v2.0.0.4a on the AT2 forum? Send me a PM with your email and I can send you the CLI software for OSX. I have some cool features I started, and I intend to finish them before the next release.

wietze
Captain Atari
Captain Atari
Posts: 216
Joined: Fri Mar 01, 2013 10:52 pm

Re: Anyone to convert a Z80 music player?

Postby wietze » Fri May 25, 2018 8:02 am

Ledone

User avatar
ggn
Atari God
Atari God
Posts: 1202
Joined: Sat Dec 28, 2002 4:49 pm

Re: Anyone to convert a Z80 music player?

Postby ggn » Sat May 26, 2018 4:38 pm

Hello, just dropping by to give an update on the player. So, since last time I posted the player:

  • supports song events, i.e. special codes the musician can add to the tune and picked up from the code
  • supports SID song events, so you can turn SID channels on and off using event commands! Big CPU savings :)
  • supports run-time YM dumping with programmable song length to dump and optional skipping ahead from the start of the tune! So the executable can pre-render the tune at any time and then play back the buffer at the probably maximum speed possible (about half a scanline!). Of course it burns "some" RAM but hey, if you're super desperate for CPU time, this is your best bet!
  • is now able to be assembled from rmac and vasm (no devpac mode, just the default). The song conversion is a bit fiddly for now but it's not impossible!

Note that these features will not be present in the bundled sources with Arkos tracker, so grab the sources from your favorite social code repositories and have fun! And stay tuned for a few more features :)
is 73 Falcon patched atari games enough ? ^^

Targhan
Atari nerd
Atari nerd
Posts: 44
Joined: Thu Mar 23, 2017 2:18 pm

Re: Anyone to convert a Z80 music player?

Postby Targhan » Sat May 26, 2018 6:33 pm

Hey, great job.
About the song events, I guess you used the "songToEvent" CLI tool or "export event" from within the software?

User avatar
ggn
Atari God
Atari God
Posts: 1202
Joined: Sat Dec 28, 2002 4:49 pm

Re: Anyone to convert a Z80 music player?

Postby ggn » Tue May 29, 2018 5:40 pm

Targhan wrote:Hey, great job.
About the song events, I guess you used the "songToEvent" CLI tool or "export event" from within the software?


We used the cli tool and then some find-and-replace to convert the dc statements width. This is bundled inside a script that also exports the .aks files to .aky source files so it's all one step really.

Also worth pointing out is that I added a brief manual on the repository so people won't feel too weirded out trying to use the player!
is 73 Falcon patched atari games enough ? ^^

Targhan
Atari nerd
Atari nerd
Posts: 44
Joined: Thu Mar 23, 2017 2:18 pm

Re: Anyone to convert a Z80 music player?

Postby Targhan » Tue May 29, 2018 9:34 pm

the dc statements width


Huh, what is that? Do you need another option in the source generator?

User avatar
ggn
Atari God
Atari God
Posts: 1202
Joined: Sat Dec 28, 2002 4:49 pm

Re: Anyone to convert a Z80 music player?

Postby ggn » Thu May 31, 2018 11:20 am

Targhan wrote:
the dc statements width


Huh, what is that? Do you need another option in the source generator?


Honestly I haven't taken a detailed look at this as the support for events has been submitted to me but from what I can see:

    * All values need to be exported as words
    * All loop addresses need to be exported as longwords

But that's (sadly) nothing compared to the trouble we went through when trying to add support for vasm assembler (which is currently probably the most popular cross assembler for ST):

    * The parser does not like spaces in expressions, so stuff like "dc.w 2 + 3" will stop parsing at "dc.w 2" ("+3 is treated as a comment). Very confusing
    * The assembler does not auto-align addresses, so a "dc.b $ff / dc.w $ffff" will produce $ffffff instead of $ff00ffff, like the other ST assemblers do. This was really bad as I had to come up with ways of changing only lines that require auto align. In the end I used a macro for this in conjunction with a more elaborate find/replace scheme.

So currently we have a rather complicated script that does this for vasm users. Broken down, this does the following:

Code: Select all

sed
-e "s/ + /+/gI" <-- Trim whitespaces in expressions
-e "s/ - /-/gI" <-- Trim whitespaces in expressions
-e "s/, /,/gI" <-- Trim whitespaces in expressions
-e "s/dc.b\(.*\); Duration./dcbx\1; Duration./gI" <-- Forces alignment in the tracks' data
-e "s/dc.b 8\t; Loop/dcbx 8\t; Loop/gI" <-- Forces alignment for loop points
-e "s/dc.b 8$/dcbx 8/gI" <-- Forces alignment for loop points


So as you see there are quite a few changes that are needed, that's why I was reluctant to ask :(.

[EDIT] Bonus: the dcbx macro:
macro dcbx
dc.b \1
even
endm
is 73 Falcon patched atari games enough ? ^^

Targhan
Atari nerd
Atari nerd
Posts: 44
Joined: Thu Mar 23, 2017 2:18 pm

Re: Anyone to convert a Z80 music player?

Postby Targhan » Mon Jun 04, 2018 8:05 am

Wow, I'm not sure this is the responsability of AT2 to manage such cases... You really use crappy assemblers, sorry to say that! Plus some points are very Atari ST specific. If you can live with this, it would be better, for now...

User avatar
ggn
Atari God
Atari God
Posts: 1202
Joined: Sat Dec 28, 2002 4:49 pm

Re: Anyone to convert a Z80 music player?

Postby ggn » Mon Jun 04, 2018 11:09 am

Targhan wrote:Wow, I'm not sure this is the responsability of AT2 to manage such cases...


IMO that's always the can o' worms anyone is opening when trying to use a different platform and tools. IMO yes it's the exporter's responsibility to handle all export problems. But hey, this is your show here - if you think that this is beyond the call of duty, it's understandable.

Targhan wrote:You really use crappy assemblers, sorry to say that!


Do you expect me to take this comment seriously after reading rasm's source code where every z80 instruction is hardcoded in its own function? :D (disclaimer: I'm a contributor to rmac and took mild offence there).

Plus some points are very Atari ST specific. If you can live with this, it would be better, for now...


No, no they're not. This is standard 68000 code issues. But still I can understand that adding support for these export options will make the editor's exporter way more complex. So I'm not requesting anything; I merely stated the state of things for now for people that might eventually want to use the player routine into their own productions - there are some strings attached for now. Maybe I will think of a way to solve these (probably producing a binary file for the exported data instead of source). We'll see...
is 73 Falcon patched atari games enough ? ^^

Targhan
Atari nerd
Atari nerd
Posts: 44
Joined: Thu Mar 23, 2017 2:18 pm

Re: Anyone to convert a Z80 music player?

Postby Targhan » Mon Jun 04, 2018 12:12 pm

Do you expect me to take this comment seriously after reading rasm's source code where every z80 instruction is hardcoded in its own function?


I only use Rasm because it works well and I have access to its source code, and Roudoudou's fast at implementing new features. But yeah, I don't like at all the way it is coded. Don't blame me :). But at least Rasm is not offended by whitespace between operands!

IMO yes it's the exporter's responsibility to handle all export problems.


I only half-agree, but am really opened to resolve all these issues. I admit I don't know anything about 68000, so I never thought such problem could arise. There are not on top-priority, but I add this to the TODO list.

Targhan
Atari nerd
Atari nerd
Posts: 44
Joined: Thu Mar 23, 2017 2:18 pm

Re: Anyone to convert a Z80 music player?

Postby Targhan » Mon Jun 04, 2018 12:24 pm

Oh, and sorry if I offended you about your assembler. It was only a joke.

So now I learn we need compatibility options for Vasm and Rmac. What would be useful would be to have a list of what to do and what not:
- Remove whitespace between operands (Vasm).
- Align every address.

I don't understand the "longword" thing about the looping addresses. Only these ones, not the other references?

mikro
Atari God
Atari God
Posts: 1682
Joined: Sat Sep 10, 2005 11:11 am
Location: Kosice, Slovakia
Contact:

Re: Anyone to convert a Z80 music player?

Postby mikro » Mon Jun 04, 2018 8:45 pm

ggn wrote:
    * The parser does not like spaces in expressions, so stuff like "dc.w 2 + 3" will stop parsing at "dc.w 2" ("+3 is treated as a comment). Very confusing
    * The assembler does not auto-align addresses, so a "dc.b $ff / dc.w $ffff" will produce $ffffff instead of $ff00ffff, like the other ST assemblers do. This was really bad as I had to come up with ways of changing only lines that require auto align. In the end I used a macro for this in conjunction with a more elaborate find/replace scheme.

What about '-spaces' and '-align' switches?

Targhan
Atari nerd
Atari nerd
Posts: 44
Joined: Thu Mar 23, 2017 2:18 pm

Re: Anyone to convert a Z80 music player?

Postby Targhan » Mon Jun 04, 2018 9:37 pm

I also need to know if *every* word should be aligned, or only those which refer to address. Example:
dw #1234 ;This is a frequency. Should be aligned?
dw LoopPoint ;Shoud be aligned?

And what is the best way to add alignment, according to the assembler. Should I add a "-compatiblity Vasm/Rmac" flag? What default assembler?

Targhan
Atari nerd
Atari nerd
Posts: 44
Joined: Thu Mar 23, 2017 2:18 pm

Re: Anyone to convert a Z80 music player?

Postby Targhan » Tue Jun 05, 2018 9:01 am

On a sidenote, someone is asking about using the player in STOS. He's already using a SND/SNDH player for Maxymiser. I guess using your player can be done, right?


Social Media

     

Return to “Coding”

Who is online

Users browsing this forum: No registered users and 1 guest