diff --git a/Frameworks/lazyusf/lazyusf/rsp_hle/alist.c b/Frameworks/lazyusf/lazyusf/rsp_hle/alist.c index d7bdcf396..55279e6e8 100644 --- a/Frameworks/lazyusf/lazyusf/rsp_hle/alist.c +++ b/Frameworks/lazyusf/lazyusf/rsp_hle/alist.c @@ -21,16 +21,10 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef _MSC_VER #include -#else -#include "mystdbool.h" -#endif #include #include -#include "common.h" - #include "alist.h" #include "arithmetics.h" #include "audio.h" @@ -409,7 +403,7 @@ void alist_envmix_ge( } count >>= 1; - for (k = 0; k < count; k++) { + for (k = 0; k < count; ++k) { int16_t gains[4]; int16_t* buffers[4]; int16_t l_vol = ramp_step(&ramps[0]); @@ -980,18 +974,16 @@ void alist_iirf( { int16_t *dst = (int16_t*)(hle->alist_buffer + dmemo); int32_t i, prev; - int16_t frame[8]; + int16_t frame[8]; int16_t ibuf[4]; uint16_t index = 7; count = align(count, 16); - #define vmulf(a, b) (((a)*(b)+0x4000)>>15) - if(init) { - for(i = 0; i < 8; i++) + for(i = 0; i < 8; ++i) frame[i] = 0; ibuf[1] = 0; ibuf[2] = 0; @@ -1007,10 +999,10 @@ void alist_iirf( prev = vmulf(table[9], frame[6]) * 2; do { - for(i = 0; i < 8; i++) + for(i = 0; i < 8; ++i) { int32_t accu; - ibuf[index&3] = *alist_s16(hle, dmemi); + ibuf[index&3] = *alist_s16(hle, dmemi); accu = prev + vmulf(table[0], ibuf[index&3]) + vmulf(table[1], ibuf[(index-1)&3]) + vmulf(table[0], ibuf[(index-2)&3]); accu += vmulf(table[8], frame[index]) * 2; @@ -1024,8 +1016,8 @@ void alist_iirf( count -= 0x10; } while (count > 0); - dram_store_u16(hle, &frame[6], address + 4, 4); - dram_store_u16(hle, (int16_t*)&ibuf[(index-2)&3], address+8, 2); - dram_store_u16(hle, (int16_t*)&ibuf[(index-1)&3], address+10, 2); + dram_store_u16(hle, (uint16_t*)&frame[6], address + 4, 4); + dram_store_u16(hle, (uint16_t*)&ibuf[(index-2)&3], address+8, 2); + dram_store_u16(hle, (uint16_t*)&ibuf[(index-1)&3], address+10, 2); } diff --git a/Frameworks/lazyusf/lazyusf/rsp_hle/alist.h b/Frameworks/lazyusf/lazyusf/rsp_hle/alist.h index 716a09af8..f684e76e0 100644 --- a/Frameworks/lazyusf/lazyusf/rsp_hle/alist.h +++ b/Frameworks/lazyusf/lazyusf/rsp_hle/alist.h @@ -22,11 +22,7 @@ #ifndef ALIST_INTERNAL_H #define ALIST_INTERNAL_H -#ifndef _MSC_VER #include -#else -#include "mystdbool.h" -#endif #include #include diff --git a/Frameworks/lazyusf/lazyusf/rsp_hle/alist_audio.c b/Frameworks/lazyusf/lazyusf/rsp_hle/alist_audio.c index 76a544a06..0a1db6e75 100644 --- a/Frameworks/lazyusf/lazyusf/rsp_hle/alist_audio.c +++ b/Frameworks/lazyusf/lazyusf/rsp_hle/alist_audio.c @@ -21,11 +21,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef _MSC_VER #include -#else -#include "mystdbool.h" -#endif #include #include diff --git a/Frameworks/lazyusf/lazyusf/rsp_hle/alist_naudio.c b/Frameworks/lazyusf/lazyusf/rsp_hle/alist_naudio.c index 837ad7705..3575b8910 100644 --- a/Frameworks/lazyusf/lazyusf/rsp_hle/alist_naudio.c +++ b/Frameworks/lazyusf/lazyusf/rsp_hle/alist_naudio.c @@ -21,11 +21,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef _MSC_VER #include -#else -#include "mystdbool.h" -#endif #include #include "common.h" diff --git a/Frameworks/lazyusf/lazyusf/rsp_hle/alist_nead.c b/Frameworks/lazyusf/lazyusf/rsp_hle/alist_nead.c index 4e3f28c28..35fd58090 100644 --- a/Frameworks/lazyusf/lazyusf/rsp_hle/alist_nead.c +++ b/Frameworks/lazyusf/lazyusf/rsp_hle/alist_nead.c @@ -21,11 +21,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef _MSC_VER #include -#else -#include "mystdbool.h" -#endif #include #include "common.h" diff --git a/Frameworks/lazyusf/lazyusf/rsp_hle/arithmetics.h b/Frameworks/lazyusf/lazyusf/rsp_hle/arithmetics.h index 3d0edf6fb..529293d25 100644 --- a/Frameworks/lazyusf/lazyusf/rsp_hle/arithmetics.h +++ b/Frameworks/lazyusf/lazyusf/rsp_hle/arithmetics.h @@ -24,6 +24,8 @@ #include +#include "common.h" + static inline int16_t clamp_s16(int_fast32_t x) { x = (x < INT16_MIN) ? INT16_MIN: x; @@ -32,5 +34,10 @@ static inline int16_t clamp_s16(int_fast32_t x) return x; } +static inline int32_t vmulf(int16_t x, int16_t y) +{ + return (((int32_t)(x))*((int32_t)(y))+0x4000)>>15; +} + #endif diff --git a/Frameworks/lazyusf/lazyusf/rsp_hle/hle.c b/Frameworks/lazyusf/lazyusf/rsp_hle/hle.c index 490274ddd..7ee5d0484 100644 --- a/Frameworks/lazyusf/lazyusf/rsp_hle/hle.c +++ b/Frameworks/lazyusf/lazyusf/rsp_hle/hle.c @@ -21,11 +21,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef _MSC_VER #include -#else -#include "mystdbool.h" -#endif #include #ifdef ENABLE_TASK_DUMP diff --git a/Frameworks/lazyusf/lazyusf/rsp_hle/musyx.c b/Frameworks/lazyusf/lazyusf/rsp_hle/musyx.c index 6d6fd1b08..36b7b7c5f 100644 --- a/Frameworks/lazyusf/lazyusf/rsp_hle/musyx.c +++ b/Frameworks/lazyusf/lazyusf/rsp_hle/musyx.c @@ -19,11 +19,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef _MSC_VER #include -#else -#include "mystdbool.h" -#endif #include #include #include diff --git a/Frameworks/lazyusf/lazyusf/rsp_hle/mystdbool.h b/Frameworks/lazyusf/lazyusf/rsp_hle/mystdbool.h deleted file mode 100644 index e9ab65a0e..000000000 --- a/Frameworks/lazyusf/lazyusf/rsp_hle/mystdbool.h +++ /dev/null @@ -1,39 +0,0 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Mupen64plus-rsp-hle - alist_internal.h * - * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * - * Copyright (C) 2014 Bobby Smiles * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -#ifndef _MYSTDBOOL_H_ -#define _MYSTDBOOL_H_ - -#pragma once - -typedef unsigned char my_bool; -enum { my_b_false = 0 }; -enum { my_b_true = 1 }; - -#undef bool -#undef true -#undef false - -#define bool my_bool -#define true my_b_true -#define false my_b_false - -#endif