Merge branch 'master' of https://github.com/GriffinRichards/pokefirered into clone-union

This commit is contained in:
GriffinR
2022-08-10 13:48:30 -04:00
1146 changed files with 40526 additions and 38156 deletions
+8 -8
View File
@@ -6,21 +6,21 @@
#include "global.h"
#include "huff.h"
static int cmp_tree(const void * a0, const void * b0) {
static int cmp_tree(const void *a0, const void *b0) {
return ((struct HuffData *)a0)->value - ((struct HuffData *)b0)->value;
}
typedef int (*cmpfun)(const void *, const void *);
int msort_r(void * data, size_t count, size_t size, cmpfun cmp, void * buffer) {
int msort_r(void *data, size_t count, size_t size, cmpfun cmp, void *buffer) {
/*
* Out-of-place mergesort (stable sort)
* Returns 1 on success, 0 on failure
*/
void * leftPtr;
void * rightPtr;
void * leftEnd;
void * rightEnd;
void *leftPtr;
void *rightPtr;
void *leftEnd;
void *rightEnd;
int i;
switch (count) {
@@ -85,8 +85,8 @@ int msort_r(void * data, size_t count, size_t size, cmpfun cmp, void * buffer) {
return 1;
}
int msort(void * data, size_t count, size_t size, cmpfun cmp) {
void * buffer = malloc(count * size);
int msort(void *data, size_t count, size_t size, cmpfun cmp) {
void *buffer = malloc(count * size);
if (buffer == NULL) return 0;
int result = msort_r(data, count, size, cmp, buffer);
free(buffer);
+2 -1
View File
@@ -18,6 +18,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#include <cmath>
#include <cstdio>
#include <cstdarg>
#include <cstring>
@@ -503,7 +504,7 @@ void PrintAgbTrack(std::vector<Event>& events)
ResetTrackVars();
break;
case EventType::Tempo:
PrintByte("TEMPO , %u*%s_tbs/2", 60000000 / event.param2, g_asmLabel.c_str());
PrintByte("TEMPO , %u*%s_tbs/2", static_cast<int>(round(60000000.0f / static_cast<float>(event.param2))), g_asmLabel.c_str());
PrintWait(event.time);
break;
case EventType::InstrumentChange: