From fd78a40adbf9b9ad1d2c76cfca7052dc64506180 Mon Sep 17 00:00:00 2001 From: Lukas Date: Wed, 31 Mar 2021 21:38:46 +0200 Subject: [PATCH] updated for GameBoy Printer Emulator V3 --- .gitignore | 2 ++ GameboyPrinterReceiver.iml | 15 +++++++++++++++ README.md | 4 +--- src/printer/PrinterEmulator.java | 2 +- 4 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 GameboyPrinterReceiver.iml diff --git a/.gitignore b/.gitignore index 9a1083f..2998671 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,5 @@ hs_err_pid* # include libraries !/libs/* /target/ +.idea +.DS_Store diff --git a/GameboyPrinterReceiver.iml b/GameboyPrinterReceiver.iml new file mode 100644 index 0000000..b492d6c --- /dev/null +++ b/GameboyPrinterReceiver.iml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/README.md b/README.md index 7d97741..fca2017 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,7 @@ [![forthebadge](https://forthebadge.com/images/badges/contains-technical-debt.svg)](https://forthebadge.com) This small Java application connects to a GameBoy Printer Emulator (see https://github.com/mofosyne/arduino-gameboy-printer-emulator) and waits for images. Once you print an image from your GameBoy Camera, the app will decode the image and save it to your computer as a PNG at a resolution of 160 by 144 pixels. This application runs in the command line and has no GUI. - -## Important Note -Currently, this Java application only works with GameBoy Printer Emulator V1 and V2. I will update thie repository in the future to support V3. +It has been updated for V3 of the GameBoy Printer Emulator. ## Installation diff --git a/src/printer/PrinterEmulator.java b/src/printer/PrinterEmulator.java index a4e26b0..199e8bf 100644 --- a/src/printer/PrinterEmulator.java +++ b/src/printer/PrinterEmulator.java @@ -32,7 +32,7 @@ public void receiveChunk(String chunk) { startImage(); if (chunk.contains("\"command\":\"PRNT\"")) finishImage(); - if (!chunk.startsWith("#") && !chunk.startsWith("!")) + if (!chunk.startsWith("//") && !chunk.startsWith("{") && !chunk.startsWith("!") && !chunk.startsWith("#")) addData(chunk); }