Reencode sounds, misc. cleanups and fixes

This commit is contained in:
spicyjpeg 2023-09-26 11:50:51 +02:00
parent 123c6fa14d
commit 55ac5478bf
No known key found for this signature in database
GPG Key ID: 5CC87404C01DF393
20 changed files with 31 additions and 14 deletions

View File

@ -1,7 +1,7 @@
{
"AboutScreen": {
"title": "{CART_ICON} About this tool",
"prompt": "Use {LEFT_BUTTON}{RIGHT_BUTTON} to scroll. Press {START_BUTTON} to go back."
"prompt": "{RIGHT_ARROW} Use {LEFT_BUTTON}{RIGHT_BUTTON} to scroll. Press {START_BUTTON} to go back."
},
"App": {
@ -164,9 +164,9 @@
}
},
"prompt": {
"locked": "Press {START_BUTTON} to unlock, hold {LEFT_BUTTON}{RIGHT_BUTTON} + {START_BUTTON} to go back.",
"unlocked": "Press {START_BUTTON} to continue, hold {LEFT_BUTTON}{RIGHT_BUTTON} + {START_BUTTON} to go back.",
"error": "Hold {LEFT_BUTTON}{RIGHT_BUTTON} + {START_BUTTON} to go back."
"locked": "{RIGHT_ARROW} Press {START_BUTTON} to unlock, hold {LEFT_BUTTON}{RIGHT_BUTTON} + {START_BUTTON} to go back.",
"unlocked": "{RIGHT_ARROW} Press {START_BUTTON} to continue, hold {LEFT_BUTTON}{RIGHT_BUTTON} + {START_BUTTON} to go back.",
"error": "{RIGHT_ARROW} Hold {LEFT_BUTTON}{RIGHT_BUTTON} + {START_BUTTON} to go back."
},
"x76f041": {
@ -194,7 +194,7 @@
"HexdumpScreen": {
"title": "{CART_ICON} Cartridge dump",
"prompt": "Use {LEFT_BUTTON}{RIGHT_BUTTON} to scroll. Press {START_BUTTON} to go back."
"prompt": "{RIGHT_ARROW} Use {LEFT_BUTTON}{RIGHT_BUTTON} to scroll. Press {START_BUTTON} to go back."
},
"KeyEntryScreen": {
@ -264,7 +264,7 @@
"SystemInfoScreen": {
"title": "System information",
"prompt": "Use {LEFT_BUTTON}{RIGHT_BUTTON} to scroll. Press {START_BUTTON} to go back."
"prompt": "{RIGHT_ARROW} Use {LEFT_BUTTON}{RIGHT_BUTTON} to scroll. Press {START_BUTTON} to go back."
},
"UnlockKeyScreen": {

BIN
assets/sounds/alert.vag Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
assets/sounds/moveleft.vag Normal file

Binary file not shown.

BIN
assets/sounds/moveright.vag Normal file

Binary file not shown.

View File

@ -20,6 +20,12 @@
"name": "assets/textures/font.metrics",
"source": "assets/textures/font.metrics.json"
},
{
"type": "binary",
"name": "assets/sounds/alert.vag",
"source": "assets/sounds/alert.vag",
"compress": null
},
{
"type": "binary",
"name": "assets/sounds/move.vag",

View File

@ -116,7 +116,7 @@ void App::_setupInterrupts(void) {
static const char *const _UI_SOUND_PATHS[ui::NUM_UI_SOUNDS]{
"assets/sounds/startup.vag", // ui::SOUND_STARTUP
"assets/sounds/error.vag", // ui::SOUND_ERROR
"assets/sounds/alert.vag", // ui::SOUND_ALERT
"assets/sounds/move.vag", // ui::SOUND_MOVE
"assets/sounds/enter.vag", // ui::SOUND_ENTER
"assets/sounds/exit.vag", // ui::SOUND_EXIT

View File

@ -31,10 +31,10 @@ public:
class QRCodeScreen : public ui::ImageScreen {
public:
inline bool generateCode(const char *textInput) {
return gpu::generateQRCode(_image, 960, 128, textInput);
return gpu::generateQRCode(_image, 960, 256, textInput);
}
inline bool generateCode(const uint8_t *binaryInput, size_t length) {
return gpu::generateQRCode(_image, 960, 128, binaryInput, length);
return gpu::generateQRCode(_image, 960, 256, binaryInput, length);
}
void show(ui::Context &ctx, bool goBack = false);

View File

@ -57,6 +57,7 @@ void MessageScreen::show(ui::Context &ctx, bool goBack) {
_locked = _prevScreen ? false : true;
MessageBoxScreen::show(ctx, goBack);
ctx.sounds[ui::SOUND_ALERT].play();
}
void MessageScreen::update(ui::Context &ctx) {
@ -89,7 +90,7 @@ void ConfirmScreen::show(ui::Context &ctx, bool goBack) {
_numButtons = 2;
MessageBoxScreen::show(ctx, goBack);
ctx.sounds[ui::SOUND_ERROR].play();
//ctx.sounds[ui::SOUND_ALERT].play();
}
void ConfirmScreen::update(ui::Context &ctx) {

View File

@ -239,6 +239,7 @@ size_t Dump::toQRString(char *output) const {
size_t uncompLength = getDumpLength();
size_t compLength = MAX_QR_STRING_LENGTH;
__builtin_memset(compressed, 0, MAX_QR_STRING_LENGTH);
int error = mz_compress2(
compressed, reinterpret_cast<mz_ulong *>(&compLength),
reinterpret_cast<const uint8_t *>(this), uncompLength,

View File

@ -295,6 +295,9 @@ void Image::drawScaled(
int x2 = x + w, u2 = u + width;
int y2 = y + h, v2 = v + height;
// Even though the packet has a texpage field, setTexturePage() is required
// here in order to update _lastTexpage and ensure dithering is disabled.
ctx.setTexturePage(texpage);
auto cmd = ctx.newPacket(9);
cmd[0] = gp0_quad(true, blend);

View File

@ -9,7 +9,7 @@ namespace spu {
/* Basic API */
static constexpr int _DMA_CHUNK_SIZE = 8;
static constexpr int _DMA_CHUNK_SIZE = 4;
static constexpr int _DMA_TIMEOUT = 10000;
static constexpr int _STATUS_TIMEOUT = 1000;

View File

@ -198,6 +198,9 @@ void TiledBackground::draw(Context &ctx) const {
tile.draw(ctx.gpuCtx, x, y);
}
if (!text)
return;
gpu::RectWH rect;
int width = ctx.font.getStringWidth(text);

View File

@ -37,7 +37,7 @@ enum Color {
enum Sound {
SOUND_STARTUP = 0,
SOUND_ERROR = 1,
SOUND_ALERT = 1,
SOUND_MOVE = 2,
SOUND_ENTER = 3,
SOUND_EXIT = 4,
@ -188,6 +188,9 @@ public:
gpu::Image tile;
const char *text;
inline TiledBackground(void)
: text(nullptr) {}
void draw(Context &ctx) const;
};

View File

@ -32,8 +32,8 @@ def decodeBase41(data: str) -> bytearray:
def serialNumberToString(_id: ByteString) -> str:
value: int = int.from_bytes(_id[1:7], "little")
if value >= 100000000:
return "xxxx-xxxx"
#if value >= 100000000:
#return "xxxx-xxxx"
return f"{(value // 10000) % 10000:04d}-{value % 10000:04d}"