Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2.5.0 release #56

Merged
merged 5 commits into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/bgmlist.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,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 },
Expand Down Expand Up @@ -254,7 +254,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:
Expand Down
2 changes: 1 addition & 1 deletion src/ebmused.exe.manifest
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
<assemblyIdentity
version="2.4.0.0"
version="2.5.0.0"
processorArchitecture="*"
name="EBMusEd"
type="win32"
Expand Down
61 changes: 56 additions & 5 deletions src/help.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <shellapi.h>
#include "ebmusv2.h"
#include "id.h"
#include "misc.h"

#define IDC_HELPTEXT 1
Expand Down Expand Up @@ -102,7 +104,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"
Expand Down Expand Up @@ -142,10 +144,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;
}
1 change: 1 addition & 0 deletions src/id.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 4 additions & 3 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <windows.h>
#include <commdlg.h>
#include <commctrl.h>
#include <mmsystem.h>
#include "ebmusv2.h"
#include "misc.h"

Expand Down Expand Up @@ -54,9 +55,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);
Expand Down Expand Up @@ -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: {
Expand Down
4 changes: 2 additions & 2 deletions src/packlist.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,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 },

Expand Down
17 changes: 10 additions & 7 deletions src/resource.rc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions src/tracker.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,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 },
Expand Down