A few Firebee questions (general & dev)

All things related to the Atari Coldfire Project

Moderators: Mathias, Mug UK, moondog/.tSCc., [ProToS], Galvez, Moderator Team

joska
Hardware Guru
Hardware Guru
Posts: 3668
Joined: Tue Oct 30, 2007 2:55 pm
Location: Florø, Norway
Contact:

Re: A few Firebee questions (general & dev)

Postby joska » Sat Nov 21, 2015 10:27 pm

Orion_ wrote:The FPGA can hold so much RAM ?? Wow !


There is 128Mb SDRAM connected directly to the FPGA. The FPGA can - unless I've misunderstood this - access this at 264MHz. However, the ColdFire CPU needs to go through the flexbus to access it, which means that if you execute code from this RAM it will be significantly slower than if you execute it from ColdFire DRAM. Just like on a real Falcon ;)

Orion_ wrote:Both $PATH and $VBCC variables are set at boot in mint.cnf, so ??


Then I don't know. Doesn't look like a Firebee-related problem. Where did you get bash from? SpareMiNT, Gentoo...?
Jo Even

Firebee - Falcon060 - Milan060 - Falcon040 - MIST - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64

helmut
Captain Atari
Captain Atari
Posts: 169
Joined: Thu Jan 07, 2010 4:30 pm

Re: A few Firebee questions (general & dev)

Postby helmut » Sun Nov 22, 2015 2:00 am

There is a $VBCC-part in the path. I don't think any program would expand this when searching for a program or file.

-Helmut

Galvez
Atari maniac
Atari maniac
Posts: 84
Joined: Fri Oct 19, 2007 7:49 am

Re: A few Firebee questions (general & dev)

Postby Galvez » Sun Nov 22, 2015 10:10 am

Orion_ wrote:
Galvez wrote:If I'm right the combination of this card plus FireTOS is going to drive you nuts. ;-)
The card that I have which makes the FireBee behave like this also came with the machine.

The brand of the CF is "disk2go.com" ... If FireTOS is not compatible with the original given CF, that's a problem :?
I will soon get a brand new Kingston 4Gb CF, I hope it will fix all the problems.


My 16 GB "disk2go.com" is a Transcend-Information card (which is working fine with my FireBee), I guess yours is also a Transcend card, there is already another known case of a 4 GB Transcend card not working. The card that I have that is not working is a Kingston 4 GB :( , I hope yours won't be exactly the same as mine. In any case let's see if we can push so a FPGA guy can help debugging this problem.

User avatar
Orion_
Captain Atari
Captain Atari
Posts: 335
Joined: Sat Jan 10, 2004 12:20 pm
Location: France
Contact:

Re: A few Firebee questions (general & dev)

Postby Orion_ » Sun Nov 22, 2015 10:23 am

I heard Kingston was one of the best card maker ...

Galvez
Atari maniac
Atari maniac
Posts: 84
Joined: Fri Oct 19, 2007 7:49 am

Re: A few Firebee questions (general & dev)

Postby Galvez » Sun Nov 22, 2015 10:43 am

Galvez wrote:
Orion_ wrote:
Galvez wrote:If I'm right the combination of this card plus FireTOS is going to drive you nuts. ;-)
The card that I have which makes the FireBee behave like this also came with the machine.

The brand of the CF is "disk2go.com" ... If FireTOS is not compatible with the original given CF, that's a problem :?
I will soon get a brand new Kingston 4Gb CF, I hope it will fix all the problems.


My 16 GB "disk2go.com" is a Transcend-Information card (which is working fine with my FireBee),


Oops I just notice that Trancend is the brand of my USB card reader not the "disk2go.com" card.

User avatar
Eero Tamminen
Atari God
Atari God
Posts: 1559
Joined: Sun Jul 31, 2011 1:11 pm

Re: A few Firebee questions (general & dev)

Postby Eero Tamminen » Sun Nov 22, 2015 11:28 am

helmut wrote:There is a $VBCC-part in the path. I don't think any program would expand this when searching for a program or file.-Helmut


I would assume that $VBCC would be replaced with empty string when PATH is set, unless:
- '$' is quoted (like "\$")
- Whole path string is quoted so that variables won't be expanded (it being inside "'" characters)

helmut
Captain Atari
Captain Atari
Posts: 169
Joined: Thu Jan 07, 2010 4:30 pm

Re: A few Firebee questions (general & dev)

Postby helmut » Sun Nov 22, 2015 11:51 am

$VBCC is *in* the path, there won't be any expansion.

User avatar
Orion_
Captain Atari
Captain Atari
Posts: 335
Joined: Sat Jan 10, 2004 12:20 pm
Location: France
Contact:

Re: A few Firebee questions (general & dev)

Postby Orion_ » Sun Nov 22, 2015 1:41 pm

ok so, this:
mfro wrote:The video base address in the Firebee is 27 bits wide. Additionally to the Falcon's 0xffff8201, 0xffff8203 and 0xffff820d base address registers, there's another three bits at 0xffff8200 in the Firebee.

is the info I was missing, that should be great to have a little doc on this because it's hard to know unless you ask or you read fpga code listing :D

But, I managed to set my own screen address by using direct Hardware like mfro said in the above quote, so we can do double buffering.
Here is my code:

Code: Select all

LONG   SetVadrs(void)
{
   *((volatile unsigned char*)0xffff8200) = (Vadrs >> 24);
   *((volatile unsigned char*)0xffff8201) = (Vadrs >> 16);
   *((volatile unsigned char*)0xffff8203) = (Vadrs >>  8);
   *((volatile unsigned char*)0xffff820d) = (Vadrs & 255);
   return (0);
}

   Vadrs = ((unsigned int)Physbase()) + 0x01000000;
   Supexec(SetVadrs);


Strangely, reading from "0xffff8200" is giving 0 (?) so that's why I prefer to use Physbase() for base address.
I don't understand why this is not feasible from the Vsetscreen Xbios call, from what I read in the xbios.c source of tos_drivers, it seems that, if you don't have a radeon card, on firebee, you can't set any screen address (it's hardcoded at 0x06000000), that's not very good for compatibility issue ...

