diff --git a/game_english/licence.txt b/game_english/licence.txt index d88d2018..33b0d67d 100644 --- a/game_english/licence.txt +++ b/game_english/licence.txt @@ -54,9 +54,27 @@ Special Thanks to... = CSE2 = ======== -Currently we don't have a licence for our code. But, considering CSE2 is -intended for modders, you can probably get away with using it for that without -any of us getting mad over it. - -It might be worth crediting us, just to be safe - I (Clownacy) don't mind, but -GabrielRavier does. +MIT License + +Copyright (c) 2019 Regan "cuckydev" Green +Copyright (c) 2019-2020 Clownacy +Copyright (c) 2019-2020 Gabriel Ravier +Copyright (c) 2020 Cameron Cawley + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/game_japanese/licence.txt b/game_japanese/licence.txt index eeb56b52..76ed13b0 100644 --- a/game_japanese/licence.txt +++ b/game_japanese/licence.txt @@ -15,9 +15,27 @@ this code defaults to 'All Rights Reserved'. = CSE2 = ======== -Currently we don't have a licence for our code. But, considering CSE2 is -intended for modders, you can probably get away with using it for that without -any of us getting mad over it. +MIT License -It might be worth crediting us, just to be safe - I (Clownacy) don't mind, but -GabrielRavier does. +Copyright (c) 2019 Regan "cuckydev" Green +Copyright (c) 2019-2020 Clownacy +Copyright (c) 2019-2020 Gabriel Ravier +Copyright (c) 2020 Cameron Cawley + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/src/Backends/Audio/SoftwareMixer/3DS.cpp b/src/Backends/Audio/SoftwareMixer/3DS.cpp index 2cded36f..a8fd1a3e 100644 --- a/src/Backends/Audio/SoftwareMixer/3DS.cpp +++ b/src/Backends/Audio/SoftwareMixer/3DS.cpp @@ -14,6 +14,8 @@ #define FRAMES_PER_BUFFER (SAMPLE_RATE / 30) // 33.333 milliseconds #define MIN(a, b) ((a) < (b) ? (a) : (b)) +#define MAX(a, b) ((a) > (b) ? (a) : (b)) +#define CLAMP(a, min, max) MIN(MAX((a), (min)), (max)) static void (*parent_callback)(long *stream, size_t frames_total); @@ -134,9 +136,11 @@ unsigned long SoftwareMixerBackend_Init(void (*callback)(long *stream, size_t fr LightEvent_Init(&audio_thread_event, RESET_ONESHOT); - audio_thread_die = false; + s32 priority = 0x30; + svcGetThreadPriority(&priority, CUR_THREAD_HANDLE); - audio_thread = threadCreate(AudioThread, NULL, 32 * 1024, 0x18, -1, false); + audio_thread_die = false; + audio_thread = threadCreate(AudioThread, NULL, 32 * 1024, CLAMP(priority - 1, 0x18, 0x3F), -1, false); return SAMPLE_RATE; } diff --git a/src/Backends/Rendering/SDLTexture.cpp b/src/Backends/Rendering/SDLTexture.cpp index 7463e0c0..8685aee7 100644 --- a/src/Backends/Rendering/SDLTexture.cpp +++ b/src/Backends/Rendering/SDLTexture.cpp @@ -245,12 +245,11 @@ void RenderBackend_UploadSurface(RenderBackend_Surface *surface, const unsigned } const unsigned char *src_pixel = pixels; + unsigned char *buffer_pointer = buffer; // Pre-multiply the colour channels with the alpha, so blending works correctly for (size_t y = 0; y < height; ++y) { - unsigned char *buffer_pointer = &buffer[y * width * 4]; - for (size_t x = 0; x < width; ++x) { *buffer_pointer++ = (src_pixel[0] * src_pixel[3]) / 0xFF;