Skip to content

Commit 4a023d3

Browse files
authored
feat: Update to remove display task (espp update) and fix sa for carts (#94)
* feat: Update to remove display task (espp update) and fix sa for carts * fix sa
1 parent e55cadf commit 4a023d3

File tree

13 files changed

+12
-21
lines changed

13 files changed

+12
-21
lines changed

components/box-emu/example/main/box_emu_example.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,8 @@ static size_t load_audio() {
154154
}
155155

156156
// these are configured in the CMakeLists.txt file
157-
extern const char wav_start[] asm("_binary_click_wav_start");
158-
extern const char wav_end[] asm("_binary_click_wav_end");
157+
extern const char wav_start[] asm("_binary_click_wav_start"); // cppcheck-suppress syntaxError
158+
extern const char wav_end[] asm("_binary_click_wav_end"); // cppcheck-suppress syntaxError
159159

160160
// -1 due to the size being 1 byte too large, I think because end is the byte
161161
// immediately after the last byte in the memory but I'm not sure - cmm 2022-08-20

components/box-emu/src/box-emu.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,8 @@ bool BoxEmu::initialize_box() {
5050
return false;
5151
}
5252
static constexpr size_t pixel_buffer_size = espp::EspBox::lcd_width() * num_rows_in_framebuffer;
53-
static constexpr int update_period_ms = 16;
54-
espp::Task::BaseConfig display_task_config = {
55-
.name = "Display",
56-
.stack_size_bytes = 6 * 1024,
57-
.priority = 10,
58-
.core_id = 1,
59-
};
6053
// initialize the LVGL display for the esp-box
61-
if (!box.initialize_display(pixel_buffer_size, display_task_config, update_period_ms)) {
54+
if (!box.initialize_display(pixel_buffer_size)) {
6255
logger_.error("Failed to initialize display!");
6356
return false;
6457
}

components/gbc/src/gameboy.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ struct fb fb;
3636
struct pcm pcm;
3737
static uint8_t currentBuffer = 0;
3838

39+
// cppcheck-suppress constParameterPointer
3940
extern "C" void die(char *fmt, ...) {
4041
// do nothing...
4142
}

components/nes/src/video_audio.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ extern "C" void osd_getinput(void)
238238
}
239239
}
240240

241+
// cppcheck-suppress constParameterPointer
241242
extern "C" void osd_getmouse(int *x, int *y, int *button)
242243
{
243244
}

components/sms/src/sms.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ void sms_frame(int skip_render);
3737
void sms_init(void);
3838
void sms_reset(void);
3939

40+
// cppcheck-suppress constParameterPointer
4041
extern "C" void system_manage_sram(uint8 *sram, int slot, int mode) {
4142
}
4243

main/cart.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,13 +171,11 @@ class Cart {
171171
// now resume the menu
172172
menu_->resume();
173173
display_->force_refresh();
174-
display_->resume();
175174
// wait here until the menu is no longer shown
176175
while (!menu_->is_paused()) {
177176
using namespace std::chrono_literals;
178177
std::this_thread::sleep_for(100ms);
179178
}
180-
display_->pause();
181179
// make sure to clear the screen before we resume the game
182180
espp::St7789::clear(0,0,320,240);
183181
// only run the post_menu if we are still running

main/gbc_cart.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class GbcCart : public Cart {
1414
init();
1515
}
1616

17-
~GbcCart() {
17+
virtual ~GbcCart() override {
1818
deinit();
1919
}
2020

main/genesis_cart.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class GenesisCart : public Cart {
1414
init();
1515
}
1616

17-
~GenesisCart() {
17+
virtual ~GenesisCart() override {
1818
logger_.info("~GenesisCart()");
1919
deinit();
2020
}

main/main.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,6 @@ extern "C" void app_main(void) {
104104
// Cart handles platform specific code, state management, etc.
105105
{
106106
std::unique_ptr<Cart> cart(make_cart(selected_rom, display));
107-
108-
display->pause();
109107
if (cart) {
110108
while (cart->run());
111109
} else {
@@ -128,6 +126,5 @@ extern "C" void app_main(void) {
128126

129127
gui.resume();
130128
display->force_refresh();
131-
display->resume();
132129
}
133130
}

0 commit comments

Comments
 (0)