Skip to content

Commit

Permalink
Merge pull request #25 from esp-cpp/feature/save-state-selection
Browse files Browse the repository at this point in the history
Save State Selection UI and Refactor
  • Loading branch information
finger563 authored May 8, 2023
2 parents 07ac94e + a238405 commit e8f281a
Show file tree
Hide file tree
Showing 240 changed files with 11,727 additions and 4,538 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ build/
sdkconfig
sdkconfig.old
.DS_Store
squareline/backup
**/squareline/backup
flash_data/
*-backups/
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
[submodule "components/jpegdec"]
path = components/jpegdec
url = [email protected]:bitbank2/JPEGDEC
[submodule "components/jpegenc"]
path = components/jpegenc
url = [email protected]:esp-cpp/JPEGENC
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ set(EXTRA_COMPONENT_DIRS
)

### NES ###
set(NES_COMPONENTS "nofrendo nofrendo-esp32")
set(NES_COMPONENTS "nes")

### GBC ###
set(GBC_COMPONENTS "gnuboy")
set(GBC_COMPONENTS "gbc")

### SMS ###
# set(SMS_COMPONENTS "smsplus")
# set(SMS_COMPONENTS "sms")

add_compile_definitions(BOARD_HAS_PSRAM)

set(
COMPONENTS
"main esptool_py fatfs esp_littlefs esp_lcd esp_psram task format display display_drivers monitor esp-idf-cxx ${NES_COMPONENTS} ${GBC_COMPONENTS} ${SMS_COMPONENTS} box-emu-hal gui"
"main esptool_py esp_lcd esp_psram task format display display_drivers monitor esp-idf-cxx ${NES_COMPONENTS} ${GBC_COMPONENTS} ${SMS_COMPONENTS} box-emu-hal gui menu"
CACHE STRING
"List of components to include"
)
Expand Down
Binary file added boxart/batman_the_animated_series.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added boxart/duck_tales.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added boxart/final_fantasy.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added boxart/final_fantasy_adventure.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added boxart/final_fantasy_ii.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added boxart/final_fantasy_iii.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added boxart/harvest_moon.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added boxart/harvest_moon_gbc.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added boxart/mario_golf.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added boxart/mario_open_golf.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added boxart/mario_tennis.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added boxart/metal_gear.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added boxart/metal_gear_solid.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added boxart/metroid_2_return_of_samus.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added boxart/source/batman_the_animated_series.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added boxart/source/duck_tales.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added boxart/source/final_fantasy.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added boxart/source/final_fantasy_adventure.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added boxart/source/final_fantasy_ii.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added boxart/source/final_fantasy_iii.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added boxart/source/harvest_moon.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added boxart/source/harvest_moon_gbc.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added boxart/source/mario_golf.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added boxart/source/mario_open_golf.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added boxart/source/mario_tennis.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added boxart/source/metal_gear.jpg
Binary file added boxart/source/metal_gear_solid.jpg
Binary file added boxart/source/metroid_2_return_of_samus.jpg
Binary file modified boxart/source/tloz_oracle_ages.jpg
Binary file modified boxart/source/tloz_oracle_seasons.jpg
Binary file modified boxart/tloz_oracle_ages.jpg
Binary file modified boxart/tloz_oracle_seasons.jpg
5 changes: 0 additions & 5 deletions components/ads1x15/CMakeLists.txt

This file was deleted.

131 changes: 0 additions & 131 deletions components/ads1x15/include/ads1x15.hpp

This file was deleted.

99 changes: 0 additions & 99 deletions components/ads1x15/src/ads1x15.cpp

This file was deleted.

2 changes: 1 addition & 1 deletion components/box-emu-hal/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
idf_component_register(
INCLUDE_DIRS "include"
SRC_DIRS "src"
REQUIRES "driver" "heap" "esp_lcd" "esp_psram" "spi_flash" "nvs_flash" "codec" "display" "display_drivers" "controller" "mcp23x17" "ads1x15" "qwiicnes" "input_drivers" "ft5x06" "tt21100" "drv2605"
REQUIRES "driver" "heap" "fatfs" "esp_littlefs" "esp_lcd" "esp_psram" "spi_flash" "nvs_flash" "codec" "display" "display_drivers" "controller" "mcp23x17" "ads1x15" "qwiicnes" "input_drivers" "ft5x06" "tt21100" "drv2605" "event_manager"
)
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,4 @@
#define MOUNT_POINT "/sdcard"
#endif

#define DEFAULT_MODE S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH

bool mkdirp(const char* path, mode_t mode = DEFAULT_MODE);
void fs_init();
6 changes: 6 additions & 0 deletions components/box-emu-hal/include/hal_events.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#pragma once

#include "event_manager.hpp"

extern const std::string mute_button_topic;
extern const std::string video_setting_topic;
1 change: 0 additions & 1 deletion components/box-emu-hal/include/i2c.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ void i2c_read_internal_bus(uint8_t dev_addr, uint8_t* read_data, size_t read_len

void i2c_write_external_bus(uint8_t dev_addr, uint8_t *data, size_t len);
void i2c_read_external_bus(uint8_t dev_addr, uint8_t reg_addr, uint8_t *read_data, size_t read_len);
void i2c_read_external_bus(uint8_t dev_addr, uint8_t* read_data, size_t read_len);
5 changes: 5 additions & 0 deletions components/box-emu-hal/include/i2s_audio.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ extern "C" {
void audio_init();
int16_t* get_audio_buffer();
void audio_play_frame(uint8_t *data, uint32_t num_bytes);

bool is_muted();
void set_muted(bool mute);

int get_audio_volume();
void set_audio_volume(int percent);

#ifdef __cplusplus
Expand Down
3 changes: 0 additions & 3 deletions components/box-emu-hal/include/input.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,8 @@ extern "C"
};

void init_input();
bool read_joystick(float *x, float *y);
void get_input_state(struct InputState *state);
void touchpad_read(unsigned char *num_touch_points, unsigned short* x, unsigned short* y, unsigned char* btn_state);
void reset_user_quit();
bool user_quit();

#ifdef __cplusplus
}
Expand Down
3 changes: 2 additions & 1 deletion components/box-emu-hal/include/mmap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@

#include <esp_err.h>
#include "nvs_flash.h"
#include "spi_flash_mmap.h"
#include "esp_partition.h"

#include "format.hpp"

void init_memory();
size_t copy_romdata_to_nesgame_partition(const std::string& rom_filename);
size_t copy_romdata_to_cart_partition(const std::string& rom_filename);
uint8_t *get_mmapped_romdata();
2 changes: 1 addition & 1 deletion components/box-emu-hal/include/spi_lcd.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ extern "C"
{
#endif

#define NUM_ROWS_IN_FRAME_BUFFER 50
#define NUM_ROWS_IN_FRAME_BUFFER 25

uint16_t make_color(uint8_t r, uint8_t g, uint8_t b);
uint16_t* get_vram0();
Expand Down
8 changes: 8 additions & 0 deletions components/box-emu-hal/include/video_setting.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#pragma once

#include <atomic>

enum class VideoSetting { ORIGINAL, FIT, FILL, MAX_UNUSED };

VideoSetting get_video_setting();
void set_video_setting(const VideoSetting& setting);
Loading

0 comments on commit e8f281a

Please sign in to comment.