Thread in English for Fujitsu FM7

Avatar de Usuario
pser1
Mensajes: 4094
Registrado: 08 Dic 2012 18:34
Agradecido : 1352 veces
Agradecimiento recibido: 1118 veces

Re: Thread in English for Fujitsu FM7

Mensajepor pser1 » 17 Sep 2017 14:06

Último mensaje de la página anterior:

Hello,
just to keep this thread up to date, I am uploading a new version that allows the player to end the game!
IN order to have the same level that we have on the Dragon version, there are some pitfalls to solve:

1) Show the 'small' shark appear little by little coming out of the sea
2) Redraw first plane objects on Brody, for instance these ones: the stairs, the pole, the counter and the Orca
3) Change to WIDTH 80,20 so that it is easier to read
4) Add some music intro (a song), maybe we could send commands right to the AY-3-8910
5) ¿Could we reproduce WAV files anyway?

- The two first points imply adding big sprites an dmodifying the subroutine that sends chunks to the Subsystem
making it compatible with the behaviour we have right now
_ The third one seems easy despite some fixed values and calculations will be affected,l becuase we are going to
have text lines that will be 10 rows high instead just 8 rows (25 x 8 = 20 x 10)
- The two final points are simply unknown to me. Maybe Malik and José Luis (jltursan) could shine some light!

Attached is the zip with the .D77 virtual disk and the source code
To test, just do
LOADM"SHARK37L",,R

You should better NOT keep pressing the same key, FM-7 repeats it for free. On certain situations, when the conversation
is not a dialogue, any keypress will erase the text, so, please, remember that recommendation!
There are some things that will need some adjustements, for instance some timings to let the user read messages, etc
Any comment about the whole game will be highly appreciated. Have fun!
cheers
pere
Shark v0.37L.zip
(81.4 KiB) Descargado 83 veces

jltursan
Mensajes: 5619
Registrado: 20 Sep 2011 13:59
Ubicación: Madrid
Agradecido : 990 veces
Agradecimiento recibido: 2040 veces
Contactar:

Re: Thread in English for Fujitsu FM7

Mensajepor jltursan » 18 Sep 2017 14:17

For a music and sfx replaying routine I need to know some details about the machine:

1) Which ones are the control and data ports of the FM-7's PSG?
2) Do we know how to setup an ISR able to execute every 1/60 second?, is there a BIOS hook capable of being used for that or we need to program a barebone 6809 interrupt routine to achieve this?

...and related to the actual development status:

3) Is there enough RAM (main CPU) available or we're running short?

There're some candidates to provide audio: Vortex Tracker or WyzTracker replaying routines .Sadly both are Z80; but I suppose that they could be easily converted to 6809 as they're not so big and mostly they work with data tables. VT routine is slightly complex as it's more powerful and has heavy use of the second set of Z80 registers, I suppose they would be a bit difficult to deal with on the 6809. VT also has bigger songs and wastes more interrupt time.

WyzTracker is lighter and faster, small songs; but also less audio possibilities. The problem is my lack of experience with it, I'll try to get a Z80 working demo very soon that would be easier to analyze. Initially, I can see a little problem with Wyz, I can't see support for multiple songs (or at least I haven't found the way to do it).

Last problem is to found anyone able to compose the music of course...:-). VT has a huge library and maybe we can recycle some themes; but Wyz is too young and there's no collections available (I know Wyz personally so maybe I can ask for some music).

Avatar de Usuario
pser1
Mensajes: 4094
Registrado: 08 Dic 2012 18:34
Agradecido : 1352 veces
Agradecimiento recibido: 1118 veces

Re: Thread in English for Fujitsu FM7

Mensajepor pser1 » 18 Sep 2017 15:37

