Skip to content

Commit

Permalink
Merge pull request #3 from ClasspadDev/diddyholz-master
Browse files Browse the repository at this point in the history
Diddyholz master
  • Loading branch information
s3ansh33p authored Sep 29, 2022
2 parents 3914d01 + 2723e58 commit a8f7002
Show file tree
Hide file tree
Showing 3 changed files with 542 additions and 244 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ CC:=sh4-elf-gcc
CC_FLAGS:=-ffreestanding -fshort-wchar -Wall -Wextra -O2 -I $(SDK_DIR)/include/ -m4-nofpu

CXX:=sh4-elf-g++
CXX_FLAGS:=-ffreestanding -fno-exceptions -fno-rtti -fshort-wchar -Wall -Wextra -O2 -I $(SDK_DIR)/include/ -m4-nofpu
CXX_FLAGS:=-ffreestanding -fno-exceptions -fno-rtti -fshort-wchar -Wall -Wextra -Wno-write-strings -O2 -I $(SDK_DIR)/include/ -m4-nofpu

LD:=sh4-elf-ld
LD_FLAGS:=-nostdlib --no-undefined
Expand Down
17 changes: 11 additions & 6 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@

// #define MAX_ROM_SIZE 0x10000

#define CPBOY_VERSION "v0.1.1-alpha"

#define GB_KEY_UP 0
#define GB_KEY_DOWN 1
#define GB_KEY_LEFT 2
Expand Down Expand Up @@ -93,7 +95,7 @@
APP_NAME("CPBoy")
APP_DESCRIPTION("A Gameboy (DMG) emulator. Forked from PeanutGB by deltabeard.")
APP_AUTHOR("diddyholz")
APP_VERSION("0.1.0-alpha")
APP_VERSION(CPBOY_VERSION)

uint8_t *read_rom_to_ram(const char *file_name);
uint8_t gb_rom_read(struct gb_s *gb, const uint_fast32_t addr);
Expand Down Expand Up @@ -313,6 +315,8 @@ void main()
findFiles();

// menu
const uint16_t color_success = 0x07E0;

bool inMenu = true;
bool buttonPressed = false;

Expand All @@ -323,10 +327,8 @@ void main()
// render
fillScreen(color(0, 0, 0));

const uint16_t color_success = 0x07E0;

print_string("CPBOY", 124, 8, 1, 0x001F, 0x0000, 1); // color(0, 0, 255)
print_string("Version 0.0.2-alpha", 100, 44, 0, 0xF800, 0x0000, 1); // color(255, 0, 0)
print_string(CPBOY_VERSION, 103, 44, 0, 0xF800, 0x0000, 1); // color(255, 0, 0)
// print_string("[Dev Build]", 124, 64, 0, 0xFFE0, 0x0000, 1); // color(255, 255, 0)

Debug_Printf(0, 9 + menuIndex, true, 0, ">");
Expand Down Expand Up @@ -2208,7 +2210,7 @@ void show_credits_dialog()
print_string("Credits", 135, dialog_y + 5, 0, dialog_border, 0x0000, 1);

// draw subtitle
print_string("Version 0.1.0-alpha", 100, dialog_y + 23, 0, subtitle_fg, 0x0000, 1);
print_string(CPBOY_VERSION, 103, dialog_y + 23, 0, subtitle_fg, 0x0000, 1);

// draw credits
print_string("Built on github.com/deltabeard/Peanut-GB", dialog_x + 8, dialog_y + 51, 0, 0xFFFF, 0x0000, 1);
Expand Down Expand Up @@ -2811,8 +2813,9 @@ void create_savestate(uint16_t (*preview_frame)[LCD_WIDTH])

gb_state->gb_halt = gb.gb_halt;
gb_state->gb_ime = gb.gb_ime;
#if PEANUT_GB_USE_BIOS
gb_state->gb_bios_enable = gb.gb_bios_enable;

#endif
gb_state->lcd_mode = gb.lcd_mode;

gb_state->selected_rom_bank = gb.selected_rom_bank;
Expand Down Expand Up @@ -2922,7 +2925,9 @@ void apply_savestate(struct savestate *savestate, uint16_t (*last_frame)[LCD_WID
// apply state
gb.gb_halt = gb_state->gb_halt;
gb.gb_ime = gb_state->gb_ime;
#if PEANUT_GB_USE_BIOS
gb.gb_bios_enable = gb_state->gb_bios_enable;
#endif
gb.lcd_mode = gb_state->lcd_mode;

gb.selected_rom_bank = gb_state->selected_rom_bank;
Expand Down
Loading

0 comments on commit a8f7002

Please sign in to comment.