Code:
//Draw background
mov #regWidth, 776;
mov #regHeight,512;
mov KS,63488
dcvxpipe 1;
dcolor c1; drect p1,p2;
//Draw name
mov #textpos.x,48; mov #textpos.y,48;
dcolor c2; dsetsize 32; dwrite textpos,text1;
//jmp Draw.Help;
jmp Draw.Profiler;
//----------------------------------------------------
Draw.Help:
mov #textpos.y,96;
dsetsize 24; dwrite textpos,text3;
dexit;
//----------------------------------------------------
Draw.Profiler:
mov #CurSector,KS:#CDD_CurrentSector;
mov #CurTrack,KS:#CDD_CurrentTrack;
mov #CurCommand,KS:#CDD_Command; add #CurCommand,Command.Start; mov EAX,#CurCommand; mov #CurCommand,#EAX;
mov #CurNotify,KS:#CDD_Notify; add #CurNotify,Notify.Start; mov EAX,#CurNotify; mov #CurNotify,#EAX;
mov #CurDataState,KS:#CDD_Data; add #CurDataState,DataState.Start; mov EAX,#CurDataState; mov #CurDataState,#EAX;
mov #CurBytesDone,KS:#CDD_BytesDone;
mov #CurBytesTotal,KS:#CDD_TotalBytes;
mov #CurSectorDone,#CurBytesDone; div #CurSectorDone,512;
mov #CurSectorsTotal,#CurBytesTotal; div #CurSectorsTotal,512;
mov #CurErrorCode,KS:#CDD_ErrorCode;
mov #CurTimeout,KS:#CDD_Timeout;
mov #CurDensity,KS:#CDD_Density;
mov #CurTracks,KS:#CDD_DiskTracks;
// mov #CurFirstTrack,KS:#CDD_DiskFirstTrack;
mov #CurCapacity,KS:#CDD_Capacity; div #CurCapacity,1024;
mov #CurAngle,KS:#CDD_Angle; mul #CurAngle,100; fint #CurAngle; div #CurAngle,100;
mov #CurVelocity,KS:#CDD_Vel; mul #CurVelocity,100; fint #CurVelocity; div #CurVelocity,100;
mov #CurTargetVelocity,KS:#CDD_TVel;
//Draw states
mov #textpos.y,96;
dsetsize 24; dwritefmt textpos,text2;
//Draw disk
mov #regCircleQuality,16; dcircle p3,88;
mov EAX,#CurAngle;
drotatescale eax,1; dmove p3; dshade 0.5;
mov #regCircleQuality,8; dcircle 0,86;
mov eax,#CurVelocity; sub eax,#CurTargetVelocity;
add eax,1.57;
drotatescale eax,1; dshade 0.5;
mov #regCircleQuality,3; dcircle 0,32;
dexit;
//----------------------------------------------------
string text1,'CDC Hardware Profiler';
text2:
db 'Sector: %i%tTrack: %i',10,10;
db 'Command: %s',10;
db 'Notify flag: %s',10;
db 'Data state: %s',10;
db 'Bytes done: %i of %i',10;
db 'Sectors done:%i of %i',10;
db 'Error code: %i',10;
db 'Timeout: %i',10,10;
db 'Disk stats:',10;
db 'Density: %i ipb',10;
db 'Track count: %i',10;
db 'Capacity: %i KB',10;
db 'Raw angle: %f rad',10;
db 'Velocity: %f rad/s',0;
alloc CurSector;
alloc CurTrack;
alloc CurCommand;
alloc CurNotify;
alloc CurDataState;
alloc CurBytesDone;
alloc CurBytesTotal;
alloc CurSectorDone;
alloc CurSectorsTotal;
alloc CurErrorCode;
alloc CurTimeout;
alloc CurDensity;
alloc CurTracks;
//alloc CurFirstTrack;
alloc CurCapacity;
alloc CurAngle;
alloc CurVelocity;
alloc CurTargetVelocity;
define CDD_Command,0;
define CDD_Notify,1;
define CDD_Data,2;
define CDD_ErrorCode,3;
define CDD_OpMode,4;
define CDD_BlockStart,5;
define CDD_BlockEnd,6;
define CDD_BufferStart,7;
define CDD_BufferEnd,8;
define CDD_MotorMode,9;
define CDD_CurrentSector,16;
define CDD_CurrentTrack,17;
define CDD_TotalBytes,18;
define CDD_BytesDone,19;
define CDD_BytesDonePercent,20;
define CDD_DiskSectors,24;
define CDD_DiskTracks,25;
define CDD_DiskFirstTrack,26;
define CDD_Capacity,27;
define CDD_Density,28;
define CDD_Angle,29;
define CDD_Vel,30;
define CDD_TVel,31;
define CDD_Timeout,21;
string Command0,'IDLE';
string Command1,'IDLE_NOSPIN';
string Command2,'IDLE_FASTSPIN';
string Command3,'WRITE';
string Command4,'READ';
string Command5,'TEST';
string Command6,'SCAN';
string Command7,'ERASE';
string Command8,'INITIALIZE';
Command.Start:
db Command0,Command1,Command2,Command3,Command4;
db Command5,Command6,Command7,Command8;
Command.End:
string Notify0,'READY/OK';
string Notify1,'NEW_DISK';
string Notify2,'NO_DISK';
string Notify3,'INIT';
string Notify4,'BUSY';
string Notify5,'DISK ERROR';
string Notify6,'EJECTED';
Notify.Start:
db Notify0,Notify1,Notify2,Notify3,Notify4,Notify5,Notify6;
Notify.End:
string DataState0,'NO DATA';
string DataState1,'PARTIAL DATA';
string DataState2,'DATA PRESENT';
DataState.Start:
db DataState0,DataState1,DataState2;
DataState.End:
text3:
db '(C) 2009 Black Phoenix',10,
db 'NUM7 to perform READ',10;
db 'NUM9 to perform WRITE',10;
db 'NUM8 to compare dest & src',10,10;
db 'Attach requested size to P0',10;
db 'Result of comparsion is out',10;
db 'to P7',10,10;
db 'Press NUM5 to perform TEST',10;
db '(result into P7, full disk)',0;
vec2f textpos;
color c1,64,64,64;
color c2,255,255,255;
vec2f p1,32,32;
vec2f p2,746,488;
vec2f p3,630,380;
Or more exactly, this is what you're interested in:
Bookmarks