Skip to content

Commit

Permalink
Version 1.5.0
Browse files Browse the repository at this point in the history
- Detect GBDK 4.3.0+
- Update GBStudio 3.2.0 due to using an interim build between GBDK 4.2.0 and 4.3.0
- Detect GBBasic Alpha 4
- Change make runtest to make test
- Add test references for gbdk 2020 4.3.0, GBBasic Alpha 4
- Update test for GBDK 2020 4.2.0 name
  • Loading branch information
bbbbbr committed May 5, 2024
1 parent a7bb749 commit 614d169
Show file tree
Hide file tree
Showing 12 changed files with 48 additions and 21 deletions.
5 changes: 5 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Changelog
=========

# Version 1.5.0
- Detect GBDK 4.3.0+
- Update GBStudio 3.2.0 due to using an interim build between GBDK 4.2.0 and 4.3.0
- Detect GBBasic Alpha 4

# Version 1.4.9
- Improved detection accuracy of GBDK versions 1.0 - 2020.3.2.0 (asie)
- Improved gbnim detection
Expand Down
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ package:
${MAKE} clean
${MAKE} linuxzip

runtest:
.PHONY: test

test:
mkdir -p test/output
find test/* -iname "*.gb*" -type f | xargs -I {} $(BIN) -pF -oC "{}" > test/output/test_run.csv
diff --brief test/test_ref.csv test/output/test_run.csv
Expand Down
3 changes: 2 additions & 1 deletion src/entry_names_gbbasic.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
// ==== GBBasic ====
//
DEF_PATTERN_BUF(sig_gbbasic_actor_init_alpha3, AR_ARGS(0x00, 0x19, 0xE5, 0x7D, 0xF8, 0x04, 0x77, 0xE1, 0x7C, 0xF8, 0x03, 0x32, 0x2A, 0x66, 0x6F, 0xAF, 0x22, 0x77, 0xE1, 0xE5, 0xAF, 0x22, 0x77, 0xF8, 0x02, 0x2A, 0x5F, 0x56));
DEF_PATTERN_BUF(sig_gbbasic_actor_init, AR_ARGS(0x00, 0x19, 0xE5, 0x7D, 0xF8, 0x04, 0x77, 0xE1, 0x7C, 0xF8, 0x03, 0x32, 0x2A, 0x66, 0x6F, 0xAF, 0x22, 0x77, 0xE1, 0xE5, 0xAF, 0x22, 0x77, 0xF8, 0x02, 0x2A, 0x5F, 0x56));
DEF_PATTERN_ADDR(sig_gbbasic_actor_init_alpha3_at, 0x861A); // Bank 2: 0x461A
DEF_PATTERN_ADDR(sig_gbbasic_actor_init_alpha4_at, 0x83C3); // Bank 2: 0x43C3

// ==== GBBASIC
// https://github.com/gbbasic/prototype
Expand Down
11 changes: 8 additions & 3 deletions src/entry_names_gbdk.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
DEF_NAME_STR(STR_GBDK_2020_4_0_5_to_4_0_6, "2020.4.0.5 - 2020.4.0.6");
DEF_NAME_STR(STR_GBDK_2020_4_1_0_to_4_1_1, "2020.4.1.0 - 2020.4.1.1");
DEF_NAME_STR(STR_GBDK_2020_4_2_0_interim, "2020.4.2.0 interim");
DEF_NAME_STR(STR_GBDK_2020_4_2_0_plus, "2020.4.2.0+");
DEF_NAME_STR(STR_GBDK_2020_4_2_0, "2020.4.2.0");
DEF_NAME_STR(STR_GBDK_2020_4_3_0_plus, "2020.4.3.0+");
DEF_NAME_STR(STR_GBDK_2020_4_UNKNOWN, "Unknown");


Expand Down Expand Up @@ -129,8 +130,12 @@
DEF_PATTERN_BUF( sig_gbdk_clear_WRAM_tail_GBDK_2020_410_plus, AR_ARGS(0x67, 0xAF, 0x6F, 0x0E, 0xA0, 0xEF, 0xC9));
DEF_PATTERN_ADDR(sig_gbdk_clear_WRAM_tail_GBDK_2020_410_plus_at, 0x00C5);
// 4.2.0+
DEF_PATTERN_BUF( sig_gbdk_clear_WRAM_tail_GBDK_2020_420_plus, AR_ARGS(0x67, 0xAF, 0x6F, 0x0E, 0xA0, 0xC3, 0x28));
DEF_PATTERN_ADDR(sig_gbdk_clear_WRAM_tail_GBDK_2020_420_plus_at, 0x00C4);
DEF_PATTERN_BUF( sig_gbdk_clear_WRAM_tail_GBDK_2020_420, AR_ARGS(0x67, 0xAF, 0x6F, 0x0E, 0xA0, 0xC3, 0x28));
DEF_PATTERN_ADDR(sig_gbdk_clear_WRAM_tail_GBDK_2020_420_at, 0x00C4);
// 0x00CC set_interrupts : 4.3.0+
DEF_PATTERN_BUF( sig_gbdk_clear_WRAM_tail_GBDK_2020_430_plus, AR_ARGS(0xF3, 0xE0, 0xFF, 0xAF, 0xFB, 0xE0, 0x0F, 0xC9));
DEF_PATTERN_ADDR(sig_gbdk_clear_WRAM_tail_GBDK_2020_430_plus_at, 0x00CC);


// ==== SHARED CODE WITH C ENDS HERE ====

Expand Down
2 changes: 1 addition & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
char filename_in[MAX_STR_LEN] = {'\0'};
uint8_t * p_buf_in = NULL;

#define VERSION "1.4.9"
#define VERSION "1.5.0"

int opt_output_style = OUTPUT_DEFAULT;
int opt_path_output_style = PATH_STYLE_DEFAULT;
Expand Down
8 changes: 6 additions & 2 deletions src/sig_basic.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@ void check_gbbasic(void) {

// ==== SHARED CODE WITH C STARTS HERE ====

entry = FORMAT_ENTRY(TYPE_ENGINE, "GBBasic", "Alpha3");
if (CHECK_PATTERN_AT_ADDR(sig_gbbasic_actor_init_alpha3, sig_gbbasic_actor_init_alpha3_at)) {
if (CHECK_PATTERN_AT_ADDR(sig_gbbasic_actor_init, sig_gbbasic_actor_init_alpha3_at)) {
entry = FORMAT_ENTRY(TYPE_ENGINE, "GBBasic", "Alpha3");
entry_add(entry);
}
else if (CHECK_PATTERN_AT_ADDR(sig_gbbasic_actor_init, sig_gbbasic_actor_init_alpha4_at)) {
entry = FORMAT_ENTRY(TYPE_ENGINE, "GBBasic", "Alpha4");
entry_add(entry);
}

Expand Down
14 changes: 11 additions & 3 deletions src/sig_gbdk.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,21 @@ bool check_gbdk(void) {
return true;
}
// 4.2.0+
else if (CHECK_PATTERN_AT_ADDR(sig_gbdk_clear_WRAM_tail_GBDK_2020_420_plus, sig_gbdk_clear_WRAM_tail_GBDK_2020_420_plus_at)) {
else if (CHECK_PATTERN_AT_ADDR(sig_gbdk_clear_WRAM_tail_GBDK_2020_420, sig_gbdk_clear_WRAM_tail_GBDK_2020_420_at)) {

entry_add_with_version(entry, STR_GBDK_2020_4_2_0_plus);
// 4.3.0+
if (CHECK_PATTERN_AT_ADDR(sig_gbdk_clear_WRAM_tail_GBDK_2020_430_plus, sig_gbdk_clear_WRAM_tail_GBDK_2020_430_plus_at)) {

entry_add_with_version(entry, STR_GBDK_2020_4_3_0_plus);
return true;
}

entry_add_with_version(entry, STR_GBDK_2020_4_2_0);
return true;
}
// Some ZGB versions uses a GBDK version somewhere between 4.0.4 and 4.0.5.v1
else if(CHECK_PATTERN_AT_ADDR(sig_gbdk_0x100_GBDK_4_0_5_v0_zgb, sig_gbdk_0x100_at)) {
else if (CHECK_PATTERN_AT_ADDR(sig_gbdk_0x100_GBDK_4_0_5_v0_zgb, sig_gbdk_0x100_at)) {

entry_add_with_version(entry, STR_GBDK_2020_4_0_5_v0_zgb);
return true;
}
Expand Down
4 changes: 2 additions & 2 deletions src/sig_gbstudio.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ bool check_gbstudio(void) {
}
else if (FIND_PATTERN_BUF(sig_gbs_fade_manager_c_dmgfadetowhitestep_3_2_0_plus)) {

// GBStudio 3.2.0 uses GBDK 4.2.0
if (entry_check_match(TYPE_TOOLS, STR_GBDK, STR_GBDK_2020_4_2_0_plus)) {
// GBStudio 3.2.0 uses an interim build between GBDK 4.2.0 and 4.3.0
if (entry_check_match(TYPE_TOOLS, STR_GBDK, STR_GBDK_2020_4_3_0_plus)) {
entry_add_with_version(entry, "3.2.0");
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion src/sig_zgb.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ bool check_zgb(void) {
return true;
}
// 2023.0 uses GBDK 4.2.0
if (entry_check_match(TYPE_TOOLS, STR_GBDK, STR_GBDK_2020_4_2_0_plus)) {
if (entry_check_match(TYPE_TOOLS, STR_GBDK, STR_GBDK_2020_4_2_0)) {
entry_add_with_version(entry, "2023.0+");
return true;
}
Expand Down
Binary file added test/gbbasic_alpha4_gbbvm.gb
Binary file not shown.
Binary file added test/template_minimal_gbdk_4_3_0.gb
Binary file not shown.
16 changes: 9 additions & 7 deletions test/test_ref.csv
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
"test/crash_handler_installed_gbdk_4_0_5_v2_standard.gb","GBDK","2020.4.0.5 - 2020.4.0.6","","","","","",""
"test/gbbasic_alpha3_01_Hello.gb","GBDK","2020.4.2.0+","GBBasic","Alpha3","hUGETracker","SuperDisk","",""
"test/gbbasic_alpha3_24_Platformer_Controller.gb","GBDK","2020.4.2.0+","GBBasic","Alpha3","hUGETracker","SuperDisk","",""
"test/gbbasic_alpha3_26_Audio_Primitives.gb","GBDK","2020.4.2.0+","GBBasic","Alpha3","hUGETracker","SuperDisk","",""
"test/gbbasic_alpha3_gbbvm.gb","GBDK","2020.4.2.0+","GBBasic","Alpha3","hUGETracker","SuperDisk","",""
"test/gbbasic_alpha3_01_Hello.gb","GBDK","2020.4.2.0","GBBasic","Alpha3","hUGETracker","SuperDisk","",""
"test/gbbasic_alpha3_24_Platformer_Controller.gb","GBDK","2020.4.2.0","GBBasic","Alpha3","hUGETracker","SuperDisk","",""
"test/gbbasic_alpha3_26_Audio_Primitives.gb","GBDK","2020.4.2.0","GBBasic","Alpha3","hUGETracker","SuperDisk","",""
"test/gbbasic_alpha3_gbbvm.gb","GBDK","2020.4.2.0","GBBasic","Alpha3","hUGETracker","SuperDisk","",""
"test/gbbasic_alpha4_gbbvm.gb","GBDK","2020.4.2.0","GBBasic","Alpha4","hUGETracker","SuperDisk","",""
"test/gbforth_aces-up.gb","GBForth","","","","","","",""
"test/gbforth_happy-birthday.gb","GBForth","","","","","","",""
"test/gbforth_simon.gb","GBForth","","","","","","",""
"test/gbforth_sokoban.gb","GBForth","","","","","","",""
"test/gbnim_pocketclicker.gb","gbnim","","","","","","",""
"test/gbstudio_3.2.0.gb","GBDK","2020.4.2.0+","GBStudio","3.2.0","hUGETracker","SuperDisk","",""
"test/gbstudio_3.2.0.gb","GBDK","2020.4.3.0+","GBStudio","3.2.0","hUGETracker","SuperDisk","",""
"test/rand_gbdk_2_1_5.gb","GBDK","2.0.18 - 2.1.5","","","","","",""
"test/rpn_gbdk_1_0.gb","GBDK","1.x - 2.0.x","","","","","",""
"test/rpn_gbdk_2_0_17.gb","GBDK","2.0.x - 2.0.17","","","","","",""
Expand All @@ -29,7 +30,8 @@
"test/template_minimal_gbdk_4_0_5_v2_standard.gb","GBDK","2020.4.0.5 - 2020.4.0.6","","","","","",""
"test/template_minimal_gbdk_4_0_6.gb","GBDK","2020.4.0.5 - 2020.4.0.6","","","","","",""
"test/template_minimal_gbdk_4_1_0.gb","GBDK","2020.4.1.0 - 2020.4.1.1","","","","","",""
"test/template_minimal_gbdk_4_2_0.gb","GBDK","2020.4.2.0+","","","","","",""
"test/template_minimal_gbdk_4_2_0.gb","GBDK","2020.4.2.0","","","","","",""
"test/template_minimal_gbdk_4_2_0_interim.gb","GBDK","2020.4.2.0 interim","","","","","",""
"test/template_minimal_gbdk_4_3_0.gb","GBDK","2020.4.3.0+","","","","","",""
"test/template_zgb_2022.0.gb","GBDK","2020.4.1.0 - 2020.4.1.1","ZGB","2022.0+","hUGETracker","SuperDisk","",""
"test/template_zgb_2023.0.gb","GBDK","2020.4.2.0+","ZGB","2023.0+","hUGETracker","SuperDisk","",""
"test/template_zgb_2023.0.gb","GBDK","2020.4.2.0","ZGB","2023.0+","hUGETracker","SuperDisk","",""

0 comments on commit 614d169

Please sign in to comment.