Hi,
- I agree that we need an ISR to control the timing of the music along the game, but if we are going to play the
Shark song ONLY in the Intro, not along the game, then we don't need the ISR and could play it right away.
So we need to know the port addresses to access the AY-3-8913 and study the datasheet of that chip.
- The complex question was about re-playing WAV files, for instance the car door and the car engine ...
We have the routine that plays these for the Dragon, we just need to know what port SHOULD be sent the data
in order to listen to those files ... no need for an ISR here, as they are very short.
The RAM question might become relevant in the moment I will try to add the big sprites that define the
three elements that require first plane, so they MUST overprint Brody, but thinking about it right now ...
This is going to be challenging as we have Brody on two planes that overprint the background. In this computer
I assume that the only way is going to 'make transparent' the part of Brody that should be behind the object.
Not easy at first glance.
Just my 2cents
cheers
pere

Avatar de Usuario
pser1
Mensajes: 4094
Registrado: 08 Dic 2012 18:34
Agradecido : 1352 veces
Agradecimiento recibido: 1118 veces

Re: Thread in English for Fujitsu FM7

Mensajepor pser1 » 18 Sep 2017 16:22

Looking at the schematics and at the datasheet, the AY-3-8913 is used to the minimal extent.
Address is done via DA0-DA7, being D8 tied to +5V and /A9 to Ground (not used)
The four low order bits (DA0-DA3) select one of the 16 registers that the user can modify or send data to.
The pins BDIR and BC1 control the data direction (input or output) DATA bus (again DA0-DA7) <--> AY-3-8913
The /chip_select input is connected to ground, so it is always working (can read or write anytime)
The programming of sound/music requires some carefull reading of the datasheet or better an example of code!
Anyway, the device IS decoded somehow, in order to react at only at two addresses, $FD0D as Command register (only write)
and $FF0E as Data register (both read and write) but this should be confirmed
cheers
pere

jltursan
Mensajes: 5619
Registrado: 20 Sep 2011 13:59
Ubicación: Madrid
Agradecido : 990 veces
Agradecimiento recibido: 2040 veces
Contactar:

Re: Thread in English for Fujitsu FM7

Mensajepor jltursan » 18 Sep 2017 17:14

So if the control and data registers are mapped with these addresses ($FD0D & $FF0E), the use must be very close to the one in the ZX as it also uses mapped ports. Don't worry about the inner working of PSG or examples, what I'm talking about are complete replayers "suites" (Windows tools to create music/audio data + ASM routines).

Do you need also a digitized sound replayer?, if so, there're several algo availables, from the simplest one, with 4-bit resolution, to more elaborated ones with more than 8-bit resolution. I'll also check it...

Do you have the original WAVs used in Dragon version?, I suppose the replayer used stops execution of game until the digitized data has been fully sent to the DAC, right?

Avatar de Usuario
pser1
Mensajes: 4094
Registrado: 08 Dic 2012 18:34
Agradecido : 1352 veces
Agradecimiento recibido: 1118 veces

Re: Thread in English for Fujitsu FM7

Mensajepor pser1 » 18 Sep 2017 17:50

jltursan escribió:So if the control and data registers are mapped with these addresses ($FD0D & $FF0E), the use must be very close to the one in the ZX as it also uses mapped ports. Don't worry about the inner working of PSG or examples, what I'm talking about are complete replayers "suites" (Windows tools to create music/audio data + ASM routines).

I am sure, right now, that with only these two registers we can do. The command register is set first, then the data register ...
I should better give a peek at some examples I have somewhere about that. If I remember correct, I think I have one from Simon Jonassen.
Concerning windows suits ... not sure if I am going to need them (?)
Do you need also a digitized sound replayer?, if so, there're several algo availables, from the simplest one, with 4-bit resolution, to more elaborated ones with more than 8-bit resolution. I'll also check it...

I cannot spot where the samples of the WAV could be sent in the FM-7 to get the sound output
Do you have the original WAVs used in Dragon version?, I suppose the replayer used stops execution of game until the digitized data
has been fully sent to the DAC, right?

I might find the original WAV files, but what I have for sure are the cut-down versions I made to occupy the less ram possible.
I think that my re-player creates one point for each one read, interpolating with previous one, so doubling the rate.
And yes, it is done with no interrupts, so the CPU stops the game and works on the wav file only
cheers
pere