User avatar
Orion_
Captain Atari
Captain Atari
Posts: 335
Joined: Sat Jan 10, 2004 12:20 pm
Location: France
Contact:

Re: A few Firebee questions (general & dev)

Postby Orion_ » Sun Nov 22, 2015 2:46 pm

ok I made some more test and it seems like using GEM or using our own videomode/buffers, is about as slow.
I don't understand how you get these 80MB/s speed in normal ram.
I made this test:
Firebee dev.zip


in 640x480x16bits:
firesysW.app : Blitting a background + 16 sprites inside a buffer in RAM, then copying this buffer in Video RAM: I get 10fps
firesysV.app : Blitting a background + 16 sprites all directly in Video RAM: I get 10fps

Another test, Blitting a background + 1 sprite in a buffer in RAM, then blitting this buffer in Video RAM: I get 17fps just like the speed I get by doing the same in a normal GEM window.

mfro wrote:Nevertheless the Firebee still a very fast machine and in practice large caches cover most of the deficiencies.

So .. One BG + one sprite = 17fps ? Where is the "fast" ? :?
From my calculation I get about 13MB/s in this test case

firebee.org wrote:The ColdFire can work with external DDR-SDRAM, for excellent performance.

from a raw memcpy loop of 600MBytes, I get 27Mbytes/s in a normal allocated buffer. (using _hz_200 system variable for timing, with coldfire native code, under TOS 4.04 Full without any auto program or acc)


Another question, How to get a fast access to USB keyboard pressed key ? (like for a game)
because I don't have any atari keyboard, and that would be great to play with any keyboard (usb or ikbd)
You do not have the required permissions to view the files attached to this post.

joska
Hardware Guru
Hardware Guru
Posts: 3668
Joined: Tue Oct 30, 2007 2:55 pm
Location: Florø, Norway
Contact:

Re: A few Firebee questions (general & dev)

Postby joska » Sun Nov 22, 2015 7:07 pm

Orion_ wrote:Another question, How to get a fast access to USB keyboard pressed key ? (like for a game)
because I don't have any atari keyboard, and that would be great to play with any keyboard (usb or ikbd)


You can hook into the IKBD vectors. These are jumped through by the USB keyboard/mouse handlers as well.
Jo Even

Firebee - Falcon060 - Milan060 - Falcon040 - MIST - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64

User avatar
mfro
Atari Super Hero
Atari Super Hero
Posts: 683
Joined: Thu Aug 02, 2012 10:33 am
Location: SW Germany

Re: A few Firebee questions (general & dev)

Postby mfro » Sun Nov 22, 2015 8:18 pm

Orion_ wrote:from a raw memcpy loop of 600MBytes, I get 27Mbytes/s in a normal allocated buffer.


That's reasonable and pretty much matches my own results.

I've never seen a Firebee doing any faster and don't know where these 80 Mb/s come from.

User avatar
Orion_
Captain Atari
Captain Atari
Posts: 335
Joined: Sat Jan 10, 2004 12:20 pm
Location: France
Contact:

Re: A few Firebee questions (general & dev)

Postby Orion_ » Sun Nov 22, 2015 8:38 pm

joska wrote:You can hook into the IKBD vectors. These are jumped through by the USB keyboard/mouse handlers as well.

From what I read in the Atari compendium and from the trace I made in Steem debugger, the "ikbdsys" vector routine must take care of getting the data from the ACIA register, it's not giving the actual keyboard data in D0 or something like that, I can't handle myself the USB stuff :/

