Due to the number of questions I have been asked since I originally released the atwin
winsock conversions for the atmon tools, I have decided to compile this faq.


Contents
--------
i) Help Me! I can't find a network adapter!
ii) I can't get my programs to pass argc/argv in correctly...so I have to hard code IP addresses
iii) (UPDATED 01/11/00) My code seems to work on a T10k, and should work on the Debug Station
but it doesnt. Why?
iv) Is the source available for ATMON? Can i relocate it in memory? Can I contact SCEI?
v) I try to burn an ATMON disk, but it won't boot. Do you know why?
vi) Why does the reset command take me back to the browser? Is there a way to solve this?
vii) I have problems fopening a file for writing on the PC

i) Help Me! I can't find a network adapter!
-------------------------------------------

I was lucky on this one. I bought the first 10/100 adapter available in the UK some 8 months
before the atmon release. By chance it happened to work. It was completely
unbranded, so I couldn't find a reliable source. However, I can confirm that the D-Link
DU-E100 is compatible and freely available in Europe for around 40UKP. For my American
friends, the D-Link DSB-650TX is the one to go for.

ii) I can't get my programs to pass argc/argv in correctly...so I have to hard code IP addresses
------------------------------------------------------------------------------------------------

The key to this is a new version of CRT0.S . There is one included in the original Sound
Previewer/Graphics Previewer. If you use this one, be sure to comment out the #define DS_SOUND
if you are compiling for the T10k, otherwise leave it in. Alternatively, use the version in this
directory, which is compatible with both without any recompiling. A word of caution here:
there was a posting on the SCEE devsite about programs which behave differently on T10k and
Debug Station/release, so, if you are compiling for a submission, DO NOT USE THIS VERSION OF
CRT0.S!!!
I will not be held responsible for sub failures...you have been warned.

Anyway, once this is compiled in, I use code similar to this to get the system working:

char FILEPREFIX[256];

int32 main(int argc, char *argv[])
{
	char *strptr;

	if (argc == 0)
	{
		sprintf(FILEPREFIX,"host0:/mydata/");
	}
	else
	{
		if (strnicmp(argv0,"atfile",6)==0)
		{
			strptr = argv0;

			while (*strptr != ',')
			{
				strptr++;
			}

			strptr++;
			*strptr = 0;
			sprintf(FILEPREFIX,"%s/mydata/",argv0);
		}
		else
		{
			sprintf(FILEPREFIX,"host0:/mydata/");
		}
	}

	// insert code for fantastic game here

	return 0;
}

Just use the FILEPREFIX before all your file names, and you will have code that will run on
T10k and Debug Station using ATMON with no recompiling.

iii) My code seems to work on a T10k, and should work on the Debug Station but it doesnt. Why?
----------------------------------------------------------------------------------------------

This is usually to do with the address that the Code/Data is org'ed at, particularly if you
are using SNSystems Win Build tools. ATMON uses 0x00200000 - 0x00600000, so avoid these areas
to be safe. We have managed to org data at 0x00400000 sucessfully, but I would recommend
avoiding this area as well. If your elf file is less than 1meg in size, then you can org it at
0x00100000 (snsytems VSi stuff tends to org code at 0x00200000), and start all your allocs from
0x00600000 onwards. Otherwise, try placing the code at a higher address. Don't forget you can
use EE-STRIP to remove the debug info and significantly reduce the elf size....

UPDATED 01/11/00
The lowest safe address that code can be org'ed at above 0x00200000 is in fact 0x00310000.
It appears that no memory is needed above this address for ATMON to function correctly.

iv) Is the source available for ATMON? Can i relocate it in memory? Can I contact SCEI?
---------------------------------------------------------------------------------------

In short, NO! I have wanted to get in contact with SCEI about atwin ever since the
first release, but to no avail. I think they are concerned about turning Debug Stations
into cheap devkits, so the chances of them making ATMON relocatable are slim. However, I
suspect that all it does is a standard create thread process to set it up, so with some
clever hacking, I'm sure it would be possible. However, I am not supporting this course of
action so please don't ask me to do it, or how to do it. For the more adventurous among you,
you could always try coding your own version of ATMON using the SNSystems TCP/IP stack...

UPDATED 12/01/2001
------------------
Hey, this is the ATWINMON release, do you really need the source now? ;o)


v) I try to burn an ATMON disk, but it won't boot. Do you know why?
-------------------------------------------------------------------

It's probably to do with your executable filename. If the filename isn't in the correct format
(i.e. SLPS_999.99, SLES_123.45, etc) it will NOT boot, no matter what it says in the
SYSTEM.CNF file.

vi) Why does the reset command take me back to the browser? Is there a way to solve this?
-----------------------------------------------------------------------------------------

Yes. If you include the original ATMON.ELF on the CD, when an reset command is given, ATMON
will reload itself from the disk, and re-initialise the threads.

vii) I have problems fopening a file for writing on the PC
----------------------------------------------------------
Try using sceOpen instead. Also check that the AtMon versionmatches your current lib version.

I'll add to this faq as the questions roll in and get answered...Any feed back is much
appreciated, you can contact me at the email address below.

Jeb@sdreams.co.uk
