Skip to content

Commit

Permalink
add 11.0.0 support
Browse files Browse the repository at this point in the history
  • Loading branch information
HookedBehemoth committed Dec 8, 2020
1 parent ec10d4e commit c8bd380
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 19 deletions.
29 changes: 15 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,28 @@
"Bitmap printer goes brrrrr"

## What does this do?
This system module captures the capture button event and instead of saving a compressed (jpeg) image on the sd card it stores an uncompressed RGB bitmap on the sd card.
This system module captures the capture button event and instead of saving a compressed (jpeg) image, it stores an uncompressed RGB bitmap on the sd card.

## Why does it need patches?
The IPC calls I use are caps:sc 1201-1203 that check a flag for debug mode. The patch makes the function call always return true.

Works on HOS version 3.0.0-10.1.0 (21.07.2020).
Works on HOS version 3.0.0-11.0.0 (08.12.2020).

Included patches:
| vi Version | Patch name (Build ID + .ips) | tested |
| --- | --- | --- |
| 3.0.0.410: | C41FC90700B2E371A88EA96D8E688E9AC954E40F.ips | yes |
| 3.0.1.50: | CDD21E75CDEC621583FAE6A09B7E64A4789BCD37.ips | yes |
| 4.0.0.200: | FC5A4D49AA96C39EFEECECAAB3A4338C89A0151F.ips | yes |
| 5.0.0.430: | 7B4123290DE2A6F52DE4AB72BEA1A83D11214C71.ips | yes |
| 5.1.0.80: | 723DF02F6955D903DF7134105A16D48F06012DB1.ips | yes |
| 6.0.0.360: | 967F4C3DFC7B165E4F7981373EC1798ACA234A45.ips | yes |
| 6.2.0.40: | 967F4C3DFC7B165E4F7981373EC1798ACA234A45.ips | yes |
| 7.0.0.200: | 98446A07BC664573F1578F3745C928D05AB73349.ips | yes |
| 8.0.0.530: | 0767302E1881700608344A3859BC57013150A375.ips | yes |
| 8.1.0.120: | 7C5894688EDA24907BC9CE7013630F365B366E4A.ips | yes |
| 9.0.0.440: | 7421EC6021AC73DD60A635BC2B3AD6FCAE2A6481.ips | yes |
| 10.0.0.300: | 96529C3226BEE906EE651754C33FE3E24ECAE832.ips | yes |
| 3.0.0.410 | C41FC90700B2E371A88EA96D8E688E9AC954E40F.ips | yes |
| 3.0.1.50 | CDD21E75CDEC621583FAE6A09B7E64A4789BCD37.ips | yes |
| 4.0.0.200 | FC5A4D49AA96C39EFEECECAAB3A4338C89A0151F.ips | yes |
| 5.0.0.430 | 7B4123290DE2A6F52DE4AB72BEA1A83D11214C71.ips | yes |
| 5.1.0.80 | 723DF02F6955D903DF7134105A16D48F06012DB1.ips | yes |
| 6.0.0.360 | 967F4C3DFC7B165E4F7981373EC1798ACA234A45.ips | yes |
| 6.2.0.40 | 967F4C3DFC7B165E4F7981373EC1798ACA234A45.ips | yes |
| 7.0.0.200 | 98446A07BC664573F1578F3745C928D05AB73349.ips | yes |
| 8.0.0.530 | 0767302E1881700608344A3859BC57013150A375.ips | yes |
| 8.1.0.120 | 7C5894688EDA24907BC9CE7013630F365B366E4A.ips | yes |
| 9.0.0.440 | 7421EC6021AC73DD60A635BC2B3AD6FCAE2A6481.ips | yes |
| 10.0.0.300 | 96529C3226BEE906EE651754C33FE3E24ECAE832.ips | yes |
| 11.0.0.400 | D689E9FAE7CAA4EC30B0CD9B419779F73ED3F88B.ips | yes |

Please post on the [issue thread](https://github.com/HookedBehemoth/bitmap-printer/issues/1) if your experience differs from the below table or if you tested an undocumented version.
Binary file not shown.
10 changes: 5 additions & 5 deletions source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ void __libnx_initheap(void) {
({ \
const auto _tmp_r_abort_rc = (res_expr); \
if (R_FAILED(_tmp_r_abort_rc)) { \
fatalThrow(_tmp_r_abort_rc); \
diagAbortWithResult(_tmp_r_abort_rc);\
} \
})

bool initialized = false;

void __attribute__((weak)) __appInit(void) {
void __appInit(void) {
while ((armGetSystemTick() / armGetSystemTickFreq()) < 10)
svcSleepThread(1'000'000'000);

Expand All @@ -61,7 +61,7 @@ void __attribute__((weak)) __appInit(void) {
smExit();
}

void __attribute__((weak)) __appExit(void) {
void __appExit(void) {
if (initialized) {
fsExit();
capsscExit();
Expand Down Expand Up @@ -240,7 +240,7 @@ int main(int argc, char *argv[]) {

/* Obtain capture button event. */
Event event;
R_ABORT_UNLESS(hidsysAcquireCaptureButtonEventHandle(&event));
R_ABORT_UNLESS(hidsysAcquireCaptureButtonEventHandle(&event, false));
eventClear(&event);

/* Loop forever. */
Expand All @@ -266,7 +266,7 @@ int main(int argc, char *argv[]) {
} else {
if (start_tick != 0) {
/* If held for more than half a second we discard the capture. */
if ((armGetSystemTick() - start_tick) >= (armGetSystemTickFreq() / 2)) {
if (armTicksToNs(armGetSystemTick() - start_tick) > 500'000'000) {
capsscCloseRawScreenShotReadStream();
start_tick = 0;
}
Expand Down

0 comments on commit c8bd380

Please sign in to comment.