diff options
author | Nebuleon <nebuleon@alakazam> | 2013-07-31 03:08:35 +0000 |
---|---|---|
committer | Nebuleon <nebuleon@alakazam> | 2013-07-31 03:08:35 +0000 |
commit | 28cbcd7782331d7f646e50565f3dcd6cf23d35bc (patch) | |
tree | c25d8ebbec637e26b403b067ccfbff9b73d605ff /source/cpu_common.c | |
parent | 4c5ef5f689e52f355cdaf283a12ba32c04ad56db (diff) | |
download | ReGBA-28cbcd7782331d7f646e50565f3dcd6cf23d35bc.zip ReGBA-28cbcd7782331d7f646e50565f3dcd6cf23d35bc.tar.gz ReGBA-28cbcd7782331d7f646e50565f3dcd6cf23d35bc.tar.bz2 |
cpu_common.c, cpu_common.h: Move into the cross-platform directory.
Diffstat (limited to 'source/cpu_common.c')
-rw-r--r-- | source/cpu_common.c | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/source/cpu_common.c b/source/cpu_common.c new file mode 100644 index 0000000..0e0dc1c --- /dev/null +++ b/source/cpu_common.c @@ -0,0 +1,49 @@ +/* unofficial gameplaySP kai + * + * Copyright (C) 2006 Exophase <exophase@gmail.com> + * Copyright (C) 2007 takka <takka@tfact.net> + * + * 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 "common.h" + +const u8 bit_count[256] = +{ + 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, + 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, + 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, + 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, + 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, + 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, + 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, + 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, + 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, + 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, + 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, + 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, + 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, + 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, + 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, + 4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8 +}; + +const u32 psr_masks[16] = +{ + 0x00000000, 0x000000FF, 0x0000FF00, 0x0000FFFF, 0x00FF0000, + 0x00FF00FF, 0x00FFFF00, 0x00FFFFFF, 0xFF000000, 0xFF0000FF, + 0xFF00FF00, 0xFF00FFFF, 0xFFFF0000, 0xFFFF00FF, 0xFFFFFF00, + 0xFFFFFFFF +}; |