Some techical questions

News, questions and bugs reports about CosmosEx by Jookie. Now we have a Raspberry Pi in our machines!

Moderators: Jookie, Moderator Team

User avatar
DrCoolZic
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2144
Joined: Mon Oct 03, 2005 7:03 pm
Location: France
Contact:

Re: Some techical questions

Postby DrCoolZic » Fri Sep 19, 2014 1:33 pm

Jookie wrote:
DrCoolZic wrote:Quick question:
If you connect an USB keyboard to CosmosEx I suppose the layout of this keyboard should match the language used in the TOS?
What about the KB provided in screencast


The pressed key from keyboard is translated to ST key equivalent, so if you have the key on a different place on USB / remote keyboard than on ST keyboard, then pressed key is responding to the key on the source keyboard, not the ST keyboard

??? I dont understand ???
More simple question: I use an Atari with french TOS that have an AZERTY KB. if I plug an AZERTY USB KB to CosmosEx should it work? Y/N

User avatar
Jookie
Hardware Guru
Hardware Guru
Posts: 1245
Joined: Wed Feb 04, 2004 6:54 pm
Location: Kosice, Slovakia
Contact:

Re: Some techical questions

Postby Jookie » Fri Sep 19, 2014 1:43 pm

DrCoolZic wrote:More simple question: I use an Atari with french TOS that have an AZERTY KB. if I plug an AZERTY USB KB to CosmosEx should it work? Y/N


It should work. If linux will handle all the keys you press on the keyboard with AZERTY layout, then then will be translated to Atari ST scan codes, and ST should receive them just fine. But if you use some special chars on that keyboard, which are not on US keyboard (some language specific keys), those won't work (correctly), but the other keys should be fine.

User avatar
DrCoolZic
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2144
Joined: Mon Oct 03, 2005 7:03 pm
Location: France
Contact:

Re: Some techical questions

Postby DrCoolZic » Fri Sep 19, 2014 1:47 pm

Floppy:
What is the usage of floppy enable in config? What if you turn it on and nothing connected? What if you turn it off and internal connector connected to CosmosEx
Is it useful?

Drive 0 or 1
If connected internally allow to switch drive as 0 or 1 (A or B) is it useful? If you change to 1 (B) does CE returns empty drive 0 to TOS or no floppy drive?
If you set it to 1 then I suspect you must be sure than no external floppy is connected? otherwise what happen?

If connected externally on the DIN14 connector can it still be changed from 0 to 1? Not even sure necessary signal are available in this connector?

Would it be easier to say that we have automatically:
- If CosmosEx floppy connector connected then floppy is enabled, and if not connected is disabled?
- If connected internally then drive A and if connected externally then drive B?
Last edited by DrCoolZic on Fri Sep 19, 2014 1:55 pm, edited 1 time in total.

User avatar
DrCoolZic
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2144
Joined: Mon Oct 03, 2005 7:03 pm
Location: France
Contact:

Re: Some techical questions

Postby DrCoolZic » Fri Sep 19, 2014 1:54 pm

Jookie wrote:
DrCoolZic wrote:More simple question: I use an Atari with french TOS that have an AZERTY KB. if I plug an AZERTY USB KB to CosmosEx should it work? Y/N


It should work. If linux will handle all the keys you press on the keyboard with AZERTY layout, then then will be translated to Atari ST scan codes, and ST should receive them just fine. But if you use some special chars on that keyboard, which are not on US keyboard (some language specific keys), those won't work (correctly), but the other keys should be fine.

- this seems to imply that the layout of the KB is something that needs to be set in the Linux loaded by CosmosEx and is not dependent of the TOS.
- if the Linux understand the layout of the KB connected (it should) then it should be able to handle special character.

Bottom line: would be nice (if not mandatory) that the language specific KB layout should work as expected through CosmosEx (do not where or how to specify).

User avatar
Jookie
Hardware Guru
Hardware Guru
Posts: 1245
Joined: Wed Feb 04, 2004 6:54 pm
Location: Kosice, Slovakia
Contact:

Re: Some techical questions

Postby Jookie » Fri Sep 19, 2014 1:57 pm

DrCoolZic wrote:What is the usage of floppy enable in config? What if you turn it on and nothing connected? What if you turn it off and internal connector connected to CosmosEx
Is it useful?


I don't know if it's useful ;) It's there for some cases when user decides to turn it off - if you could turn off real drive (extra logic would be required), you could use this to have real and emulated floppy connected to the same cable, and thus having drive A: once real, and emulated in other case. The same goes for drive ID 0 or 1 - it works with the default settings, but someone might need it otherwise, so he has the option to do that.

DrCoolZic wrote:Would it be easier to say that we have automatically:
- If CosmosEx floppy connector connected then floppy is enabled, and if not connected is disabled?
- If connected internally then drive A and if connected externally then drive B?


You don't need to disable the drive when you don't have it connected, this is disabling on electrical level and on low level, so you can have the floppy connected to the cable, but it behaves like it's not there. And the auto detection of internal / external (A / B) would be difficult, if not impossible, or unreliable. I'd rather leave that to user.

