TempleOSTS_130707.ISO

v6
Terry A. Davis 9 years ago committed by minexew
parent 17b71f1a2d
commit 1343005a29
  1. BIN
      0000Boot/0000Kernel.BIN.C
  2. BIN
      0000Boot/BootCD.BIN
  3. BIN
      0000Boot/BootMHD2.BIN.C
  4. 1
      TempleOS/Accts/Adam3.CPP
  5. 2
      TempleOS/Accts/Adam3aLocalize.CPP
  6. 3
      TempleOS/Accts/Adam3bPkgs.CPP
  7. 10
      TempleOS/Accts/Adam3cSnd.CPP
  8. 12
      TempleOS/Accts/Adam3dKeyPlugIns.CPP
  9. 6
      TempleOS/Accts/Adam3fSys.CPP
  10. 4
      TempleOS/Accts/DoItOnce.CPP
  11. 5
      TempleOS/Accts/Install/Adam3fSys.CPP
  12. 28
      TempleOS/Accts/Install/DoItOnce.CPP
  13. BIN
      TempleOS/Accts/PersonalMenu.TXT
  14. 9
      TempleOS/Accts/SafeMode/Adam3.CPP
  15. 1
      TempleOS/Accts/SafeMode/Adam3cSnd.CPP
  16. 38
      TempleOS/Accts/SafeMode/Adam3fSys.CPP
  17. 9
      TempleOS/Accts/SafeMode/DoItOnce.CPP
  18. 1
      TempleOS/Accts/TS/Adam3bPkgs.CPP
  19. 20
      TempleOS/Accts/TS/Adam3dKeyPlugIns.CPP
  20. 5
      TempleOS/Accts/TS/Adam3fSys.CPP
  21. 11
      TempleOS/Accts/TS/DbgAdam1.CPP
  22. 2
      TempleOS/Accts/TS/DoItOnce.CPP
  23. BIN
      TempleOS/Accts/TS/PersonalMenu.TXT
  24. 1
      TempleOS/Accts/TS/TAD/Adam3.CPP
  25. 2
      TempleOS/Accts/TS/TAD/Adam3aLocalize.CPP
  26. 488
      TempleOS/Accts/TS/TAD/Archive/FileSysISO3.CPP
  27. BIN
      TempleOS/Accts/TS/TAD/Archive/Logo.TXT
  28. 21
      TempleOS/Accts/TS/TAD/Archive/Marketing.TXT
  29. 217
      TempleOS/Accts/TS/TAD/Archive/USB.CPP
  30. 114
      TempleOS/Accts/TS/TAD/Archive/USB1a.CPP
  31. 54
      TempleOS/Accts/TS/TAD/MakeDistro.CPP
  32. 11
      TempleOS/Accts/TS/TAD/MusicOrgan/abiding.CPP
  33. 6
      TempleOS/Accts/TS/TAD/MusicOrgan/abyss.CPP
  34. 8
      TempleOS/Accts/TS/TAD/MusicOrgan/awake.CPP
  35. BIN
      TempleOS/Accts/TS/TAD/MusicOrgan/battlehymnsolo.CPP
  36. 8
      TempleOS/Accts/TS/TAD/MusicOrgan/born.CPP
  37. 2
      TempleOS/Accts/TS/TAD/MusicOrgan/childish.CPP
  38. 8
      TempleOS/Accts/TS/TAD/MusicOrgan/compassions.CPP
  39. BIN
      TempleOS/Accts/TS/TAD/MusicOrgan/completed.CPP
  40. 6
      TempleOS/Accts/TS/TAD/MusicOrgan/cosam.CPP
  41. 6
      TempleOS/Accts/TS/TAD/MusicOrgan/despairing.CPP
  42. BIN
      TempleOS/Accts/TS/TAD/MusicOrgan/dialogue.CPP
  43. 6
      TempleOS/Accts/TS/TAD/MusicOrgan/disputing.CPP
  44. BIN
      TempleOS/Accts/TS/TAD/MusicOrgan/doing.CPP
  45. 8
      TempleOS/Accts/TS/TAD/MusicOrgan/dream.CPP
  46. BIN
      TempleOS/Accts/TS/TAD/MusicOrgan/elijah.CPP
  47. 4
      TempleOS/Accts/TS/TAD/MusicOrgan/environeth.CPP
  48. 2
      TempleOS/Accts/TS/TAD/MusicOrgan/epicurus.CPP
  49. 1
      TempleOS/Accts/TS/TAD/MusicOrgan/exalt.CPP
  50. 9
      TempleOS/Accts/TS/TAD/MusicOrgan/exiled.CPP
  51. 8
      TempleOS/Accts/TS/TAD/MusicOrgan/exodus.CPP
  52. 6
      TempleOS/Accts/TS/TAD/MusicOrgan/feigned.CPP
  53. BIN
      TempleOS/Accts/TS/TAD/MusicOrgan/finger.CPP
  54. BIN
      TempleOS/Accts/TS/TAD/MusicOrgan/first.CPP
  55. BIN
      TempleOS/Accts/TS/TAD/MusicOrgan/fishermen.CPP
  56. 6
      TempleOS/Accts/TS/TAD/MusicOrgan/fixing.CPP
  57. 6
      TempleOS/Accts/TS/TAD/MusicOrgan/flung.CPP
  58. BIN
      TempleOS/Accts/TS/TAD/MusicOrgan/forasmuch.CPP
  59. 8
      TempleOS/Accts/TS/TAD/MusicOrgan/freaks.CPP
  60. 10
      TempleOS/Accts/TS/TAD/MusicOrgan/free.CPP
  61. BIN
      TempleOS/Accts/TS/TAD/MusicOrgan/furnishing.CPP
  62. BIN
      TempleOS/Accts/TS/TAD/MusicOrgan/gutenberg.CPP
  63. 6
      TempleOS/Accts/TS/TAD/MusicOrgan/honestly.CPP
  64. BIN
      TempleOS/Accts/TS/TAD/MusicOrgan/hope.CPP
  65. BIN
      TempleOS/Accts/TS/TAD/MusicOrgan/josh.CPP
  66. BIN
      TempleOS/Accts/TS/TAD/MusicOrgan/keeping.CPP
  67. BIN
      TempleOS/Accts/TS/TAD/MusicOrgan/limit.CPP
  68. 6
      TempleOS/Accts/TS/TAD/MusicOrgan/mary.CPP
  69. BIN
      TempleOS/Accts/TS/TAD/MusicOrgan/mildly.CPP
  70. 8
      TempleOS/Accts/TS/TAD/MusicOrgan/myrrh.CPP
  71. BIN
      TempleOS/Accts/TS/TAD/MusicOrgan/night.CPP
  72. 8
      TempleOS/Accts/TS/TAD/MusicOrgan/o.CPP
  73. 6
      TempleOS/Accts/TS/TAD/MusicOrgan/population.CPP
  74. BIN
      TempleOS/Accts/TS/TAD/MusicOrgan/prosper.CPP
  75. 6
      TempleOS/Accts/TS/TAD/MusicOrgan/psalm.CPP
  76. 6
      TempleOS/Accts/TS/TAD/MusicOrgan/reposes.CPP
  77. 6
      TempleOS/Accts/TS/TAD/MusicOrgan/restless.CPP
  78. 6
      TempleOS/Accts/TS/TAD/MusicOrgan/rifled.CPP
  79. 5
      TempleOS/Accts/TS/TAD/MusicOrgan/risen.CPP
  80. BIN
      TempleOS/Accts/TS/TAD/MusicOrgan/satisfaction.CPP
  81. 4
      TempleOS/Accts/TS/TAD/MusicOrgan/service.CPP
  82. 6
      TempleOS/Accts/TS/TAD/MusicOrgan/signifies.CPP
  83. 8
      TempleOS/Accts/TS/TAD/MusicOrgan/silver.CPP
  84. 8
      TempleOS/Accts/TS/TAD/MusicOrgan/teachings.CPP
  85. 11
      TempleOS/Accts/TS/TAD/MusicOrgan/thereupon.CPP
  86. 6
      TempleOS/Accts/TS/TAD/MusicOrgan/thither.CPP
  87. 2
      TempleOS/Accts/TS/TAD/MusicOrgan/twins.CPP
  88. 6
      TempleOS/Accts/TS/TAD/MusicOrgan/verses.CPP
  89. 6
      TempleOS/Accts/TS/TAD/MusicOrgan/villa.CPP
  90. 8
      TempleOS/Accts/TS/TAD/MusicOrgan/worship.CPP
  91. 8
      TempleOS/Accts/TS/TAD/MusicOrgan/yesterday.CPP
  92. 6
      TempleOS/Accts/TS/TAD/MusicOrgan/you.CPP
  93. 54
      TempleOS/Accts/TS/TAD/PersonalNotes.TXT
  94. 28
      TempleOS/Accts/TS/TAD/Registry.CPP
  95. 53
      TempleOS/Accts/TS/TAD/Test.CPP
  96. 69
      TempleOS/Accts/TS/TSAdam.CPP
  97. 125
      TempleOS/Accts/TS/TSDistro.CPP
  98. 14
      TempleOS/Accts/TS/Wb2/Blog.TXT
  99. 24
      TempleOS/Accts/TS/Wb2/Games.TXT
  100. 1
      TempleOS/Accts/TS/Wb2/Hymns.TXT
  101. Some files were not shown because too many files have changed in this diff Show More

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -3,7 +3,6 @@
#include "HOME/Adam3aLocalize"
#include "HOME/Adam3bPkgs"
#include "HOME/Adam3cSnd"
#include "HOME/Adam3dKeyPlugIns"
#include "HOME/Adam3eWrappers"
#include "HOME/Adam3fSys"

