Fix USB.ZC spacing formatting.

This commit is contained in:
TomAwezome 2022-12-21 04:07:50 -05:00 committed by GitHub
parent f23a32d331
commit d4317cb582
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -14,11 +14,11 @@ different mice.PS2 is more compatible.
#help_index "USB"
extern I64 sys_num_usb;
extern CUSB sys_usb_devs[USB_NUM];
extern CUSBTD* USBAllocTD();
extern CUSBTD *USBAllocTD();
extern U0 USBFreeTD(CUSBTD *tmptd);
extern U0 USBEndAll();
extern U0 USBInitAll();
extern U32* USBAllocFrameLst(I64 usb_num, I64 size);
extern U32 *USBAllocFrameLst(I64 usb_num, I64 size);
U8* StatCB(CDoc *, CDocEntry *doc_e, CTask *mem_task)
{
@ -40,8 +40,8 @@ U8* StatCB(CDoc *, CDocEntry *doc_e, CTask *mem_task)
U0 PutStat()
{
I64 i;
CDocEntry * doc_e;
CUSB * u;
CDocEntry *doc_e;
CUSB *u;
WinMax;
"$$FG,GREEN$$Dev Stat Bits\n$$FG$$"
@ -79,9 +79,9 @@ U0 PutStat()
extern U0 PutQH(U32 h);
U32* P(U32 d)
U32 *P(U32 d)
{
return d &~3;
return d & ~3;
}
U0 PutTD(U32 t)
@ -91,10 +91,10 @@ U0 PutTD(U32 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))
// DocDm(*P(t+12), *P(t+4) >> 21 & 0x7FF);
if (!(*P(t) & 1))
{
if (*P(t) &2)
if (*P(t) & 2)
PutQH(*P(t));
else
PutTD(*P(t));
@ -107,17 +107,17 @@ U0 PutQH(U32 h)
"%08X\n", *P(h);
"%08X\n", *P(h + 4);
if (!(*P(h) &1))
if (!(*P(h) & 1))
{
if (*P(h) &2)
if (*P(h) & 2)
PutQH(*P(h));
else
PutTD(*P(h));
}
if (!(*P(h + 4) &1))
if (!(*P(h + 4) & 1))
{
if (*P(h + 4) &2)
if (*P(h + 4) & 2)
PutQH(*P(h + 4));
else
PutTD(*P(h + 4));
@ -132,14 +132,14 @@ U0 PutFrame(U32 f)
U0 PutFrames()
{
I64 i, d, f, w1, w2;
CUSB * u;
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)
if (w1 & 1 || w2 & 1)
{
f = InU32(d + USBP_FRBASEADD);
PutFrame(f);
@ -169,49 +169,49 @@ Main;
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);
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
OutU16(d + USBP_CMD, 2); //Reset
"<1>\n"; Sleep(100);
OutU16(d+USBP_CMD,0);
OutU16(d + USBP_CMD, 0);
"<2>\n"; Sleep(100);
OutU16(d+USBP_PORTSC0,4); //Enable
OutU16(d+USBP_PORTSC1,4);
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+LEN_MAX<<21;
tds[3]=buf;
buf[0]=0+RQ_SET_ADDR<<8+DEV_ADD<<16;
buf[1]=0+0<<16;
tds[0] = &tds[4](U8*);
tds[1] = 0;
tds[2] = PID_SETUP + DEV_ADD_INIT << 8 + END_PT0 << 15 + LEN_MAX << 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+LEN_MAX<<21;
tds[7]=buf(U8*)+8;
buf[2]=0+RQ_SET_ADDR<<8+DEV_ADD<<16;
buf[3]=0+0<<16;
tds[4] = TERMINATE;
tds[5] = 0;
tds[6] = PID_SETUP + DEV_ADD_INIT << 8 + END_PT0 << 15 + LEN_MAX << 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;
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);
OutU16(d + USBP_FRNUM, frm);
OutU32(d + USBP_FRBASEADD, frm);
"<4>\n"; Sleep(200);
OutU16(d+USBP_CMD,1);
OutU16(d + USBP_CMD,1);
"<5>\n"; Sleep(1000);
OutU16(d+USBP_CMD,0);
OutU16(d + USBP_CMD,0);
"<6>\n"; Sleep(200);
}
SetUpTD;
*/
*/