mfro wrote:That's reasonable and pretty much matches my own results.

"reasonable" is relative, it's not reasonable in regards to the Firebee huge video resolution
but from all the test I did today, I now know better what I can expect from the Firebee, i.e: not more than 15fps if using GEM, and maybe more Fps but only if using very low resolution display (320x240x8bits i.e: not much more than a Falcon CT60)

User avatar
mfro
Atari Super Hero
Atari Super Hero
Posts: 683
Joined: Thu Aug 02, 2012 10:33 am
Location: SW Germany

Re: A few Firebee questions (general & dev)

Postby mfro » Sun Nov 22, 2015 8:59 pm

Orion_ wrote:...
mfro wrote:That's reasonable and pretty much matches my own results.

"reasonable" is relative, it's not reasonable in regards to the Firebee huge video resolution
but from all the test I did today, I now know better what I can expect from the Firebee, i.e: not more than 15fps if using GEM, and maybe more Fps but only if using very low resolution display (320x240x8bits i.e: not much more than a Falcon CT60)


Basically, its the same problem PCs had with high resolution PCI graphics cards (slow bus, demanding video resolutions).

We'll probably need the same strategy: blitting could be done _much_ faster if most of it would be done _inside_ the FPGA (copy sprites and background only once and then just issue blit commands to the FPGA). This would take bandwidth demands off the FlexBus, but require somebody to sit down and design a VHDL blit engine.

User avatar
Orion_
Captain Atari
Captain Atari
Posts: 335
Joined: Sat Jan 10, 2004 12:20 pm
Location: France
Contact:

Re: A few Firebee questions (general & dev)

Postby Orion_ » Sun Nov 22, 2015 9:08 pm

mfro > yes yes I know, sorry, I'm so frustrated by this powerful processor and can't really use it due to memory access >_<

About IKBD, Here is what I read in the tos_driver source:
ikbdvec = (void (**)())&kbdvecs2[-1]; /* undocumented */

so, the USB code is sent to an undocumented function ?! >_<
What I don't understand is that "pmdoom" is working with my USB keyboard, but when I read the SDL atari port source, it reads ACIA register, so does the USB take care of updating ACIA register as well ? I'm confused

User avatar
Orion_
Captain Atari
Captain Atari
Posts: 335
Joined: Sat Jan 10, 2004 12:20 pm
Location: France
Contact:

Re: A few Firebee questions (general & dev)

Postby Orion_ » Mon Nov 23, 2015 10:16 am

Well, Bconstat/Bconin works, but there is too much lag, maybe gem event is better

User avatar
Orion_
Captain Atari
Captain Atari
Posts: 335
Joined: Sat Jan 10, 2004 12:20 pm
Location: France
Contact:

Re: A few Firebee questions (general & dev)

Postby Orion_ » Mon Nov 23, 2015 1:19 pm

I don't like dirty code, but when you have no other clean choice for a fast & efficient keyboard polling ... :/

Code: Select all

LONG   IKBDhookSetup(void);
LONG   IKBDhookRestore(void);
void   IKBDhook(void);
extern   u8   KeyData;

   Supexec(IKBDhookSetup);
   Supexec(IKBDhookRestore);

   public   _IKBDhookSetup
   public   _IKBDhookRestore
   public   _IKBDhook
   public   _KeyData
   public   _IKBDsave

_IKBDhookSetup:
   move.w   #$22,-(a7)   ; Kbdvbase();
   trap   #14
   addq.l   #2,a7
   move.l   d0,a0
   subq.l   #4,a0      ; Undocumented USB Keyboard Hook from Firebee tos_driver
   move.l   (a0),_IKBDsave
   move.l   #_IKBDhook,(a0)
   rts

_IKBDhookRestore:
   move.w   #$22,-(a7)   ; Kbdvbase();
   trap   #14
   addq.l   #2,a7
   move.l   d0,a0
   subq.l   #4,a0      ; Undocumented USB Keyboard Hook from Firebee tos_driver
   move.l   _IKBDsave,(a0)
   rts

_IKBDhook:
   move.b   d0,_KeyData
   move.l   _IKBDsave,-(a7)
   rts

_KeyData:   dc.w   0
_IKBDsave:   dc.l   0

User avatar
Orion_
Captain Atari
Captain Atari
Posts: 335
Joined: Sat Jan 10, 2004 12:20 pm
Location: France
Contact:

Re: A few Firebee questions (general & dev)

Postby Orion_ » Mon Nov 23, 2015 8:42 pm

I spent the whole afternoon trying to use standard falcon video mode on my Firebee, It is not working...
I guess the Falcon compatibility is really an issue
I tried standard falcon video mode 320x240x8 using "VsetMode", this seems to work, BUT
Setting custom screen (allocated in MX_STRAM) at $FF8201/3/D <- doesn't work
Setting custom screen (allocated in MX_STRAM) using Vsetscreen <- doesn't work
Changing videl palette at $FF9800 <- doesn't work