@ -7,8 +7,6 @@ SetTypeMatic(0);
//Set Time Zone
local_time_offset=0*60*60*CDATE_FREQ;
snd_vol=0.1;
//$AN,"","mouse_move_scale"$adjust these to set mouse move scale
mxx_scale=0.5;
myy_scale=0.5;

@ -3,7 +3,8 @@
Cd("/TempleOS/Adam/Boot");;
#include "InsBoot"
Cd("/TempleOS/Adam");;
Cd("/TempleOS/Adam/Utils");;
#include "Profiler"
#include "Diff"
#include "Grep"
#include "LineCnt"

@ -1,10 +0,0 @@
//Change anything you want in this
//acct file or others.
Cd("/TempleOS/Adam/Snd");;
#include "HDAudio"
//Uncomment this after running $LK-A,"::/TempleOS/Adam/Snd/HDCfg.CPP"$.
//#include "HOME/HDAudioCfg"
LBtr(&sys_semas[SYS_SEMA_SND],0);
Cd("HOME");;

@ -3,9 +3,9 @@
U0 FillInTime()
{
CDate spdt;
spdt=GetCurTimeCDate;
"$$IV,1$$----%D %T----$$IV,0$$\n",spdt,spdt;
CDate cdt;
cdt=GetCurTimeDate;
"$$IV,1$$----%D %T----$$IV,0$$\n",cdt,cdt;
}
@ -96,7 +96,7 @@ Bool MyPutKey(I64 ch,I64 sc)
SetKeyDesc("Misc/Insert Datetime");
} else {
if (sc & SCF_SHIFT)
DocInsSafe(DocCur,
DocInsSafe(DocPut,
"$$HS+C$$$$FG$$$$HE$$");
else
FillInTime();
@ -135,7 +135,7 @@ Bool MyPutKey(I64 ch,I64 sc)
else {
ClipBoardDel;
DocPrintF(sys_clipboard_doc,"$$LK-A,\"FL:%s,%d\"$$",
DocCur->filename.name,DocCur->cur_entry->y+1);
DocPut->filename.name,DocPut->cur_entry->y+1);
}
return TRUE;
case 'L':
@ -145,7 +145,7 @@ Bool MyPutKey(I64 ch,I64 sc)
i=RandU32;
ClipBoardDel;
DocPrintF(sys_clipboard_doc,"$$LK,\"<TODO>\",\"FA:%s,ANC%d\"$$",
DocCur->filename.name,i);
DocPut->filename.name,i);
"$$AN,\"<TODO>\",\"ANC%d\"$$",i;
}
return TRUE;

