Karoshi MSX Community

Desarrollo MSX => Development (English/Ingles) => Mensaje iniciado por: Dioniso en 11 de Enero de 2007, 12:46:50 am



Título: PT3 Player *1744 bytes*
Publicado por: Dioniso en 11 de Enero de 2007, 12:46:50 am
.


Título: Re: PT3 Player *1744 bytes*
Publicado por: pitpan en 11 de Enero de 2007, 10:26:51 am
Has this PT3 replayer self-modifiable code? Let me rephrase it: will the code work in ROM as it comes?

Anyway, congratulations for the size improvement!


Título: Re: PT3 Player *1744 bytes*
Publicado por: Dioniso en 11 de Enero de 2007, 10:34:31 am
.


Título: Re: PT3 Player *1744 bytes*
Publicado por: Dioniso en 11 de Enero de 2007, 10:57:09 am
.


Título: Re: PT3 Player *1744 bytes*
Publicado por: jltursan en 11 de Enero de 2007, 11:58:43 am
Citar
Not for the moment. You can see there is still self-modifiable code. If this code works (remember the original one from Spectrum is from Bulba) I will release another version non self-modifiable and a shorter one without some commands

As for now I found that the new squeezed PT3 routine is even more usable from RAM thanks it's new size, although I would be happy to see a ROM friendly routine, right now I'm fine with the RAM frienly one. I guess that I'll change my PT2 routines for PT3 very soon...thanks Dioniso! :)


Título: Re: PT3 Player *1744 bytes*
Publicado por: burguera en 11 de Enero de 2007, 08:07:02 pm
Great, Dioniso. I'll try this shorter player as soon as possible and send you some feedback.


Título: Re: PT3 Player *1744 bytes*
Publicado por: Dioniso en 11 de Enero de 2007, 11:32:43 pm
.


Título: Re: PT3 Player *1744 bytes*
Publicado por: Dioniso en 12 de Enero de 2007, 12:45:33 am
.


Título: Re: PT3 Player *1744 bytes*
Publicado por: SapphiRe en 12 de Enero de 2007, 10:19:34 am
Hey! Nice!  :D

What about an integrated effects replayer? Maybe playing PT3 samples stored outside PT3 modules... Just an idea :P


Título: Re: PT3 Player *1744 bytes*
Publicado por: Dioniso en 12 de Enero de 2007, 10:41:34 am
.


Título: Re: PT3 Player *1744 bytes*
Publicado por: burguera en 12 de Enero de 2007, 12:10:13 pm
Good job, Dioniso. I tested this shorter replayer yesterday and it seems to work fine. Those extra bytes will be very useful for me 8)


Título: Re: PT3 Player *1744 bytes*
Publicado por: Dioniso en 12 de Enero de 2007, 12:13:25 pm
.


Título: Re: PT3 Player *1744 bytes*
Publicado por: burguera en 12 de Enero de 2007, 12:16:56 pm
Citar
Thanks for testing it. It's good to hear it works.

I'll try to see those sfx next.

Well, I tested the 1744 bytes version. Now I see there is a shorter one, so... now I'll have to decide what can I do with the extra memory ;-)

About SFX, it would be great to have them properly integrated in the player, maybe using PT3 too as a format for SFX.



Título: Re: PT3 Player *1744 bytes*
Publicado por: Dioniso en 12 de Enero de 2007, 12:39:24 pm
.


Título: Re: PT3 Player *1744 bytes*
Publicado por: burguera en 12 de Enero de 2007, 01:04:58 pm
Citar
The problem is that you can't just edit some samples and put it in your PT3 song. If you don't use those sfx/samples in your module, they'll be erased by VTII  Undecided

I see. And what about using an additional PT3 file containing only SFX, but that is never played as a song and only used to store SFX data? I think this would be the best option, because most games have more than a single music and it would be too expensive to copy all the effects into each module.

Anyway, do you think PT3 is a good format to store SFX?


Título: Re: PT3 Player *1744 bytes*
Publicado por: Dioniso en 12 de Enero de 2007, 01:41:47 pm
.


Título: Re: PT3 Player *1744 bytes*
Publicado por: burguera en 12 de Enero de 2007, 02:19:45 pm
Citar
This could be done very easily from a PC; C or C++. With a program that takes two PT3: one with the song and another one with the sfx, played one after another (as a "song"). The PC program should only take the SFX/samples from the second PT3 module and insert them in the free space, within the 64 bytes for the samples, in the first PT3 module.

So... do this mean that these 64 bytes are there, in the PT3, even if there are only a few samples? In that case, your proposal seems to be OK, but 64 bytes seem to be very short. Moreover, if I correctly understood, this is an important flaw in the PT3 format, as it wastes some memory.