joska
Hardware Guru
Hardware Guru
Posts: 3668
Joined: Tue Oct 30, 2007 2:55 pm
Location: Florø, Norway
Contact:

Re: A few Firebee questions (general & dev)

Postby joska » Mon Nov 23, 2015 9:42 pm

Orion_ wrote:Setting custom screen (allocated in MX_STRAM) at $FF8201/3/D <- doesn't work


Did you try this: http://atari-forum.com/viewtopic.php?f=92&t=28873&start=25#p283800?
Jo Even

Firebee - Falcon060 - Milan060 - Falcon040 - MIST - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64

User avatar
Orion_
Captain Atari
Captain Atari
Posts: 335
Joined: Sat Jan 10, 2004 12:20 pm
Location: France
Contact:

Re: A few Firebee questions (general & dev)

Postby Orion_ » Mon Nov 23, 2015 10:21 pm

joska wrote:
Orion_ wrote:Setting custom screen (allocated in MX_STRAM) at $FF8201/3/D <- doesn't work

Did you try this: http://atari-forum.com/viewtopic.php?f=92&t=28873&start=25#p283800?

I just tried, it's not changing anything.

So, Is there a Bug reporting system for the Firebee Project ? or do I have to contact Didier Méquignon ?

User avatar
mfro
Atari Super Hero
Atari Super Hero
Posts: 683
Joined: Thu Aug 02, 2012 10:33 am
Location: SW Germany

Re: A few Firebee questions (general & dev)

Postby mfro » Tue Nov 24, 2015 6:17 am

Orion_ wrote:So, Is there a Bug reporting system for the Firebee Project ? or do I have to contact Didier Méquignon ?


Yes, we do. His name is Mathias ;)

Can you show in code what you tried? A minimal non working example would be great. Maybe we can fiddle it out.

User avatar
Orion_
Captain Atari
Captain Atari
Posts: 335
Joined: Sat Jan 10, 2004 12:20 pm
Location: France
Contact:

Re: A few Firebee questions (general & dev)

Postby Orion_ » Tue Nov 24, 2015 9:41 am

Here is my test with source code
firebee_test.zip

I will contact didier as he is the FireTOS coder (and so I can explain better in French)
You do not have the required permissions to view the files attached to this post.

User avatar
Orion_
Captain Atari
Captain Atari
Posts: 335
Joined: Sat Jan 10, 2004 12:20 pm
Location: France
Contact:

Re: A few Firebee questions (general & dev)

Postby Orion_ » Tue Nov 24, 2015 1:14 pm

I'm wondering, what is "BaS" exactly ? On what processor is it executed ?

I read in the tos060.zip readme "the FPGA code is loaded to the FPGA by Coldfire from the BAS or dBUG before start the TOS."
does this mean that the FPGA memory is flashed at each boot ?
I read somewhere that flash memory have a limited life cycle so, isn't this killing it too much ?

User avatar
mfro
Atari Super Hero
Atari Super Hero
Posts: 683
Joined: Thu Aug 02, 2012 10:33 am
Location: SW Germany

Re: A few Firebee questions (general & dev)

Postby mfro » Tue Nov 24, 2015 5:41 pm

Orion_ wrote:I'm wondering, what is "BaS" exactly ? On what processor is it executed ?

BaS is the "basic system" - basically the firmware - of the Firebee. Think of it like a PC's ROM BIOS.

It sets up the hardware (initializes the SDRAM controller, sets up processor caches, the MMU, loads the FPGA config from flash into the FPGA, configures the various Coldfire multi-function pins for their desired functionality, sets up the PCI bus, the "internal" Coldfire interrupt vectors and handlers, sets up the Coldfire MDMA, the various timers, gets the NVRAM contents and time from the PIC and various other things I surely forgot. You can connect a serial terminal to the Firebee's serial port to get an idea on what it does - there should be some diagnostics.

Orion_ wrote:I read in the tos060.zip readme "the FPGA code is loaded to the FPGA by Coldfire from the BAS or dBUG before start the TOS."
does this mean that the FPGA memory is flashed at each boot ?

The FPGA itself has no non-volatile components. It 'forgets' everything on reset. It gets its configuration fed from the CPU on every boot (fetched from flash memory). There is no "lifetime limit" on this process. The flash itself, however, has a limit on how often it can be erased and rewritten. I don't know exactly, but I think I remember 100000 cycles? You hopefully will not meet these limits very soon...

Regarding you nonworking code: I will have a look at it, but it will probably take some days (busy with other things). If it's Firetos related, it will likely take Didier to fix it, however.


Social Media

     

Return to “FireBee”

Who is online

Users browsing this forum: No registered users and 1 guest