User avatar
DrCoolZic
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2144
Joined: Mon Oct 03, 2005 7:03 pm
Location: France
Contact:

Re: Some techical questions

Postby DrCoolZic » Fri Sep 19, 2014 2:37 pm

Jookie wrote:You don't need to disable the drive when you don't have it connected, this is disabling on electrical level and on low level, so you can have the floppy connected to the cable, but it behaves like it's not there.

Interesting. Door open to some nice setup.

And the auto detection of internal / external (A / B) would be difficult, if not impossible, or unreliable. I'd rather leave that to user.

I am not talking about auto detection. By default the floppy drive connected internally is 0/A. Not sure in Atari but in order to connect as drive 1/B in PC is usually done by using cable with selection pin switched on second connector.
As both selection line comes to the connector I suspect CosmosEx can select one or the other directly.

By default external drives provided for Atari where always 1/B
on my site http://info-coach.fr/atari/hardware/int ... _INTERFACE you can find the DIN14 pinout
Pin 5 and 6 are drive 0 drive 1 selection. This is quite interesting because this means that it is possible to use CosmosEx externally using the DIN14 connector and still use it as drive 0 or 1 if properly cabled.
To bad there is no way to easily turn off the internal floppy as this would have allowed to use internal or CosmosEx as drive 0

Need to check the cable used in Atari SF314 external floppy drive

JimDrew
Atari Super Hero
Atari Super Hero
Posts: 580
Joined: Mon Nov 04, 2013 5:23 pm

Re: Some techical questions

Postby JimDrew » Fri Sep 19, 2014 7:23 pm

Jookie wrote:
JimDrew wrote:Jookie, how are you clocking data to the floppy RDData and WRData lines currently? I assume you are generating the flux pulse with a .5us high-low-high transition every 4us/6us/8us bit cell? How is this generated on your board (interrupt, task, etc. ?) Are you pre-loading and converting the entire .msa/.dsk image, or a track at a time? How much buffer space do you have?


The whole image is converted to MFM stream in Raspberry Pi, and then only a single side of single track is sent to Franz. The MFM stream is in Hans streamed out using a timer, which is fed using a DMA. The available space for for that is 15'000 bytes, each cell (4 / 6 / 8 us) is represented using 2 bits, that means that those 15'000 bytes can represent maximum of 60'000 cells (actually a little bit less, as few bytes there are used for some control purposes).


Ok, so this will never work for copy protected disks then. You need to be able to send an exact pulse width, not just 4 /6 / 8 us. There are many programs that use variable length bit cells for copy protection, along with weak bits, no flux areas, etc.

To support copy protected disks, you would need a track buffer of 125KB (the max size [in words] with all data being ~4us). The DMA would fetch each word and just set the timer for the pulse. The other option is to spool the data from the SD card using a couple of small (512 byte) ping-pong buffers and always access the SD card. It's much easier to emulate a rotating disk from a RAM buffer.
I am the flux ninja

User avatar
DrCoolZic
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2144
Joined: Mon Oct 03, 2005 7:03 pm
Location: France
Contact:

Re: Some techical questions

Postby DrCoolZic » Fri Sep 19, 2014 9:37 pm

I agree with Jim that you will need to support variable bit width cell even if this is not on top of your list of priority.
Adding support for the SCP format would be great feature. I can easily write a converter from KF raw format to SCP

JimDrew
Atari Super Hero
Atari Super Hero
Posts: 580
Joined: Mon Nov 04, 2013 5:23 pm

Re: Some techical questions

Postby JimDrew » Sat Sep 20, 2014 4:27 am

I think you could probably get away with just a ~50K size buffer by taking the word value for each bitcell length from the .scp image file and shifting it right by 1 (dividing it by two) and storing it as a byte in the buffer. This would reduce the capture resolution to 50ns, but this would let you have to up to 12.75us per bitcell in length using just a single byte (255 x 50 = 12750). So, this would cut the buffer size in half from normal. I don't know how far you can actually go on reducing the resolution on the ST. I experimented with this on the Amiga and a 100ns capture does not always work with the Rob Northern stuff, but 50ns does.
I am the flux ninja

User avatar
DrCoolZic
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2144
Joined: Mon Oct 03, 2005 7:03 pm
Location: France
Contact:

Re: Some techical questions

Postby DrCoolZic » Sat Sep 20, 2014 7:20 am

JimDrew wrote:I think you could probably get away with just a ~50K size buffer by taking the word value for each bitcell length from the .scp image file and shifting it right by 1 (dividing it by two) and storing it as a byte in the buffer. This would reduce the capture resolution to 50ns, but this would let you have to up to 12.75us per bitcell in length using just a single byte (255 x 50 = 12750). So, this would cut the buffer size in half from normal. I don't know how far you can actually go on reducing the resolution on the ST. I experimented with this on the Amiga and a 100ns capture does not always work with the Rob Northern stuff, but 50ns does.

Why all these questions about buffer size?
Is this really a limitation on CosmosEx that has 512 MB of RAM?

JimDrew
Atari Super Hero
Atari Super Hero
Posts: 580
Joined: Mon Nov 04, 2013 5:23 pm

Re: Some techical questions