jltursan
Mensajes: 5619
Registrado: 20 Sep 2011 13:59
Ubicación: Madrid
Agradecido : 990 veces
Agradecimiento recibido: 2040 veces
Contactar:

Re: Thread in English for Fujitsu FM7

Mensajepor jltursan » 18 Sep 2017 21:27

Concerning windows suits ... not sure if I am going to need them (?)


Sure, they're great if we go the route to compose our own BSO.

I cannot spot where the samples of the WAV could be sent in the FM-7 to get the sound output


The FM-7's PSG (AY-3-8910) itself, thanks to a design "flaw" can play samples with amazing quality, ranging from 4bit to more than 8bits, the trick is always the same, changing amplitudes at a very fast rate.

I might find the original WAV files, but what I have for sure are the cut-down versions I made to occupy the less ram possible.
I think that my re-player creates one point for each one read, interpolating with previous one, so doubling the rate.
And yes, it is done with no interrupts, so the CPU stops the game and works on the wav file on


If you don't find them, we can always look for new original samples...

Avatar de Usuario
pser1
Mensajes: 4094
Registrado: 08 Dic 2012 18:34
Agradecido : 1352 veces
Agradecimiento recibido: 1118 veces

Re: Thread in English for Fujitsu FM7

Mensajepor pser1 » 18 Sep 2017 22:08

jltursan escribió:Sure, they're great if we go the route to compose our own BSO.

I am not sure I am going to spend a minute creating a song ... I prefer assembler 'playing' instead -507
The FM-7's PSG (AY-3-8910) itself, thanks to a design "flaw" can play samples with amazing quality, ranging from 4bit to more than 8bits, the trick is always the same, changing amplitudes at a very fast rate.

Amazing! you will have to tell me how to do that, I mean what command should we use to make it send the next data as an output level.
If you don't find them, we can always look for new original samples...

Yes, we could, but I entered this project justa as a means to learn to program the Dual Processor, not very interested in sound ...
this is for Simon, for instance. Any way I am sure I will find them as soon as I search for them!
That said, once the ported program does all the things that the Dragon version does (except for the music/sound), then I will gladly
learn to program the AY-3-8913 to create 3 voice-music and to reproduce WAVs, of course.
There are some add-ons for the CoCo and Dragon that contain one of these sound chips, probably the better AY-3-8910 and even the YM2149
that seems a lot better and is compatible at pin-level -drinks

malikto999
Mensajes: 152
Registrado: 09 Jun 2017 11:20
Agradecimiento recibido: 192 veces

Re: Thread in English for Fujitsu FM7

Mensajepor malikto999 » 19 Sep 2017 09:38

For FM-7 's PSG, there is a description in the manual. (e.g. chapter 8.4 below)
https://archive.org/details/FM7SYSMN
I do not have time today so I will explain the contents of the manual tomorrow onwards.


To use PSG from the assembler, use the I/O address $FD0D (control register) and $FD0E (data register).
Access is done in the following procedure.

1) Register selection
- Write the register number you want to use to the data register.
- Write $03 (register address latch) to the control register.
- Write $00 to the control register and end register specification.

2) Write data
- Write data to the data register.
- Write $02 (data write) to the control register.
- Write $00 to the control register and finish writing data.

I attached the above sample code.
Adjuntos
SAMPLE.zip
(993 Bytes) Descargado 56 veces

jltursan
Mensajes: 5619
Registrado: 20 Sep 2011 13:59
Ubicación: Madrid
Agradecido : 990 veces
Agradecimiento recibido: 2040 veces
Contactar:

Re: Thread in English for Fujitsu FM7

Mensajepor jltursan » 19 Sep 2017 09:47

Seems enough, thanks malik!

Avatar de Usuario
pser1
Mensajes: 4094
Registrado: 08 Dic 2012 18:34
Agradecido : 1352 veces
Agradecimiento recibido: 1118 veces

Re: Thread in English for Fujitsu FM7

Mensajepor pser1 » 19 Sep 2017 16:08