It would not be possible to have 2 PT3 on the MSX memory and, when SFX has to be played, stop one channel for the main PT3, store the pointers, indexes and whatever, start playing the SFX in that channel and, when the SFX is finished, restore pointers, indexes and so on and continue the main song properly?


Título: Re: PT3 Player *1744 bytes*
Publicado por: SapphiRe en 12 de Enero de 2007, 02:46:44 pm
I see. And what about using an additional PT3 file containing only SFX, but that is never played as a song and only used to store SFX data? I think this would be the best option, because most games have more than a single music and it would be too expensive to copy all the effects into each module.

It's not possible to save individual samples on VT2?

Citar
Anyway, do you think PT3 is a good format to store SFX?

A good question, indeed! Any other format suggestion?


Título: Re: PT3 Player *1744 bytes*
Publicado por: Dioniso en 12 de Enero de 2007, 02:54:25 pm
.


Título: Re: PT3 Player *1744 bytes*
Publicado por: burguera en 12 de Enero de 2007, 02:56:54 pm
Citar
It's not possible to save individual samples on VT2?

It is possible but, AFAIK, in a text format useful for VT2 but too long to be used in MSX.

Citar
A good question, indeed! Any other format suggestion?

I have no idea. What about the SEE format? Is it a good format?


Título: Re: PT3 Player *1744 bytes*
Publicado por: Dioniso en 12 de Enero de 2007, 02:57:52 pm
.


Título: Re: PT3 Player *1744 bytes*
Publicado por: SapphiRe en 12 de Enero de 2007, 03:10:58 pm
Citar
It's not possible to save individual samples on VT2?

It is possible but, AFAIK, in a text format useful for VT2 but too long to be used in MSX.

So the question is if we'll need a tool to transform a sample in text format to a sample in bin format ready for the replayer.

I guess it's easy to code that tool reading the explanation of Dioniso... ::)


Título: Re: PT3 Player *1744 bytes*
Publicado por: Dioniso en 12 de Enero de 2007, 03:33:11 pm
.


Título: Re: PT3 Player *1744 bytes*
Publicado por: burguera en 12 de Enero de 2007, 07:36:08 pm
Citar
Citar
It would not be possible to have 2 PT3 on the MSX memory and, when SFX has to be played, stop one channel for the main PT3, store the pointers, indexes and whatever, start playing the SFX in that channel and, when the SFX is finished, restore pointers, indexes and so on and continue the main song properly?

That would be a waste of memory, I'm afraid. As SapphiRe says ...

Cita de: SapphiRe en Hoy a las 02:46:44
It's not possible to save individual samples on VT2?

Yes, but you'll have to put them yourself in the PT3 module ...

OK, now I see. Since PT3 format "wastes" memory, the SFX could be stored into each PT3 in the game with no "extra cost". Good.
The problem is when compressing, as you mentioned. Maybe an option is to have the sfx in the exact format needed by PT3, but in a separate place. And let the MSX copy those SFX into the PT3 file. In that way, all the PT3 in the game will have zeros in the area you mentioned and compression would be effective. When a PT3 music is decompressed into MSX memory then the SFX could be copied.



Título: Re: PT3 Player *1744 bytes*
Publicado por: ARTRAG en 17 de Enero de 2007, 06:06:37 pm
 :o ??? ??? ???

where is the code?


Título: Re: PT3 Player *1744 bytes*
Publicado por: Dioniso en 17 de Enero de 2007, 07:17:01 pm
:o ??? ??? ???

where is the code?


