Initial commit of files
This commit is contained in:
11
utils/CMakeLists.txt
Normal file
11
utils/CMakeLists.txt
Normal file
@ -0,0 +1,11 @@
|
||||
cmake_minimum_required(VERSION 3.7)
|
||||
project(Cnomicon)
|
||||
|
||||
# list of header files
|
||||
set(SUB_DIRS
|
||||
# bin2c fdmp
|
||||
)
|
||||
|
||||
foreach(SUB_DIR ${SUB_DIRS})
|
||||
add_subdirectory(${SUB_DIR})
|
||||
endforeach()
|
||||
22
utils/bin2c/bin2c.c
Normal file
22
utils/bin2c/bin2c.c
Normal file
@ -0,0 +1,22 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main( int argc, char *argv[] )
|
||||
{
|
||||
int c;
|
||||
int n = 0;
|
||||
|
||||
printf( "\t" );
|
||||
while ( (c = getchar()) !=EOF )
|
||||
{
|
||||
if ( n )
|
||||
{
|
||||
printf( ", " );
|
||||
if ( n % 8 == 0 )
|
||||
printf( "\n\t" );
|
||||
}
|
||||
|
||||
printf( "0x%02x", c );
|
||||
n++;
|
||||
}
|
||||
printf( "\n" );
|
||||
}
|
||||
58
utils/fdmp/fdmp.c
Normal file
58
utils/fdmp/fdmp.c
Normal file
@ -0,0 +1,58 @@
|
||||
#include <stdio.h>
|
||||
#include <memory.h>
|
||||
#include <ctype.h>
|
||||
|
||||
int main( int argc, char *argv[] )
|
||||
{
|
||||
FILE *pFile = NULL;
|
||||
long iAddr = 0;
|
||||
char szBuf[16];
|
||||
char szAsc[17];
|
||||
int i, n;
|
||||
|
||||
if ( argc == 2 )
|
||||
pFile = fopen( argv[1], "r" );
|
||||
|
||||
if ( !pFile )
|
||||
{
|
||||
perror( argv[1] );
|
||||
return 1;
|
||||
}
|
||||
|
||||
while( !feof(pFile) )
|
||||
{
|
||||
printf( "%08lx ", (long)iAddr );
|
||||
|
||||
n = fread( szBuf, 1, 16, pFile );
|
||||
|
||||
for( i=0 ; i<n ; i++ )
|
||||
{
|
||||
printf( "%02x ", szBuf[i] & 0xff );
|
||||
}
|
||||
|
||||
for( i=n ; i<16 ; i++ )
|
||||
{
|
||||
printf( " " );
|
||||
}
|
||||
|
||||
printf( " " );
|
||||
|
||||
memset( szAsc, ' ', 16 );
|
||||
for( i=0 ; i<n ; i++ )
|
||||
{
|
||||
if ( isprint(szBuf[i]) )
|
||||
szAsc[i] = szBuf[i];
|
||||
else
|
||||
szAsc[i] = '.';
|
||||
}
|
||||
szAsc[16] = '\0';
|
||||
|
||||
printf( "%s\n", szAsc );
|
||||
|
||||
iAddr += 16;
|
||||
}
|
||||
|
||||
fclose( pFile );
|
||||
return 0;
|
||||
}
|
||||
|
||||
13
utils/picrate/20.mhz
Normal file
13
utils/picrate/20.mhz
Normal file
@ -0,0 +1,13 @@
|
||||
4 = 250000, 12.00
|
||||
9 = 125000, 24.00
|
||||
14 = 83333, 36.00
|
||||
19 = 62500, 48.00
|
||||
24 = 50000, 60.00
|
||||
29 = 41666, 72.00
|
||||
34 = 35714, 84.00
|
||||
39 = 31250, 96.00
|
||||
44 = 27777, 108.00
|
||||
49 = 25000, 120.00
|
||||
54 = 22727, 132.00
|
||||
59 = 20833, 144.00
|
||||
64 = 19230, 156.01
|
||||
13
utils/picrate/40.mhz
Normal file
13
utils/picrate/40.mhz
Normal file
@ -0,0 +1,13 @@
|
||||
4 = 500000, 6.00
|
||||
9 = 250000, 12.00
|
||||
14 = 166666, 18.00
|
||||
19 = 125000, 24.00
|
||||
24 = 100000, 30.00
|
||||
29 = 83333, 36.00
|
||||
34 = 71428, 42.00
|
||||
39 = 62500, 48.00
|
||||
44 = 55555, 54.00
|
||||
49 = 50000, 60.00
|
||||
54 = 45454, 66.00
|
||||
59 = 41666, 72.00
|
||||
64 = 38461, 78.00
|
||||
20
utils/picrate/picrate.c
Normal file
20
utils/picrate/picrate.c
Normal file
@ -0,0 +1,20 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
int pic;
|
||||
int rate;
|
||||
double usb;
|
||||
int div;
|
||||
|
||||
for ( pic=1; pic<=64 ; pic++ )
|
||||
{
|
||||
rate = 40000000 / ((pic+1)*16);
|
||||
usb = 3000000.0 / (double)rate;
|
||||
|
||||
div = (int)usb;
|
||||
if ( usb - (double)div < .01 )
|
||||
printf( "%d = %d, %.2f\n", pic, rate, usb );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user