Hi,
I am sorry to say that I can just imagine the way to send data to the AY-3-8913 to program the three
sound channels as well as the noise one. To do that I wil need to have by my side the datasheet or
something that explains every command effect ... and there are quite a lot.
On the other side, I don't get the way to send data without using the internal sound generators ...

Just something I wanted to point here. This chip has three DACs but these are just FOUR bits each.
So values can range from 0 to 15, the generators present a not linear response as can be seen on
the datasheet ...
And we were saying that the Dragon DAC was shit because it was just 6 bits (0-63) -507
If we could send data to the AY-3 DACs, we would need to 'convert' the data from the WAV files
because they are waiting for a linear device to receive the data.
Nothing that cannot be solved with a lokup-table, of course. But we must keep it into account!
cheers
pere

Ps will wait for further explanations from Malik

jltursan
Mensajes: 5619
Registrado: 20 Sep 2011 13:59
Ubicación: Madrid
Agradecido : 990 veces
Agradecimiento recibido: 2040 veces
Contactar:

Re: Thread in English for Fujitsu FM7

Mensajepor jltursan » 19 Sep 2017 21:59

The correct IC model is the very same AY-3-8910, not the 8913 ;-)

Is not correct to talk about the AY having "DACs", it has three tone generator plus a noise one. You can send data through registers sets A, B or C and the PSG plays by itself the sound programmed, nothing more, nothing less.

The "DAC" feature comes from some unexpected behaviour when one changes very fast the amplitudes (volumes ranging from 0 to 15, that's why you probably confused terms). The DAC effect can be emulated with very high detail if you use the three amplitudes availables (channels A,B and C), if you use a look-up table to overcome the lack of linearity (it operates in a logarithmic scale), as you already suggested, the results can be excellent. Reached this point, this article could be extremely interesting for you: Playing samples on the PSG.

I think the routine in the above article could be easily adapted.

Avatar de Usuario
pser1
Mensajes: 4094
Registrado: 08 Dic 2012 18:34
Agradecido : 1352 veces
Agradecimiento recibido: 1118 veces

Re: Thread in English for Fujitsu FM7

Mensajepor pser1 » 19 Sep 2017 22:27

jltursan escribió:The correct IC model is the very same AY-3-8910, not the 8913 ;-)

The schematics I got from the japanese magazines we were talking about some time ago, state clearly that the
chip is the smallest one: AY-3-8913. This one has NO parallel ports, whilst the 8910 has two 8 bit ports
Maybe the later computers as FM-77AV used the big one, I don't know.
Attached is a page of that long schematic, pity I don't remember right now where did I get it from -banghead
Is not correct to talk about the AY having "DACs", it has three tone generator plus a noise one. You can send data through registers sets A, B or C and the PSG plays by itself the sound programmed, nothing more, nothing less.
The "DAC" feature comes from some unexpected behaviour when one changes very fast the amplitudes (volumes ranging from 0 to 15, that's why you probably confused terms). The DAC effect can be emulated with very high detail if you use the three amplitudes availables (channels A,B and C), if you use a look-up table to overcome the lack of linearity (it operates in a logarithmic scale), as you already suggested, the results can be excellent. Reached this point, this article could be extremely interesting for you: Playing samples on the PSG.

I attach here a copy of a part of the datasheet for the three AY-3-891x where it states clearly that the output of every sound channel
is in fact a DAC, what else could have been? Explains its logarithmic action for the human ear response and you can see that the
maximal value is 15 also 4 bits. Full doc included as a zip file (pdf). Looking at the block-diagram, you will see THREE DACs just as the
last stage inside the chip (D/A Converters)
regards
pere
PSG sound DACs.jpg
PSG sound DACs.jpg (44.21 KiB) Visto 4977 veces

AY-3-891x.zip
(800.23 KiB) Descargado 63 veces

FM-7 - sound chip.zip
(3.64 MiB) Descargado 78 veces

Avatar de Usuario
pser1
Mensajes: 4094
Registrado: 08 Dic 2012 18:34
Agradecido : 1352 veces
Agradecimiento recibido: 1118 veces

Re: Thread in English for Fujitsu FM7

Mensajepor pser1 » 19 Sep 2017 22:39

hello,
I am sorry, but I cannot upoload the magazine because it is 50Mb long
It is the IO from 1983 April, the schematics are from page (mag. number) 282 untill 300.
The AY appears in page 299
regards
pere

jltursan
Mensajes: 5619
Registrado: 20 Sep 2011 13:59
Ubicación: Madrid
Agradecido : 990 veces
Agradecimiento recibido: 2040 veces
Contactar:

Re: Thread in English for Fujitsu FM7

Mensajepor jltursan » 20 Sep 2017 11:38

I promise you ;-)

