Update apdskIIread.ino

This commit is contained in:
JoaoPagotto 2019-10-02 11:22:36 -03:00 committed by GitHub
parent a99381d938
commit d6fc88766c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,8 +1,8 @@
//-----------------------------------------------------------------------------
//
// Apple Disk II PROM Reader v1.10
// Apple Disk II PROM Reader v1.02
//
// Date: 2019-10-02
// Date: 2019-10-02 12:30am
//
// João Ricardo Pagotto
// https://github.com/joaopagotto
@ -13,6 +13,8 @@
//
//-----------------------------------------------------------------------------
char title[] = "Apple Disk II PROM Reader v1.02\0";
int a0 = 22;
int a1 = 24;
int a2 = 26;
@ -67,8 +69,9 @@ unsigned char rom_empty[] = {
//-----------------------------------------------------------------------------
// Apple Disk II 13 Sector Interface Card ROM P5 - 341-0009.bin
// 341-0009.BIN
char str_romP5_341_0009[] = "Apple Disk II 13 Sector Interface Card ROM P5 - 341-0009.bin\0";
char str_romP5_341_0009[] = "Apple Disk II 13 Sector Interface Card ROM P5 - 341-0009.BIN\0";
unsigned char romP5_341_0009[] = {
0xa2, 0x20, 0xa0, 0x00, 0xa9, 0x03, 0x85, 0x3c, 0x18, 0x88, 0x98, 0x24, 0x3c, 0xf0, 0xf5, 0x26,
@ -90,9 +93,9 @@ unsigned char romP5_341_0009[] = {
};
//-----------------------------------------------------------------------------
// Apple Disk II 13 Sector Interface Card ROM P6 - 341-0010.bin
// Apple Disk II 13 Sector Interface Card ROM P6 - 341-0010.BIN
char str_romP6_341_0010[] = "Apple Disk II 13 Sector Interface Card ROM P6 - 341-0010.bin\0";
char str_romP6_341_0010[] = "Apple Disk II 13 Sector Interface Card ROM P6 - 341-0010.BIN\0";
unsigned char romP6_341_0010[] = {
0xb8, 0xb8, 0x88, 0xc8, 0x0a, 0x0a, 0x0a, 0x0a, 0x88, 0xc9, 0x88, 0xc9, 0x88, 0xcb, 0x88, 0xcb,
@ -114,9 +117,9 @@ unsigned char romP6_341_0010[] = {
};
//-----------------------------------------------------------------------------
// Apple Disk II 16 Sector Interface Card ROM P5 - 341-0027.bin
// Apple Disk II 16 Sector Interface Card ROM P5 - 341-0027.BIN
char str_romP5_341_0027[] = "Apple Disk II 16 Sector Interface Card ROM P5 - 341-0027.bin\0";
char str_romP5_341_0027[] = "Apple Disk II 16 Sector Interface Card ROM P5 - 341-0027.BIN\0";
unsigned char romP5_341_0027[] = {
0xa2, 0x20, 0xa0, 0x00, 0xa2, 0x03, 0x86, 0x3c, 0x8a, 0x0a, 0x24, 0x3c, 0xf0, 0x10, 0x05, 0x3c,
@ -138,9 +141,9 @@ unsigned char romP5_341_0027[] = {
};
//-----------------------------------------------------------------------------
// Apple Disk II 16 Sector Interface Card ROM P6 - 341-0028.bin
// Apple Disk II 16 Sector Interface Card ROM P6 - 341-0028.BIN
char str_romP6_341_0028[] = "Apple Disk II 16 Sector Interface Card ROM P6 - 341-0028.bin\0";
char str_romP6_341_0028[] = "Apple Disk II 16 Sector Interface Card ROM P6 - 341-0028.BIN\0";
unsigned char romP6_341_0028[] = {
0x18, 0xd8, 0x18, 0x08, 0x0a, 0x0a, 0x0a, 0x0a, 0x18, 0x39, 0x18, 0x39, 0x18, 0x3b, 0x18, 0x3b,
@ -162,43 +165,66 @@ unsigned char romP6_341_0028[] = {
};
//-----------------------------------------------------------------------------
// Apple Disk II 16 Sector Interface Card ROM P5A - 341-0027-A.bin
// http://www.applelogic.org/APPLEASICs.html
// http://www.applelogic.org/files/3410027A.BIN
// Apple Disk II 16 Sector Interface Card ROM P5A - 341-0027-A.BIN
char str_romP5A_341_0027_A[] = "Apple Disk II 16 Sector Interface Card ROM P5A - 341-0027-A.bin\0";
char str_romP5A_341_0027_A[] = "Apple Disk II 16 Sector Interface Card ROM P5A - 341-0027-A.BIN\0";
unsigned char romP5A_341_0027_A[] = {
0x52, 0x40, 0x50, 0x00, 0x52, 0x03, 0x16, 0xCC, 0x1A, 0x0A, 0x44, 0xCC, 0xF0, 0x80, 0x05, 0xCC,
0x29, 0xFF, 0x49, 0xEE, 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0xB0, 0xF3,
0x7A, 0xDD, 0x1C, 0x30, 0x80, 0xFB, 0x39, 0x96, 0xF0, 0x09, 0x48, 0x90, 0xBF, 0x29, 0x5D, 0xF0,
0x03, 0x4A, 0xAE, 0x00, 0x03, 0x4A, 0x91, 0x46, 0x38, 0xB0, 0x7E, 0x76, 0x47, 0x76, 0xCD, 0x55,
0xCD, 0x3D, 0x00, 0x08, 0x56, 0x4B, 0x90, 0xBB, 0x2C, 0x01, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00
0x52, 0x40, 0x50, 0x00, 0x52, 0x03, 0x16, 0xcc, 0x1a, 0x0a, 0x44, 0xcc, 0xf0, 0x80, 0x05, 0xcc,
0x29, 0xff, 0x49, 0xee, 0xd0, 0x08, 0x2a, 0xb0, 0xfb, 0x98, 0x9d, 0xa6, 0x03, 0x38, 0x78, 0x80,
0x45, 0xb0, 0xb9, 0x50, 0x03, 0x15, 0x20, 0xdd, 0x1c, 0x30, 0x80, 0xfb, 0x4a, 0x15, 0xcc, 0xdd,
0x1c, 0x30, 0x80, 0xfb, 0x45, 0xcc, 0x18, 0xb0, 0x7c, 0x48, 0x35, 0xcd, 0xb0, 0xde, 0x55, 0x20,
0x98, 0x49, 0x03, 0x0a, 0x05, 0x4b, 0x5a, 0xdd, 0x11, 0x30, 0x59, 0xa6, 0x40, 0x58, 0xfc, 0x18,
0x80, 0x7b, 0x15, 0x46, 0x15, 0xcd, 0x15, 0x21, 0x59, 0x08, 0x15, 0x47, 0x88, 0x08, 0xdd, 0x1c,
0xfb, 0xa9, 0xb6, 0x02, 0x54, 0xcc, 0x91, 0x46, 0x38, 0xb0, 0x7f, 0xdc, 0x1c, 0x30, 0x80, 0xfb,
0xa9, 0xb6, 0x02, 0xb0, 0x17, 0x50, 0x00, 0x52, 0xa6, 0x3a, 0xc0, 0xfb, 0xd1, 0x46, 0xae, 0x00,
0x75, 0x40, 0xa8, 0xff, 0xda, 0xdd, 0x00, 0x01, 0x0a, 0x0a, 0x0a, 0x0a, 0x15, 0x4b, 0x5a, 0xdd,
0x1e, 0x30, 0xdd, 0x1c, 0x30, 0xdd, 0x1a, 0x30, 0xdd, 0x19, 0x30, 0x50, 0xa0, 0xdd, 0x10, 0x30,
0x35, 0x21, 0xb0, 0xd8, 0xd0, 0xd7, 0x50, 0xa6, 0x14, 0xcc, 0xdc, 0x1c, 0x30, 0x80, 0xfb, 0xa9,
0xb6, 0x02, 0x54, 0xcc, 0x18, 0x99, 0x00, 0x03, 0xb0, 0x7e, 0x14, 0xcc, 0xdc, 0x1c, 0x30, 0x80,
0x30, 0x80, 0xfb, 0x29, 0xb5, 0xb0, 0xf7, 0xdd, 0x1c, 0x30, 0x80, 0xfb, 0x39, 0x5a, 0xb0, 0xf3,
0x7a, 0xdd, 0x1c, 0x30, 0x80, 0xfb, 0x39, 0x96, 0xf0, 0x09, 0x48, 0x90, 0xbf, 0x29, 0x5d, 0xf0,
0x03, 0x4a, 0xae, 0x00, 0x03, 0x4a, 0x91, 0x46, 0x38, 0xb0, 0x7e, 0x76, 0x47, 0x76, 0xcd, 0x55,
0xcd, 0x3d, 0x00, 0x08, 0x56, 0x4b, 0x90, 0xbb, 0x2c, 0x01, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00
};
//-----------------------------------------------------------------------------
// Apple Disk II 16 Sector Interface Card ROM P6A - 342-0028-A.BIN
char str_romP6A_341_0028_A[] = "Apple Disk II 16 Sector Interface Card ROM P6A - 342-0028-A.BIN\0";
unsigned char romP6A_341_0028_A[] = {
0x18, 0xd8, 0x18, 0x08, 0x0a, 0x0a, 0x0a, 0x0a, 0x18, 0x39, 0x18, 0x39, 0x18, 0x3b, 0x18, 0x3b,
0x18, 0x38, 0x18, 0x28, 0x0a, 0x0a, 0x0a, 0x0a, 0x18, 0x39, 0x18, 0x39, 0x18, 0x3b, 0x18, 0x3b,
0x2d, 0xd8, 0x38, 0x48, 0x0a, 0x0a, 0x0a, 0x0a, 0x28, 0x48, 0x28, 0x48, 0x28, 0x48,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e0, 0x0a, 0x0a, 0x0a, 0x0a, 0xe8, 0x88, 0xe8, 0x08, 0xe8, 0x88, 0xe8, 0x08,
0x08, 0x4d, 0xe8, 0xe0, 0x0a, 0x0a, 0x0a, 0x0a, 0xe8, 0x88, 0xe8, 0x08, 0xe8, 0x88, 0xe8, 0x08
};
//-----------------------------------------------------------------------------
unsigned char checkProm(unsigned char *prom_read, unsigned char *prom_content)
unsigned char checkProm(unsigned char *check1, unsigned char *check2)
{
address = 0x00;
while ( address <= 0xff )
{
if ( prom_read[address] != prom_content[address] )
address = 0xff;
do {
if ( check1[address] != check2[address] )
return false;
address++;
}
address--;
} while ( address );
return true;
}
@ -238,13 +264,13 @@ void setup()
void loop()
{
Serial.write("Apple Disk II PROM Reader v1.00\r\n\n");
Serial.write(title);
Serial.write("\r\n\n");
enable = 0xff;
address = 0xff;
address = 0x00;
while ( address <= 0xff )
{
do {
//---------------------
// Define Address
@ -296,8 +322,8 @@ void loop()
Serial.write("\r\n");
}
address++;
}
address--;
} while ( address );
Serial.write("\r\n");
@ -347,6 +373,12 @@ void loop()
valid = true;
}
if ( checkProm(data_read, romP6A_341_0028_A) ) {
sprintf(buffer, "- The content is: [%s]\r\n", str_romP6A_341_0028_A);
Serial.write(buffer);
valid = true;
}
//--------------------------------------
if ( ! valid ) {