Everything was deleted and I will not continue improving it. The last replayer can be found here (http://www.geocities.com/dioniso072/PT3_Replayer_1696_bytes_long.zip) and it's 1696 long. Read the info in the zip file. If you have questions, better ask me by email.


Título: Re: PT3 Player *1744 bytes*
Publicado por: WYZ en 17 de Enero de 2007, 08:50:25 pm
Dioniso .... IMHO this isn't the right way. Please, take it easy and let us learn a little bit with your knowledges.


Título: Re: PT3 Player *1744 bytes*
Publicado por: ARTRAG en 18 de Enero de 2007, 05:08:53 pm
:o ??? ??? ???

where is the code?


Everything was deleted and I will not continue improving it. The last replayer can be found here (http://www.geocities.com/dioniso072/PT3_Replayer_1696_bytes_long.zip) and it's 1696 long. Read the info in the zip file. If you have questions, better ask me by email.

Dioniso, I think that your skill on the PT3 is unique in the MSX scene.
I am sad to hear that you'll not improve the replayer any more.
I hope that your decisions are only due to lack of time.



Título: Re: PT3 Player *1744 bytes*
Publicado por: Jon_Cortazar en 18 de Enero de 2007, 05:42:46 pm
I guess Mr. Dioniso is kinda bored of those "PSG killer", "7th bit incident", "or burnt PSGs" comments, and I can understand him as those kind of comments are made practically daily... I just hope he rests a bit and decide to come back with his potent and versatile and even-being-improved PT3 replayer.

All I have to say to Dionisio is a big "thanks!" and another big "please, continue your good work!" ;)


Título: Re: PT3 Player *1744 bytes*
Publicado por: ARTRAG en 23 de Enero de 2007, 09:30:33 am
 
I was very interested in Dioniso's work about the PT3 replayer and the discussion on how integrate SFX in PT3.
I would be amazing to get a PT3 replayer able to process at the same time music and SFX commands issued from
the main code.

Could someone please give me some hints on what to do to get such a result ?
Is there any doc I could start to analyze about the PT3 format?
 
Integrate sfx and music is a very old problem that has no general solution yet in the MSX scene, why not to
fill this gap?
 


Título: Re: PT3 Player *1744 bytes*
Publicado por: nerlaska en 23 de Enero de 2007, 10:38:16 am
Taking a look to VT2 Pascal sources .. you will find all the info about PT3 Format.
And extend this format for adding new channels is very easy .. and extend for adding SCC is very easy.
Good luck!


Título: Re: PT3 Player *1744 bytes*
Publicado por: nrgo en 11 de Septiembre de 2008, 07:55:14 pm
Hi to all!
PT3 format and replayer are very interesting!
Since I've made some games in Turbo Pascal with MSXPad IDE, I'm interested in PT3 routines to load, play, stop, etc music and SFX in this environment.
I love PT3 and not FM Music because of the need of a memory mapper and other resource consuming things... (I'm always talking about TP and Lammassaari's libraries).

Can you help me? I'm not so skilled in ASM programming, but it would be very simple to write such routines in Pascal, for ex. using the InLine function. Also think about the possibility to use all the MSX's 64KB RAM, because programs runs on MSX-DOS.

It would be great if I'll be possible to use PT3 in C language.

Thankyou in advance for your help.


Título: Re: PT3 Player *1744 bytes*
Publicado por: nerlaska en 12 de Septiembre de 2008, 05:44:22 am
You can find in this forum sources in C for playing PT3 and AFX
Take a look into Snippets


Título: Re: PT3 Player *1744 bytes*
Publicado por: pitpan en 12 de Septiembre de 2008, 07:22:26 am
There *might* be a problem: IIRC the PT3 replayer written in assembler uses self-modifying code. I'm not sure if it can be easily ported thus to Turbo Pascal inlines. But you'd better try and tell us the results.

Porting the C source to Pascal shouldn't be that hard, but AFAIK pointer handling in Pascal is not so direct as in C. Good luck with your quest!


Título: Re: PT3 Player *1744 bytes*
Publicado por: ARTRAG en 12 de Septiembre de 2008, 10:14:36 am
There are many not self modifying version of the player both on Bulba AY site and on Sapphire blog.
If you want asm, start from that. They are not that compact, but they work fine.

PS
In my experience Pascal or C does not count.
If you execute your code in RAM, ASM self modifying code should work fine, even if included with inlines.


Título: Re: PT3 Player *1744 bytes*
Publicado por: SapphiRe_MSX en 12 de Septiembre de 2008, 11:35:24 am
There *might* be a problem: IIRC the PT3 replayer written in assembler uses self-modifying code. I'm not sure if it can be easily ported thus to Turbo Pascal inlines. But you'd better try and tell us the results.

Robsy, as ARTRAG said, there's a PT3 replayer version that works in ROM on my blog (http://z80st-software.blogspot.com). You heard it on last Barcelona's RU :D

Regards
--
Sph.


Título: Re: PT3 Player *1744 bytes*
Publicado por: pitpan en 12 de Septiembre de 2008, 12:56:13 pm
The problem with the Pascal INLINEs is that you do not include assembler, but opcdes in hex. Therefore, it is not very convenient when it comes to selfreferencing, specially when you don't know where the code would be located.

And yes, I just considered the Dioniso replayer, not the Sapphire one. Blame on me!


Título: Re: PT3 Player *1744 bytes*
Publicado por: ARTRAG en 12 de Septiembre de 2008, 01:06:22 pm
If you cannot process symbols in INLINE, the linking could place your code anywhere without permitting you any control on what to modify....
Better to avoid self modifying code in this case