1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2 * Mupen64plus-rsp-hle - alist.c *
3 * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
4 * Copyright (C) 2012 Bobby Smiles *
5 * Copyright (C) 2009 Richard Goedeken *
6 * Copyright (C) 2002 Hacktarux *
8 * This program is free software; you can redistribute it and/or modify *
9 * it under the terms of the GNU General Public License as published by *
10 * the Free Software Foundation; either version 2 of the License, or *
11 * (at your option) any later version. *
13 * This program is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16 * GNU General Public License for more details. *
18 * You should have received a copy of the GNU General Public License *
19 * along with this program; if not, write to the *
20 * Free Software Foundation, Inc., *
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
22 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
25 #include "alist_internal.h"
27 // FIXME: this decomposition into 3 ABI is not accurate,
28 // there are a least 9 or 10 different ABI, each with one or a few revisions
29 // for a total of almost 16 differents audio ucode.
31 // ABI2 in fact is a mix of at least 7 differents ABI which are mostly compatible
32 // but not totally, that's why there is a isZeldaABI/isMKABI workaround.
34 extern const acmd_callback_t ABI1[0x10];
35 extern const acmd_callback_t ABI2[0x20];
36 extern const acmd_callback_t ABI3[0x10];
39 static void alist_process(const acmd_callback_t abi[], unsigned int abi_size)
43 const OSTask_t * const task = get_task();
45 const unsigned int *alist = (unsigned int*)(rsp.RDRAM + task->data_ptr);
46 const unsigned int * const alist_end = alist + (task->data_size >> 2);
48 while (alist != alist_end)
57 (*abi[acmd])(inst1, inst2);
61 DebugMessage(M64MSG_WARNING, "Invalid ABI command %u", acmd);
66 /* global functions */
67 void alist_process_ABI1()
69 alist_process(ABI1, 0x10);
72 void alist_process_ABI2()
74 alist_process(ABI2, 0x20);
77 void alist_process_ABI3()
79 alist_process(ABI3, 0x10);