Postby JimDrew » Sat Sep 20, 2014 8:29 pm

Well... I didn't know how much RAM was available! I thought it had around 256KB of RAM. With 512MB available, load the entire .scp image into RAM and call it a day! LOL! Easy at that point to spool it to the WD1772!
I am the flux ninja

User avatar
Jookie
Hardware Guru
Hardware Guru
Posts: 1245
Joined: Wed Feb 04, 2004 6:54 pm
Location: Kosice, Slovakia
Contact:

Re: Some techical questions

Postby Jookie » Sun Sep 21, 2014 8:22 am

DrCoolZic wrote:Why all these questions about buffer size?
Is this really a limitation on CosmosEx that has 512 MB of RAM?


Because this is the limitation of current implementation :) To offload SPI bus of RPi only the current track (only single side) is sent to Franz, which can store it, and stream it to WD1772 without further communication with RPi, but this is limited to 15 KB. In the future there could be a version of Main App and Franz firmware, which would stream data from RPi to Franz all the time that data is sent to WD1772 and thus removing this 15 KB limitation (size of Franz's RAM is 20 kB), but this will not be done in the following weeks, as the bug fixes for the hard drive part are more important than new features.

...and I'm also worried about the performance of of hard drive part if the floppy part would be done that way - when copying between floppy and hard drive the SPI bus would be then loaded with the floppy stream, and the hard drive performance in that time would drop.

JimDrew
Atari Super Hero
Atari Super Hero
Posts: 580
Joined: Mon Nov 04, 2013 5:23 pm

Re: Some techical questions

Postby JimDrew » Sun Sep 21, 2014 3:58 pm

Why not load the image into the RPi's main memory and just transfer that data? Is there some kind of flow chart showing how the hardware is integrated? I am not sure what "Franz" is.
I am the flux ninja

User avatar
Jookie
Hardware Guru
Hardware Guru
Posts: 1245
Joined: Wed Feb 04, 2004 6:54 pm
Location: Kosice, Slovakia
Contact:

Re: Some techical questions

Postby Jookie » Sun Sep 21, 2014 7:57 pm

JimDrew wrote:Why not load the image into the RPi's main memory and just transfer that data? Is there some kind of flow chart showing how the hardware is integrated? I am not sure what "Franz" is.


That's what I wrote that the future version could do, but the current version does it bit differently. 'Franz' is the floppy low level handling chip (STM32F103) (there's another one handling low level hard drive stuff).

User avatar
Bama
Captain Atari
Captain Atari
Posts: 169
Joined: Sat Feb 28, 2015 1:25 pm

Re: Some techical questions

Postby Bama » Wed Mar 11, 2015 1:23 am

Jookie wrote:
DrCoolZic wrote:What is the usage of floppy enable in config? What if you turn it on and nothing connected? What if you turn it off and internal connector connected to CosmosEx
Is it useful?


I don't know if it's useful ;) It's there for some cases when user decides to turn it off - if you could turn off real drive (extra logic would be required), you could use this to have real and emulated floppy connected to the same cable, and thus having drive A: once real, and emulated in other case. The same goes for drive ID 0 or 1 - it works with the default settings, but someone might need it otherwise, so he has the option to do that.

DrCoolZic wrote:Would it be easier to say that we have automatically:
- If CosmosEx floppy connector connected then floppy is enabled, and if not connected is disabled?
- If connected internally then drive A and if connected externally then drive B?


You don't need to disable the drive when you don't have it connected, this is disabling on electrical level and on low level, so you can have the floppy connected to the cable, but it behaves like it's not there. And the auto detection of internal / external (A / B) would be difficult, if not impossible, or unreliable. I'd rather leave that to user.



So by my reading of this quote: I can connect the CE inside my STacy and have the CE and the internal floppy on the same cable. Which means I will be able to use both the real floppy and the CE floppy emulator?!?!?!


.
:-)
BAMA

User avatar
Jookie
Hardware Guru
Hardware Guru
Posts: 1245
Joined: Wed Feb 04, 2004 6:54 pm
Location: Kosice, Slovakia
Contact:

Re: Some techical questions

Postby Jookie » Mon Mar 16, 2015 1:28 pm

Bama wrote:So by my reading of this quote: I can connect the CE inside my STacy and have the CE and the internal floppy on the same cable. Which means I will be able to use both the real floppy and the CE floppy emulator?!?!?!


Yes, but only one of them will be drive A:, so that one only can be used for booting games from floppy.

User avatar
Bama
Captain Atari
Captain Atari
Posts: 169
Joined: Sat Feb 28, 2015 1:25 pm

Re: Some techical questions

Postby Bama » Mon Mar 16, 2015 3:18 pm

Jookie wrote:
Bama wrote:So by my reading of this quote: I can connect the CE inside my STacy and have the CE and the internal floppy on the same cable. Which means I will be able to use both the real floppy and the CE floppy emulator?!?!?!


Yes, but only one of them will be drive A:, so that one only can be used for booting games from floppy.


Cool!

Thx
:-)
BAMA


Social Media

     

Return to “CosmosEx”

Who is online

Users browsing this forum: No registered users and 3 guests