Skip to content

Commit

Permalink
optimizing screen refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
DantSu committed Jul 17, 2024
1 parent 6b4e9fe commit f287d74
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 30 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
###########################################################

TARGET=TelmiOS
VERSION=1.4.0
VERSION=1.4.1

###########################################################

Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![Total Download](https://img.shields.io/github/downloads/DantSu/Telmi-story-teller/total.svg) [![v1.4.0 download](https://img.shields.io/github/downloads/DantSu/Telmi-story-teller/1.4.0/total.svg)](https://github.com/DantSu/Telmi-story-teller/releases/tag/1.4.0)
![Total Download](https://img.shields.io/github/downloads/DantSu/Telmi-story-teller/total.svg) [![v1.4.1 download](https://img.shields.io/github/downloads/DantSu/Telmi-story-teller/1.4.1/total.svg)](https://github.com/DantSu/Telmi-story-teller/releases/tag/1.4.1)

<p align="center"><img src="https://dantsu.com/files/Telmi_1280.png" alt="Telmi OS splash screen" /></p>

Expand All @@ -13,7 +13,7 @@ The story teller is compatible with stories exported from [STUdio](https://githu

### Download the installation files

- [Download the latest version of Telmi](https://github.com/DantSu/Telmi-story-teller/releases/download/1.4.0/TelmiOS_v1.4.0.zip)
- [Download the latest version of Telmi](https://github.com/DantSu/Telmi-story-teller/releases/download/1.4.1/TelmiOS_v1.4.1.zip)

### Format your SD card as FAT32 (not exFAT!)

Expand Down Expand Up @@ -48,9 +48,9 @@ Make sure you choose: `For use with all systems and devices (FAT)`

Chrome already has a tool to format an SD card. Insert the card into your Chromebook, right-click it and click **Format Device**, make sure `FAT32` is selected under **Format** and click or tap **Erase & Format**.

### Unzip TelmiOS_v1.4.0.zip
### Unzip TelmiOS_v1.4.1.zip

Put the content of `TelmiOS_v1.4.0.zip` at the root of the SD card.
Put the content of `TelmiOS_v1.4.1.zip` at the root of the SD card.

### Power on your Miyoo

Expand Down
52 changes: 27 additions & 25 deletions src/storyTeller/stories_reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -489,26 +489,6 @@ void stories_readStage(void) {
sprintf(story_audio_path, "%s%s/audios/", STORIES_RESOURCES, storiesList[storyIndex]);
sprintf(story_image_path, "%s%s/images/", STORIES_RESOURCES, storiesList[storyIndex]);

if (isImageDefined) {
display_setScreen(true);
storyScreenEnabled = true;
video_screenBlack();
video_screenAddImage(story_image_path, cJSON_GetStringValue(imageJson), 0, 0, 640);
if (hasInventory) {
stories_inventory_screenDraw();
}
if (storiesNightModeEnabled) {
stories_nightMode_screenDisplayCount();
}
video_applyToVideo();
} else {
video_displayBlackScreen();
storyScreenEnabled = false;
if (!applock_isLockRecentlyChanged() && !applock_isUnlocking()) {
display_setScreen(false);
}
}

if (isAudioDefined) {
audio_play(story_audio_path, cJSON_GetStringValue(audioJson), storyTime);
storyStartTime = get_time();
Expand All @@ -523,15 +503,37 @@ void stories_readStage(void) {
stories_autosleep_unlock();
}

if (storiesNightModeEnabled && storyAutoplay && !storyOkAction && !storyScreenEnabled) {
sprintf(storiesNightModeCurrentAudio, "%s%s", story_audio_path, cJSON_GetStringValue(audioJson));
if (isImageDefined) {
display_setScreen(true);
storyScreenEnabled = true;
video_screenBlack();
video_screenAddImage(SYSTEM_RESOURCES, "storytellerNightMode.png", 0, 0, 640);
stories_nightMode_screenDisplayCount();
video_screenAddImage(story_image_path, cJSON_GetStringValue(imageJson), 0, 0, 640);
if (hasInventory) {
stories_inventory_screenDraw();
}
if (storiesNightModeEnabled) {
storiesNightModeCurrentAudio[0] = '\0';
stories_nightMode_screenDisplayCount();
}
video_applyToVideo();
} else {
storiesNightModeCurrentAudio[0] = '\0';
storyScreenEnabled = false;
if (storiesNightModeEnabled && storyAutoplay && !storyOkAction) {
sprintf(storiesNightModeCurrentAudio, "%s%s", story_audio_path, cJSON_GetStringValue(audioJson));
display_setScreen(true);
video_screenBlack();
video_screenAddImage(SYSTEM_RESOURCES, "storytellerNightMode.png", 0, 0, 640);
stories_nightMode_screenDisplayCount();
video_applyToVideo();
} else {
video_displayBlackScreen();
if (!applock_isLockRecentlyChanged() && !applock_isUnlocking()) {
display_setScreen(false);
}
if (storiesNightModeEnabled) {
storiesNightModeCurrentAudio[0] = '\0';
}
}
}
}

Expand Down

0 comments on commit f287d74

Please sign in to comment.