From d77fd770f436747154fdb19a1efd62b373b750b2 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Thu, 21 Mar 2024 13:43:14 -0500 Subject: [PATCH 1/5] 5E01: fix 12xx --- .github/issue_template.md | 21 +++++++++++++++------ CONTRIBUTING.md | 26 +++++++++++++++++++------- src/engine/platform/nes.cpp | 2 ++ 3 files changed, 36 insertions(+), 13 deletions(-) diff --git a/.github/issue_template.md b/.github/issue_template.md index a61840fb9..60746d3c3 100644 --- a/.github/issue_template.md +++ b/.github/issue_template.md @@ -1,7 +1,12 @@ -# IMPORTANT NOTICE +# EXTREMELY IMPORTANT NOTICE - PLEASE **READ**!!!!!!! -1. this section is exclusively for ISSUES related to Furnace (bugs, major annoyances and others). -2. this section is NOT for Suggestions, Questions, Showcase or any other Discussions that do not meet the criteria and definition of an ISSUE. +BY SUBMITTING AN ISSUE, YOU HEREBY AGREE TO COMPLY WITH THESE TERMS. +FAILURE TO DO SO MAY RESULT IN YOUR ISSUE BEING DECLARED VOID. + +**ADDITIONALLY, FAILURE TO COMPLY WITH POINTS 1 AND 2 WILL RESULT IN THE INABILITY TO ISSUE FURTHER ISSUE REPORTS.** + +1. this section is exclusively for ISSUES related to Furnace (bugs, major annoyances and others). ONLY THINGS THAT COUNT AS **ISSUES** (ad pedem litterae). +2. **THIS SECTION IS NOT FOR SUGGESTIONS, REQUESTS, QUESTIONS, SHOWCASE OR ANY OTHER DISCUSSIONS THAT DO NOT MEET THE CRITERIA AND DEFINITION OF AN __ISSUE__.** - see the Discussions section if you wish to submit these. 3. check whether your issue has been reported already. - go to the Issues section, and use the search bar that appears on top of the Issues list. @@ -33,7 +38,11 @@ - Linux: `~/.config/furnace/furnace.log` - make sure to remove any personal information for privacy reasons. -BY SUBMITTING A TICKET, YOU HEREBY AGREE TO COMPLY WITH THESE TERMS. -FAILURE TO DO SO MAY RESULT IN YOUR TICKET BEING DECLARED VOID. +BY SUBMITTING AN ISSUE, YOU HEREBY AGREE TO COMPLY WITH THESE TERMS. +FAILURE TO DO SO MAY RESULT IN YOUR ISSUE BEING DECLARED VOID. -***END OF NOTICE*** --- REMOVE THIS NOTICE AFTER READING! +**ADDITIONALLY, FAILURE TO COMPLY WITH POINTS 1 AND 2 WILL RESULT IN THE INABILITY TO ISSUE FURTHER ISSUE REPORTS.** + +***END OF NOTICE*** +PLEASE REMOVE THIS NOTICE AFTER READING. +FAILURE TO REMOVE THIS NOTICE IS NEGLIGENCE. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7fd671d5d..922996555 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,7 +2,19 @@ contributions to Furnace are welcome! -# Getting ready +# Issue reports + +if you find an issue with Furnace, see the Issues section. + +# Suggestions and other types of discussions + +see the Discussions section. + +**DO NOT USE THE ISSUES SECTION FOR THESE - it is only for ISSUES.** + +# Other + +## Getting ready log into your Github account, and click the Fork button in the header of the project's page. @@ -14,9 +26,9 @@ git clone git@github.com:USERNAME/furnace.git (replace `USERNAME` with your username) -# Working +## Working -## Code +### Code bug fixes, improvements and several other things accepted. @@ -84,11 +96,11 @@ additional guidelines: - on a switch block, **always** put `default` last and not in any other position. - I have fear of some C/C++ compilers ignoring the rest of cases upon hitting default. -## Do NOT Force-Push after submitting Pull Request +### Do NOT Force-Push after submitting Pull Request if you do so, your pull request will be closed. -## Demo Songs +### Demo Songs just put your demo song in `demos/`! be noted there are some guidelines: @@ -100,11 +112,11 @@ just put your demo song in `demos/`! be noted there are some guidelines: - Pong: it is a joke system. - the song shall be in Furnace file format. -# Finishing +## Finishing after you've done your modifications, commit the changes and push. then open your fork on GitHub and send a pull request. -# I don't know how to use Git but I want to contribute with a demo song +## I don't know how to use Git but I want to contribute with a demo song you can also contact me directly! [find me here.](https://tildearrow.org/?p=contact) diff --git a/src/engine/platform/nes.cpp b/src/engine/platform/nes.cpp index 6ccfb5c11..d8c922cda 100644 --- a/src/engine/platform/nes.cpp +++ b/src/engine/platform/nes.cpp @@ -608,6 +608,8 @@ int DivPlatformNES::dispatch(DivCommand c) { chan[c.chan].duty=c.value; if (c.chan==3) { // noise chan[c.chan].freqChanged=true; + } else if (c.chan==2 && isE) { + rWrite(0x4000+9,chan[c.chan].duty); } else if (c.chan<2) { rWrite(0x4000+c.chan*4,(chan[c.chan].active?((chan[c.chan].envMode<<4)|chan[c.chan].outVol):0x30)|((chan[c.chan].duty&3)<<6)); } From e4cc48fe3f41973d5282ded2088e68eaa5ddbf90 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Fri, 22 Mar 2024 02:20:16 -0500 Subject: [PATCH 2/5] GUI: fix "I'm feeling lucky" button --- src/gui/newSong.cpp | 41 ++++++++++++++++++++++++++++++++++------- 1 file changed, 34 insertions(+), 7 deletions(-) diff --git a/src/gui/newSong.cpp b/src/gui/newSong.cpp index 08b30d7ae..79ea9e9a8 100644 --- a/src/gui/newSong.cpp +++ b/src/gui/newSong.cpp @@ -201,16 +201,43 @@ void FurnaceGUI::drawNewSong() { if (ImGui::Button("I'm feeling lucky")) { if (sysCategories.size()==0) { + showError("no categories available! what in the world."); ImGui::CloseCurrentPopup(); } else { - FurnaceGUISysCategory* newSystemCat=&sysCategories[rand()%sysCategories.size()]; - if (newSystemCat->systems.size()==0) { + int tries=0; + for (tries=0; tries<50; tries++) { + FurnaceGUISysCategory* newSystemCat=&sysCategories[rand()%sysCategories.size()]; + if (newSystemCat->systems.empty()) { + continue; + } else { + unsigned int selection=rand()%newSystemCat->systems.size(); + + if (newSystemCat->systems[selection].orig.empty() && newSystemCat->systems[selection].subDefs.empty()) continue; + if (!newSystemCat->systems[selection].subDefs.empty()) { + if (rand()%2) { + unsigned int subSel=rand()%newSystemCat->systems[selection].subDefs.size(); + nextDesc=newSystemCat->systems[selection].subDefs[subSel].definition; + nextDescName=newSystemCat->systems[selection].subDefs[subSel].name; + accepted=true; + } else { + if (newSystemCat->systems[selection].orig.empty()) continue; + nextDesc=newSystemCat->systems[selection].definition; + nextDescName=newSystemCat->systems[selection].name; + accepted=true; + } + } else { + nextDesc=newSystemCat->systems[selection].definition; + nextDescName=newSystemCat->systems[selection].name; + accepted=true; + } + } + + if (accepted) break; + } + + if (tries>=50) { + showError("it appears you're extremely lucky today!"); ImGui::CloseCurrentPopup(); - } else { - unsigned int selection=rand()%newSystemCat->systems.size(); - nextDesc=newSystemCat->systems[selection].definition; - nextDescName=newSystemCat->systems[selection].name; - accepted=true; } } } From d35ac87ff66a4cfa8bb07ad44fb979b6e6d62947 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Fri, 22 Mar 2024 02:21:33 -0500 Subject: [PATCH 3/5] NDS: rename --- src/engine/sysDef.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/engine/sysDef.cpp b/src/engine/sysDef.cpp index e3cbc2c94..0b1be7a55 100644 --- a/src/engine/sysDef.cpp +++ b/src/engine/sysDef.cpp @@ -2056,7 +2056,7 @@ void DivEngine::registerSystems() { ); sysDefs[DIV_SYSTEM_NDS]=new DivSysDef( - "NDS", NULL, 0xd6, 0, 16, false, true, 0, false, (1U< Date: Fri, 22 Mar 2024 02:23:04 -0500 Subject: [PATCH 4/5] GUI: rename NDS ins type --- src/gui/guiConst.cpp | 2 +- src/gui/settings.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/guiConst.cpp b/src/gui/guiConst.cpp index aee901f4d..08b84dc1f 100644 --- a/src/gui/guiConst.cpp +++ b/src/gui/guiConst.cpp @@ -179,7 +179,7 @@ const char* insTypes[DIV_INS_MAX+1][3]={ {"PowerNoise (noise)",ICON_FUR_NOISE,ICON_FUR_INS_POWERNOISE}, {"PowerNoise (slope)",ICON_FUR_SAW,ICON_FUR_INS_POWERNOISE_SAW}, {"Dave",ICON_FA_BAR_CHART,ICON_FUR_INS_DAVE}, - {"NDS",ICON_FA_BAR_CHART,ICON_FUR_INS_NDS}, + {"Nintendo DS",ICON_FA_BAR_CHART,ICON_FUR_INS_NDS}, {"GBA DMA",ICON_FA_GAMEPAD,ICON_FUR_INS_GBA_DMA}, {"GBA MinMod",ICON_FA_VOLUME_UP,ICON_FUR_INS_GBA_MINMOD}, {NULL,ICON_FA_QUESTION,ICON_FA_QUESTION} diff --git a/src/gui/settings.cpp b/src/gui/settings.cpp index ea069044a..7a0cb3670 100644 --- a/src/gui/settings.cpp +++ b/src/gui/settings.cpp @@ -3563,7 +3563,7 @@ void FurnaceGUI::drawSettings() { UI_COLOR_CONFIG(GUI_COLOR_INSTR_POWERNOISE,"PowerNoise (noise)"); UI_COLOR_CONFIG(GUI_COLOR_INSTR_POWERNOISE_SLOPE,"PowerNoise (slope)"); UI_COLOR_CONFIG(GUI_COLOR_INSTR_DAVE,"Dave"); - UI_COLOR_CONFIG(GUI_COLOR_INSTR_NDS,"NDS"); + UI_COLOR_CONFIG(GUI_COLOR_INSTR_NDS,"Nintendo DS"); UI_COLOR_CONFIG(GUI_COLOR_INSTR_GBA_DMA,"GBA DMA"); UI_COLOR_CONFIG(GUI_COLOR_INSTR_GBA_MINMOD,"GBA MinMod"); UI_COLOR_CONFIG(GUI_COLOR_INSTR_UNKNOWN,"Other/Unknown"); From 0d486c18d069cc5669385dec735adae2b5d7d1f9 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Fri, 22 Mar 2024 03:08:53 -0500 Subject: [PATCH 5/5] NDS: decrease the clock divider --- src/engine/platform/nds.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/engine/platform/nds.cpp b/src/engine/platform/nds.cpp index 86135f0ae..cc5146a94 100644 --- a/src/engine/platform/nds.cpp +++ b/src/engine/platform/nds.cpp @@ -23,7 +23,7 @@ #include #define CHIP_DIVIDER 32 -#define CLOCK_DIVIDER 512 // for match to output rate +#define CLOCK_DIVIDER 128 // for match to output rate #define rRead8(a) (nds.read8(a)) #define rWrite8(a,v) {if(!skipRegisterWrites) {nds.write8((a),(v)); regPool[(a)]=(v); if(dumpWrites) addWrite((a),(v)); }}