X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=source%2Fmupen64plus-rsp-hle%2Fsrc%2Falist.c;fp=source%2Fmupen64plus-rsp-hle%2Fsrc%2Falist.c;h=c1418939e25962fc15db60f346fa3d7ce68de6c9;hb=d9e74a6f3c9f96acfb0d64f4bda43f9b9c14984e;hp=0000000000000000000000000000000000000000;hpb=48d52ab5e2ab263c49b77c46ec72a6130d31a51a;p=mupen64plus-pandora.git diff --git a/source/mupen64plus-rsp-hle/src/alist.c b/source/mupen64plus-rsp-hle/src/alist.c new file mode 100644 index 0000000..c141893 --- /dev/null +++ b/source/mupen64plus-rsp-hle/src/alist.c @@ -0,0 +1,82 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-rsp-hle - alist.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2012 Bobby Smiles * + * Copyright (C) 2009 Richard Goedeken * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include "hle.h" +#include "alist_internal.h" + +// FIXME: this decomposition into 3 ABI is not accurate, +// there are a least 9 or 10 different ABI, each with one or a few revisions +// for a total of almost 16 differents audio ucode. +// +// ABI2 in fact is a mix of at least 7 differents ABI which are mostly compatible +// but not totally, that's why there is a isZeldaABI/isMKABI workaround. +// +extern const acmd_callback_t ABI1[0x10]; +extern const acmd_callback_t ABI2[0x20]; +extern const acmd_callback_t ABI3[0x10]; + +/* local functions */ +static void alist_process(const acmd_callback_t abi[], unsigned int abi_size) +{ + u32 inst1, inst2; + unsigned int acmd; + const OSTask_t * const task = get_task(); + + const unsigned int *alist = (unsigned int*)(rsp.RDRAM + task->data_ptr); + const unsigned int * const alist_end = alist + (task->data_size >> 2); + + while (alist != alist_end) + { + inst1 = *(alist++); + inst2 = *(alist++); + + acmd = inst1 >> 24; + + if (acmd < abi_size) + { + (*abi[acmd])(inst1, inst2); + } + else + { + DebugMessage(M64MSG_WARNING, "Invalid ABI command %u", acmd); + } + } +} + +/* global functions */ +void alist_process_ABI1() +{ + alist_process(ABI1, 0x10); +} + +void alist_process_ABI2() +{ + alist_process(ABI2, 0x20); +} + +void alist_process_ABI3() +{ + alist_process(ABI3, 0x10); +} + +