@ -4,16 +4,16 @@
U0 UserStartUp()
{ //Run each time a user a spawned
UseTermDoc;
DocCurAttr(WHITE<<4+BLUE);
Type("::/TempleOS/Doc/Start.TXT");
LBts(&Fs->display_flags,DISPLAYf_SHOW);
WinZBufUpdate;
if (!IsSysDeterministic)
Preempt(ON);
Dir;
}
U0 ServantStartUp()
{ //Run each time a servant task is spawned.
U0 SrvStartUp()
{ //Run each time a srv task is spawned.
UseTermDoc;
LBts(&Fs->display_flags,DISPLAYf_SHOW);
WinZBufUpdate;

@ -1,6 +1,6 @@
//This file is executed by the
//first terminal window upon start-up.
//See $LK,"DoItOnce","FF:HOME/Adam3fSys.CPP,DoItOnce"$.
//See $LK,"DoItOnce","FF:HOME/Adam3fSys.CPP,DoItOnce"$ and $LK,"Acct Files","FF:::/TempleOS/Doc/GuideLines.TXT,ACCT FILES"$.
//It goes in your HOME directory and
//you can customize it.
@ -11,6 +11,6 @@ Type("::/TempleOS/Doc/Customize.TXT");
"\nTake Tour";
if (YorN) {
Cd("/TempleOS/Misc/Tour");
Cd("::/TempleOS/Misc/Tour");
AutoFile("Tour");
}

@ -4,7 +4,6 @@
U0 UserStartUp()
{ //Run each time a user a spawned
UseTermDoc;
DocCurAttr(WHITE<<4+BLUE);
Type("::/TempleOS/Doc/Start.TXT");
LBts(&Fs->display_flags,DISPLAYf_SHOW);
WinZBufUpdate;
@ -12,8 +11,8 @@ U0 UserStartUp()
Preempt(ON);
}
U0 ServantStartUp()
{ //Run each time a servant task is spawned.
U0 SrvStartUp()
{ //Run each time a srv task is spawned.
UseTermDoc;
LBts(&Fs->display_flags,DISPLAYf_SHOW);
WinZBufUpdate;

@ -26,7 +26,7 @@ U0 VMInstallBoot(CTask *task,U8 cd_drv,U8 drv,U8 *acct_name,
XTalkWait(task,
"MakeOSInstallPrtBootLoader('%C');\n"
"B10x20000\n",drv);
"B1\n0x20000\n",drv);
if (ata_drv)
XTalkWait(task,"C2p%d\n",ata_drv->num);
@ -48,11 +48,15 @@ U0 VMInstallWizard()
CTask *task;
while (TRUE) {
"Make-up a Log-In Name (account).\n";
acct_name=PmtStr("User Acct Name (%s): ","User");
acct_name=PmtStr("User Acct Name: ");
if (FileNameChk(acct_name))
break;
Free(acct_name);
}
"\nIt's normal for this to freeze for a moment or two.\n";
PressAKey;
task=SpawnUser;
TaskWait(task);
SetWinHorz(Fs->win_left,Fs->win_right,task);
@ -61,10 +65,10 @@ U0 VMInstallWizard()
WinToTop(Fs);
ATARep(FALSE,TRUE,&root);
ATAIDDrvs(root,dft_drv,&ata_drv,&atapi_drv);
ATAIDDrvs(root,*sys_acct,&ata_drv,&atapi_drv);
if (VMPrtDsk(task,ata_drv)) {
VMInstallBoot(task,dft_drv,'C',acct_name,ata_drv,atapi_drv);
VMInstallBoot(task,dft_drv,'D',acct_name,ata_drv,atapi_drv);
VMInstallBoot(task,*sys_acct,'C',acct_name,ata_drv,atapi_drv);
VMInstallBoot(task,*sys_acct,'D',acct_name,ata_drv,atapi_drv);
InstallMasterBootLoader('C');
}
LinkedLstDel(root);
@ -85,11 +89,15 @@ U0 RegularInstallWizard()
while (TRUE) {
"Make-up a Log-In Name (account).\n";
acct_name=PmtStr("User Acct Name (%s): ","User");
acct_name=PmtStr("User Acct Name: ");
if (FileNameChk(acct_name))
break;
Free(acct_name);
}
"\nIt's normal for this to freeze for a moment or two.\n";
PressAKey;
task=SpawnUser;
TaskWait(task);
SetWinHorz(Fs->win_left,Fs->win_right,task);
@ -143,7 +151,7 @@ U0 RegularInstallWizard()
}
NewLine;
st1=MSPrintF("%C:/TempleOS",dft_drv);
st1=MSPrintF("%C:/TempleOS",*sys_acct);
st2=MSPrintF("%C:/TempleOS",*dst);
"$$FG,RED$$Format %C Partition?$$FG$$\n",*dst;
@ -151,7 +159,7 @@ U0 RegularInstallWizard()
NewLine;
while (TRUE) {
"$$FG,PURPLE$$1$$FG$$) Use FAT32\n"
"$$FG,PURPLE$$2$$FG$$) Use TempleOS Native\n"
"$$FG,PURPLE$$2$$FG$$) Use RedSea\n"
"\nFile System Type: ";
ch=GetChar;
NewLine;
@ -161,7 +169,7 @@ U0 RegularInstallWizard()
if (ch=='1')
Fmt(*dst,TRUE,FALSE,PT_FAT32);
else
Fmt(*dst,TRUE,FALSE,PT_NATIVE);
Fmt(*dst,TRUE,FALSE,PT_REDSEA);
} else {
"\n$$BK,1$$WARNING$$BK,0$$ if you answer yes to the following "
"you will lose all TempleOS files in your /TempleOS directory tree.\n"
@ -183,7 +191,7 @@ U0 RegularInstallWizard()
Copy("::/TempleOS/Demo/MakeDistro.CPP.Z",new_home_str);
XTalkWait(task,
"MakeOSInstallPrtBootLoader('%C');\n"
"B10x20000\n"
"B1\n0x20000\n"
"C"
"2p"
"%s\n"

Binary file not shown.

@ -1,9 +0,0 @@
//Change anything you want in this
//acct file or others.
mp_cnt=1;
#include "HOME/Adam3aLocalize"
#include "HOME/Adam3bPkgs"
#include "HOME/Adam3cSnd"
#include "HOME/Adam3dKeyPlugIns"
#include "HOME/Adam3eWrappers"
#include "HOME/Adam3fSys"

@ -1,38 +0,0 @@
//Change anything you want in this
//acct file or others.
U0 UserStartUp()
{ //Run each time a user a spawned
UseTermDoc;
DocCurAttr(WHITE<<4+BLUE);
Type("::/TempleOS/Doc/Start.TXT");
LBts(&Fs->display_flags,DISPLAYf_SHOW);
WinZBufUpdate;
if (!IsSysDeterministic)
Preempt(ON);
}
U0 ServantStartUp()
{ //Run each time a servant task is spawned.
UseTermDoc;
LBts(&Fs->display_flags,DISPLAYf_SHOW);
WinZBufUpdate;
if (!IsSysDeterministic)
Preempt(ON);
}
U0 StartUpTasks()
{
CTask *task1,*task2;
task1=SpawnUser;
task2=SpawnUser;
WinToTop(task1);
WinTileVert;
if (!IsSysDeterministic)
PopUp("#include \"::/TempleOS/Adam/Start\";");
AdamLog("Boot Time:%7.3fs\n",tS);
}
StartUpTasks;
"\nOS Compile Time:%D %T\n",sys_compile_time,sys_compile_time;

@ -1,9 +0,0 @@
//This file is executed by the
//first terminal window upon start-up.
//See $LK,"DoItOnce","FF:HOME/Adam3fSys.CPP,DoItOnce"$.
//It goes in your HOME directory and
//you can customize it.
//Delete this to get rid of
//default start-up msg.

@ -5,5 +5,4 @@
Cd("HOME");;
#include "/TempleOS/Accts/TS/TSAdam"
#include "/TempleOS/Accts/TS/TSDistro"
#include "/TempleOS/Demo/WebLogExample/WebLogRep"
Cd("HOME");;

@ -3,13 +3,13 @@
U0 FillInTime()
{
CDate spdt;
spdt=GetCurTimeCDate;
"$$IV,1$$----%D %T----$$IV,0$$\n",spdt,spdt;
CDate cdt;
cdt=GetCurTimeDate;
"$$IV,1$$----%D %T----$$IV,0$$\n",cdt,cdt;
}
U0 RandQuote(I64 num)
{ //$LK-A,"::/TempleOS/Apps/AfterEgypt/AENotes.TXT"$
{ //$LK-A,"::/TempleOS/Apps/HolySpirit/HSNotes.TXT"$
I64 i,size,l=512;
U8 *bible_filename=Define("ST_BIBLE_FILE"),
*buf=FileRead(bible_filename,&size);
@ -22,7 +22,7 @@ U0 RandQuote(I64 num)
}
U0 BadCodeJump(I64 num)
{ //$LK-A,"::/TempleOS/Apps/AfterEgypt/AENotes.TXT"$
{ //$LK-A,"::/TempleOS/Apps/HolySpirit/HSNotes.TXT"$
CDirEntry *root=FilesFind("/TempleOS/*",FUF_JUST_FILES|FUF_RECURSE|FUF_FLATTEN_TREE|FUF_JUST_SRC_FILES),
*tempm=root;
I64 cnt=0;
@ -129,7 +129,7 @@ Bool MyPutKey(I64 ch,I64 sc)
else
SetKeyDesc("God Word");
} else {
//$LK-A,"::/TempleOS/Apps/AfterEgypt/AENotes.TXT"$
//$LK-A,"::/TempleOS/Apps/HolySpirit/HSNotes.TXT"$
if (sc & SCF_SHIFT)
RandQuote(KbdMouseEvtTime>>4);
else
@ -157,7 +157,7 @@ Bool MyPutKey(I64 ch,I64 sc)
SetKeyDesc("Misc/Insert Datetime");
} else {
if (sc & SCF_SHIFT)
DocInsSafe(DocCur,
DocInsSafe(DocPut,
"$$HS+C$$$$FG$$$$HE$$");
else
FillInTime();
@ -202,7 +202,7 @@ Bool MyPutKey(I64 ch,I64 sc)
else {
ClipBoardDel;
DocPrintF(sys_clipboard_doc,"$$LK-A,\"FL:%s,%d\"$$",
DocCur->filename.name,DocCur->cur_entry->y+1);
DocPut->filename.name,DocPut->cur_entry->y+1);
}
return TRUE;
case 'L':
@ -212,7 +212,7 @@ Bool MyPutKey(I64 ch,I64 sc)
i=RandU32;
ClipBoardDel;
DocPrintF(sys_clipboard_doc,"$$LK,\"<TODO>\",\"FA:%s,ANC%d\"$$",
DocCur->filename.name,i);
DocPut->filename.name,i);
"$$AN,\"<TODO>\",\"ANC%d\"$$",i;
}
return TRUE;
@ -234,7 +234,7 @@ Bool MyPutKey(I64 ch,I64 sc)
case 'b':
if (sc&SCF_KEY_DESC)
SetKeyDesc("Cmd/Jump to Bad Code");
else //$LK-A,"::/TempleOS/Apps/AfterEgypt/AENotes.TXT"$
else //$LK-A,"::/TempleOS/Apps/HolySpirit/HSNotes.TXT"$
BadCodeJump(KbdMouseEvtTime>>4);
return TRUE;

@ -1,7 +1,6 @@
U0 UserStartUp()
{ //Run each time a user a spawned
UseTermDoc;
DocCurAttr(WHITE<<4+BLUE);
Type("::/TempleOS/Doc/Start.TXT");
LBts(&Fs->display_flags,DISPLAYf_SHOW);
WinZBufUpdate;
@ -22,8 +21,8 @@ U0 UserStartUp()
CPURep;
}
U0 ServantStartUp()
{ //Run each time a servant task is spawned.
U0 SrvStartUp()
{ //Run each time a srv task is spawned.
UseTermDoc;
LBts(&Fs->display_flags,DISPLAYf_SHOW);
WinZBufUpdate;

@ -0,0 +1,11 @@
//This is executed by Adam at boot.
//See $LK,"Adam1 Start-up","FF:::/TempleOS/Kernel/KEnd.CPP,Adam1:2"$
extern I8i OptEqu(I64i num,I8i val);
OptEqu(0,0); //(0,0)=EchoOff (0,1)=EchoOn
#include "/TempleOS/Kernel/BootDefs.HPP"
#include "/TempleOS/Kernel/Adam1a.HPP"
#include "/TempleOS/Compiler/CmpDefs.HPP"
#include "/TempleOS/Kernel/Adam1b.HPP"
#include "/TempleOS/Kernel/Adam1c.HPP"
#include "/TempleOS/Compiler/Compiler.HPP"
Dbg("Type 'G;'");

@ -1,6 +1,6 @@
//This file is executed by the
//first terminal window upon start-up.
//See $LK,"DoItOnce","FF:HOME/Adam3fSys.CPP,DoItOnce"$.
//See $LK,"DoItOnce","FF:HOME/Adam3fSys.CPP,DoItOnce"$ and $LK,"Acct Files","FF:::/TempleOS/Doc/GuideLines.TXT,ACCT FILES"$.
//It goes in your HOME directory and
//you can customize it.

@ -5,7 +5,6 @@
#exe {OptOn(OPTf_WARN_DUP_TYPES);};
#include "HOME/Adam3aLocalize"
#include "HOME/Adam3bPkgs"
#include "HOME/Adam3cSnd"
#include "HOME/Adam3dKeyPlugIns"
#include "HOME/Adam3eWrappers"
#include "HOME/Adam3fSys"

@ -7,8 +7,6 @@ SetTypeMatic(0);
//Set Time Zone
local_time_offset=-7*60*60*CDATE_FREQ; //Pacific
snd_vol=0.1;
//$AN,"","mouse_move_scale"$adjust these to set mouse move scale
mxx_scale=0.5;
myy_scale=0.5;

@ -1,488 +0,0 @@
//ISO1 is ISO9660
//ISO2 is ISO13490
//ISO3 is ISO13346
//ISO13346 tag id types
#define ISO3T_PRI_VOL_DESC 1
#define ISO3T_ANCHOR_VOL_DESC_PTR 2
#define ISO3T_VOL_DESC_PTR 3
#define ISO3T_IMPLEMENTATION_VOL_DESC 4
#define ISO3T_PRT_DESC 5
#define ISO3T_LOG_VOL_DESC 6
#define ISO3T_UNALLOCATED_SPACE_DESC 7
#define ISO3T_TERMINATOR_DESC 8
#define ISO3T_LOG_VOL_INTEGRITY_DESC 9
#define ISO3T_FILE_SET_DESC 256
#define ISO3T_FILE_ID_DESC 257
#define ISO3T_ALLOC_EXTENT_DESC 258
#define ISO3T_INDIRECT_ENTRY 259
#define ISO3T_TERMINAL_ENTRY 260
#define ISO3T_FILE_ENTRY 261
#define ISO3T_EXT_ATTR_HEADER_DESC 262
#define ISO3T_UNALLOC_SPACE_ENTRY 263
#define ISO3T_SPACE_BITMAP_DESC 264
#define ISO3T_PRT_INTEGRITY_ENTRY 265
#define ISO3T_EXT_FILE_ENTRY 266
class CISO3Tag
{
U16 id;
U16 version;
U8 xsum;
U8 reserved;
U16 serial_num;
U16 desc_crc;
U16 desc_crc_len;
U32 loc;
};
class CISO3Date
{
U16 time_zone;
I16 year;
U8 mon;
U8 day;
U8 hour;
U8 min;
U8 sec;
U8 sec100;
U8 sec10000;
U8 sec1000000;
};
class CISO3DString32
{
U8 body[31];
U8 len;
};
class CISO3DString128
{
U8 body[127];
U8 len;
};
class CISO3CharSpec
{
U8 type;
U8 body[63];
};
class CISO3RegId
{
U8 flags;
U8 id[23];
U8 id_suffix[8];
};
class CISO3ExtentAD
{
U32 len;
U32 loc;
};
class CISO3LBAdd
{
U32 log_blk_num;
U16 prt_ref_num;
};
class CISO3LongAD
{
U32 len;
CISO3LBAdd loc;
U8 implementation_use[6];
};
class CISO3ICBTag
{
U32 prior_record_direct_entries;
U16 strategy_type;
U16 strategy_param;
U16 max_entries;
U8 reserved;
U8 file_type;
CISO3LBAdd parent_icb_loc;
U16 flags;
};
class CISO3PriDesc
{
CISO3Tag tag;
U32 vol_desc_seq_num;
U32 pri_vol_desc_num;
CISO3DString32 vol_id;
U16 vol_seq_num;
U16 max_vol_seq_num;
U16 interchg_level;
U16 max_interchg_level;
U32 char_set_lst;
U32 max_char_set_lst;
CISO3DString128 vol_set_id;
CISO3CharSpec desc_char_set;
CISO3CharSpec explanatory_char_set;
CISO3ExtentAD vol_abstract;
CISO3ExtentAD vol_copyright_notice;
CISO3RegId app_id;
CISO3Date recording_date_time;
CISO3RegId implementation_id[32];
U8 implementation_use[64];
U32 pred_vol_desc_seq_loc;
U16 flags;
U8 reserved[22];
};
class CISO3PrtMap
{
U8 type;
U8 len;
U0 mapping;
};
class CISO3PrtMap1
{
U8 type;
U8 len;
U16 vol_seq_num;
U16 prt_num;
};
class CISO3PrtMap2
{
U8 type;
U8 len;
U8 prt_id[62];
};
class CISO3LogVolDesc
{
CISO3Tag tag;
U32 vol_desc_seq_num;
CISO3CharSpec desc_char_set;
CISO3DString128 log_vol_id;
U32 blk_size;
CISO3RegId domain_id;
U8 log_vol_contents_use[16];
U32 map_table_len;
U32 num_prt_maps;
CISO3RegId implementation_id;
U8 implementation_use[128];
CISO3ExtentAD integrity_seq_extent;
U0 prt_maps;
};
class CISO3Prt
{
CISO3Tag tag;
U32 vol_desc_seq_num;
U16 flags;
U16 num;
CISO3RegId contents;
U8 contents_use[128];
U32 access_type;
U32 starting_loc;
U32 len;
CISO3RegId implementation_id;
U8 implementation_use[128];
U8 reserved[156];
};
class CISO3FileSetDesc
{
CISO3Tag tag;
CISO3Date recording_date_time;
U16 interchg_level;
U16 max_interchg_level;
U32 char_set_lst;
U32 max_char_set_lst;
U32 file_set_num;
U32 file_set_desc_num;
CISO3CharSpec log_vol_id_char_set;
CISO3DString128 log_vol_id;
CISO3CharSpec file_set_char_set;
CISO3DString32 file_set_id;
CISO3DString32 copyright_file_id;
CISO3DString32 abstract_file_id;
CISO3LongAD root_dir_icb;
CISO3RegId domain_id;
CISO3LongAD next_extent;
CISO3LongAD sys_stream_dir_icb;
U8 reserved[32];
};
class CISO3FileIdDesc
{
CISO3Tag tag;
U16 version;
U8 characteristics;
U8 len_of_file_id;
CISO3LongAD icb;
U16 len_of_implementation_use;
U0 implementation_use;
U0 file_id;
};
class CISO3File
{
CISO3Tag tag;
CISO3ICBTag icb_tag;
U32 uid;
U32 gid;
U32 permissions;
U16 file_link_cnt;
U8 record_fmt;
U8 record_display_attr;
U32 record_len;
I64 info_len;
I64 log_blks_recorded;
CISO3Date access_date_time;
CISO3Date modification_date_time;
CISO3Date attr_date_time;
U32 chk_pt;
CISO3LongAD ext_attr_icb;
CISO3RegId implementation_id;
I64 unique_id;
U32 ext_attr_len;
U32 alloc_desc_len;
U0 ext_attr;
U0 alloc_desc;
};
class CISO3FileExt
{
CISO3Tag tag;
CISO3ICBTag icb_tag;
U32 uid;
U32 gid;
U32 permissions;
U16 file_link_cnt;
U8 record_fmt;
U8 record_display_attr;
U32 record_len;
I64 info_len;
I64 object_size;
I64 log_blks_recorded;
CISO3Date access_date_time;
CISO3Date modification_date_time;
CISO3Date creation_date_time;
CISO3Date attr_date_time;
U32 chk_pt;
U32 reserved;
CISO3LongAD ext_attr_icb;
CISO3LongAD stream_dir_icb;
CISO3RegId implementation_id;
I64 unique_id;
U32 ext_attr_len;
U32 alloc_desc_len;
U0 ext_attr;
U0 alloc_desc;
};
import U0 ClassRep(U8 *class_name,U8 *d,I64 max_depth=2,Bool fun=FALSE,I64 offset=0);
Bool ISO3PrtInitPrt(CPrt *p,I64 blk)
{
CBlkDev *bdev=p->bdev;
I64 spc=bdev->blk_size>>BLK_SIZE_BITS,i=blk/spc;
CISO3FileSetDesc *iso=MAlloc(bdev->blk_size);
Bool unlock,result=FALSE;
try {
unlock=PrtLock(p);
while (TRUE) {
p->size=MaxI64(p->size,(i+1)*spc);
RBlks(p,iso,i*spc,spc);
"%X:%X\n",i,iso->tag.id;
switch (iso->tag.id) {
case ISO3T_FILE_SET_DESC:
ClassRep("CISO3FileSetDesc",iso,3);
// p->offset=blk;
// p->root_cluster=iso->root_dir_icb.loc.log_blk_num+p->offset/spc;
result=TRUE;
break;
case ISO3T_EXT_FILE_ENTRY:
ClassRep("CISO3FileExt",iso,3);
break;
case ISO3T_FILE_ENTRY:
ClassRep("CISO3File",iso,3);
break;
case ISO3T_FILE_ID_DESC:
ClassRep("CISO3FileIdDesc",iso,3);
break;
case ISO3T_ALLOC_EXTENT_DESC:
case ISO3T_INDIRECT_ENTRY:
case ISO3T_TERMINAL_ENTRY:
case ISO3T_EXT_ATTR_HEADER_DESC:
case ISO3T_UNALLOC_SPACE_ENTRY:
case ISO3T_SPACE_BITMAP_DESC:
case ISO3T_PRT_INTEGRITY_ENTRY:
break;
default
goto i3pip_done;
}
i++;
}
i3pip_done:
Free(iso);
if (unlock)
PrtUnlock(p);
} catch {
Free(iso);
if (unlock)
PrtUnlock(p);
}
return result;
}
Bool ISO3PrtInit(CPrt *p,I64 blk)
{
CBlkDev *bdev=p->bdev;
I64 spc=bdev->blk_size>>BLK_SIZE_BITS,i=blk/spc,offset=0;
CISO3Prt *iso=MAlloc(bdev->blk_size);
Bool unlock,result=FALSE;
try {
unlock=PrtLock(p);
while (TRUE) {
p->size=MaxI64(p->size,(i+1)*spc);
RBlks(p,iso,i*spc,spc);
"%X:%X\n",i,iso->tag.id;
switch (iso->tag.id) {
case ISO3T_PRT_DESC:
ClassRep("CISO3Prt",iso,3);
offset=iso->starting_loc*spc; //one partition for now
break;
case ISO3T_PRI_VOL_DESC:
ClassRep("CISO3PriDesc",iso,3);
break;
case ISO3T_LOG_VOL_DESC:
ClassRep("CISO3LogVolDesc",iso,3);
D(&iso(CISO3LogVolDesc *)->prt_maps);
break;
case ISO3T_ANCHOR_VOL_DESC_PTR:
case ISO3T_VOL_DESC_PTR:
case ISO3T_IMPLEMENTATION_VOL_DESC:
case ISO3T_UNALLOCATED_SPACE_DESC:
case ISO3T_LOG_VOL_INTEGRITY_DESC:
break;
case ISO3T_TERMINATOR_DESC:
goto i3pi_done;
default:
PutDefineErr("ST_UNSUPPORTED_FILE_SYSTEM");
throw(EXCEPT_PRT,10);
}
i++;
}
i3pi_done:
if (offset)
result=ISO3PrtInitPrt(p,offset);
Free(iso);
if (unlock)
PrtUnlock(p);
} catch {
Free(iso);
if (unlock)
PrtUnlock(p);
}
return result;
}
/****
U0 CDate2ISO3(CISO3Date *dst,CDate spdt)
{
CDateStruct ds;
CDate2CDateStruct(&ds,spdt);
MemSet(dst,0,sizeof(CISO3Date));
dst->year=ds.year;
dst->mon=ds.mon;
dst->day=ds.day_of_mon;
dst->hour=ds.hour;
dst->min=ds.min;
dst->sec=ds.sec;
dst->sec100=ds.sec100;
}
CDate ISO3Date2CDate(CISO3Date *dt)
{
CDateStruct ds;
MemSet(&ds,0,sizeof(CDateStruct));
ds.day_of_mon=dt->day;
ds.mon=dt->mon;
ds.year=dt->year;
ds.sec100=dt->sec100;
ds.sec=dt->sec;
ds.min=dt->min;
ds.hour=dt->hour;
return CDateStruct2CDate(&ds);
}
****/
Bool ISOPrtInit(CPrt *p,I64 blk)
{
CBlkDev *bdev=p->bdev;
I64 spc=bdev->blk_size>>BLK_SIZE_BITS,i=blk/spc;
CISO1PriDesc *iso=MAlloc(bdev->blk_size);
CISO1DirEntry *de;
Bool unlock,result=FALSE;
U8 buf[8];
try {
unlock=PrtLock(p);
p->type=PT_ISO9660; //default
p->spc=spc;
p->offset=p->data=p->root_cluster=p->size=0;
while (TRUE) {
p->size=MaxI64(p->size,(i+1)*spc);
RBlks(p,iso,i*spc,spc);
buf[0](U32)=iso->id[0](U32);
buf[4](U16)=iso->id[4](U8);
switch (LstEntryMatch(buf,"CD001\0CDW02\0BEA01\0BOOT2\0NSR02\0NSR03\0TEA01\0",LEF_EXACT)) {
case 0:
p->type=PT_ISO9660;
switch (iso->type) {
case ISO1T_SUPPLEMENTARY_DESC:
p->data=0;
de=&iso->root_dir_record;
p->root_cluster=de->loc.little;
p->size=iso->vol_space_size.little*bdev->blk_size>>BLK_SIZE_BITS;
result=TRUE;
goto ipi_done;
case ISO1T_TERMINATOR:
throw(EXCEPT_PRT,11);
}
break;
case 2...6:
p->type=PT_ISO13346;
break;
case 1: //PT_ISO13490 (Not supported)
default: //Its normal for ISO13346 to read NULL blk as terminator
switch (p->type) {
case PT_ISO13346:
i++; //Terminator is blk after last valid. Advance to next blk
if (ISO3PrtInit(p,i*spc)) {
result=TRUE;
goto ipi_done;
}
break;
}
PutDefineErr("ST_UNSUPPORTED_FILE_SYSTEM");
throw(EXCEPT_PRT,12);
}
i++;
}
ipi_done:
Free(iso);
if (unlock)
PrtUnlock(p);
} catch {
p->type=PT_ISO9660;
p->spc=spc;
p->offset=p->data=p->root_cluster=0;
Free(iso);
if (unlock)
PrtUnlock(p);
}
return result;
}

@ -1,21 +0,0 @@
$WW,1$I have a million metaphors. Linux is a semi; Windows is a car; and TempleOS is a motorcycle. Or, it's like a 1960's muscle car that wouldn't be street legal, now, with all the safety crap regulations complicating and gunking-up, but boy is it fun and beautiful under the hood. Maybe, it's a tree-house -- you don't need building codes to mod it and it has no networking. It's a kayak, not a Titanic -- just reset it. Why do you want a 1970's main frame operating system, anyway, that has ugly 32-bit crap all over its C language? 7-bit ASCII for source code? Please! Why not fix all the standard C library to pure 64-bit? How awful PrintF() with "%ld" instead of "%d" and crap for long constants! Yuck! You'll love $LK,"TempleOS C","FI:::/TempleOS/Doc/Differences.TXT"$.
Okay, here's a $LK,"Pop Quiz","FI:::/TempleOS/Demo/Lectures/64BitAsmQuiz.TXT"$ to get you psyched-up for TempleOS! Assembly language knowledge is not required, but anyone interested in TempleOS is probably at least curious about assembly language.
TempleOS has a good chance of running natively on $FG,4$x86_64$FG$ machines from about 2003-2010. After that, it will probably work just in VMware.
1) Download the free $FG,4$$TX+HTML,"TempleOSCD.ISO (24.0 MB)","http://www.templeos.org/TempleOSCD.ISO"$$FG$.
2) Download the free $FG,4$$TX+HTML,"VMware Player","https://my.vmware.com/web/vmware/free#desktop_end_user_computing/vmware_player/5_0"$$FG$ (The $FG,4$$TX+HTML,"VMware","https://my.vmware.com/web/vmware/free#desktop_end_user_computing/vmware_player/5_0"$$FG$ web page takes a whole minute to load completely. Be patient. When it finally shows, pick the first ".exe" to download.)
3) Create an "Other 64-Bit" virtual machine. Aim its CD-ROM to TempleOSCD.ISO
4) Play the virtual machine.
5) Log-in as "Accts/Install".
6) Optionally, purchase $FG,4$$TX+HTML,"VMware WorkStation","http://www.vmware.com"$$FG$ or download $FG,4$$TX+HTML,"WinImage","http://www.winimage.com/winimage.htm"$$FG$ if you wish to transfer files in and out.
If you want to install my personal version for $FG,4$$TX+HTML,"VMware","https://my.vmware.com/web/vmware/free#desktop_end_user_computing/vmware_player/5_0"$$FG$...
1b) Download the free $FG,4$$TX+HTML,"TempleOSTS.ISO (24.5 MB)","http://www.templeos.org/TempleOSTS.ISO"$$FG$.
3b) Create an "Other 64-Bit" virtual machine. Aim its CD-ROM to TempleOSTS.ISO
5b) Type >$FG,4$TSInstall;$FG$ or >$FG,4$TSUpgrade;$FG$ at the command-line.
7b) See $FG,4$MakeBackUp$FG$ to reproduce the ISO's in $FG,4$E:/Wb$FG$. It makes this website, too.
* "WinImage" is a trademark of Gilles Vollant.

