From bd8c7492923f2abeea473dbd50d5661c7e41c205 Mon Sep 17 00:00:00 2001 From: Chris Date: Sun, 8 Oct 2023 20:14:14 -0500 Subject: [PATCH 1/4] Updated version number and help text --- src/help.c | 59 +++++++++++++++++++++++++++++++++++++++++++++---- src/id.h | 1 + src/resource.rc | 11 +++++---- 3 files changed, 63 insertions(+), 8 deletions(-) diff --git a/src/help.c b/src/help.c index 1e20311..8bcf68c 100644 --- a/src/help.c +++ b/src/help.c @@ -1,6 +1,8 @@ #define WIN32_LEAN_AND_MEAN #include +#include #include "ebmusv2.h" +#include "id.h" #define IDC_HELPTEXT 1 @@ -141,10 +143,59 @@ LRESULT CALLBACK CodeListWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPa return 0; } +static WNDPROC HomepageLinkWndProc; +static LRESULT CALLBACK HomepageLinkProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { + switch (uMsg) { + case WM_SETCURSOR: + HCURSOR hCursor = LoadCursor(NULL, IDC_HAND); + if (NULL == hCursor) hCursor = LoadCursor(NULL, IDC_ARROW); + SetCursor(hCursor); + return TRUE; + } + + return CallWindowProc(HomepageLinkWndProc, hWnd, uMsg, wParam, lParam); +} + BOOL CALLBACK AboutDlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { - if (uMsg == WM_COMMAND && LOWORD(wParam) == IDOK) { - EndDialog(hWnd, IDOK); - return TRUE; + switch(uMsg) { + case WM_INITDIALOG: + HWND hwndLink = GetDlgItem(hWnd, IDC_HOMEPAGELINK); + HomepageLinkWndProc = (WNDPROC)SetWindowLongPtr(hwndLink, GWLP_WNDPROC, (LONG_PTR)HomepageLinkProc); + + // Set font to underlined + HFONT hFont = (HFONT)SendMessage(hwndLink, WM_GETFONT, 0, 0); + LOGFONT lf; + GetObject(hFont, sizeof(lf), &lf); + lf.lfUnderline = TRUE; + HFONT hUnderlinedFont = CreateFontIndirect(&lf); + SendMessage(hwndLink, WM_SETFONT, (WPARAM)hUnderlinedFont, FALSE); + SetTextColor(hwndLink, RGB(0, 0, 192)); + + break; + case WM_COMMAND: + switch(LOWORD(wParam)) { + case IDC_HOMEPAGELINK: + if (HIWORD(wParam) == BN_CLICKED) { + ShellExecute(hWnd, "open", "https://github.com/PKHackers/ebmused/", NULL, NULL, SW_SHOWNORMAL); + } + break; + case IDOK: + EndDialog(hWnd, IDOK); + break; + } + break; + case WM_CTLCOLORSTATIC: + if ((HWND)lParam == GetDlgItem(hWnd, IDC_HOMEPAGELINK)) + { + SetBkMode((HDC)wParam, TRANSPARENT); + SetTextColor((HDC)wParam, RGB(0, 0, 192)); + return (BOOL)GetSysColorBrush(COLOR_3DFACE); + } + return FALSE; + break; + default: + return FALSE; } - return FALSE; + + return TRUE; } diff --git a/src/id.h b/src/id.h index 1c70b00..e6257a7 100644 --- a/src/id.h +++ b/src/id.h @@ -46,6 +46,7 @@ #define IDC_BUFSIZE 4 #define IDD_ABOUT 2 +#define IDC_HOMEPAGELINK 3 #define IDD_TRANSPOSE 3 #define IDC_TRANSPOSE_OFF 3 diff --git a/src/resource.rc b/src/resource.rc index d540b8c..3e58a74 100644 --- a/src/resource.rc +++ b/src/resource.rc @@ -123,14 +123,17 @@ BEGIN PUSHBUTTON "&Cancel", IDCANCEL, 51, 43, 44, 14 END -IDD_ABOUT DIALOG 0, 0, 220, 42 +IDD_ABOUT DIALOG 0, 0, 180, 70 STYLE 0 CAPTION "About" FONT 8, "MS Shell Dlg" BEGIN - LTEXT "EarthBound Music Editor v2.4.0\r\nReleased August 27, 2021\r\nProgrammed by Goplat\r\nAdditional programming by BlueStone, phoenixbound, and vince94\r\n", 0, - 5, 5, 215, 55 - DEFPUSHBUTTON "Fuzzy Pickles!", IDOK, 130, 8, 60, 14 + LTEXT "EarthBound Music Editor\r\n" + "v2.5.0\r\n", 0, + 5, 5, 170, 55 + CONTROL "https://github.com/PKHackers/ebmused/", IDC_HOMEPAGELINK, "Static", SS_NOTIFY | WS_GROUP | WS_TABSTOP, + 5, 30, 170, 8 + DEFPUSHBUTTON "&OK", IDOK, 125, 51, 50, 14 END IDD_TRANSPOSE DIALOG 0, 0, 98, 43 From a15f98a9988afc5a9d406d4ded962c30d1c28c23 Mon Sep 17 00:00:00 2001 From: Chris Date: Sun, 8 Oct 2023 21:09:22 -0500 Subject: [PATCH 2/4] Corrected labels --- src/bgmlist.c | 16 ++++++++-------- src/help.c | 2 +- src/main.c | 4 ++-- src/packlist.c | 4 ++-- src/resource.rc | 6 +++--- src/tracker.c | 12 ++++++------ 6 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/bgmlist.c b/src/bgmlist.c index 77ddd25..a6e09ec 100644 --- a/src/bgmlist.c +++ b/src/bgmlist.c @@ -50,15 +50,15 @@ static const struct control_desc bgm_list_controls[] = { { "Edit", 440,130, 25, 20, NULL, IDC_BGM_IPACK_2, WS_BORDER }, //(ROM) Secondary Pack textbox { "Edit", 530,130, 25, 20, NULL, IDC_CUR_IPACK_1, WS_BORDER }, //(Current) Main Pack textbox { "Edit", 560,130, 25, 20, NULL, IDC_CUR_IPACK_2, WS_BORDER }, //(Current) Secondary Pack textbox - { "Static", 325,157, 80, 20, "Song pack:", 0, SS_RIGHT }, - { "Edit", 410,155, 25, 20, NULL, IDC_BGM_SPACK, WS_BORDER }, //(ROM) Song Pack textbox - { "Edit", 530,155, 25, 20, NULL, IDC_CUR_SPACK, WS_BORDER }, //(Current) Song Pack textbox - { "Static", 325,182, 80, 20, "Song to play:", 0, SS_RIGHT }, - { "Edit", 410,180, 55, 20, NULL, IDC_BGM_SPCADDR, WS_BORDER }, //(ROM) Song ARAM textbox - {"ComboBox",530,180, 55, 200, NULL, IDC_CUR_SPCADDR, CBS_DROPDOWNLIST | WS_VSCROLL }, //(Current) Song ARAM ComboBox + { "Static", 325,157, 80, 20, "Music pack:", 0, SS_RIGHT }, + { "Edit", 410,155, 25, 20, NULL, IDC_BGM_SPACK, WS_BORDER }, //(ROM) Music Pack textbox + { "Edit", 530,155, 25, 20, NULL, IDC_CUR_SPACK, WS_BORDER }, //(Current) Music Pack textbox + { "Static", 325,182, 80, 20, "Start address:", 0, SS_RIGHT }, + { "Edit", 410,180, 55, 20, NULL, IDC_BGM_SPCADDR, WS_BORDER }, //(ROM) Music ARAM textbox + {"ComboBox",530,180, 55, 200, NULL, IDC_CUR_SPCADDR, CBS_DROPDOWNLIST | WS_VSCROLL }, //(Current) Music ARAM ComboBox { "Button", 485,130, 25, 30, "-->", IDC_LOAD_BGM, 0 }, { "Button", 485,170, 25, 30, "<--", IDC_CHANGE_BGM, 0 }, - { "Button", 353,205,112, 20, "Update Song Table", IDC_SAVE_INFO, 0 }, + { "Button", 353,205,112, 20, "Update BGM Table", IDC_SAVE_INFO, 0 }, { "Edit", 320,250,230, 20, NULL, IDC_SEARCH_TEXT, WS_BORDER }, { "Button", 560,250, 60, 20, "Search", IDC_SEARCH, 0 }, { "Edit", 320,275,230, 20, NULL, IDC_TITLE, WS_BORDER | ES_AUTOHSCROLL }, @@ -253,7 +253,7 @@ write_error: MessageBox2(strerror(errno), "Save", MB_ICONERROR); song_address[selected_bgm] = new_spc_address; fflush(rom); sprintf(buf, "Info for BGM %02X saved!", selected_bgm + 1); - MessageBox2(buf, "Song Table Updated", MB_OK); + MessageBox2(buf, "BGM Table Updated", MB_OK); break; } case IDC_CUR_IPACK_1: diff --git a/src/help.c b/src/help.c index 8bcf68c..4ddb9f7 100644 --- a/src/help.c +++ b/src/help.c @@ -103,7 +103,7 @@ const char help_text[] = { "[F8 time lvol rvol]\r\n" " Slide echo volumes (not implemented)\r\n" "[F9 start length note]\r\n" -" Note portamento. This goes after a note and only affects that note.\r\n" +" Pitch bend\r\n" "[FA instrument]\r\n" " Set the first instrument to be used by CA-DF codes\r\n" " In EarthBound, this is always set to the first instrument of the\r\n" diff --git a/src/main.c b/src/main.c index 235bc00..f140461 100644 --- a/src/main.c +++ b/src/main.c @@ -53,9 +53,9 @@ static const char *const tab_class[NUM_TABS] = { "ebmused_packs" }; static const char *const tab_name[NUM_TABS] = { - "Song Table", + "BGM Table", "Instruments", - "Sequence Editor", + "Tracker", "Data Packs" }; LRESULT CALLBACK BGMListWndProc(HWND, UINT, WPARAM, LPARAM); diff --git a/src/packlist.c b/src/packlist.c index cfaa8d9..a5ac712 100644 --- a/src/packlist.c +++ b/src/packlist.c @@ -64,8 +64,8 @@ static const struct control_desc pack_list_controls[] = { //Buttons on the right for modifying the pack { "Button", 290,-55, 118, 20, "Save Changes", IDC_PACK_SAVE, WS_DISABLED }, //Same as Ctrl-S I think { "Button", 410,-55, 118, 20, "Revert", IDC_PACK_RESET, WS_DISABLED }, //Wipes all changes - { "Button", 290,-30, 78, 20, "New Song", IDC_SONG_NEW, WS_DISABLED }, //adds a new song entry in the current modified pack - { "Button", 370,-30, 78, 20, "Delete Song", IDC_SONG_DEL, WS_DISABLED }, //Deleltes the currently-selected song + { "Button", 290,-30, 78, 20, "New BGM", IDC_SONG_NEW, WS_DISABLED }, //adds a new song entry in the current modified pack + { "Button", 370,-30, 78, 20, "Delete BGM", IDC_SONG_DEL, WS_DISABLED }, //Deleltes the currently-selected song { "Button", 450,-30, 38, 20, "Up", IDC_SONG_UP, WS_DISABLED }, //Moves the currently-selected song { "Button", 490,-30, 38, 20, "Down", IDC_SONG_DOWN, WS_DISABLED }, diff --git a/src/resource.rc b/src/resource.rc index 3e58a74..3aee862 100644 --- a/src/resource.rc +++ b/src/resource.rc @@ -11,8 +11,8 @@ BEGIN MENUITEM "&Save All\tCtrl+S", ID_SAVE_ALL, GRAYED MENUITEM "&Close", ID_CLOSE, GRAYED MENUITEM SEPARATOR - MENUITEM "&Import Song...", ID_IMPORT//, GRAYED - MENUITEM "&Export Song...", ID_EXPORT//, GRAYED + MENUITEM "&Import EBM...", ID_IMPORT//, GRAYED + MENUITEM "&Export EBM...", ID_EXPORT//, GRAYED MENUITEM "Import S&PC...", ID_IMPORT_SPC MENUITEM "Expo&rt SPC...", ID_EXPORT_SPC//, GRAYED MENUITEM SEPARATOR @@ -48,7 +48,7 @@ BEGIN BEGIN MENUITEM "&Sound Options...", ID_OPTIONS END - POPUP "&Song" + POPUP "&Playback" BEGIN MENUITEM "&Play\tCtrl+P", ID_PLAY MENUITEM "&Stop\tEsc", ID_STOP, GRAYED diff --git a/src/tracker.c b/src/tracker.c index 9e3c3a2..3f9dd15 100644 --- a/src/tracker.c +++ b/src/tracker.c @@ -32,12 +32,12 @@ static char cs_title[] = "Channel state (0)"; static const struct control_desc editor_controls[] = { // Upper - { "Static", 10, 13, 42, 20, "Patterns:", 0, 0 }, //"Order" label - { "ebmused_order", 56, 10,-420,20, NULL, IDC_ORDER, WS_BORDER }, //Pattern order list - { "Static", -360, 13, 55, 20, "Loop Song:", IDC_REP_CAPTION, 0 }, - { "Edit", -303, 10, 30, 20, NULL, IDC_REPEAT, WS_BORDER | ES_NUMBER }, //Loop textbox - { "Static", -266, 13, 40, 20, "Position:", IDC_REP_POS_CAPTION, 0 }, - { "Edit", -223, 10, 30, 20, NULL, IDC_REPEAT_POS, WS_BORDER | ES_NUMBER }, //Loop position textbox + { "Static", 10, 13, 35, 20, "Order:", 0, 0 }, // "Order" label + { "ebmused_order", 50, 10,-420,20, NULL, IDC_ORDER, WS_BORDER }, // Pattern order list + { "Static", -363, 13, 60, 20, "Loop Count:", IDC_REP_CAPTION, 0 }, + { "Edit", -303, 10, 30, 20, NULL, IDC_REPEAT, WS_BORDER | ES_NUMBER }, // Loop textbox + { "Static", -268, 13, 45, 20, "Loop To:", IDC_REP_POS_CAPTION, 0 }, + { "Edit", -223, 10, 30, 20, NULL, IDC_REPEAT_POS, WS_BORDER | ES_NUMBER }, // Loop position textbox { "Static", -187, 13, 45, 20, "Pattern:", IDC_PAT_LIST_CAPTION, 0 }, { "ComboBox", -147, 9, 40,300, NULL, IDC_PAT_LIST, CBS_DROPDOWNLIST | WS_VSCROLL }, { "Button", -100, 9, 30, 20, "Add", IDC_PAT_ADD, 0 }, From b404d4ac9a04a718293040d30b698bed8ec9c8bb Mon Sep 17 00:00:00 2001 From: Chris Date: Mon, 9 Oct 2023 00:02:24 -0500 Subject: [PATCH 3/4] Removed some magic numbers --- src/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index a8e0318..d9b3be7 100644 --- a/src/main.c +++ b/src/main.c @@ -20,6 +20,7 @@ #include #include #include +#include #include "ebmusv2.h" #include "misc.h" @@ -590,7 +591,7 @@ static BOOL validate_playable(void) { LRESULT CALLBACK MainWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch (uMsg) { - case 0x3BB: case 0x3BC: case 0x3BD: // MM_WOM_OPEN, CLOSE, DONE + case MM_WOM_OPEN: case MM_WOM_CLOSE: case MM_WOM_DONE: winmm_message(uMsg); break; case WM_CREATE: { From 29ea024cf76fd3b3ddfb26e0bd9cfc376d06e88b Mon Sep 17 00:00:00 2001 From: Chris Date: Mon, 9 Oct 2023 00:06:59 -0500 Subject: [PATCH 4/4] Updated manifest version number --- src/ebmused.exe.manifest | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ebmused.exe.manifest b/src/ebmused.exe.manifest index ca5f50f..6852f54 100644 --- a/src/ebmused.exe.manifest +++ b/src/ebmused.exe.manifest @@ -1,7 +1,7 @@