Skip to content

Commit

Permalink
ID the Kindle KT6, PW6 & CS
Browse files Browse the repository at this point in the history
  • Loading branch information
NiLuJe committed Jan 5, 2025
1 parent 645aa08 commit 426d8f1
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 10 deletions.
2 changes: 1 addition & 1 deletion cutef8/utf8.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
/* is c the start of a utf8 sequence? */
#define isutf(c) (((c) & 0xC0) != 0x80)

#define UEOF ((uint32_t) - 1)
#define UEOF ((uint32_t) -1)

/* returns length of next utf-8 sequence */
size_t u8_seqlen(const char* restrict s) __attribute__((pure));
Expand Down
2 changes: 1 addition & 1 deletion fbink.c
Original file line number Diff line number Diff line change
Expand Up @@ -12176,7 +12176,7 @@ int
free(dump->data);
dump->data = NULL;
// Reset the crop settings
dump->clip = (const FBInkRect){ 0U };
dump->clip = (const FBInkRect) { 0U };
}
// Start by allocating enough memory for a full dump of the visible screen...
dump->stride = fInfo.line_length;
Expand Down
1 change: 0 additions & 1 deletion fbink_cozette.c
Original file line number Diff line number Diff line change
Expand Up @@ -1173,4 +1173,3 @@ static const unsigned char*
return cozette_block1[0];
}
}

51 changes: 50 additions & 1 deletion fbink_device_id.c
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ static bool
strtcpy(deviceQuirks.deviceCodename, "Cava", sizeof(deviceQuirks.deviceCodename));
strtcpy(deviceQuirks.devicePlatform, "Bellatrix", sizeof(deviceQuirks.devicePlatform));
return true;
case 0x8F2u:
case 0x8F2u: // KS
case 0x974u:
case 0x8C3u:
case 0x847u:
Expand All @@ -314,6 +314,55 @@ static bool
strtcpy(deviceQuirks.deviceCodename, "Barolo", sizeof(deviceQuirks.deviceCodename));
strtcpy(deviceQuirks.devicePlatform, "Bellatrix3", sizeof(deviceQuirks.devicePlatform));
return true;
case 0xE85u: // KT6
case 0xE86u:
case 0xE84u:
case 0xE83u:
case 0x2909u:
case 0xE82u:
case 0xE75u:
deviceQuirks.isMTK = true;
deviceQuirks.hasEclipseWfm = true;
deviceQuirks.screenDPI = 300U;
strtcpy(deviceQuirks.deviceName, "Basic 5", sizeof(deviceQuirks.deviceName));
strtcpy(deviceQuirks.deviceCodename, "Rossini", sizeof(deviceQuirks.deviceCodename));
strtcpy(deviceQuirks.devicePlatform, "Bellatrix", sizeof(deviceQuirks.devicePlatform));
return true;
case 0xC89u: // PW6
case 0xC86u:
case 0xC7Fu:
case 0xC7Eu:
case 0xE2Au:
case 0xE25u:
case 0xE23u:
case 0xE28u:
case 0xE45u:
case 0xE5Au:
deviceQuirks.isMTK = true;
deviceQuirks.hasEclipseWfm = true;
deviceQuirks.screenDPI = 300U;
strtcpy(deviceQuirks.deviceName, "PaperWhite 5", sizeof(deviceQuirks.deviceName));
strtcpy(deviceQuirks.deviceCodename, "Sangria", sizeof(deviceQuirks.deviceCodename));
strtcpy(deviceQuirks.devicePlatform, "Bellatrix4", sizeof(deviceQuirks.devicePlatform));
return true;
case 0xE29u: // CS
case 0xE24u:
case 0xE2Bu:
case 0xE26u:
case 0xE22u:
case 0xC9Fu:
case 0xE27u:
case 0xE5Bu:
case 0xE46u:
case 0x10A6u:
deviceQuirks.isMTK = true;
deviceQuirks.hasEclipseWfm = true;
deviceQuirks.screenDPI = 300U;
deviceQuirks.hasColorPanel = true;
strtcpy(deviceQuirks.deviceName, "ColorSoft", sizeof(deviceQuirks.deviceName));
strtcpy(deviceQuirks.deviceCodename, "SeaBreeze", sizeof(deviceQuirks.deviceCodename));
strtcpy(deviceQuirks.devicePlatform, "Bellatrix4", sizeof(deviceQuirks.devicePlatform));
return true;
default:
strtcpy(deviceQuirks.deviceName, "Unknown!", sizeof(deviceQuirks.deviceName));
return false;
Expand Down
12 changes: 6 additions & 6 deletions utils/dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ int
fbink_wait_for_complete(fbfd, LAST_MARKER);
}
// Forget about the crop for the other tests
dump.clip = (const FBInkRect){ 0U };
dump.clip = (const FBInkRect) { 0U };

// Restore, this time with a negative L + T crop
fprintf(stdout, "[06b-] RESTORE w/ (-) L+T CROP\n");
Expand All @@ -203,7 +203,7 @@ int
fbink_wait_for_complete(fbfd, LAST_MARKER);
}
// Forget about the crop for the other tests
dump.clip = (const FBInkRect){ 0U };
dump.clip = (const FBInkRect) { 0U };

// Restore, this time with a positive R + B crop
dump.clip = dump.area;
Expand All @@ -219,7 +219,7 @@ int
fbink_wait_for_complete(fbfd, LAST_MARKER);
}
// Forget about the crop for the other tests
dump.clip = (const FBInkRect){ 0U };
dump.clip = (const FBInkRect) { 0U };

// Restore, this time with a negative R + B crop (i.e., the overlap will match the full dump area)
dump.clip = dump.area;
Expand All @@ -235,7 +235,7 @@ int
fbink_wait_for_complete(fbfd, LAST_MARKER);
}
// Forget about the crop for the other tests
dump.clip = (const FBInkRect){ 0U };
dump.clip = (const FBInkRect) { 0U };

// Restore, this time with a crop on all sides
dump.clip = dump.area;
Expand All @@ -255,7 +255,7 @@ int
fbink_wait_for_complete(fbfd, LAST_MARKER);
}
// Forget about the crop for the other tests
dump.clip = (const FBInkRect){ 0U };
dump.clip = (const FBInkRect) { 0U };

// This should fail to restore (no overlap)
dump.clip = dump.area;
Expand All @@ -270,7 +270,7 @@ int
goto cleanup;
}
// Forget about the crop for the other tests
dump.clip = (const FBInkRect){ 0U };
dump.clip = (const FBInkRect) { 0U };

// Now, for something slightly crazy, which I don't necessarily recommend relying on,
// restore, but at a different position.
Expand Down

0 comments on commit 426d8f1

Please sign in to comment.