@ -1,217 +0,0 @@
/*
You can play with this if you are
interested in USB. I'm not planning
on doing USB unless the legacy PS2
keyboard/mouse mode disappears.
There EHCI UHCI in various ICH chips and
others and God knows how many custom packet
formats for different keyboards and mice. Okay,
I suppose if BIOS can make a universal
packet, it is done just one way for
different mice. PS2 is more compatible.
*/
#help_index "USB"
extern I64 sys_num_usb;
extern CUSB sys_usb_devs[MAX_USB];
extern CUSBTD *USBAllocTD();
extern U0 USBFreeTD(CUSBTD *temptd);
extern U0 USBEndAll();
extern U0 USBInitAll();
extern U32 *USBAllocFrameLst(I64 usb_num,I64 size);
U8 *StatCB(CDoc *,CDocEntry *doc_e,CTask *mem_task)
{ //This routine shows the stat of the USB ports
U8 *st=MAlloc(128,mem_task);
U16 w1,w2,w3,w4;
U32 d1;
CUSB *u=doc_e->user_data;
I64 d=u->ports;
w3=InU16(d+USBP_STS);
w1=InU16(d+USBP_PORTSC0); w2=InU16(d+USBP_PORTSC1);
w4=InU16(d+USBP_FRNUM);
d1=InU32(d+USBP_FRBASEADD);
SPrintF(st,"%X:Stat:%04X P0:%04X P1:%04X FRAME:%04X",d1,w3,w1,w2,w4);
return st;
}
U0 PutStat()
{
I64 i;
Bool old_preempt=Preempt(OFF);
CDocEntry *doc_e;
CUSB *u;
WinMax;
"$$FG,GREEN$$Dev Stat Bits\n$$FG$$"
" 0:IRQ\n"
" 1:IRQ err\n"
" 2:Resume\n"
" 3:Host Sys Err\n"
" 4:Host Process Err\n"
" 5:Halted\n"
"$$FG,GREEN$$Port Stat Bits\n$$FG$$"
" 0:Connection Stat\n"
" 1:Connection Stat Change\n"
" 2:Port Enabled\n"
" 3:Port Enabled Change\n"
"4-5:Line Stat\n"
" 6:Resume Detect\n"
" 8:Low Speed\n"
" 9:Port Rst\n"
" 10:Overcurrent Active\n"
" 11:Overcurrent Indicator\n"
" 12:Suspend\n\n";
for (i=0;i<sys_num_usb;i++) {
u=&sys_usb_devs[i];
"$$FG,LTRED$$Dev%d:%X:",i,u->ports;
doc_e=DocPutS(DocCur,"$$TX+TC,\" \"$$");
doc_e->user_data=&sys_usb_devs[i];
doc_e->tag_cb=&StatCB;
"$$FG$$\n";
}
Preempt(old_preempt);
NewLine;
}
extern U0 PutQH(U32 h);
U32 *P(U32 d)
{
return d&~3;
}
U0 PutTD(U32 t)
{
"TD:$$FG,GREEN$$%08X$$FG$$\n",t;
"%08X\n",*P(t);
DocDm(t+4,8);
if (*P(t+12))
DocDm(*P(t+12),16);
// DocDm(*P(t+12),*P(t+4)>>21&0x7FF);
if (!(*P(t)&1)) {
if (*P(t)&2)
PutQH(*P(t));
else
PutTD(*P(t));
}
}
U0 PutQH(U32 h)
{
"QH:$$FG,RED$$%08X$$FG$$\n",h;
"%08X\n",*P(h);
"%08X\n",*P(h+4);
if (!(*P(h)&1)) {
if (*P(h)&2)
PutQH(*P(h));
else
PutTD(*P(h));
}
if (!(*P(h+4)&1)) {
if (*P(h+4)&2)
PutQH(*P(h+4));
else
PutTD(*P(h+4));
}
}
U0 PutFrame(U32 f)
{
PutQH(f);
}
U0 PutFrames()
{
I64 i,d,f,w1,w2;
CUSB *u;
for (i=0;i<sys_num_usb;i++) {
u=&sys_usb_devs[i];
d=u->ports;
w1=InU16(d+USBP_PORTSC0); w2=InU16(d+USBP_PORTSC1);
if (w1&1 || w2&1) {
f=InU32(d+USBP_FRBASEADD);
PutFrame(f);
}
}
}
U0 Main()
{
USBInitAll;
PutStat;
PutFrames;
"$$FG,RED$$The BIOS sets-up the USB in PS/2 legacy mode.$$FG$$\n";
}
Main;
/* Not Finished
#define PORT 5
#define DEV_ADD_INIT 1
#define DEV_ADD 1
#define END_PT0 0
#define END_PT1 1
#define END_PT2 2
#define MAX_LEN 8
#define TERMINATE 1
U0 SetUpTD()
{
CUSB *u=&sys_usb_devs[PORT];
I64 i,d=u->ports;
U32 *frm=CAllocAligned(0x1000,0x1000,Fs->code_heap),
*tds=CAllocAligned(256,16,Fs->code_heap),
*buf=CAlloc(128,Fs->code_heap);
DocD(buf,128);
"<0>\n"; Sleep(100);
OutU16(d+USBP_CMD,2); //Reset
"<1>\n"; Sleep(100);
OutU16(d+USBP_CMD,0);
"<2>\n"; Sleep(100);
OutU16(d+USBP_PORTSC0,4); //Enable
OutU16(d+USBP_PORTSC1,4);
"<3>\n"; Sleep(100);
tds[0]=&tds[4](U8 *);
tds[1]=0;
tds[2]=PID_SETUP+DEV_ADD_INIT<<8+END_PT0<<15+MAX_LEN<<21;
tds[3]=buf;
buf[0]=0+RQ_SET_ADDR<<8+DEV_ADD<<16;
buf[1]=0+0<<16;
tds[4]=TERMINATE;
tds[5]=0;
tds[6]=PID_SETUP+DEV_ADD_INIT<<8+END_PT0<<15+MAX_LEN<<21;
tds[7]=buf(U8 *)+8;
buf[2]=0+RQ_SET_ADDR<<8+DEV_ADD<<16;
buf[3]=0+0<<16;
frm[0]=&tds[0](U8 *);
for (i=1;i<0x1000/4;i++)
frm[i]=TERMINATE;
OutU16(d+USBP_FRNUM,frm);
OutU32(d+USBP_FRBASEADD,frm);
"<4>\n"; Sleep(200);
OutU16(d+USBP_CMD,1);
"<5>\n"; Sleep(1000);
OutU16(d+USBP_CMD,0);
"<6>\n"; Sleep(200);
}
SetUpTD;
*/