Imagen

I've never seen a FM-7 with any other model of PSG. I want to check the Secoinsa; but I guess that it'll mount the same IC.

About how the PSG manages the sound internally, of course it have DAC architecture; but I mean that you must forgot all about working with it as if it was a real DAC, you don't dump raw data; instead you must "program" the OSG to operate as you want and it does the task concurrently the main processor.

Right now, I can only offer you simple Z80 sources to create some basic sounds, just to familiarize with the chip; but usually, when you want to squeeze the power of the PSG, you must use one of the routines already developed. Check for example Caverns of Titan, a MSX game that I programmed several years ago; what you hear is the Vortex Tracker sound (PT3 format), the replayer can play songs and generate SFX at the same time without too much effort.

malikto999
Mensajes: 152
Registrado: 09 Jun 2017 11:20
Agradecimiento recibido: 192 veces

Re: Thread in English for Fujitsu FM7

Mensajepor malikto999 » 20 Sep 2017 11:53

jltursan escribió:The correct IC model is the very same AY-3-8910, not the 8913 ;-)

The "DAC" feature comes from some unexpected behaviour when one changes very fast the amplitudes (volumes ranging from 0 to 15, that's why you probably confused terms). The DAC effect can be emulated with very high detail if you use the three amplitudes availables (channels A,B and C), if you use a look-up table to overcome the lack of linearity (it operates in a logarithmic scale), as you already suggested, the results can be excellent. Reached this point, this article could be extremely interesting for you: Playing samples on the PSG.

I think the routine in the above article could be easily adapted.




I found an article related to jltursan's post from Oh! FM.
In the April and June 1990 issue of Oh! FM, tools for PCM playback with FM-7's PSG are posted.
According to the article, it seems that it corresponds to the sampling frequency of 16000 Hz and the quantization number of 8 bits.
It seems that the mechanism is generally based on the way jltursan comments.

I will attach the PCM playback routine and sample PCM files from Oh!FM 1990/6.
After booting F-BASIC, execute RUN "PCM".

Incidentally, PCM data format is FM-TOWNS 's SND file format.
Adjuntos
PSGPCM.zip
(238.67 KiB) Descargado 70 veces

jltursan
Mensajes: 5619
Registrado: 20 Sep 2011 13:59
Ubicación: Madrid
Agradecido : 990 veces
Agradecimiento recibido: 2040 veces
Contactar:

Re: Thread in English for Fujitsu FM7

Mensajepor jltursan » 20 Sep 2017 12:14

That's great!, so no need to convert any other PCM routine. This one sounds fab, longest examples, "THANKYOU" or "BYEBYE" are really impressive.
Of course, this quality has a price, the samples are a little big, from 8Kb to 15Kb :-(. Maybe pser1 can apply the interpolation algorithm he developed in his own replay routine, or simply use a lower resolution routine. The 4-bit is really small and simple; but quality is a bit crappy.

<offtopic>That common source corde project emulator (adapted by Yoshida-San) is giving me some headaches, since a couple of versions it doesn't loads disk images (D77 or D88) right, it simply fails to mount them. I need to use an older version that works flawlessly. Pretty annoying :-( </offtopic>


Volver a “Fujitsu FM7”

¿Quién está conectado?

Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 3 invitados