@ -1,114 +0,0 @@
#define USBP_CMD 0x00
#define USBP_STS 0x02
#define USBP_INTR 0x04
#define USBP_FRNUM 0x06
#define USBP_FRBASEADD 0x08
#define USBP_SOFMOD 0x0C
#define USBP_PORTSC0 0x10
#define USBP_PORTSC1 0x12
#define MAX_USB 16
class CUSBTD //Not implemented
{
U32 td[4];
};
class CUSB //Not implemented
{
U8 num, //USB dev num
bus,dev,fun;
U16 ports,pad;
U32 *frame_lst;
};
//USB Pkt ID's
#define PID_OUT 0xE1
#define PID_IN 0x69
#define PID_SOF 0xA5
#define PID_SETUP 0x2D
#define PID_DATA0 0xC3
#define PID_DATA1 0x4B
#define PID_DATA2 0x87
#define PID_MDATA 0x0F
#define PID_ACK 0xD2
#define PID_NAK 0x5A
#define PID_STALL 0x1E
#define PID_NYET 0x96
#define PID_PRE 0x3C
#define PID_ERR 0x3C
#define PID_SPLIT 0x78
#define PID_PING 0xB4
//USB Std Rqsts
#define RQ_GET_STAT 0x0
#define RQ_CLR_FEAT 0x1
#define RQ_SET_FEAT 0x3
#define RQ_SET_ADDR 0x5
#define RQ_SET_DESC 0x7
#define RQ_GET_CFG 0x8
#define RQ_SET_CFG 0x9
#define RQ_GET_INTERFACE 0xA
#define RQ_SET_INTERFACE 0xB
#define RQ_SYNC_FRAME 0xC
I64 sys_num_usb=0;
CUSB sys_usb_devs[MAX_USB];
MemSet(sys_usb_devs,0,MAX_USB*sizeof(CUSB));
U0 USBInitOne(I64 b,I64 d,I64 f)
{
CUSB *u;
if (sys_num_usb<MAX_USB &&
PCIReadU16(b,d,f,0)==0x8086) {
u=&sys_usb_devs[sys_num_usb++];
u->num=sys_num_usb;
u->bus=b;
u->dev=d;
u->fun=f;
u->ports=PCIReadU32(b,d,f,0x20)&~0x1F;
}
}
U0 USBEndAll()
{
sys_num_usb=0;
}
U0 USBInitAll() //This is only valid for my ICH10 dev
{
if (sys_num_usb)
USBEndAll;
USBInitOne(0,29,0);
USBInitOne(0,29,1);
USBInitOne(0,29,2);
USBInitOne(0,29,3);
USBInitOne(0,26,0);
USBInitOne(0,26,1);
USBInitOne(0,26,2);
}