Browse code

[GSF] Cleanup, a tiny bit of making sure it was like viogsf, also used the standard integer types and not VBA-M's typedefs.

Naram Qashat authored on 2013/05/10 17:45:36
Showing 20 changed files
... ...
@@ -83,7 +83,6 @@
83 83
     <ClCompile Include="vbam\apu\Blip_Buffer.cpp" />
84 84
     <ClCompile Include="vbam\apu\Effects_Buffer.cpp" />
85 85
     <ClCompile Include="vbam\apu\Gb_Apu.cpp" />
86
-    <ClCompile Include="vbam\apu\Gb_Apu_State.cpp" />
87 86
     <ClCompile Include="vbam\apu\Gb_Oscs.cpp" />
88 87
     <ClCompile Include="vbam\apu\Multi_Buffer.cpp" />
89 88
     <ClCompile Include="vbam\gba\bios.cpp" />
... ...
@@ -106,6 +105,7 @@
106 105
     <ClInclude Include="vbam\apu\Multi_Buffer.h" />
107 106
     <ClInclude Include="vbam\common\Port.h" />
108 107
     <ClInclude Include="vbam\common\SoundDriver.h" />
108
+    <ClInclude Include="vbam\common\Types.h" />
109 109
     <ClInclude Include="vbam\gba\bios.h" />
110 110
     <ClInclude Include="vbam\gba\GBA.h" />
111 111
     <ClInclude Include="vbam\gba\GBAcpu.h" />
... ...
@@ -75,9 +75,6 @@
75 75
     <ClCompile Include="XSFConfig_GSF.cpp">
76 76
       <Filter>Source Files</Filter>
77 77
     </ClCompile>
78
-    <ClCompile Include="vbam\apu\Gb_Apu_State.cpp">
79
-      <Filter>Source Files\vbam\apu</Filter>
80
-    </ClCompile>
81 78
   </ItemGroup>
82 79
   <ItemGroup>
83 80
     <ClInclude Include="vbam\apu\blargg_common.h">
... ...
@@ -128,5 +125,8 @@
128 125
     <ClInclude Include="vbam\gba\Sound.h">
129 126
       <Filter>Header Files\vbam\gba</Filter>
130 127
     </ClInclude>
128
+    <ClInclude Include="vbam\common\Types.h">
129
+      <Filter>Header Files\vbam\common</Filter>
130
+    </ClInclude>
131 131
   </ItemGroup>
132 132
 </Project>
133 133
\ No newline at end of file
... ...
@@ -29,7 +29,7 @@ int const silent_buf_size = 1; // size used for Silent_Blip_Buffer
29 29
 
30 30
 Blip_Buffer::Blip_Buffer()
31 31
 {
32
-	factor_       = (blip_ulong)LONG_MAX;
32
+	factor_       = LONG_MAX;
33 33
 	buffer_       = 0;
34 34
 	buffer_size_  = 0;
35 35
 	sample_rate_  = 0;
... ...
@@ -78,16 +78,6 @@ public:
78 78
 	// tempo in a game music player.
79 79
 	void set_tempo( double );
80 80
 
81
-// Save states
82
-
83
-	// Saves full emulation state to state_out. Data format is portable and
84
-	// includes some extra space to avoid expansion in case more state needs
85
-	// to be stored in the future.
86
-	void save_state( gb_apu_state_t* state_out );
87
-
88
-	// Loads state. You should call reset() BEFORE this.
89
-	blargg_err_t load_state( gb_apu_state_t const& in );
90
-
91 81
 public:
92 82
 	Gb_Apu();
93 83
 
... ...
@@ -131,8 +121,6 @@ private:
131 121
 	void run_until( blip_time_t );
132 122
 	void silence_osc( Gb_Osc& );
133 123
 	void write_osc( int index, int reg, int old_data, int data );
134
-	const char* save_load( gb_apu_state_t*, bool save );
135
-	void save_load2( gb_apu_state_t*, bool save );
136 124
 	friend class Gb_Apu_Tester;
137 125
 
138 126
 public:
139 127
deleted file mode 100644
... ...
@@ -1,119 +0,0 @@
1
-// Gb_Snd_Emu $vers. http://www.slack.net/~ant/
2
-
3
-#include "Gb_Apu.h"
4
-
5
-#include <string.h>
6
-
7
-/* Copyright (C) 2007 Shay Green. This module is free software; you
8
-can redistribute it and/or modify it under the terms of the GNU Lesser
9
-General Public License as published by the Free Software Foundation; either
10
-version 2.1 of the License, or (at your option) any later version. This
11
-module is distributed in the hope that it will be useful, but WITHOUT ANY
12
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13
-FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
14
-details. You should have received a copy of the GNU Lesser General Public
15
-License along with this module; if not, write to the Free Software Foundation,
16
-Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */
17
-
18
-#include "blargg_source.h"
19
-
20
-#if GB_APU_CUSTOM_STATE
21
-	#define REFLECT( x, y ) (save ?       (io->y) = (x) :         (x) = (io->y)          )
22
-#else
23
-	#define REFLECT( x, y ) (save ? set_val( io->y, x ) : (void) ((x) = get_val( io->y )))
24
-
25
-	static blargg_ulong get_val( byte const* p )
26
-	{
27
-		return  p [3] * 0x1000000 + p [2] * 0x10000 + p [1] * 0x100 + p [0];
28
-	}
29
-
30
-	static void set_val( byte* p, blargg_ulong n )
31
-	{
32
-		p [0] = (byte) (n      );
33
-		p [1] = (byte) (n >>  8);
34
-		p [2] = (byte) (n >> 16);
35
-		p [3] = (byte) (n >> 24);
36
-	}
37
-#endif
38
-
39
-inline const char* Gb_Apu::save_load( gb_apu_state_t* io, bool save )
40
-{
41
-	#if !GB_APU_CUSTOM_STATE
42
-		assert( sizeof (gb_apu_state_t) == 256 );
43
-	#endif
44
-
45
-	int format = io->format0;
46
-	REFLECT( format, format );
47
-	if ( format != io->format0 )
48
-		return "Unsupported sound save state format";
49
-
50
-	int version = 0;
51
-	REFLECT( version, version );
52
-
53
-	// Registers and wave RAM
54
-	assert( regs_size == sizeof io->regs );
55
-	if ( save )
56
-		memcpy( io->regs, regs, sizeof io->regs );
57
-	else
58
-		memcpy( regs, io->regs, sizeof     regs );
59
-
60
-	// Frame sequencer
61
-	REFLECT( frame_time,  frame_time  );
62
-	REFLECT( frame_phase, frame_phase );
63
-
64
-	REFLECT( square1.sweep_freq,    sweep_freq );
65
-	REFLECT( square1.sweep_delay,   sweep_delay );
66
-	REFLECT( square1.sweep_enabled, sweep_enabled );
67
-	REFLECT( square1.sweep_neg,     sweep_neg );
68
-
69
-	REFLECT( noise.divider,         noise_divider );
70
-	REFLECT( wave.sample_buf,       wave_buf );
71
-
72
-	return 0;
73
-}
74
-
75
-// second function to avoid inline limits of some compilers
76
-inline void Gb_Apu::save_load2( gb_apu_state_t* io, bool save )
77
-{
78
-	for ( int i = osc_count; --i >= 0; )
79
-	{
80
-		Gb_Osc& osc = *oscs [i];
81
-		REFLECT( osc.delay,      delay      [i] );
82
-		REFLECT( osc.length_ctr, length_ctr [i] );
83
-		REFLECT( osc.phase,      phase      [i] );
84
-		REFLECT( osc.enabled,    enabled    [i] );
85
-
86
-		if ( i != 2 )
87
-		{
88
-			int j = min( i, 2 );
89
-			Gb_Env& env = STATIC_CAST(Gb_Env&,osc);
90
-			REFLECT( env.env_delay,   env_delay   [j] );
91
-			REFLECT( env.volume,      env_volume  [j] );
92
-			REFLECT( env.env_enabled, env_enabled [j] );
93
-		}
94
-	}
95
-}
96
-
97
-void Gb_Apu::save_state( gb_apu_state_t* out )
98
-{
99
-	(void) save_load( out, true );
100
-	save_load2( out, true );
101
-
102
-	#if !GB_APU_CUSTOM_STATE
103
-		memset( out->unused, 0, sizeof out->unused );
104
-	#endif
105
-}
106
-
107
-blargg_err_t Gb_Apu::load_state( gb_apu_state_t const& in )
108
-{
109
-	RETURN_ERR( save_load( CONST_CAST(gb_apu_state_t*,&in), false ) );
110
-	save_load2( CONST_CAST(gb_apu_state_t*,&in), false );
111
-
112
-	apply_stereo();
113
-	synth_volume( 0 );          // suppress output for the moment
114
-	run_until_( last_time );    // get last_amp updated
115
-	apply_volume();             // now use correct volume
116
-
117
-	return 0;
118
-}
119
-
... ...
@@ -4,13 +4,13 @@
4 4
 #include "Types.h"
5 5
 
6 6
 // swaps a 16-bit value
7
-static inline u16 swap16(u16 v)
7
+static inline uint16_t swap16(uint16_t v)
8 8
 {
9 9
   return (v<<8)|(v>>8);
10 10
 }
11 11
 
12 12
 // swaps a 32-bit value
13
-static inline u32 swap32(u32 v)
13
+static inline uint32_t swap32(uint32_t v)
14 14
 {
15 15
   return (v<<24)|((v<<8)&0xff0000)|((v>>8)&0xff00)|(v>>24);
16 16
 }
... ...
@@ -36,23 +36,23 @@ static inline u32 swap32(u32 v)
36 36
 
37 37
 #else
38 38
 #define READ16LE(x) \
39
-  swap16(*((u16 *)(x)))
39
+  swap16(*((uint16_t *)(x)))
40 40
 #define READ32LE(x) \
41
-  swap32(*((u32 *)(x)))
41
+  swap32(*((uint32_t *)(x)))
42 42
 #define WRITE16LE(x,v) \
43
-  *((u16 *)x) = swap16((v))
43
+  *((uint16_t *)x) = swap16((v))
44 44
 #define WRITE32LE(x,v) \
45
-  *((u32 *)x) = swap32((v))
45
+  *((uint32_t *)x) = swap32((v))
46 46
 #endif
47 47
 #else
48 48
 #define READ16LE(x) \
49
-  *((u16 *)x)
49
+  *((uint16_t *)x)
50 50
 #define READ32LE(x) \
51
-  *((u32 *)x)
51
+  *((uint32_t *)x)
52 52
 #define WRITE16LE(x,v) \
53
-  *((u16 *)x) = (v)
53
+  *((uint16_t *)x) = (v)
54 54
 #define WRITE32LE(x,v) \
55
-  *((u32 *)x) = (v)
55
+  *((uint32_t *)x) = (v)
56 56
 #endif
57 57
 
58 58
 #endif // PORT_H
... ...
@@ -57,7 +57,7 @@ public:
57 57
 	/**
58 58
 	 * Write length bytes of data from the finalWave buffer to the driver output buffer.
59 59
 	 */
60
-	virtual void write(u16 * finalWave, int length) = 0;
60
+	virtual void write(uint16_t * finalWave, int length) = 0;
61 61
 
62 62
 	virtual void setThrottle(unsigned short throttle) { };
63 63
 };
... ...
@@ -20,7 +20,7 @@
20 20
 
21 21
 #include <stdint.h>
22 22
 
23
-typedef uint8_t u8;
23
+/*typedef uint8_t u8;
24 24
 typedef uint16_t u16;
25 25
 typedef uint32_t u32;
26 26
 typedef uint64_t u64;
... ...
@@ -28,6 +28,6 @@ typedef uint64_t u64;
28 28
 typedef int8_t s8;
29 29
 typedef int16_t s16;
30 30
 typedef int32_t s32;
31
-typedef int64_t s64;
31
+typedef int64_t s64;*/
32 32
 
33 33
 #endif // __VBA_TYPES_H__
... ...
@@ -35,7 +35,7 @@
35 35
 
36 36
 static int clockTicks;
37 37
 
38
-static INSN_REGPARM void armUnknownInsn(u32 opcode)
38
+static INSN_REGPARM void armUnknownInsn(uint32_t opcode)
39 39
 {
40 40
 #ifdef GBA_LOGGING
41 41
     if (systemVerbose & VERBOSE_UNDEFINED) {
... ...
@@ -47,7 +47,7 @@ static INSN_REGPARM void armUnknownInsn(u32 opcode)
47 47
 }
48 48
 
49 49
 #ifdef BKPT_SUPPORT
50
-static INSN_REGPARM void armBreakpoint(u32 opcode)
50
+static INSN_REGPARM void armBreakpoint(uint32_t opcode)
51 51
 {
52 52
     reg[15].I -= 4;
53 53
     armNextPC -= 4;
... ...
@@ -60,7 +60,7 @@ static INSN_REGPARM void armBreakpoint(u32 opcode)
60 60
 // Subroutine to count instructions (for debugging/optimizing)
61 61
 //#define INSN_COUNTER  // comment out if you don't want it
62 62
 #ifdef INSN_COUNTER
63
-static void count(u32 opcode, int cond_res)
63
+static void count(uint32_t opcode, int cond_res)
64 64
 {
65 65
     static int insncount = 0;    // number of insns seen
66 66
     static int executed = 0;     // number of insns executed
... ...
@@ -716,11 +716,11 @@ static void count(u32 opcode, int cond_res)
716 716
 // C core
717 717
 
718 718
 #define C_SETCOND_LOGICAL \
719
-    N_FLAG = ((s32)res < 0) ? true : false;             \
719
+    N_FLAG = ((int32_t)res < 0) ? true : false;             \
720 720
     Z_FLAG = (res == 0) ? true : false;                 \
721 721
     C_FLAG = C_OUT;
722 722
 #define C_SETCOND_ADD \
723
-    N_FLAG = ((s32)res < 0) ? true : false;             \
723
+    N_FLAG = ((int32_t)res < 0) ? true : false;             \
724 724
     Z_FLAG = (res == 0) ? true : false;                 \
725 725
     V_FLAG = ((NEG(lhs) & NEG(rhs) & POS(res)) |        \
726 726
               (POS(lhs) & POS(rhs) & NEG(res))) ? true : false;\
... ...
@@ -728,7 +728,7 @@ static void count(u32 opcode, int cond_res)
728 728
               (NEG(lhs) & POS(res)) |                   \
729 729
               (NEG(rhs) & POS(res))) ? true : false;
730 730
 #define C_SETCOND_SUB \
731
-    N_FLAG = ((s32)res < 0) ? true : false;             \
731
+    N_FLAG = ((int32_t)res < 0) ? true : false;             \
732 732
     Z_FLAG = (res == 0) ? true : false;                 \
733 733
     V_FLAG = ((NEG(lhs) & POS(rhs) & POS(res)) |        \
734 734
               (POS(lhs) & NEG(rhs) & NEG(res))) ? true : false;\
... ...
@@ -740,7 +740,7 @@ static void count(u32 opcode, int cond_res)
740 740
  #define ALU_INIT_C \
741 741
     int dest = (opcode>>12) & 15;                       \
742 742
     bool C_OUT = C_FLAG;                                \
743
-    u32 value;
743
+    uint32_t value;
744 744
 #endif
745 745
 // OP Rd,Rb,Rm LSL #
746 746
 #ifndef VALUE_LSL_IMM_C
... ...
@@ -749,7 +749,7 @@ static void count(u32 opcode, int cond_res)
749 749
     if (LIKELY(!shift)) {  /* LSL #0 most common? */    \
750 750
         value = reg[opcode & 0x0F].I;                   \
751 751
     } else {                                            \
752
-        u32 v = reg[opcode & 0x0F].I;                   \
752
+        uint32_t v = reg[opcode & 0x0F].I;                   \
753 753
         C_OUT = (v >> (32 - shift)) & 1 ? true : false; \
754 754
         value = v << shift;                             \
755 755
     }
... ...
@@ -757,8 +757,8 @@ static void count(u32 opcode, int cond_res)
757 757
 // OP Rd,Rb,Rm LSL Rs
758 758
 #ifndef VALUE_LSL_REG_C
759 759
  #define VALUE_LSL_REG_C \
760
-    u32 shift = reg[(opcode >> 8)&15].B.B0;                  \
761
-    u32 rm = reg[opcode & 0x0F].I;                           \
760
+    uint32_t shift = reg[(opcode >> 8)&15].B.B0;                  \
761
+    uint32_t rm = reg[opcode & 0x0F].I;                           \
762 762
     if((opcode & 0x0F) == 15) {                              \
763 763
         rm += 4;                                             \
764 764
     }                                                        \
... ...
@@ -767,7 +767,7 @@ static void count(u32 opcode, int cond_res)
767 767
             value = 0;                                  \
768 768
             C_OUT = (rm & 1 ? true : false);                 \
769 769
         } else if (LIKELY(shift < 32)) {                \
770
-            u32 v = rm;                                      \
770
+            uint32_t v = rm;                                      \
771 771
             C_OUT = (v >> (32 - shift)) & 1 ? true : false;\
772 772
             value = v << shift;                         \
773 773
         } else {                                        \
... ...
@@ -781,9 +781,9 @@ static void count(u32 opcode, int cond_res)
781 781
 // OP Rd,Rb,Rm LSR #
782 782
 #ifndef VALUE_LSR_IMM_C
783 783
  #define VALUE_LSR_IMM_C \
784
-    u32 shift = (opcode >> 7) & 0x1F;                   \
784
+    uint32_t shift = (opcode >> 7) & 0x1F;                   \
785 785
     if (LIKELY(shift)) {                                \
786
-        u32 v = reg[opcode & 0x0F].I;                   \
786
+        uint32_t v = reg[opcode & 0x0F].I;                   \
787 787
         C_OUT = (v >> (shift - 1)) & 1 ? true : false;  \
788 788
         value = v >> shift;                             \
789 789
     } else {                                            \
... ...
@@ -795,7 +795,7 @@ static void count(u32 opcode, int cond_res)
795 795
 #ifndef VALUE_LSR_REG_C
796 796
  #define VALUE_LSR_REG_C \
797 797
     unsigned int shift = reg[(opcode >> 8)&15].B.B0;    \
798
-    u32 rm = reg[opcode & 0x0F].I;                      \
798
+    uint32_t rm = reg[opcode & 0x0F].I;                      \
799 799
     if((opcode & 0x0F) == 15) {                         \
800 800
         rm += 4;                                            \
801 801
     }                                                   \
... ...
@@ -804,7 +804,7 @@ static void count(u32 opcode, int cond_res)
804 804
             value = 0;                                  \
805 805
             C_OUT = (rm & 0x80000000 ? true : false);\
806 806
         } else if (LIKELY(shift < 32)) {                \
807
-            u32 v = rm;               \
807
+            uint32_t v = rm;               \
808 808
             C_OUT = (v >> (shift - 1)) & 1 ? true : false;\
809 809
             value = v >> shift;                         \
810 810
         } else {                                        \
... ...
@@ -821,7 +821,7 @@ static void count(u32 opcode, int cond_res)
821 821
     unsigned int shift = (opcode >> 7) & 0x1F;          \
822 822
     if (LIKELY(shift)) {                                \
823 823
         /* VC++ BUG: u32 v; (s32)v>>n is optimized to shr! */ \
824
-        s32 v = reg[opcode & 0x0F].I;                   \
824
+        int32_t v = reg[opcode & 0x0F].I;                   \
825 825
         C_OUT = (v >> (int)(shift - 1)) & 1 ? true : false;\
826 826
         value = v >> (int)shift;                        \
827 827
     } else {                                            \
... ...
@@ -838,13 +838,13 @@ static void count(u32 opcode, int cond_res)
838 838
 #ifndef VALUE_ASR_REG_C
839 839
  #define VALUE_ASR_REG_C \
840 840
     unsigned int shift = reg[(opcode >> 8)&15].B.B0;    \
841
-    u32 rm = reg[opcode & 0x0F].I;                      \
841
+    uint32_t rm = reg[opcode & 0x0F].I;                      \
842 842
     if((opcode & 0x0F) == 15) {                         \
843 843
         rm += 4;                                            \
844 844
     }                                                   \
845 845
     if (LIKELY(shift < 32)) {                           \
846 846
         if (LIKELY(shift)) {                            \
847
-            s32 v = rm;               \
847
+            int32_t v = rm;               \
848 848
             C_OUT = (v >> (int)(shift - 1)) & 1 ? true : false;\
849 849
             value = v >> (int)shift;                    \
850 850
         } else {                                        \
... ...
@@ -865,12 +865,12 @@ static void count(u32 opcode, int cond_res)
865 865
  #define VALUE_ROR_IMM_C \
866 866
     unsigned int shift = (opcode >> 7) & 0x1F;          \
867 867
     if (LIKELY(shift)) {                                \
868
-        u32 v = reg[opcode & 0x0F].I;                   \
868
+        uint32_t v = reg[opcode & 0x0F].I;                   \
869 869
         C_OUT = (v >> (shift - 1)) & 1 ? true : false;  \
870 870
         value = ((v << (32 - shift)) |                  \
871 871
                  (v >> shift));                         \
872 872
     } else {                                            \
873
-        u32 v = reg[opcode & 0x0F].I;                   \
873
+        uint32_t v = reg[opcode & 0x0F].I;                   \
874 874
         C_OUT = (v & 1) ? true : false;                 \
875 875
         value = ((v >> 1) |                             \
876 876
                  (C_FLAG << 31));                       \
... ...
@@ -880,12 +880,12 @@ static void count(u32 opcode, int cond_res)
880 880
 #ifndef VALUE_ROR_REG_C
881 881
  #define VALUE_ROR_REG_C \
882 882
     unsigned int shift = reg[(opcode >> 8)&15].B.B0;    \
883
-    u32 rm = reg[opcode & 0x0F].I;                      \
883
+    uint32_t rm = reg[opcode & 0x0F].I;                      \
884 884
     if((opcode & 0x0F) == 15) {                         \
885 885
         rm += 4;                                            \
886 886
     }                                                   \
887 887
     if (LIKELY(shift & 0x1F)) {                         \
888
-        u32 v = rm;                   \
888
+        uint32_t v = rm;                   \
889 889
         C_OUT = (v >> (shift - 1)) & 1 ? true : false;  \
890 890
         value = ((v << (32 - shift)) |                  \
891 891
                  (v >> shift));                         \
... ...
@@ -900,7 +900,7 @@ static void count(u32 opcode, int cond_res)
900 900
  #define VALUE_IMM_C \
901 901
     int shift = (opcode & 0xF00) >> 7;                  \
902 902
     if (UNLIKELY(shift)) {                              \
903
-        u32 v = opcode & 0xFF;                          \
903
+        uint32_t v = opcode & 0xFF;                          \
904 904
         C_OUT = (v >> (shift - 1)) & 1 ? true : false;  \
905 905
         value = ((v << (32 - shift)) |                  \
906 906
                  (v >> shift));                         \
... ...
@@ -945,7 +945,7 @@ static void count(u32 opcode, int cond_res)
945 945
 #define C_CHECK_PC(SETCOND) if (LIKELY(dest != 15)) { SETCOND }
946 946
 #ifndef OP_AND
947 947
  #define OP_AND \
948
-    u32 res = reg[(opcode>>16)&15].I & value;           \
948
+    uint32_t res = reg[(opcode>>16)&15].I & value;           \
949 949
     reg[dest].I = res;
950 950
 #endif
951 951
 #ifndef OP_ANDS
... ...
@@ -953,7 +953,7 @@ static void count(u32 opcode, int cond_res)
953 953
 #endif
954 954
 #ifndef OP_EOR
955 955
  #define OP_EOR \
956
-    u32 res = reg[(opcode>>16)&15].I ^ value;           \
956
+    uint32_t res = reg[(opcode>>16)&15].I ^ value;           \
957 957
     reg[dest].I = res;
958 958
 #endif
959 959
 #ifndef OP_EORS
... ...
@@ -961,9 +961,9 @@ static void count(u32 opcode, int cond_res)
961 961
 #endif
962 962
 #ifndef OP_SUB
963 963
  #define OP_SUB \
964
-    u32 lhs = reg[(opcode>>16)&15].I;                   \
965
-    u32 rhs = value;                                    \
966
-    u32 res = lhs - rhs;                                \
964
+    uint32_t lhs = reg[(opcode>>16)&15].I;                   \
965
+    uint32_t rhs = value;                                    \
966
+    uint32_t res = lhs - rhs;                                \
967 967
     reg[dest].I = res;
968 968
 #endif
969 969
 #ifndef OP_SUBS
... ...
@@ -971,9 +971,9 @@ static void count(u32 opcode, int cond_res)
971 971
 #endif
972 972
 #ifndef OP_RSB
973 973
  #define OP_RSB \
974
-    u32 lhs = value;                                    \
975
-    u32 rhs = reg[(opcode>>16)&15].I;                   \
976
-    u32 res = lhs - rhs;                                \
974
+    uint32_t lhs = value;                                    \
975
+    uint32_t rhs = reg[(opcode>>16)&15].I;                   \
976
+    uint32_t res = lhs - rhs;                                \
977 977
     reg[dest].I = res;
978 978
 #endif
979 979
 #ifndef OP_RSBS
... ...
@@ -981,9 +981,9 @@ static void count(u32 opcode, int cond_res)
981 981
 #endif
982 982
 #ifndef OP_ADD
983 983
  #define OP_ADD \
984
-    u32 lhs = reg[(opcode>>16)&15].I;                   \
985
-    u32 rhs = value;                                    \
986
-    u32 res = lhs + rhs;                                \
984
+    uint32_t lhs = reg[(opcode>>16)&15].I;                   \
985
+    uint32_t rhs = value;                                    \
986
+    uint32_t res = lhs + rhs;                                \
987 987
     reg[dest].I = res;
988 988
 #endif
989 989
 #ifndef OP_ADDS
... ...
@@ -991,9 +991,9 @@ static void count(u32 opcode, int cond_res)
991 991
 #endif
992 992
 #ifndef OP_ADC
993 993
  #define OP_ADC \
994
-    u32 lhs = reg[(opcode>>16)&15].I;                   \
995
-    u32 rhs = value;                                    \
996
-    u32 res = lhs + rhs + (u32)C_FLAG;                  \
994
+    uint32_t lhs = reg[(opcode>>16)&15].I;                   \
995
+    uint32_t rhs = value;                                    \
996
+    uint32_t res = lhs + rhs + (uint32_t)C_FLAG;                  \
997 997
     reg[dest].I = res;
998 998
 #endif
999 999
 #ifndef OP_ADCS
... ...
@@ -1001,9 +1001,9 @@ static void count(u32 opcode, int cond_res)
1001 1001
 #endif
1002 1002
 #ifndef OP_SBC
1003 1003
  #define OP_SBC \
1004
-    u32 lhs = reg[(opcode>>16)&15].I;                   \
1005
-    u32 rhs = value;                                    \
1006
-    u32 res = lhs - rhs - !((u32)C_FLAG);               \
1004
+    uint32_t lhs = reg[(opcode>>16)&15].I;                   \
1005
+    uint32_t rhs = value;                                    \
1006
+    uint32_t res = lhs - rhs - !((uint32_t)C_FLAG);               \
1007 1007
     reg[dest].I = res;
1008 1008
 #endif
1009 1009
 #ifndef OP_SBCS
... ...
@@ -1011,9 +1011,9 @@ static void count(u32 opcode, int cond_res)
1011 1011
 #endif
1012 1012
 #ifndef OP_RSC
1013 1013
  #define OP_RSC \
1014
-    u32 lhs = value;                                    \
1015
-    u32 rhs = reg[(opcode>>16)&15].I;                   \
1016
-    u32 res = lhs - rhs - !((u32)C_FLAG);               \
1014
+    uint32_t lhs = value;                                    \
1015
+    uint32_t rhs = reg[(opcode>>16)&15].I;                   \
1016
+    uint32_t res = lhs - rhs - !((uint32_t)C_FLAG);               \
1017 1017
     reg[dest].I = res;
1018 1018
 #endif
1019 1019
 #ifndef OP_RSCS
... ...
@@ -1021,31 +1021,31 @@ static void count(u32 opcode, int cond_res)
1021 1021
 #endif
1022 1022
 #ifndef OP_TST
1023 1023
  #define OP_TST \
1024
-    u32 res = reg[(opcode >> 16) & 0x0F].I & value;     \
1024
+    uint32_t res = reg[(opcode >> 16) & 0x0F].I & value;     \
1025 1025
     C_SETCOND_LOGICAL;
1026 1026
 #endif
1027 1027
 #ifndef OP_TEQ
1028 1028
  #define OP_TEQ \
1029
-    u32 res = reg[(opcode >> 16) & 0x0F].I ^ value;     \
1029
+    uint32_t res = reg[(opcode >> 16) & 0x0F].I ^ value;     \
1030 1030
     C_SETCOND_LOGICAL;
1031 1031
 #endif
1032 1032
 #ifndef OP_CMP
1033 1033
  #define OP_CMP \
1034
-    u32 lhs = reg[(opcode>>16)&15].I;                   \
1035
-    u32 rhs = value;                                    \
1036
-    u32 res = lhs - rhs;                                \
1034
+    uint32_t lhs = reg[(opcode>>16)&15].I;                   \
1035
+    uint32_t rhs = value;                                    \
1036
+    uint32_t res = lhs - rhs;                                \
1037 1037
     C_SETCOND_SUB;
1038 1038
 #endif
1039 1039
 #ifndef OP_CMN
1040 1040
  #define OP_CMN \
1041
-    u32 lhs = reg[(opcode>>16)&15].I;                   \
1042
-    u32 rhs = value;                                    \
1043
-    u32 res = lhs + rhs;                                \
1041
+    uint32_t lhs = reg[(opcode>>16)&15].I;                   \
1042
+    uint32_t rhs = value;                                    \
1043
+    uint32_t res = lhs + rhs;                                \
1044 1044
     C_SETCOND_ADD;
1045 1045
 #endif
1046 1046
 #ifndef OP_ORR
1047 1047
  #define OP_ORR \
1048
-    u32 res = reg[(opcode >> 16) & 0x0F].I | value;     \
1048
+    uint32_t res = reg[(opcode >> 16) & 0x0F].I | value;     \
1049 1049
     reg[dest].I = res;
1050 1050
 #endif
1051 1051
 #ifndef OP_ORRS
... ...
@@ -1053,7 +1053,7 @@ static void count(u32 opcode, int cond_res)
1053 1053
 #endif
1054 1054
 #ifndef OP_MOV
1055 1055
  #define OP_MOV \
1056
-    u32 res = value;                                    \
1056
+    uint32_t res = value;                                    \
1057 1057
     reg[dest].I = res;
1058 1058
 #endif
1059 1059
 #ifndef OP_MOVS
... ...
@@ -1061,7 +1061,7 @@ static void count(u32 opcode, int cond_res)
1061 1061
 #endif
1062 1062
 #ifndef OP_BIC
1063 1063
  #define OP_BIC \
1064
-    u32 res = reg[(opcode >> 16) & 0x0F].I & (~value);  \
1064
+    uint32_t res = reg[(opcode >> 16) & 0x0F].I & (~value);  \
1065 1065
     reg[dest].I = res;
1066 1066
 #endif
1067 1067
 #ifndef OP_BICS
... ...
@@ -1069,7 +1069,7 @@ static void count(u32 opcode, int cond_res)
1069 1069
 #endif
1070 1070
 #ifndef OP_MVN
1071 1071
  #define OP_MVN \
1072
-    u32 res = ~value;                                   \
1072
+    uint32_t res = ~value;                                   \
1073 1073
     reg[dest].I = res;
1074 1074
 #endif
1075 1075
 #ifndef OP_MVNS
... ...
@@ -1081,7 +1081,7 @@ static void count(u32 opcode, int cond_res)
1081 1081
 #endif
1082 1082
 #ifndef SETCOND_MUL
1083 1083
  #define SETCOND_MUL \
1084
-     N_FLAG = ((s32)reg[dest].I < 0) ? true : false;    \
1084
+     N_FLAG = ((int32_t)reg[dest].I < 0) ? true : false;    \
1085 1085
      Z_FLAG = reg[dest].I ? false : true;
1086 1086
 #endif
1087 1087
 #ifndef SETCOND_MULL
... ...
@@ -1096,7 +1096,7 @@ static void count(u32 opcode, int cond_res)
1096 1096
 
1097 1097
 #ifndef ROR_IMM_MSR
1098 1098
  #define ROR_IMM_MSR \
1099
-    u32 v = opcode & 0xff;                              \
1099
+    uint32_t v = opcode & 0xff;                              \
1100 1100
     value = ((v << (32 - shift)) | (v >> shift));
1101 1101
 #endif
1102 1102
 #ifndef ROR_OFFSET
... ...
@@ -1144,25 +1144,25 @@ static void count(u32 opcode, int cond_res)
1144 1144
 #define MODECHANGE_YES CPUSwitchMode(reg[17].I & 0x1f, false);
1145 1145
 
1146 1146
 #define DEFINE_ALU_INSN_C(CODE1, CODE2, OP, MODECHANGE) \
1147
-  static INSN_REGPARM void arm##CODE1##0(u32 opcode) { ALU_INSN(ALU_INIT_C, VALUE_LSL_IMM_C, OP_##OP, MODECHANGE_##MODECHANGE, 0); }\
1148
-  static INSN_REGPARM void arm##CODE1##1(u32 opcode) { ALU_INSN(ALU_INIT_C, VALUE_LSL_REG_C, OP_##OP, MODECHANGE_##MODECHANGE, 1); }\
1149
-  static INSN_REGPARM void arm##CODE1##2(u32 opcode) { ALU_INSN(ALU_INIT_C, VALUE_LSR_IMM_C, OP_##OP, MODECHANGE_##MODECHANGE, 0); }\
1150
-  static INSN_REGPARM void arm##CODE1##3(u32 opcode) { ALU_INSN(ALU_INIT_C, VALUE_LSR_REG_C, OP_##OP, MODECHANGE_##MODECHANGE, 1); }\
1151
-  static INSN_REGPARM void arm##CODE1##4(u32 opcode) { ALU_INSN(ALU_INIT_C, VALUE_ASR_IMM_C, OP_##OP, MODECHANGE_##MODECHANGE, 0); }\
1152
-  static INSN_REGPARM void arm##CODE1##5(u32 opcode) { ALU_INSN(ALU_INIT_C, VALUE_ASR_REG_C, OP_##OP, MODECHANGE_##MODECHANGE, 1); }\
1153
-  static INSN_REGPARM void arm##CODE1##6(u32 opcode) { ALU_INSN(ALU_INIT_C, VALUE_ROR_IMM_C, OP_##OP, MODECHANGE_##MODECHANGE, 0); }\
1154
-  static INSN_REGPARM void arm##CODE1##7(u32 opcode) { ALU_INSN(ALU_INIT_C, VALUE_ROR_REG_C, OP_##OP, MODECHANGE_##MODECHANGE, 1); }\
1155
-  static INSN_REGPARM void arm##CODE2##0(u32 opcode) { ALU_INSN(ALU_INIT_C, VALUE_IMM_C,     OP_##OP, MODECHANGE_##MODECHANGE, 0); }
1147
+  static INSN_REGPARM void arm##CODE1##0(uint32_t opcode) { ALU_INSN(ALU_INIT_C, VALUE_LSL_IMM_C, OP_##OP, MODECHANGE_##MODECHANGE, 0); }\
1148
+  static INSN_REGPARM void arm##CODE1##1(uint32_t opcode) { ALU_INSN(ALU_INIT_C, VALUE_LSL_REG_C, OP_##OP, MODECHANGE_##MODECHANGE, 1); }\
1149
+  static INSN_REGPARM void arm##CODE1##2(uint32_t opcode) { ALU_INSN(ALU_INIT_C, VALUE_LSR_IMM_C, OP_##OP, MODECHANGE_##MODECHANGE, 0); }\
1150
+  static INSN_REGPARM void arm##CODE1##3(uint32_t opcode) { ALU_INSN(ALU_INIT_C, VALUE_LSR_REG_C, OP_##OP, MODECHANGE_##MODECHANGE, 1); }\
1151
+  static INSN_REGPARM void arm##CODE1##4(uint32_t opcode) { ALU_INSN(ALU_INIT_C, VALUE_ASR_IMM_C, OP_##OP, MODECHANGE_##MODECHANGE, 0); }\
1152
+  static INSN_REGPARM void arm##CODE1##5(uint32_t opcode) { ALU_INSN(ALU_INIT_C, VALUE_ASR_REG_C, OP_##OP, MODECHANGE_##MODECHANGE, 1); }\
1153
+  static INSN_REGPARM void arm##CODE1##6(uint32_t opcode) { ALU_INSN(ALU_INIT_C, VALUE_ROR_IMM_C, OP_##OP, MODECHANGE_##MODECHANGE, 0); }\
1154
+  static INSN_REGPARM void arm##CODE1##7(uint32_t opcode) { ALU_INSN(ALU_INIT_C, VALUE_ROR_REG_C, OP_##OP, MODECHANGE_##MODECHANGE, 1); }\
1155
+  static INSN_REGPARM void arm##CODE2##0(uint32_t opcode) { ALU_INSN(ALU_INIT_C, VALUE_IMM_C,     OP_##OP, MODECHANGE_##MODECHANGE, 0); }
1156 1156
 #define DEFINE_ALU_INSN_NC(CODE1, CODE2, OP, MODECHANGE) \
1157
-  static INSN_REGPARM void arm##CODE1##0(u32 opcode) { ALU_INSN(ALU_INIT_NC, VALUE_LSL_IMM_NC, OP_##OP, MODECHANGE_##MODECHANGE, 0); }\
1158
-  static INSN_REGPARM void arm##CODE1##1(u32 opcode) { ALU_INSN(ALU_INIT_NC, VALUE_LSL_REG_NC, OP_##OP, MODECHANGE_##MODECHANGE, 1); }\
1159
-  static INSN_REGPARM void arm##CODE1##2(u32 opcode) { ALU_INSN(ALU_INIT_NC, VALUE_LSR_IMM_NC, OP_##OP, MODECHANGE_##MODECHANGE, 0); }\
1160
-  static INSN_REGPARM void arm##CODE1##3(u32 opcode) { ALU_INSN(ALU_INIT_NC, VALUE_LSR_REG_NC, OP_##OP, MODECHANGE_##MODECHANGE, 1); }\
1161
-  static INSN_REGPARM void arm##CODE1##4(u32 opcode) { ALU_INSN(ALU_INIT_NC, VALUE_ASR_IMM_NC, OP_##OP, MODECHANGE_##MODECHANGE, 0); }\
1162
-  static INSN_REGPARM void arm##CODE1##5(u32 opcode) { ALU_INSN(ALU_INIT_NC, VALUE_ASR_REG_NC, OP_##OP, MODECHANGE_##MODECHANGE, 1); }\
1163
-  static INSN_REGPARM void arm##CODE1##6(u32 opcode) { ALU_INSN(ALU_INIT_NC, VALUE_ROR_IMM_NC, OP_##OP, MODECHANGE_##MODECHANGE, 0); }\
1164
-  static INSN_REGPARM void arm##CODE1##7(u32 opcode) { ALU_INSN(ALU_INIT_NC, VALUE_ROR_REG_NC, OP_##OP, MODECHANGE_##MODECHANGE, 1); }\
1165
-  static INSN_REGPARM void arm##CODE2##0(u32 opcode) { ALU_INSN(ALU_INIT_NC, VALUE_IMM_NC,     OP_##OP, MODECHANGE_##MODECHANGE, 0); }
1157
+  static INSN_REGPARM void arm##CODE1##0(uint32_t opcode) { ALU_INSN(ALU_INIT_NC, VALUE_LSL_IMM_NC, OP_##OP, MODECHANGE_##MODECHANGE, 0); }\
1158
+  static INSN_REGPARM void arm##CODE1##1(uint32_t opcode) { ALU_INSN(ALU_INIT_NC, VALUE_LSL_REG_NC, OP_##OP, MODECHANGE_##MODECHANGE, 1); }\
1159
+  static INSN_REGPARM void arm##CODE1##2(uint32_t opcode) { ALU_INSN(ALU_INIT_NC, VALUE_LSR_IMM_NC, OP_##OP, MODECHANGE_##MODECHANGE, 0); }\
1160
+  static INSN_REGPARM void arm##CODE1##3(uint32_t opcode) { ALU_INSN(ALU_INIT_NC, VALUE_LSR_REG_NC, OP_##OP, MODECHANGE_##MODECHANGE, 1); }\
1161
+  static INSN_REGPARM void arm##CODE1##4(uint32_t opcode) { ALU_INSN(ALU_INIT_NC, VALUE_ASR_IMM_NC, OP_##OP, MODECHANGE_##MODECHANGE, 0); }\
1162
+  static INSN_REGPARM void arm##CODE1##5(uint32_t opcode) { ALU_INSN(ALU_INIT_NC, VALUE_ASR_REG_NC, OP_##OP, MODECHANGE_##MODECHANGE, 1); }\
1163
+  static INSN_REGPARM void arm##CODE1##6(uint32_t opcode) { ALU_INSN(ALU_INIT_NC, VALUE_ROR_IMM_NC, OP_##OP, MODECHANGE_##MODECHANGE, 0); }\
1164
+  static INSN_REGPARM void arm##CODE1##7(uint32_t opcode) { ALU_INSN(ALU_INIT_NC, VALUE_ROR_REG_NC, OP_##OP, MODECHANGE_##MODECHANGE, 1); }\
1165
+  static INSN_REGPARM void arm##CODE2##0(uint32_t opcode) { ALU_INSN(ALU_INIT_NC, VALUE_IMM_NC,     OP_##OP, MODECHANGE_##MODECHANGE, 0); }
1166 1166
 
1167 1167
 // AND
1168 1168
 DEFINE_ALU_INSN_NC(00, 20, AND,  NO)
... ...
@@ -1243,12 +1243,12 @@ DEFINE_ALU_INSN_C (1F, 3F, MVNS, YES)
1243 1243
 // CYCLES: base cycle count (1, 2, or 3)
1244 1244
 #define MUL_INSN(OP, SETCOND, CYCLES) \
1245 1245
     int mult = (opcode & 0x0F);                         \
1246
-    u32 rs = reg[(opcode >> 8) & 0x0F].I;               \
1246
+    uint32_t rs = reg[(opcode >> 8) & 0x0F].I;               \
1247 1247
     int acc = (opcode >> 12) & 0x0F;   /* or destLo */  \
1248 1248
     int dest = (opcode >> 16) & 0x0F;  /* or destHi */  \
1249 1249
     OP;                                                 \
1250 1250
     SETCOND;                                            \
1251
-    if ((s32)rs < 0)                                    \
1251
+    if ((int32_t)rs < 0)                                    \
1252 1252
         rs = ~rs;                                       \
1253 1253
     if ((rs & 0xFFFFFF00) == 0)                         \
1254 1254
         clockTicks += 0;                                \
... ...
@@ -1267,58 +1267,58 @@ DEFINE_ALU_INSN_C (1F, 3F, MVNS, YES)
1267 1267
 #define OP_MLA \
1268 1268
     reg[dest].I = reg[mult].I * rs + reg[acc].I;
1269 1269
 #define OP_MULL(SIGN) \
1270
-    SIGN##64 res = (SIGN##64)(SIGN##32)reg[mult].I      \
1271
-                 * (SIGN##64)(SIGN##32)rs;              \
1272
-    reg[acc].I = (u32)res;                              \
1273
-    reg[dest].I = (u32)(res >> 32);
1270
+    SIGN##64_t res = (SIGN##64_t)(SIGN##32_t)reg[mult].I      \
1271
+                 * (SIGN##64_t)(SIGN##32_t)rs;              \
1272
+    reg[acc].I = (uint32_t)res;                              \
1273
+    reg[dest].I = (uint32_t)(res >> 32);
1274 1274
 #define OP_MLAL(SIGN) \
1275
-    SIGN##64 res = ((SIGN##64)reg[dest].I<<32 | reg[acc].I)\
1276
-                 + ((SIGN##64)(SIGN##32)reg[mult].I     \
1277
-                    * (SIGN##64)(SIGN##32)rs);          \
1278
-    reg[acc].I = (u32)res;                              \
1279
-    reg[dest].I = (u32)(res >> 32);
1280
-#define OP_UMULL OP_MULL(u)
1281
-#define OP_UMLAL OP_MLAL(u)
1282
-#define OP_SMULL OP_MULL(s)
1283
-#define OP_SMLAL OP_MLAL(s)
1275
+    SIGN##64_t res = ((SIGN##64_t)reg[dest].I<<32 | reg[acc].I)\
1276
+                 + ((SIGN##64_t)(SIGN##32_t)reg[mult].I     \
1277
+                    * (SIGN##64_t)(SIGN##32_t)rs);          \
1278
+    reg[acc].I = (uint32_t)res;                              \
1279
+    reg[dest].I = (uint32_t)(res >> 32);
1280
+#define OP_UMULL OP_MULL(uint)
1281
+#define OP_UMLAL OP_MLAL(uint)
1282
+#define OP_SMULL OP_MULL(int)
1283
+#define OP_SMLAL OP_MLAL(int)
1284 1284
 
1285 1285
 // MUL Rd, Rm, Rs
1286
-static INSN_REGPARM void arm009(u32 opcode) { MUL_INSN(OP_MUL, SETCOND_NONE, 1); }
1286
+static INSN_REGPARM void arm009(uint32_t opcode) { MUL_INSN(OP_MUL, SETCOND_NONE, 1); }
1287 1287
 // MULS Rd, Rm, Rs
1288
-static INSN_REGPARM void arm019(u32 opcode) { MUL_INSN(OP_MUL, SETCOND_MUL, 1); }
1288
+static INSN_REGPARM void arm019(uint32_t opcode) { MUL_INSN(OP_MUL, SETCOND_MUL, 1); }
1289 1289
 
1290 1290
 // MLA Rd, Rm, Rs, Rn
1291
-static INSN_REGPARM void arm029(u32 opcode) { MUL_INSN(OP_MLA, SETCOND_NONE, 2); }
1291
+static INSN_REGPARM void arm029(uint32_t opcode) { MUL_INSN(OP_MLA, SETCOND_NONE, 2); }
1292 1292
 // MLAS Rd, Rm, Rs, Rn
1293
-static INSN_REGPARM void arm039(u32 opcode) { MUL_INSN(OP_MLA, SETCOND_MUL, 2); }
1293
+static INSN_REGPARM void arm039(uint32_t opcode) { MUL_INSN(OP_MLA, SETCOND_MUL, 2); }
1294 1294
 
1295 1295
 // UMULL RdLo, RdHi, Rn, Rs
1296
-static INSN_REGPARM void arm089(u32 opcode) { MUL_INSN(OP_UMULL, SETCOND_NONE, 2); }
1296
+static INSN_REGPARM void arm089(uint32_t opcode) { MUL_INSN(OP_UMULL, SETCOND_NONE, 2); }
1297 1297
 // UMULLS RdLo, RdHi, Rn, Rs
1298
-static INSN_REGPARM void arm099(u32 opcode) { MUL_INSN(OP_UMULL, SETCOND_MULL, 2); }
1298
+static INSN_REGPARM void arm099(uint32_t opcode) { MUL_INSN(OP_UMULL, SETCOND_MULL, 2); }
1299 1299
 
1300 1300
 // UMLAL RdLo, RdHi, Rn, Rs
1301
-static INSN_REGPARM void arm0A9(u32 opcode) { MUL_INSN(OP_UMLAL, SETCOND_NONE, 3); }
1301
+static INSN_REGPARM void arm0A9(uint32_t opcode) { MUL_INSN(OP_UMLAL, SETCOND_NONE, 3); }
1302 1302
 // UMLALS RdLo, RdHi, Rn, Rs
1303
-static INSN_REGPARM void arm0B9(u32 opcode) { MUL_INSN(OP_UMLAL, SETCOND_MULL, 3); }
1303
+static INSN_REGPARM void arm0B9(uint32_t opcode) { MUL_INSN(OP_UMLAL, SETCOND_MULL, 3); }
1304 1304
 
1305 1305
 // SMULL RdLo, RdHi, Rm, Rs
1306
-static INSN_REGPARM void arm0C9(u32 opcode) { MUL_INSN(OP_SMULL, SETCOND_NONE, 2); }
1306
+static INSN_REGPARM void arm0C9(uint32_t opcode) { MUL_INSN(OP_SMULL, SETCOND_NONE, 2); }
1307 1307
 // SMULLS RdLo, RdHi, Rm, Rs
1308
-static INSN_REGPARM void arm0D9(u32 opcode) { MUL_INSN(OP_SMULL, SETCOND_MULL, 2); }
1308
+static INSN_REGPARM void arm0D9(uint32_t opcode) { MUL_INSN(OP_SMULL, SETCOND_MULL, 2); }
1309 1309
 
1310 1310
 // SMLAL RdLo, RdHi, Rm, Rs
1311
-static INSN_REGPARM void arm0E9(u32 opcode) { MUL_INSN(OP_SMLAL, SETCOND_NONE, 3); }
1311
+static INSN_REGPARM void arm0E9(uint32_t opcode) { MUL_INSN(OP_SMLAL, SETCOND_NONE, 3); }
1312 1312
 // SMLALS RdLo, RdHi, Rm, Rs
1313
-static INSN_REGPARM void arm0F9(u32 opcode) { MUL_INSN(OP_SMLAL, SETCOND_MULL, 3); }
1313
+static INSN_REGPARM void arm0F9(uint32_t opcode) { MUL_INSN(OP_SMLAL, SETCOND_MULL, 3); }
1314 1314
 
1315 1315
 // Misc instructions //////////////////////////////////////////////////////
1316 1316
 
1317 1317
 // SWP Rd, Rm, [Rn]
1318
-static INSN_REGPARM void arm109(u32 opcode)
1318
+static INSN_REGPARM void arm109(uint32_t opcode)
1319 1319
 {
1320
-    u32 address = reg[(opcode >> 16) & 15].I;
1321
-    u32 temp = CPUReadMemory(address);
1320
+    uint32_t address = reg[(opcode >> 16) & 15].I;
1321
+    uint32_t temp = CPUReadMemory(address);
1322 1322
     CPUWriteMemory(address, reg[opcode&15].I);
1323 1323
     reg[(opcode >> 12) & 15].I = temp;
1324 1324
     clockTicks = 4 + dataTicksAccess32(address) + dataTicksAccess32(address)
... ...
@@ -1326,10 +1326,10 @@ static INSN_REGPARM void arm109(u32 opcode)
1326 1326
 }
1327 1327
 
1328 1328
 // SWPB Rd, Rm, [Rn]
1329
-static INSN_REGPARM void arm149(u32 opcode)
1329
+static INSN_REGPARM void arm149(uint32_t opcode)
1330 1330
 {
1331
-    u32 address = reg[(opcode >> 16) & 15].I;
1332
-    u32 temp = CPUReadByte(address);
1331
+    uint32_t address = reg[(opcode >> 16) & 15].I;
1332
+    uint32_t temp = CPUReadByte(address);
1333 1333
     CPUWriteByte(address, reg[opcode&15].B.B0);
1334 1334
     reg[(opcode>>12)&15].I = temp;
1335 1335
     clockTicks = 4 + dataTicksAccess32(address) + dataTicksAccess32(address)
... ...
@@ -1337,7 +1337,7 @@ static INSN_REGPARM void arm149(u32 opcode)
1337 1337
 }
1338 1338
 
1339 1339
 // MRS Rd, CPSR
1340
-static INSN_REGPARM void arm100(u32 opcode)
1340
+static INSN_REGPARM void arm100(uint32_t opcode)
1341 1341
 {
1342 1342
     if (LIKELY((opcode & 0x0FFF0FFF) == 0x010F0000)) {
1343 1343
         CPUUpdateCPSR();
... ...
@@ -1348,7 +1348,7 @@ static INSN_REGPARM void arm100(u32 opcode)
1348 1348
 }
1349 1349
 
1350 1350
 // MRS Rd, SPSR
1351
-static INSN_REGPARM void arm140(u32 opcode)
1351
+static INSN_REGPARM void arm140(uint32_t opcode)
1352 1352
 {
1353 1353
     if (LIKELY((opcode & 0x0FFF0FFF) == 0x014F0000)) {
1354 1354
         reg[(opcode >> 12) & 0x0F].I = reg[17].I;
... ...
@@ -1358,12 +1358,12 @@ static INSN_REGPARM void arm140(u32 opcode)
1358 1358
 }
1359 1359
 
1360 1360
 // MSR CPSR_fields, Rm
1361
-static INSN_REGPARM void arm120(u32 opcode)
1361
+static INSN_REGPARM void arm120(uint32_t opcode)
1362 1362
 {
1363 1363
     if (LIKELY((opcode & 0x0FF0FFF0) == 0x0120F000)) {
1364 1364
         CPUUpdateCPSR();
1365
-        u32 value = reg[opcode & 15].I;
1366
-        u32 newValue = reg[16].I;
1365
+        uint32_t value = reg[opcode & 15].I;
1366
+        uint32_t newValue = reg[16].I;
1367 1367
         if (armMode > 0x10) {
1368 1368
             if (opcode & 0x00010000)
1369 1369
                 newValue = (newValue & 0xFFFFFF00) | (value & 0x000000FF);
... ...
@@ -1388,10 +1388,10 @@ static INSN_REGPARM void arm120(u32 opcode)
1388 1388
 }
1389 1389
 
1390 1390
 // MSR SPSR_fields, Rm
1391
-static INSN_REGPARM void arm160(u32 opcode)
1391
+static INSN_REGPARM void arm160(uint32_t opcode)
1392 1392
 {
1393 1393
     if (LIKELY((opcode & 0x0FF0FFF0) == 0x0160F000)) {
1394
-        u32 value = reg[opcode & 15].I;
1394
+        uint32_t value = reg[opcode & 15].I;
1395 1395
         if (armMode > 0x10 && armMode < 0x1F) {
1396 1396
             if (opcode & 0x00010000)
1397 1397
                 reg[17].I = (reg[17].I & 0xFFFFFF00) | (value & 0x000000FF);
... ...
@@ -1408,16 +1408,16 @@ static INSN_REGPARM void arm160(u32 opcode)
1408 1408
 }
1409 1409
 
1410 1410
 // MSR CPSR_fields, #
1411
-static INSN_REGPARM void arm320(u32 opcode)
1411
+static INSN_REGPARM void arm320(uint32_t opcode)
1412 1412
 {
1413 1413
     if (LIKELY((opcode & 0x0FF0F000) == 0x0320F000)) {
1414 1414
         CPUUpdateCPSR();
1415
-        u32 value = opcode & 0xFF;
1415
+        uint32_t value = opcode & 0xFF;
1416 1416
         int shift = (opcode & 0xF00) >> 7;
1417 1417
         if (shift) {
1418 1418
             ROR_IMM_MSR;
1419 1419
         }
1420
-        u32 newValue = reg[16].I;
1420
+        uint32_t newValue = reg[16].I;
1421 1421
         if (armMode > 0x10) {
1422 1422
             if (opcode & 0x00010000)
1423 1423
                 newValue = (newValue & 0xFFFFFF00) | (value & 0x000000FF);
... ...
@@ -1444,11 +1444,11 @@ static INSN_REGPARM void arm320(u32 opcode)
1444 1444
 }
1445 1445
 
1446 1446
 // MSR SPSR_fields, #
1447
-static INSN_REGPARM void arm360(u32 opcode)
1447
+static INSN_REGPARM void arm360(uint32_t opcode)
1448 1448
 {
1449 1449
     if (LIKELY((opcode & 0x0FF0F000) == 0x0360F000)) {
1450 1450
         if (armMode > 0x10 && armMode < 0x1F) {
1451
-            u32 value = opcode & 0xFF;
1451
+            uint32_t value = opcode & 0xFF;
1452 1452
             int shift = (opcode & 0xF00) >> 7;
1453 1453
             if (shift) {
1454 1454
                 ROR_IMM_MSR;
... ...
@@ -1468,7 +1468,7 @@ static INSN_REGPARM void arm360(u32 opcode)
1468 1468
 }
1469 1469
 
1470 1470
 // BX Rm
1471
-static INSN_REGPARM void arm121(u32 opcode)
1471
+static INSN_REGPARM void arm121(uint32_t opcode)
1472 1472
 {
1473 1473
     if (LIKELY((opcode & 0x0FFFFFF0) == 0x012FFF10)) {
1474 1474
         int base = opcode & 0x0F;
... ...
@@ -1513,14 +1513,14 @@ static INSN_REGPARM void arm121(u32 opcode)
1513 1513
     int shift = (opcode >> 7) & 31;                     \
1514 1514
     int offset;                                         \
1515 1515
     if (shift)                                          \
1516
-        offset = (int)((s32)reg[opcode & 15].I >> shift);\
1516
+        offset = (int)((int32_t)reg[opcode & 15].I >> shift);\
1517 1517
     else if (reg[opcode & 15].I & 0x80000000)           \
1518 1518
         offset = 0xFFFFFFFF;                            \
1519 1519
     else                                                \
1520 1520
         offset = 0;
1521 1521
 #define OFFSET_ROR \
1522 1522
     int shift = (opcode >> 7) & 31;                     \
1523
-    u32 offset = reg[opcode & 15].I;                    \
1523
+    uint32_t offset = reg[opcode & 15].I;                    \
1524 1524
     if (shift) {                                        \
1525 1525
         ROR_OFFSET;                                     \
1526 1526
     } else {                                            \
... ...
@@ -1537,8 +1537,8 @@ static INSN_REGPARM void arm121(u32 opcode)
1537 1537
 #define OP_LDR    reg[dest].I = CPUReadMemory(address)
1538 1538
 #define OP_LDRH   reg[dest].I = CPUReadHalfWord(address)
1539 1539
 #define OP_LDRB   reg[dest].I = CPUReadByte(address)
1540
-#define OP_LDRSH  reg[dest].I = (u32)CPUReadHalfWordSigned(address)
1541
-#define OP_LDRSB  reg[dest].I = (s8)CPUReadByte(address)
1540
+#define OP_LDRSH  reg[dest].I = (uint32_t)CPUReadHalfWordSigned(address)
1541
+#define OP_LDRSB  reg[dest].I = (int8_t)CPUReadByte(address)
1542 1542
 
1543 1543
 #define WRITEBACK_NONE     /*nothing*/
1544 1544
 #define WRITEBACK_PRE      reg[base].I = address
... ...
@@ -1551,7 +1551,7 @@ static INSN_REGPARM void arm121(u32 opcode)
1551 1551
     int dest = (opcode >> 12) & 15;                     \
1552 1552
     int base = (opcode >> 16) & 15;                     \
1553 1553
     CALC_OFFSET;                                        \
1554
-    u32 address = CALC_ADDRESS;
1554
+    uint32_t address = CALC_ADDRESS;
1555 1555
 
1556 1556
 #define STR(CALC_OFFSET, CALC_ADDRESS, STORE_DATA, WRITEBACK1, WRITEBACK2, SIZE) \
1557 1557
     LDRSTR_INIT(CALC_OFFSET, CALC_ADDRESS);             \
... ...
@@ -1604,347 +1604,347 @@ static INSN_REGPARM void arm121(u32 opcode)
1604 1604
   LDR(CALC_OFFSET, ADDRESS_PREINC, LOAD_DATA, WRITEBACK_PRE, SIZE)
1605 1605
 
1606 1606
 // STRH Rd, [Rn], -Rm
1607
-static INSN_REGPARM void arm00B(u32 opcode) { STR_POSTDEC(OFFSET_REG, OP_STRH, 16); }
1607
+static INSN_REGPARM void arm00B(uint32_t opcode) { STR_POSTDEC(OFFSET_REG, OP_STRH, 16); }
1608 1608
 // STRH Rd, [Rn], #-offset
1609
-static INSN_REGPARM void arm04B(u32 opcode) { STR_POSTDEC(OFFSET_IMM8, OP_STRH, 16); }
1609
+static INSN_REGPARM void arm04B(uint32_t opcode) { STR_POSTDEC(OFFSET_IMM8, OP_STRH, 16); }
1610 1610
 // STRH Rd, [Rn], Rm
1611
-static INSN_REGPARM void arm08B(u32 opcode) { STR_POSTINC(OFFSET_REG, OP_STRH, 16); }
1611
+static INSN_REGPARM void arm08B(uint32_t opcode) { STR_POSTINC(OFFSET_REG, OP_STRH, 16); }
1612 1612
 // STRH Rd, [Rn], #offset
1613
-static INSN_REGPARM void arm0CB(u32 opcode) { STR_POSTINC(OFFSET_IMM8, OP_STRH, 16); }
1613
+static INSN_REGPARM void arm0CB(uint32_t opcode) { STR_POSTINC(OFFSET_IMM8, OP_STRH, 16); }
1614 1614
 // STRH Rd, [Rn, -Rm]
1615
-static INSN_REGPARM void arm10B(u32 opcode) { STR_PREDEC(OFFSET_REG, OP_STRH, 16); }
1615
+static INSN_REGPARM void arm10B(uint32_t opcode) { STR_PREDEC(OFFSET_REG, OP_STRH, 16); }
1616 1616
 // STRH Rd, [Rn, -Rm]!
1617
-static INSN_REGPARM void arm12B(u32 opcode) { STR_PREDEC_WB(OFFSET_REG, OP_STRH, 16); }
1617
+static INSN_REGPARM void arm12B(uint32_t opcode) { STR_PREDEC_WB(OFFSET_REG, OP_STRH, 16); }
1618 1618
 // STRH Rd, [Rn, -#offset]
1619
-static INSN_REGPARM void arm14B(u32 opcode) { STR_PREDEC(OFFSET_IMM8, OP_STRH, 16); }
1619
+static INSN_REGPARM void arm14B(uint32_t opcode) { STR_PREDEC(OFFSET_IMM8, OP_STRH, 16); }
1620 1620
 // STRH Rd, [Rn, -#offset]!
1621
-static INSN_REGPARM void arm16B(u32 opcode) { STR_PREDEC_WB(OFFSET_IMM8, OP_STRH, 16); }
1621
+static INSN_REGPARM void arm16B(uint32_t opcode) { STR_PREDEC_WB(OFFSET_IMM8, OP_STRH, 16); }
1622 1622
 // STRH Rd, [Rn, Rm]
1623
-static INSN_REGPARM void arm18B(u32 opcode) { STR_PREINC(OFFSET_REG, OP_STRH, 16); }
1623
+static INSN_REGPARM void arm18B(uint32_t opcode) { STR_PREINC(OFFSET_REG, OP_STRH, 16); }
1624 1624
 // STRH Rd, [Rn, Rm]!
1625
-static INSN_REGPARM void arm1AB(u32 opcode) { STR_PREINC_WB(OFFSET_REG, OP_STRH, 16); }
1625
+static INSN_REGPARM void arm1AB(uint32_t opcode) { STR_PREINC_WB(OFFSET_REG, OP_STRH, 16); }
1626 1626
 // STRH Rd, [Rn, #offset]
1627
-static INSN_REGPARM void arm1CB(u32 opcode) { STR_PREINC(OFFSET_IMM8, OP_STRH, 16); }
1627
+static INSN_REGPARM void arm1CB(uint32_t opcode) { STR_PREINC(OFFSET_IMM8, OP_STRH, 16); }
1628 1628
 // STRH Rd, [Rn, #offset]!
1629
-static INSN_REGPARM void arm1EB(u32 opcode) { STR_PREINC_WB(OFFSET_IMM8, OP_STRH, 16); }
1629
+static INSN_REGPARM void arm1EB(uint32_t opcode) { STR_PREINC_WB(OFFSET_IMM8, OP_STRH, 16); }
1630 1630
 
1631 1631
 // LDRH Rd, [Rn], -Rm
1632
-static INSN_REGPARM void arm01B(u32 opcode) { LDR_POSTDEC(OFFSET_REG, OP_LDRH, 16); }
1632
+static INSN_REGPARM void arm01B(uint32_t opcode) { LDR_POSTDEC(OFFSET_REG, OP_LDRH, 16); }
1633 1633
 // LDRH Rd, [Rn], #-offset
1634
-static INSN_REGPARM void arm05B(u32 opcode) { LDR_POSTDEC(OFFSET_IMM8, OP_LDRH, 16); }
1634
+static INSN_REGPARM void arm05B(uint32_t opcode) { LDR_POSTDEC(OFFSET_IMM8, OP_LDRH, 16); }
1635 1635
 // LDRH Rd, [Rn], Rm
1636
-static INSN_REGPARM void arm09B(u32 opcode) { LDR_POSTINC(OFFSET_REG, OP_LDRH, 16); }
1636
+static INSN_REGPARM void arm09B(uint32_t opcode) { LDR_POSTINC(OFFSET_REG, OP_LDRH, 16); }
1637 1637
 // LDRH Rd, [Rn], #offset
1638
-static INSN_REGPARM void arm0DB(u32 opcode) { LDR_POSTINC(OFFSET_IMM8, OP_LDRH, 16); }
1638
+static INSN_REGPARM void arm0DB(uint32_t opcode) { LDR_POSTINC(OFFSET_IMM8, OP_LDRH, 16); }
1639 1639
 // LDRH Rd, [Rn, -Rm]
1640
-static INSN_REGPARM void arm11B(u32 opcode) { LDR_PREDEC(OFFSET_REG, OP_LDRH, 16); }
1640
+static INSN_REGPARM void arm11B(uint32_t opcode) { LDR_PREDEC(OFFSET_REG, OP_LDRH, 16); }
1641 1641
 // LDRH Rd, [Rn, -Rm]!
1642
-static INSN_REGPARM void arm13B(u32 opcode) { LDR_PREDEC_WB(OFFSET_REG, OP_LDRH, 16); }
1642
+static INSN_REGPARM void arm13B(uint32_t opcode) { LDR_PREDEC_WB(OFFSET_REG, OP_LDRH, 16); }
1643 1643
 // LDRH Rd, [Rn, -#offset]
1644
-static INSN_REGPARM void arm15B(u32 opcode) { LDR_PREDEC(OFFSET_IMM8, OP_LDRH, 16); }
1644
+static INSN_REGPARM void arm15B(uint32_t opcode) { LDR_PREDEC(OFFSET_IMM8, OP_LDRH, 16); }
1645 1645
 // LDRH Rd, [Rn, -#offset]!
1646
-static INSN_REGPARM void arm17B(u32 opcode) { LDR_PREDEC_WB(OFFSET_IMM8, OP_LDRH, 16); }
1646
+static INSN_REGPARM void arm17B(uint32_t opcode) { LDR_PREDEC_WB(OFFSET_IMM8, OP_LDRH, 16); }
1647 1647
 // LDRH Rd, [Rn, Rm]
1648
-static INSN_REGPARM void arm19B(u32 opcode) { LDR_PREINC(OFFSET_REG, OP_LDRH, 16); }
1648
+static INSN_REGPARM void arm19B(uint32_t opcode) { LDR_PREINC(OFFSET_REG, OP_LDRH, 16); }
1649 1649
 // LDRH Rd, [Rn, Rm]!
1650
-static INSN_REGPARM void arm1BB(u32 opcode) { LDR_PREINC_WB(OFFSET_REG, OP_LDRH, 16); }
1650
+static INSN_REGPARM void arm1BB(uint32_t opcode) { LDR_PREINC_WB(OFFSET_REG, OP_LDRH, 16); }
1651 1651
 // LDRH Rd, [Rn, #offset]
1652
-static INSN_REGPARM void arm1DB(u32 opcode) { LDR_PREINC(OFFSET_IMM8, OP_LDRH, 16); }
1652
+static INSN_REGPARM void arm1DB(uint32_t opcode) { LDR_PREINC(OFFSET_IMM8, OP_LDRH, 16); }
1653 1653
 // LDRH Rd, [Rn, #offset]!
1654
-static INSN_REGPARM void arm1FB(u32 opcode) { LDR_PREINC_WB(OFFSET_IMM8, OP_LDRH, 16); }
1654
+static INSN_REGPARM void arm1FB(uint32_t opcode) { LDR_PREINC_WB(OFFSET_IMM8, OP_LDRH, 16); }
1655 1655
 
1656 1656
 // LDRSB Rd, [Rn], -Rm
1657
-static INSN_REGPARM void arm01D(u32 opcode) { LDR_POSTDEC(OFFSET_REG, OP_LDRSB, 16); }
1657
+static INSN_REGPARM void arm01D(uint32_t opcode) { LDR_POSTDEC(OFFSET_REG, OP_LDRSB, 16); }
1658 1658
 // LDRSB Rd, [Rn], #-offset
1659
-static INSN_REGPARM void arm05D(u32 opcode) { LDR_POSTDEC(OFFSET_IMM8, OP_LDRSB, 16); }
1659
+static INSN_REGPARM void arm05D(uint32_t opcode) { LDR_POSTDEC(OFFSET_IMM8, OP_LDRSB, 16); }
1660 1660
 // LDRSB Rd, [Rn], Rm
1661
-static INSN_REGPARM void arm09D(u32 opcode) { LDR_POSTINC(OFFSET_REG, OP_LDRSB, 16); }
1661
+static INSN_REGPARM void arm09D(uint32_t opcode) { LDR_POSTINC(OFFSET_REG, OP_LDRSB, 16); }
1662 1662
 // LDRSB Rd, [Rn], #offset
1663
-static INSN_REGPARM void arm0DD(u32 opcode) { LDR_POSTINC(OFFSET_IMM8, OP_LDRSB, 16); }
1663
+static INSN_REGPARM void arm0DD(uint32_t opcode) { LDR_POSTINC(OFFSET_IMM8, OP_LDRSB, 16); }
1664 1664
 // LDRSB Rd, [Rn, -Rm]
1665
-static INSN_REGPARM void arm11D(u32 opcode) { LDR_PREDEC(OFFSET_REG, OP_LDRSB, 16); }
1665
+static INSN_REGPARM void arm11D(uint32_t opcode) { LDR_PREDEC(OFFSET_REG, OP_LDRSB, 16); }
1666 1666
 // LDRSB Rd, [Rn, -Rm]!
1667
-static INSN_REGPARM void arm13D(u32 opcode) { LDR_PREDEC_WB(OFFSET_REG, OP_LDRSB, 16); }
1667
+static INSN_REGPARM void arm13D(uint32_t opcode) { LDR_PREDEC_WB(OFFSET_REG, OP_LDRSB, 16); }
1668 1668
 // LDRSB Rd, [Rn, -#offset]
1669
-static INSN_REGPARM void arm15D(u32 opcode) { LDR_PREDEC(OFFSET_IMM8, OP_LDRSB, 16); }
1669
+static INSN_REGPARM void arm15D(uint32_t opcode) { LDR_PREDEC(OFFSET_IMM8, OP_LDRSB, 16); }
1670 1670
 // LDRSB Rd, [Rn, -#offset]!
1671
-static INSN_REGPARM void arm17D(u32 opcode) { LDR_PREDEC_WB(OFFSET_IMM8, OP_LDRSB, 16); }
1671
+static INSN_REGPARM void arm17D(uint32_t opcode) { LDR_PREDEC_WB(OFFSET_IMM8, OP_LDRSB, 16); }
1672 1672
 // LDRSB Rd, [Rn, Rm]
1673
-static INSN_REGPARM void arm19D(u32 opcode) { LDR_PREINC(OFFSET_REG, OP_LDRSB, 16); }
1673
+static INSN_REGPARM void arm19D(uint32_t opcode) { LDR_PREINC(OFFSET_REG, OP_LDRSB, 16); }
1674 1674
 // LDRSB Rd, [Rn, Rm]!
1675
-static INSN_REGPARM void arm1BD(u32 opcode) { LDR_PREINC_WB(OFFSET_REG, OP_LDRSB, 16); }
1675
+static INSN_REGPARM void arm1BD(uint32_t opcode) { LDR_PREINC_WB(OFFSET_REG, OP_LDRSB, 16); }
1676 1676
 // LDRSB Rd, [Rn, #offset]
1677
-static INSN_REGPARM void arm1DD(u32 opcode) { LDR_PREINC(OFFSET_IMM8, OP_LDRSB, 16); }
1677
+static INSN_REGPARM void arm1DD(uint32_t opcode) { LDR_PREINC(OFFSET_IMM8, OP_LDRSB, 16); }
1678 1678
 // LDRSB Rd, [Rn, #offset]!
1679
-static INSN_REGPARM void arm1FD(u32 opcode) { LDR_PREINC_WB(OFFSET_IMM8, OP_LDRSB, 16); }
1679
+static INSN_REGPARM void arm1FD(uint32_t opcode) { LDR_PREINC_WB(OFFSET_IMM8, OP_LDRSB, 16); }
1680 1680
 
1681 1681
 // LDRSH Rd, [Rn], -Rm
1682
-static INSN_REGPARM void arm01F(u32 opcode) { LDR_POSTDEC(OFFSET_REG, OP_LDRSH, 16); }
1682
+static INSN_REGPARM void arm01F(uint32_t opcode) { LDR_POSTDEC(OFFSET_REG, OP_LDRSH, 16); }
1683 1683
 // LDRSH Rd, [Rn], #-offset
1684
-static INSN_REGPARM void arm05F(u32 opcode) { LDR_POSTDEC(OFFSET_IMM8, OP_LDRSH, 16); }
1684
+static INSN_REGPARM void arm05F(uint32_t opcode) { LDR_POSTDEC(OFFSET_IMM8, OP_LDRSH, 16); }
1685 1685
 // LDRSH Rd, [Rn], Rm
1686
-static INSN_REGPARM void arm09F(u32 opcode) { LDR_POSTINC(OFFSET_REG, OP_LDRSH, 16); }
1686
+static INSN_REGPARM void arm09F(uint32_t opcode) { LDR_POSTINC(OFFSET_REG, OP_LDRSH, 16); }
1687 1687
 // LDRSH Rd, [Rn], #offset
1688
-static INSN_REGPARM void arm0DF(u32 opcode) { LDR_POSTINC(OFFSET_IMM8, OP_LDRSH, 16); }
1688
+static INSN_REGPARM void arm0DF(uint32_t opcode) { LDR_POSTINC(OFFSET_IMM8, OP_LDRSH, 16); }
1689 1689
 // LDRSH Rd, [Rn, -Rm]
1690
-static INSN_REGPARM void arm11F(u32 opcode) { LDR_PREDEC(OFFSET_REG, OP_LDRSH, 16); }
1690
+static INSN_REGPARM void arm11F(uint32_t opcode) { LDR_PREDEC(OFFSET_REG, OP_LDRSH, 16); }
1691 1691
 // LDRSH Rd, [Rn, -Rm]!
1692
-static INSN_REGPARM void arm13F(u32 opcode) { LDR_PREDEC_WB(OFFSET_REG, OP_LDRSH, 16); }
1692
+static INSN_REGPARM void arm13F(uint32_t opcode) { LDR_PREDEC_WB(OFFSET_REG, OP_LDRSH, 16); }
1693 1693
 // LDRSH Rd, [Rn, -#offset]
1694
-static INSN_REGPARM void arm15F(u32 opcode) { LDR_PREDEC(OFFSET_IMM8, OP_LDRSH, 16); }
1694
+static INSN_REGPARM void arm15F(uint32_t opcode) { LDR_PREDEC(OFFSET_IMM8, OP_LDRSH, 16); }
1695 1695
 // LDRSH Rd, [Rn, -#offset]!
1696
-static INSN_REGPARM void arm17F(u32 opcode) { LDR_PREDEC_WB(OFFSET_IMM8, OP_LDRSH, 16); }
1696
+static INSN_REGPARM void arm17F(uint32_t opcode) { LDR_PREDEC_WB(OFFSET_IMM8, OP_LDRSH, 16); }
1697 1697
 // LDRSH Rd, [Rn, Rm]
1698
-static INSN_REGPARM void arm19F(u32 opcode) { LDR_PREINC(OFFSET_REG, OP_LDRSH, 16); }
1698
+static INSN_REGPARM void arm19F(uint32_t opcode) { LDR_PREINC(OFFSET_REG, OP_LDRSH, 16); }
1699 1699
 // LDRSH Rd, [Rn, Rm]!
1700
-static INSN_REGPARM void arm1BF(u32 opcode) { LDR_PREINC_WB(OFFSET_REG, OP_LDRSH, 16); }
1700
+static INSN_REGPARM void arm1BF(uint32_t opcode) { LDR_PREINC_WB(OFFSET_REG, OP_LDRSH, 16); }
1701 1701
 // LDRSH Rd, [Rn, #offset]
1702
-static INSN_REGPARM void arm1DF(u32 opcode) { LDR_PREINC(OFFSET_IMM8, OP_LDRSH, 16); }
1702
+static INSN_REGPARM void arm1DF(uint32_t opcode) { LDR_PREINC(OFFSET_IMM8, OP_LDRSH, 16); }
1703 1703
 // LDRSH Rd, [Rn, #offset]!
1704
-static INSN_REGPARM void arm1FF(u32 opcode) { LDR_PREINC_WB(OFFSET_IMM8, OP_LDRSH, 16); }
1704
+static INSN_REGPARM void arm1FF(uint32_t opcode) { LDR_PREINC_WB(OFFSET_IMM8, OP_LDRSH, 16); }
1705 1705
 
1706 1706
 // STR[T] Rd, [Rn], -#
1707 1707
 // Note: STR and STRT do the same thing on the GBA (likewise for LDR/LDRT etc)
1708
-static INSN_REGPARM void arm400(u32 opcode) { STR_POSTDEC(OFFSET_IMM, OP_STR, 32); }
1708
+static INSN_REGPARM void arm400(uint32_t opcode) { STR_POSTDEC(OFFSET_IMM, OP_STR, 32); }
1709 1709
 // LDR[T] Rd, [Rn], -#
1710
-static INSN_REGPARM void arm410(u32 opcode) { LDR_POSTDEC(OFFSET_IMM, OP_LDR, 32); }
1710
+static INSN_REGPARM void arm410(uint32_t opcode) { LDR_POSTDEC(OFFSET_IMM, OP_LDR, 32); }
1711 1711
 // STRB[T] Rd, [Rn], -#
1712
-static INSN_REGPARM void arm440(u32 opcode) { STR_POSTDEC(OFFSET_IMM, OP_STRB, 16); }
1712
+static INSN_REGPARM void arm440(uint32_t opcode) { STR_POSTDEC(OFFSET_IMM, OP_STRB, 16); }
1713 1713
 // LDRB[T] Rd, [Rn], -#
1714
-static INSN_REGPARM void arm450(u32 opcode) { LDR_POSTDEC(OFFSET_IMM, OP_LDRB, 16); }
1714
+static INSN_REGPARM void arm450(uint32_t opcode) { LDR_POSTDEC(OFFSET_IMM, OP_LDRB, 16); }
1715 1715
 // STR[T] Rd, [Rn], #
1716
-static INSN_REGPARM void arm480(u32 opcode) { STR_POSTINC(OFFSET_IMM, OP_STR, 32); }
1716
+static INSN_REGPARM void arm480(uint32_t opcode) { STR_POSTINC(OFFSET_IMM, OP_STR, 32); }
1717 1717
 // LDR Rd, [Rn], #
1718
-static INSN_REGPARM void arm490(u32 opcode) { LDR_POSTINC(OFFSET_IMM, OP_LDR, 32); }
1718
+static INSN_REGPARM void arm490(uint32_t opcode) { LDR_POSTINC(OFFSET_IMM, OP_LDR, 32); }
1719 1719
 // STRB[T] Rd, [Rn], #
1720
-static INSN_REGPARM void arm4C0(u32 opcode) { STR_POSTINC(OFFSET_IMM, OP_STRB, 16); }
1720
+static INSN_REGPARM void arm4C0(uint32_t opcode) { STR_POSTINC(OFFSET_IMM, OP_STRB, 16); }
1721 1721
 // LDRB[T] Rd, [Rn], #
1722
-static INSN_REGPARM void arm4D0(u32 opcode) { LDR_POSTINC(OFFSET_IMM, OP_LDRB, 16); }
1722
+static INSN_REGPARM void arm4D0(uint32_t opcode) { LDR_POSTINC(OFFSET_IMM, OP_LDRB, 16); }
1723 1723
 // STR Rd, [Rn, -#]
1724
-static INSN_REGPARM void arm500(u32 opcode) { STR_PREDEC(OFFSET_IMM, OP_STR, 32); }
1724
+static INSN_REGPARM void arm500(uint32_t opcode) { STR_PREDEC(OFFSET_IMM, OP_STR, 32); }
1725 1725
 // LDR Rd, [Rn, -#]
1726
-static INSN_REGPARM void arm510(u32 opcode) { LDR_PREDEC(OFFSET_IMM, OP_LDR, 32); }
1726
+static INSN_REGPARM void arm510(uint32_t opcode) { LDR_PREDEC(OFFSET_IMM, OP_LDR, 32); }
1727 1727
 // STR Rd, [Rn, -#]!
1728
-static INSN_REGPARM void arm520(u32 opcode) { STR_PREDEC_WB(OFFSET_IMM, OP_STR, 32); }
1728
+static INSN_REGPARM void arm520(uint32_t opcode) { STR_PREDEC_WB(OFFSET_IMM, OP_STR, 32); }
1729 1729
 // LDR Rd, [Rn, -#]!
1730
-static INSN_REGPARM void arm530(u32 opcode) { LDR_PREDEC_WB(OFFSET_IMM, OP_LDR, 32); }
1730
+static INSN_REGPARM void arm530(uint32_t opcode) { LDR_PREDEC_WB(OFFSET_IMM, OP_LDR, 32); }
1731 1731
 // STRB Rd, [Rn, -#]
1732
-static INSN_REGPARM void arm540(u32 opcode) { STR_PREDEC(OFFSET_IMM, OP_STRB, 16); }
1732
+static INSN_REGPARM void arm540(uint32_t opcode) { STR_PREDEC(OFFSET_IMM, OP_STRB, 16); }
1733 1733
 // LDRB Rd, [Rn, -#]
1734
-static INSN_REGPARM void arm550(u32 opcode) { LDR_PREDEC(OFFSET_IMM, OP_LDRB, 16); }
1734
+static INSN_REGPARM void arm550(uint32_t opcode) { LDR_PREDEC(OFFSET_IMM, OP_LDRB, 16); }
1735 1735
 // STRB Rd, [Rn, -#]!
1736
-static INSN_REGPARM void arm560(u32 opcode) { STR_PREDEC_WB(OFFSET_IMM, OP_STRB, 16); }
1736
+static INSN_REGPARM void arm560(uint32_t opcode) { STR_PREDEC_WB(OFFSET_IMM, OP_STRB, 16); }
1737 1737
 // LDRB Rd, [Rn, -#]!
1738
-static INSN_REGPARM void arm570(u32 opcode) { LDR_PREDEC_WB(OFFSET_IMM, OP_LDRB, 16); }
1738
+static INSN_REGPARM void arm570(uint32_t opcode) { LDR_PREDEC_WB(OFFSET_IMM, OP_LDRB, 16); }
1739 1739
 // STR Rd, [Rn, #]
1740
-static INSN_REGPARM void arm580(u32 opcode) { STR_PREINC(OFFSET_IMM, OP_STR, 32); }
1740
+static INSN_REGPARM void arm580(uint32_t opcode) { STR_PREINC(OFFSET_IMM, OP_STR, 32); }
1741 1741
 // LDR Rd, [Rn, #]
1742
-static INSN_REGPARM void arm590(u32 opcode) { LDR_PREINC(OFFSET_IMM, OP_LDR, 32); }
1742
+static INSN_REGPARM void arm590(uint32_t opcode) { LDR_PREINC(OFFSET_IMM, OP_LDR, 32); }
1743 1743
 // STR Rd, [Rn, #]!
1744
-static INSN_REGPARM void arm5A0(u32 opcode) { STR_PREINC_WB(OFFSET_IMM, OP_STR, 32); }
1744
+static INSN_REGPARM void arm5A0(uint32_t opcode) { STR_PREINC_WB(OFFSET_IMM, OP_STR, 32); }
1745 1745
 // LDR Rd, [Rn, #]!
1746
-static INSN_REGPARM void arm5B0(u32 opcode) { LDR_PREINC_WB(OFFSET_IMM, OP_LDR, 32); }
1746
+static INSN_REGPARM void arm5B0(uint32_t opcode) { LDR_PREINC_WB(OFFSET_IMM, OP_LDR, 32); }
1747 1747
 // STRB Rd, [Rn, #]
1748
-static INSN_REGPARM void arm5C0(u32 opcode) { STR_PREINC(OFFSET_IMM, OP_STRB, 16); }
1748
+static INSN_REGPARM void arm5C0(uint32_t opcode) { STR_PREINC(OFFSET_IMM, OP_STRB, 16); }
1749 1749
 // LDRB Rd, [Rn, #]
1750
-static INSN_REGPARM void arm5D0(u32 opcode) { LDR_PREINC(OFFSET_IMM, OP_LDRB, 16); }
1750
+static INSN_REGPARM void arm5D0(uint32_t opcode) { LDR_PREINC(OFFSET_IMM, OP_LDRB, 16); }
1751 1751
 // STRB Rd, [Rn, #]!
1752
-static INSN_REGPARM void arm5E0(u32 opcode) { STR_PREINC_WB(OFFSET_IMM, OP_STRB, 16); }
1752
+static INSN_REGPARM void arm5E0(uint32_t opcode) { STR_PREINC_WB(OFFSET_IMM, OP_STRB, 16); }
1753 1753
 // LDRB Rd, [Rn, #]!
1754
-static INSN_REGPARM void arm5F0(u32 opcode) { LDR_PREINC_WB(OFFSET_IMM, OP_LDRB, 16); }
1754
+static INSN_REGPARM void arm5F0(uint32_t opcode) { LDR_PREINC_WB(OFFSET_IMM, OP_LDRB, 16); }
1755 1755
 
1756 1756
 // STR[T] Rd, [Rn], -Rm, LSL #
1757
-static INSN_REGPARM void arm600(u32 opcode) { STR_POSTDEC(OFFSET_LSL, OP_STR, 32); }
1757
+static INSN_REGPARM void arm600(uint32_t opcode) { STR_POSTDEC(OFFSET_LSL, OP_STR, 32); }
1758 1758
 // STR[T] Rd, [Rn], -Rm, LSR #
1759
-static INSN_REGPARM void arm602(u32 opcode) { STR_POSTDEC(OFFSET_LSR, OP_STR, 32); }
1759
+static INSN_REGPARM void arm602(uint32_t opcode) { STR_POSTDEC(OFFSET_LSR, OP_STR, 32); }
1760 1760
 // STR[T] Rd, [Rn], -Rm, ASR #
1761
-static INSN_REGPARM void arm604(u32 opcode) { STR_POSTDEC(OFFSET_ASR, OP_STR, 32); }
1761
+static INSN_REGPARM void arm604(uint32_t opcode) { STR_POSTDEC(OFFSET_ASR, OP_STR, 32); }
1762 1762
 // STR[T] Rd, [Rn], -Rm, ROR #
1763
-static INSN_REGPARM void arm606(u32 opcode) { STR_POSTDEC(OFFSET_ROR, OP_STR, 32); }
1763
+static INSN_REGPARM void arm606(uint32_t opcode) { STR_POSTDEC(OFFSET_ROR, OP_STR, 32); }
1764 1764
 // LDR[T] Rd, [Rn], -Rm, LSL #
1765
-static INSN_REGPARM void arm610(u32 opcode) { LDR_POSTDEC(OFFSET_LSL, OP_LDR, 32); }
1765
+static INSN_REGPARM void arm610(uint32_t opcode) { LDR_POSTDEC(OFFSET_LSL, OP_LDR, 32); }
1766 1766
 // LDR[T] Rd, [Rn], -Rm, LSR #
1767
-static INSN_REGPARM void arm612(u32 opcode) { LDR_POSTDEC(OFFSET_LSR, OP_LDR, 32); }
1767
+static INSN_REGPARM void arm612(uint32_t opcode) { LDR_POSTDEC(OFFSET_LSR, OP_LDR, 32); }
1768 1768
 // LDR[T] Rd, [Rn], -Rm, ASR #
1769
-static INSN_REGPARM void arm614(u32 opcode) { LDR_POSTDEC(OFFSET_ASR, OP_LDR, 32); }
1769
+static INSN_REGPARM void arm614(uint32_t opcode) { LDR_POSTDEC(OFFSET_ASR, OP_LDR, 32); }
1770 1770
 // LDR[T] Rd, [Rn], -Rm, ROR #
1771
-static INSN_REGPARM void arm616(u32 opcode) { LDR_POSTDEC(OFFSET_ROR, OP_LDR, 32); }
1771
+static INSN_REGPARM void arm616(uint32_t opcode) { LDR_POSTDEC(OFFSET_ROR, OP_LDR, 32); }
1772 1772
 // STRB[T] Rd, [Rn], -Rm, LSL #
1773
-static INSN_REGPARM void arm640(u32 opcode) { STR_POSTDEC(OFFSET_LSL, OP_STRB, 16); }
1773
+static INSN_REGPARM void arm640(uint32_t opcode) { STR_POSTDEC(OFFSET_LSL, OP_STRB, 16); }
1774 1774
 // STRB[T] Rd, [Rn], -Rm, LSR #
1775
-static INSN_REGPARM void arm642(u32 opcode) { STR_POSTDEC(OFFSET_LSR, OP_STRB, 16); }
1775
+static INSN_REGPARM void arm642(uint32_t opcode) { STR_POSTDEC(OFFSET_LSR, OP_STRB, 16); }
1776 1776
 // STRB[T] Rd, [Rn], -Rm, ASR #
1777
-static INSN_REGPARM void arm644(u32 opcode) { STR_POSTDEC(OFFSET_ASR, OP_STRB, 16); }
1777
+static INSN_REGPARM void arm644(uint32_t opcode) { STR_POSTDEC(OFFSET_ASR, OP_STRB, 16); }
1778 1778
 // STRB[T] Rd, [Rn], -Rm, ROR #
1779
-static INSN_REGPARM void arm646(u32 opcode) { STR_POSTDEC(OFFSET_ROR, OP_STRB, 16); }
1779
+static INSN_REGPARM void arm646(uint32_t opcode) { STR_POSTDEC(OFFSET_ROR, OP_STRB, 16); }
1780 1780
 // LDRB[T] Rd, [Rn], -Rm, LSL #
1781
-static INSN_REGPARM void arm650(u32 opcode) { LDR_POSTDEC(OFFSET_LSL, OP_LDRB, 16); }
1781
+static INSN_REGPARM void arm650(uint32_t opcode) { LDR_POSTDEC(OFFSET_LSL, OP_LDRB, 16); }
1782 1782
 // LDRB[T] Rd, [Rn], -Rm, LSR #
1783
-static INSN_REGPARM void arm652(u32 opcode) { LDR_POSTDEC(OFFSET_LSR, OP_LDRB, 16); }
1783
+static INSN_REGPARM void arm652(uint32_t opcode) { LDR_POSTDEC(OFFSET_LSR, OP_LDRB, 16); }
1784 1784
 // LDRB[T] Rd, [Rn], -Rm, ASR #
1785
-static INSN_REGPARM void arm654(u32 opcode) { LDR_POSTDEC(OFFSET_ASR, OP_LDRB, 16); }
1785
+static INSN_REGPARM void arm654(uint32_t opcode) { LDR_POSTDEC(OFFSET_ASR, OP_LDRB, 16); }
1786 1786
 // LDRB Rd, [Rn], -Rm, ROR #
1787
-static INSN_REGPARM void arm656(u32 opcode) { LDR_POSTDEC(OFFSET_ROR, OP_LDRB, 16); }
1787
+static INSN_REGPARM void arm656(uint32_t opcode) { LDR_POSTDEC(OFFSET_ROR, OP_LDRB, 16); }
1788 1788
 // STR[T] Rd, [Rn], Rm, LSL #
1789
-static INSN_REGPARM void arm680(u32 opcode) { STR_POSTINC(OFFSET_LSL, OP_STR, 32); }
1789
+static INSN_REGPARM void arm680(uint32_t opcode) { STR_POSTINC(OFFSET_LSL, OP_STR, 32); }
1790 1790
 // STR[T] Rd, [Rn], Rm, LSR #
1791
-static INSN_REGPARM void arm682(u32 opcode) { STR_POSTINC(OFFSET_LSR, OP_STR, 32); }
1791
+static INSN_REGPARM void arm682(uint32_t opcode) { STR_POSTINC(OFFSET_LSR, OP_STR, 32); }
1792 1792
 // STR[T] Rd, [Rn], Rm, ASR #
1793
-static INSN_REGPARM void arm684(u32 opcode) { STR_POSTINC(OFFSET_ASR, OP_STR, 32); }
1793
+static INSN_REGPARM void arm684(uint32_t opcode) { STR_POSTINC(OFFSET_ASR, OP_STR, 32); }
1794 1794
 // STR[T] Rd, [Rn], Rm, ROR #
1795
-static INSN_REGPARM void arm686(u32 opcode) { STR_POSTINC(OFFSET_ROR, OP_STR, 32); }
1795
+static INSN_REGPARM void arm686(uint32_t opcode) { STR_POSTINC(OFFSET_ROR, OP_STR, 32); }
1796 1796
 // LDR[T] Rd, [Rn], Rm, LSL #
1797
-static INSN_REGPARM void arm690(u32 opcode) { LDR_POSTINC(OFFSET_LSL, OP_LDR, 32); }
1797
+static INSN_REGPARM void arm690(uint32_t opcode) { LDR_POSTINC(OFFSET_LSL, OP_LDR, 32); }
1798 1798
 // LDR[T] Rd, [Rn], Rm, LSR #
1799
-static INSN_REGPARM void arm692(u32 opcode) { LDR_POSTINC(OFFSET_LSR, OP_LDR, 32); }
1799
+static INSN_REGPARM void arm692(uint32_t opcode) { LDR_POSTINC(OFFSET_LSR, OP_LDR, 32); }
1800 1800
 // LDR[T] Rd, [Rn], Rm, ASR #
1801
-static INSN_REGPARM void arm694(u32 opcode) { LDR_POSTINC(OFFSET_ASR, OP_LDR, 32); }
1801
+static INSN_REGPARM void arm694(uint32_t opcode) { LDR_POSTINC(OFFSET_ASR, OP_LDR, 32); }
1802 1802
 // LDR[T] Rd, [Rn], Rm, ROR #
1803
-static INSN_REGPARM void arm696(u32 opcode) { LDR_POSTINC(OFFSET_ROR, OP_LDR, 32); }
1803
+static INSN_REGPARM void arm696(uint32_t opcode) { LDR_POSTINC(OFFSET_ROR, OP_LDR, 32); }
1804 1804
 // STRB[T] Rd, [Rn], Rm, LSL #
1805
-static INSN_REGPARM void arm6C0(u32 opcode) { STR_POSTINC(OFFSET_LSL, OP_STRB, 16); }
1805
+static INSN_REGPARM void arm6C0(uint32_t opcode) { STR_POSTINC(OFFSET_LSL, OP_STRB, 16); }
1806 1806
 // STRB[T] Rd, [Rn], Rm, LSR #
1807
-static INSN_REGPARM void arm6C2(u32 opcode) { STR_POSTINC(OFFSET_LSR, OP_STRB, 16); }
1807
+static INSN_REGPARM void arm6C2(uint32_t opcode) { STR_POSTINC(OFFSET_LSR, OP_STRB, 16); }
1808 1808
 // STRB[T] Rd, [Rn], Rm, ASR #
1809
-static INSN_REGPARM void arm6C4(u32 opcode) { STR_POSTINC(OFFSET_ASR, OP_STRB, 16); }
1809
+static INSN_REGPARM void arm6C4(uint32_t opcode) { STR_POSTINC(OFFSET_ASR, OP_STRB, 16); }
1810 1810
 // STRB[T] Rd, [Rn], Rm, ROR #
1811
-static INSN_REGPARM void arm6C6(u32 opcode) { STR_POSTINC(OFFSET_ROR, OP_STRB, 16); }
1811
+static INSN_REGPARM void arm6C6(uint32_t opcode) { STR_POSTINC(OFFSET_ROR, OP_STRB, 16); }
1812 1812
 // LDRB[T] Rd, [Rn], Rm, LSL #
1813
-static INSN_REGPARM void arm6D0(u32 opcode) { LDR_POSTINC(OFFSET_LSL, OP_LDRB, 16); }
1813
+static INSN_REGPARM void arm6D0(uint32_t opcode) { LDR_POSTINC(OFFSET_LSL, OP_LDRB, 16); }
1814 1814
 // LDRB[T] Rd, [Rn], Rm, LSR #
1815
-static INSN_REGPARM void arm6D2(u32 opcode) { LDR_POSTINC(OFFSET_LSR, OP_LDRB, 16); }
1815
+static INSN_REGPARM void arm6D2(uint32_t opcode) { LDR_POSTINC(OFFSET_LSR, OP_LDRB, 16); }
1816 1816
 // LDRB[T] Rd, [Rn], Rm, ASR #
1817
-static INSN_REGPARM void arm6D4(u32 opcode) { LDR_POSTINC(OFFSET_ASR, OP_LDRB, 16); }
1817
+static INSN_REGPARM void arm6D4(uint32_t opcode) { LDR_POSTINC(OFFSET_ASR, OP_LDRB, 16); }
1818 1818
 // LDRB[T] Rd, [Rn], Rm, ROR #
1819
-static INSN_REGPARM void arm6D6(u32 opcode) { LDR_POSTINC(OFFSET_ROR, OP_LDRB, 16); }
1819
+static INSN_REGPARM void arm6D6(uint32_t opcode) { LDR_POSTINC(OFFSET_ROR, OP_LDRB, 16); }
1820 1820
 // STR Rd, [Rn, -Rm, LSL #]
1821
-static INSN_REGPARM void arm700(u32 opcode) { STR_PREDEC(OFFSET_LSL, OP_STR, 32); }
1821
+static INSN_REGPARM void arm700(uint32_t opcode) { STR_PREDEC(OFFSET_LSL, OP_STR, 32); }
1822 1822
 // STR Rd, [Rn, -Rm, LSR #]
1823
-static INSN_REGPARM void arm702(u32 opcode) { STR_PREDEC(OFFSET_LSR, OP_STR, 32); }
1823
+static INSN_REGPARM void arm702(uint32_t opcode) { STR_PREDEC(OFFSET_LSR, OP_STR, 32); }
1824 1824
 // STR Rd, [Rn, -Rm, ASR #]
1825
-static INSN_REGPARM void arm704(u32 opcode) { STR_PREDEC(OFFSET_ASR, OP_STR, 32); }
1825
+static INSN_REGPARM void arm704(uint32_t opcode) { STR_PREDEC(OFFSET_ASR, OP_STR, 32); }
1826 1826
 // STR Rd, [Rn, -Rm, ROR #]
1827
-static INSN_REGPARM void arm706(u32 opcode) { STR_PREDEC(OFFSET_ROR, OP_STR, 32); }
1827
+static INSN_REGPARM void arm706(uint32_t opcode) { STR_PREDEC(OFFSET_ROR, OP_STR, 32); }
1828 1828
 // LDR Rd, [Rn, -Rm, LSL #]
1829
-static INSN_REGPARM void arm710(u32 opcode) { LDR_PREDEC(OFFSET_LSL, OP_LDR, 32); }
1829
+static INSN_REGPARM void arm710(uint32_t opcode) { LDR_PREDEC(OFFSET_LSL, OP_LDR, 32); }
1830 1830
 // LDR Rd, [Rn, -Rm, LSR #]
1831
-static INSN_REGPARM void arm712(u32 opcode) { LDR_PREDEC(OFFSET_LSR, OP_LDR, 32); }
1831
+static INSN_REGPARM void arm712(uint32_t opcode) { LDR_PREDEC(OFFSET_LSR, OP_LDR, 32); }
1832 1832
 // LDR Rd, [Rn, -Rm, ASR #]
1833
-static INSN_REGPARM void arm714(u32 opcode) { LDR_PREDEC(OFFSET_ASR, OP_LDR, 32); }
1833
+static INSN_REGPARM void arm714(uint32_t opcode) { LDR_PREDEC(OFFSET_ASR, OP_LDR, 32); }
1834 1834
 // LDR Rd, [Rn, -Rm, ROR #]
1835
-static INSN_REGPARM void arm716(u32 opcode) { LDR_PREDEC(OFFSET_ROR, OP_LDR, 32); }
1835
+static INSN_REGPARM void arm716(uint32_t opcode) { LDR_PREDEC(OFFSET_ROR, OP_LDR, 32); }
1836 1836
 // STR Rd, [Rn, -Rm, LSL #]!
1837
-static INSN_REGPARM void arm720(u32 opcode) { STR_PREDEC_WB(OFFSET_LSL, OP_STR, 32); }
1837
+static INSN_REGPARM void arm720(uint32_t opcode) { STR_PREDEC_WB(OFFSET_LSL, OP_STR, 32); }
1838 1838
 // STR Rd, [Rn, -Rm, LSR #]!
1839
-static INSN_REGPARM void arm722(u32 opcode) { STR_PREDEC_WB(OFFSET_LSR, OP_STR, 32); }
1839
+static INSN_REGPARM void arm722(uint32_t opcode) { STR_PREDEC_WB(OFFSET_LSR, OP_STR, 32); }
1840 1840
 // STR Rd, [Rn, -Rm, ASR #]!
1841
-static INSN_REGPARM void arm724(u32 opcode) { STR_PREDEC_WB(OFFSET_ASR, OP_STR, 32); }
1841
+static INSN_REGPARM void arm724(uint32_t opcode) { STR_PREDEC_WB(OFFSET_ASR, OP_STR, 32); }
1842 1842
 // STR Rd, [Rn, -Rm, ROR #]!
1843
-static INSN_REGPARM void arm726(u32 opcode) { STR_PREDEC_WB(OFFSET_ROR, OP_STR, 32); }
1843
+static INSN_REGPARM void arm726(uint32_t opcode) { STR_PREDEC_WB(OFFSET_ROR, OP_STR, 32); }
1844 1844
 // LDR Rd, [Rn, -Rm, LSL #]!
1845
-static INSN_REGPARM void arm730(u32 opcode) { LDR_PREDEC_WB(OFFSET_LSL, OP_LDR, 32); }
1845
+static INSN_REGPARM void arm730(uint32_t opcode) { LDR_PREDEC_WB(OFFSET_LSL, OP_LDR, 32); }
1846 1846
 // LDR Rd, [Rn, -Rm, LSR #]!
1847
-static INSN_REGPARM void arm732(u32 opcode) { LDR_PREDEC_WB(OFFSET_LSR, OP_LDR, 32); }
1847
+static INSN_REGPARM void arm732(uint32_t opcode) { LDR_PREDEC_WB(OFFSET_LSR, OP_LDR, 32); }
1848 1848
 // LDR Rd, [Rn, -Rm, ASR #]!
1849
-static INSN_REGPARM void arm734(u32 opcode) { LDR_PREDEC_WB(OFFSET_ASR, OP_LDR, 32); }
1849
+static INSN_REGPARM void arm734(uint32_t opcode) { LDR_PREDEC_WB(OFFSET_ASR, OP_LDR, 32); }
1850 1850
 // LDR Rd, [Rn, -Rm, ROR #]!
1851
-static INSN_REGPARM void arm736(u32 opcode) { LDR_PREDEC_WB(OFFSET_ROR, OP_LDR, 32); }
1851
+static INSN_REGPARM void arm736(uint32_t opcode) { LDR_PREDEC_WB(OFFSET_ROR, OP_LDR, 32); }
1852 1852
 // STRB Rd, [Rn, -Rm, LSL #]
1853
-static INSN_REGPARM void arm740(u32 opcode) { STR_PREDEC(OFFSET_LSL, OP_STRB, 16); }
1853
+static INSN_REGPARM void arm740(uint32_t opcode) { STR_PREDEC(OFFSET_LSL, OP_STRB, 16); }
1854 1854
 // STRB Rd, [Rn, -Rm, LSR #]
1855
-static INSN_REGPARM void arm742(u32 opcode) { STR_PREDEC(OFFSET_LSR, OP_STRB, 16); }
1855
+static INSN_REGPARM void arm742(uint32_t opcode) { STR_PREDEC(OFFSET_LSR, OP_STRB, 16); }
1856 1856
 // STRB Rd, [Rn, -Rm, ASR #]
1857
-static INSN_REGPARM void arm744(u32 opcode) { STR_PREDEC(OFFSET_ASR, OP_STRB, 16); }
1857
+static INSN_REGPARM void arm744(uint32_t opcode) { STR_PREDEC(OFFSET_ASR, OP_STRB, 16); }
1858 1858
 // STRB Rd, [Rn, -Rm, ROR #]
1859
-static INSN_REGPARM void arm746(u32 opcode) { STR_PREDEC(OFFSET_ROR, OP_STRB, 16); }
1859
+static INSN_REGPARM void arm746(uint32_t opcode) { STR_PREDEC(OFFSET_ROR, OP_STRB, 16); }
1860 1860
 // LDRB Rd, [Rn, -Rm, LSL #]
1861
-static INSN_REGPARM void arm750(u32 opcode) { LDR_PREDEC(OFFSET_LSL, OP_LDRB, 16); }
1861
+static INSN_REGPARM void arm750(uint32_t opcode) { LDR_PREDEC(OFFSET_LSL, OP_LDRB, 16); }
1862 1862
 // LDRB Rd, [Rn, -Rm, LSR #]
1863
-static INSN_REGPARM void arm752(u32 opcode) { LDR_PREDEC(OFFSET_LSR, OP_LDRB, 16); }
1863
+static INSN_REGPARM void arm752(uint32_t opcode) { LDR_PREDEC(OFFSET_LSR, OP_LDRB, 16); }
1864 1864
 // LDRB Rd, [Rn, -Rm, ASR #]
1865
-static INSN_REGPARM void arm754(u32 opcode) { LDR_PREDEC(OFFSET_ASR, OP_LDRB, 16); }
1865
+static INSN_REGPARM void arm754(uint32_t opcode) { LDR_PREDEC(OFFSET_ASR, OP_LDRB, 16); }
1866 1866
 // LDRB Rd, [Rn, -Rm, ROR #]
1867
-static INSN_REGPARM void arm756(u32 opcode) { LDR_PREDEC(OFFSET_ROR, OP_LDRB, 16); }
1867
+static INSN_REGPARM void arm756(uint32_t opcode) { LDR_PREDEC(OFFSET_ROR, OP_LDRB, 16); }
1868 1868
 // STRB Rd, [Rn, -Rm, LSL #]!
1869
-static INSN_REGPARM void arm760(u32 opcode) { STR_PREDEC_WB(OFFSET_LSL, OP_STRB, 16); }
1869
+static INSN_REGPARM void arm760(uint32_t opcode) { STR_PREDEC_WB(OFFSET_LSL, OP_STRB, 16); }
1870 1870
 // STRB Rd, [Rn, -Rm, LSR #]!
1871
-static INSN_REGPARM void arm762(u32 opcode) { STR_PREDEC_WB(OFFSET_LSR, OP_STRB, 16); }
1871
+static INSN_REGPARM void arm762(uint32_t opcode) { STR_PREDEC_WB(OFFSET_LSR, OP_STRB, 16); }
1872 1872
 // STRB Rd, [Rn, -Rm, ASR #]!
1873
-static INSN_REGPARM void arm764(u32 opcode) { STR_PREDEC_WB(OFFSET_ASR, OP_STRB, 16); }
1873
+static INSN_REGPARM void arm764(uint32_t opcode) { STR_PREDEC_WB(OFFSET_ASR, OP_STRB, 16); }
1874 1874
 // STRB Rd, [Rn, -Rm, ROR #]!
1875
-static INSN_REGPARM void arm766(u32 opcode) { STR_PREDEC_WB(OFFSET_ROR, OP_STRB, 16); }
1875
+static INSN_REGPARM void arm766(uint32_t opcode) { STR_PREDEC_WB(OFFSET_ROR, OP_STRB, 16); }
1876 1876
 // LDRB Rd, [Rn, -Rm, LSL #]!
1877
-static INSN_REGPARM void arm770(u32 opcode) { LDR_PREDEC_WB(OFFSET_LSL, OP_LDRB, 16); }
1877
+static INSN_REGPARM void arm770(uint32_t opcode) { LDR_PREDEC_WB(OFFSET_LSL, OP_LDRB, 16); }
1878 1878
 // LDRB Rd, [Rn, -Rm, LSR #]!
1879
-static INSN_REGPARM void arm772(u32 opcode) { LDR_PREDEC_WB(OFFSET_LSR, OP_LDRB, 16); }
1879
+static INSN_REGPARM void arm772(uint32_t opcode) { LDR_PREDEC_WB(OFFSET_LSR, OP_LDRB, 16); }
1880 1880
 // LDRB Rd, [Rn, -Rm, ASR #]!
1881
-static INSN_REGPARM void arm774(u32 opcode) { LDR_PREDEC_WB(OFFSET_ASR, OP_LDRB, 16); }
1881
+static INSN_REGPARM void arm774(uint32_t opcode) { LDR_PREDEC_WB(OFFSET_ASR, OP_LDRB, 16); }
1882 1882
 // LDRB Rd, [Rn, -Rm, ROR #]!
1883
-static INSN_REGPARM void arm776(u32 opcode) { LDR_PREDEC_WB(OFFSET_ROR, OP_LDRB, 16); }
1883
+static INSN_REGPARM void arm776(uint32_t opcode) { LDR_PREDEC_WB(OFFSET_ROR, OP_LDRB, 16); }
1884 1884
 // STR Rd, [Rn, Rm, LSL #]
1885
-static INSN_REGPARM void arm780(u32 opcode) { STR_PREINC(OFFSET_LSL, OP_STR, 32); }
1885
+static INSN_REGPARM void arm780(uint32_t opcode) { STR_PREINC(OFFSET_LSL, OP_STR, 32); }
1886 1886
 // STR Rd, [Rn, Rm, LSR #]
1887
-static INSN_REGPARM void arm782(u32 opcode) { STR_PREINC(OFFSET_LSR, OP_STR, 32); }
1887
+static INSN_REGPARM void arm782(uint32_t opcode) { STR_PREINC(OFFSET_LSR, OP_STR, 32); }
1888 1888
 // STR Rd, [Rn, Rm, ASR #]
1889
-static INSN_REGPARM void arm784(u32 opcode) { STR_PREINC(OFFSET_ASR, OP_STR, 32); }
1889
+static INSN_REGPARM void arm784(uint32_t opcode) { STR_PREINC(OFFSET_ASR, OP_STR, 32); }
1890 1890
 // STR Rd, [Rn, Rm, ROR #]
1891
-static INSN_REGPARM void arm786(u32 opcode) { STR_PREINC(OFFSET_ROR, OP_STR, 32); }
1891
+static INSN_REGPARM void arm786(uint32_t opcode) { STR_PREINC(OFFSET_ROR, OP_STR, 32); }
1892 1892
 // LDR Rd, [Rn, Rm, LSL #]
1893
-static INSN_REGPARM void arm790(u32 opcode) { LDR_PREINC(OFFSET_LSL, OP_LDR, 32); }
1893
+static INSN_REGPARM void arm790(uint32_t opcode) { LDR_PREINC(OFFSET_LSL, OP_LDR, 32); }
1894 1894
 // LDR Rd, [Rn, Rm, LSR #]
1895
-static INSN_REGPARM void arm792(u32 opcode) { LDR_PREINC(OFFSET_LSR, OP_LDR, 32); }
1895
+static INSN_REGPARM void arm792(uint32_t opcode) { LDR_PREINC(OFFSET_LSR, OP_LDR, 32); }
1896 1896
 // LDR Rd, [Rn, Rm, ASR #]
1897
-static INSN_REGPARM void arm794(u32 opcode) { LDR_PREINC(OFFSET_ASR, OP_LDR, 32); }
1897
+static INSN_REGPARM void arm794(uint32_t opcode) { LDR_PREINC(OFFSET_ASR, OP_LDR, 32); }
1898 1898
 // LDR Rd, [Rn, Rm, ROR #]
1899
-static INSN_REGPARM void arm796(u32 opcode) { LDR_PREINC(OFFSET_ROR, OP_LDR, 32); }
1899
+static INSN_REGPARM void arm796(uint32_t opcode) { LDR_PREINC(OFFSET_ROR, OP_LDR, 32); }
1900 1900
 // STR Rd, [Rn, Rm, LSL #]!
1901
-static INSN_REGPARM void arm7A0(u32 opcode) { STR_PREINC_WB(OFFSET_LSL, OP_STR, 32); }
1901
+static INSN_REGPARM void arm7A0(uint32_t opcode) { STR_PREINC_WB(OFFSET_LSL, OP_STR, 32); }
1902 1902
 // STR Rd, [Rn, Rm, LSR #]!
1903
-static INSN_REGPARM void arm7A2(u32 opcode) { STR_PREINC_WB(OFFSET_LSR, OP_STR, 32); }
1903
+static INSN_REGPARM void arm7A2(uint32_t opcode) { STR_PREINC_WB(OFFSET_LSR, OP_STR, 32); }
1904 1904
 // STR Rd, [Rn, Rm, ASR #]!
1905
-static INSN_REGPARM void arm7A4(u32 opcode) { STR_PREINC_WB(OFFSET_ASR, OP_STR, 32); }
1905
+static INSN_REGPARM void arm7A4(uint32_t opcode) { STR_PREINC_WB(OFFSET_ASR, OP_STR, 32); }
1906 1906
 // STR Rd, [Rn, Rm, ROR #]!
1907
-static INSN_REGPARM void arm7A6(u32 opcode) { STR_PREINC_WB(OFFSET_ROR, OP_STR, 32); }
1907
+static INSN_REGPARM void arm7A6(uint32_t opcode) { STR_PREINC_WB(OFFSET_ROR, OP_STR, 32); }
1908 1908
 // LDR Rd, [Rn, Rm, LSL #]!
1909
-static INSN_REGPARM void arm7B0(u32 opcode) { LDR_PREINC_WB(OFFSET_LSL, OP_LDR, 32); }
1909
+static INSN_REGPARM void arm7B0(uint32_t opcode) { LDR_PREINC_WB(OFFSET_LSL, OP_LDR, 32); }
1910 1910
 // LDR Rd, [Rn, Rm, LSR #]!
1911
-static INSN_REGPARM void arm7B2(u32 opcode) { LDR_PREINC_WB(OFFSET_LSR, OP_LDR, 32); }
1911
+static INSN_REGPARM void arm7B2(uint32_t opcode) { LDR_PREINC_WB(OFFSET_LSR, OP_LDR, 32); }
1912 1912
 // LDR Rd, [Rn, Rm, ASR #]!
1913
-static INSN_REGPARM void arm7B4(u32 opcode) { LDR_PREINC_WB(OFFSET_ASR, OP_LDR, 32); }
1913
+static INSN_REGPARM void arm7B4(uint32_t opcode) { LDR_PREINC_WB(OFFSET_ASR, OP_LDR, 32); }
1914 1914
 // LDR Rd, [Rn, Rm, ROR #]!
1915
-static INSN_REGPARM void arm7B6(u32 opcode) { LDR_PREINC_WB(OFFSET_ROR, OP_LDR, 32); }
1915
+static INSN_REGPARM void arm7B6(uint32_t opcode) { LDR_PREINC_WB(OFFSET_ROR, OP_LDR, 32); }
1916 1916
 // STRB Rd, [Rn, Rm, LSL #]
1917
-static INSN_REGPARM void arm7C0(u32 opcode) { STR_PREINC(OFFSET_LSL, OP_STRB, 16); }
1917
+static INSN_REGPARM void arm7C0(uint32_t opcode) { STR_PREINC(OFFSET_LSL, OP_STRB, 16); }
1918 1918
 // STRB Rd, [Rn, Rm, LSR #]
1919
-static INSN_REGPARM void arm7C2(u32 opcode) { STR_PREINC(OFFSET_LSR, OP_STRB, 16); }
1919
+static INSN_REGPARM void arm7C2(uint32_t opcode) { STR_PREINC(OFFSET_LSR, OP_STRB, 16); }
1920 1920
 // STRB Rd, [Rn, Rm, ASR #]
1921
-static INSN_REGPARM void arm7C4(u32 opcode) { STR_PREINC(OFFSET_ASR, OP_STRB, 16); }
1921
+static INSN_REGPARM void arm7C4(uint32_t opcode) { STR_PREINC(OFFSET_ASR, OP_STRB, 16); }
1922 1922
 // STRB Rd, [Rn, Rm, ROR #]
1923
-static INSN_REGPARM void arm7C6(u32 opcode) { STR_PREINC(OFFSET_ROR, OP_STRB, 16); }
1923
+static INSN_REGPARM void arm7C6(uint32_t opcode) { STR_PREINC(OFFSET_ROR, OP_STRB, 16); }
1924 1924
 // LDRB Rd, [Rn, Rm, LSL #]
1925
-static INSN_REGPARM void arm7D0(u32 opcode) { LDR_PREINC(OFFSET_LSL, OP_LDRB, 16); }
1925
+static INSN_REGPARM void arm7D0(uint32_t opcode) { LDR_PREINC(OFFSET_LSL, OP_LDRB, 16); }
1926 1926
 // LDRB Rd, [Rn, Rm, LSR #]
1927
-static INSN_REGPARM void arm7D2(u32 opcode) { LDR_PREINC(OFFSET_LSR, OP_LDRB, 16); }
1927
+static INSN_REGPARM void arm7D2(uint32_t opcode) { LDR_PREINC(OFFSET_LSR, OP_LDRB, 16); }
1928 1928
 // LDRB Rd, [Rn, Rm, ASR #]
1929
-static INSN_REGPARM void arm7D4(u32 opcode) { LDR_PREINC(OFFSET_ASR, OP_LDRB, 16); }
1929
+static INSN_REGPARM void arm7D4(uint32_t opcode) { LDR_PREINC(OFFSET_ASR, OP_LDRB, 16); }
1930 1930
 // LDRB Rd, [Rn, Rm, ROR #]
1931
-static INSN_REGPARM void arm7D6(u32 opcode) { LDR_PREINC(OFFSET_ROR, OP_LDRB, 16); }
1931
+static INSN_REGPARM void arm7D6(uint32_t opcode) { LDR_PREINC(OFFSET_ROR, OP_LDRB, 16); }
1932 1932
 // STRB Rd, [Rn, Rm, LSL #]!
1933
-static INSN_REGPARM void arm7E0(u32 opcode) { STR_PREINC_WB(OFFSET_LSL, OP_STRB, 16); }
1933
+static INSN_REGPARM void arm7E0(uint32_t opcode) { STR_PREINC_WB(OFFSET_LSL, OP_STRB, 16); }
1934 1934
 // STRB Rd, [Rn, Rm, LSR #]!
1935
-static INSN_REGPARM void arm7E2(u32 opcode) { STR_PREINC_WB(OFFSET_LSR, OP_STRB, 16); }
1935
+static INSN_REGPARM void arm7E2(uint32_t opcode) { STR_PREINC_WB(OFFSET_LSR, OP_STRB, 16); }
1936 1936
 // STRB Rd, [Rn, Rm, ASR #]!
1937
-static INSN_REGPARM void arm7E4(u32 opcode) { STR_PREINC_WB(OFFSET_ASR, OP_STRB, 16); }
1937
+static INSN_REGPARM void arm7E4(uint32_t opcode) { STR_PREINC_WB(OFFSET_ASR, OP_STRB, 16); }
1938 1938
 // STRB Rd, [Rn, Rm, ROR #]!
1939
-static INSN_REGPARM void arm7E6(u32 opcode) { STR_PREINC_WB(OFFSET_ROR, OP_STRB, 16); }
1939
+static INSN_REGPARM void arm7E6(uint32_t opcode) { STR_PREINC_WB(OFFSET_ROR, OP_STRB, 16); }
1940 1940
 // LDRB Rd, [Rn, Rm, LSL #]!
1941
-static INSN_REGPARM void arm7F0(u32 opcode) { LDR_PREINC_WB(OFFSET_LSL, OP_LDRB, 16); }
1941
+static INSN_REGPARM void arm7F0(uint32_t opcode) { LDR_PREINC_WB(OFFSET_LSL, OP_LDRB, 16); }
1942 1942
 // LDRB Rd, [Rn, Rm, LSR #]!
1943
-static INSN_REGPARM void arm7F2(u32 opcode) { LDR_PREINC_WB(OFFSET_LSR, OP_LDRB, 16); }
1943
+static INSN_REGPARM void arm7F2(uint32_t opcode) { LDR_PREINC_WB(OFFSET_LSR, OP_LDRB, 16); }
1944 1944
 // LDRB Rd, [Rn, Rm, ASR #]!
1945
-static INSN_REGPARM void arm7F4(u32 opcode) { LDR_PREINC_WB(OFFSET_ASR, OP_LDRB, 16); }
1945
+static INSN_REGPARM void arm7F4(uint32_t opcode) { LDR_PREINC_WB(OFFSET_ASR, OP_LDRB, 16); }
1946 1946
 // LDRB Rd, [Rn, Rm, ROR #]!
1947
-static INSN_REGPARM void arm7F6(u32 opcode) { LDR_PREINC_WB(OFFSET_ROR, OP_LDRB, 16); }
1947
+static INSN_REGPARM void arm7F6(uint32_t opcode) { LDR_PREINC_WB(OFFSET_ROR, OP_LDRB, 16); }
1948 1948
 
1949 1949
 // STM/LDM ////////////////////////////////////////////////////////////////
1950 1950
 
... ...
@@ -2144,56 +2144,56 @@ static INSN_REGPARM void arm7F6(u32 opcode) { LDR_PREINC_WB(OFFSET_ROR, OP_LDRB,
2144 2144
 
2145 2145
 
2146 2146
 // STMDA Rn, {Rlist}
2147
-static INSN_REGPARM void arm800(u32 opcode)
2147
+static INSN_REGPARM void arm800(uint32_t opcode)
2148 2148
 {
2149 2149
     if (busPrefetchCount == 0)
2150 2150
         busPrefetch = busPrefetchEnable;
2151 2151
     int base = (opcode & 0x000F0000) >> 16;
2152
-    u32 temp = reg[base].I -
2152
+    uint32_t temp = reg[base].I -
2153 2153
         4 * (cpuBitsSet[opcode & 255] + cpuBitsSet[(opcode >> 8) & 255]);
2154
-    u32 address = (temp + 4) & 0xFFFFFFFC;
2154
+    uint32_t address = (temp + 4) & 0xFFFFFFFC;
2155 2155
     int count = 0;
2156 2156
     STM_ALL;
2157 2157
     clockTicks += 1 + codeTicksAccess32(armNextPC);
2158 2158
 }
2159 2159
 
2160 2160
 // LDMDA Rn, {Rlist}
2161
-static INSN_REGPARM void arm810(u32 opcode)
2161
+static INSN_REGPARM void arm810(uint32_t opcode)
2162 2162
 {
2163 2163
     if (busPrefetchCount == 0)
2164 2164
         busPrefetch = busPrefetchEnable;
2165 2165
     int base = (opcode & 0x000F0000) >> 16;
2166
-    u32 temp = reg[base].I -
2166
+    uint32_t temp = reg[base].I -
2167 2167
         4 * (cpuBitsSet[opcode & 255] + cpuBitsSet[(opcode >> 8) & 255]);
2168
-    u32 address = (temp + 4) & 0xFFFFFFFC;
2168
+    uint32_t address = (temp + 4) & 0xFFFFFFFC;
2169 2169
     int count = 0;
2170 2170
     LDM_ALL;
2171 2171
     clockTicks += 2 + codeTicksAccess32(armNextPC);
2172 2172
 }
2173 2173
 
2174 2174
 // STMDA Rn!, {Rlist}
2175
-static INSN_REGPARM void arm820(u32 opcode)
2175
+static INSN_REGPARM void arm820(uint32_t opcode)
2176 2176
 {
2177 2177
     if (busPrefetchCount == 0)
2178 2178
         busPrefetch = busPrefetchEnable;
2179 2179
     int base = (opcode & 0x000F0000) >> 16;
2180
-    u32 temp = reg[base].I -
2180
+    uint32_t temp = reg[base].I -
2181 2181
         4 * (cpuBitsSet[opcode & 255] + cpuBitsSet[(opcode >> 8) & 255]);
2182
-    u32 address = (temp+4) & 0xFFFFFFFC;
2182
+    uint32_t address = (temp+4) & 0xFFFFFFFC;
2183 2183
     int count = 0;
2184 2184
     STMW_ALL;
2185 2185
     clockTicks += 1 + codeTicksAccess32(armNextPC);
2186 2186
 }
2187 2187
 
2188 2188
 // LDMDA Rn!, {Rlist}
2189
-static INSN_REGPARM void arm830(u32 opcode)
2189
+static INSN_REGPARM void arm830(uint32_t opcode)
2190 2190
 {
2191 2191
     if (busPrefetchCount == 0)
2192 2192
         busPrefetch = busPrefetchEnable;
2193 2193
     int base = (opcode & 0x000F0000) >> 16;
2194
-    u32 temp = reg[base].I -
2194
+    uint32_t temp = reg[base].I -
2195 2195
         4 * (cpuBitsSet[opcode & 255] + cpuBitsSet[(opcode >> 8) & 255]);
2196
-    u32 address = (temp + 4) & 0xFFFFFFFC;
2196
+    uint32_t address = (temp + 4) & 0xFFFFFFFC;
2197 2197
     int count = 0;
2198 2198
     LDM_ALL;
2199 2199
     clockTicks += 2 + codeTicksAccess32(armNextPC);
... ...
@@ -2202,28 +2202,28 @@ static INSN_REGPARM void arm830(u32 opcode)
2202 2202
 }
2203 2203
 
2204 2204
 // STMDA Rn, {Rlist}^
2205
-static INSN_REGPARM void arm840(u32 opcode)
2205
+static INSN_REGPARM void arm840(uint32_t opcode)
2206 2206
 {
2207 2207
     if (busPrefetchCount == 0)
2208 2208
         busPrefetch = busPrefetchEnable;
2209 2209
     int base = (opcode & 0x000F0000) >> 16;
2210
-    u32 temp = reg[base].I -
2210
+    uint32_t temp = reg[base].I -
2211 2211
         4 * (cpuBitsSet[opcode & 255] + cpuBitsSet[(opcode >> 8) & 255]);
2212
-    u32 address = (temp+4) & 0xFFFFFFFC;
2212
+    uint32_t address = (temp+4) & 0xFFFFFFFC;
2213 2213
     int count = 0;
2214 2214
     STM_ALL_2;
2215 2215
     clockTicks += 1 + codeTicksAccess32(armNextPC);
2216 2216
 }
2217 2217
 
2218 2218
 // LDMDA Rn, {Rlist}^
2219
-static INSN_REGPARM void arm850(u32 opcode)
2219
+static INSN_REGPARM void arm850(uint32_t opcode)
2220 2220
 {
2221 2221
     if (busPrefetchCount == 0)
2222 2222
         busPrefetch = busPrefetchEnable;
2223 2223
     int base = (opcode & 0x000F0000) >> 16;
2224
-    u32 temp = reg[base].I -
2224
+    uint32_t temp = reg[base].I -
2225 2225
         4 * (cpuBitsSet[opcode & 255] + cpuBitsSet[(opcode >> 8) & 255]);
2226
-    u32 address = (temp + 4) & 0xFFFFFFFC;
2226
+    uint32_t address = (temp + 4) & 0xFFFFFFFC;
2227 2227
     int count = 0;
2228 2228
     LDM_ALL_2;
2229 2229
     LDM_ALL_2B;
... ...
@@ -2231,28 +2231,28 @@ static INSN_REGPARM void arm850(u32 opcode)
2231 2231
 }
2232 2232
 
2233 2233
 // STMDA Rn!, {Rlist}^
2234
-static INSN_REGPARM void arm860(u32 opcode)
2234
+static INSN_REGPARM void arm860(uint32_t opcode)
2235 2235
 {
2236 2236
     if (busPrefetchCount == 0)
2237 2237
         busPrefetch = busPrefetchEnable;
2238 2238
     int base = (opcode & 0x000F0000) >> 16;
2239
-    u32 temp = reg[base].I -
2239
+    uint32_t temp = reg[base].I -
2240 2240
         4 * (cpuBitsSet[opcode & 255] + cpuBitsSet[(opcode >> 8) & 255]);
2241
-    u32 address = (temp+4) & 0xFFFFFFFC;
2241
+    uint32_t address = (temp+4) & 0xFFFFFFFC;
2242 2242
     int count = 0;
2243 2243
     STMW_ALL_2;
2244 2244
     clockTicks += 1 + codeTicksAccess32(armNextPC);
2245 2245
 }
2246 2246
 
2247 2247
 // LDMDA Rn!, {Rlist}^
2248
-static INSN_REGPARM void arm870(u32 opcode)
2248
+static INSN_REGPARM void arm870(uint32_t opcode)
2249 2249
 {
2250 2250
     if (busPrefetchCount == 0)
2251 2251
         busPrefetch = busPrefetchEnable;
2252 2252
     int base = (opcode & 0x000F0000) >> 16;
2253
-    u32 temp = reg[base].I -
2253
+    uint32_t temp = reg[base].I -
2254 2254
         4 * (cpuBitsSet[opcode & 255] + cpuBitsSet[(opcode >> 8) & 255]);
2255
-    u32 address = (temp + 4) & 0xFFFFFFFC;
2255
+    uint32_t address = (temp + 4) & 0xFFFFFFFC;
2256 2256
     int count = 0;
2257 2257
     LDM_ALL_2;
2258 2258
     if (!(opcode & (1U << base)))
... ...
@@ -2262,52 +2262,52 @@ static INSN_REGPARM void arm870(u32 opcode)
2262 2262
 }
2263 2263
 
2264 2264
 // STMIA Rn, {Rlist}
2265
-static INSN_REGPARM void arm880(u32 opcode)
2265
+static INSN_REGPARM void arm880(uint32_t opcode)
2266 2266
 {
2267 2267
     if (busPrefetchCount == 0)
2268 2268
         busPrefetch = busPrefetchEnable;
2269 2269
     int base = (opcode & 0x000F0000) >> 16;
2270
-    u32 address = reg[base].I & 0xFFFFFFFC;
2270
+    uint32_t address = reg[base].I & 0xFFFFFFFC;
2271 2271
     int count = 0;
2272 2272
     STM_ALL;
2273 2273
     clockTicks += 1 + codeTicksAccess32(armNextPC);
2274 2274
 }
2275 2275
 
2276 2276
 // LDMIA Rn, {Rlist}
2277
-static INSN_REGPARM void arm890(u32 opcode)
2277
+static INSN_REGPARM void arm890(uint32_t opcode)
2278 2278
 {
2279 2279
     if (busPrefetchCount == 0)
2280 2280
         busPrefetch = busPrefetchEnable;
2281 2281
     int base = (opcode & 0x000F0000) >> 16;
2282
-    u32 address = reg[base].I & 0xFFFFFFFC;
2282
+    uint32_t address = reg[base].I & 0xFFFFFFFC;
2283 2283
     int count = 0;
2284 2284
     LDM_ALL;
2285 2285
     clockTicks += 2 + codeTicksAccess32(armNextPC);
2286 2286
 }
2287 2287
 
2288 2288
 // STMIA Rn!, {Rlist}
2289
-static INSN_REGPARM void arm8A0(u32 opcode)
2289
+static INSN_REGPARM void arm8A0(uint32_t opcode)
2290 2290
 {
2291 2291
     if (busPrefetchCount == 0)
2292 2292
         busPrefetch = busPrefetchEnable;
2293 2293
     int base = (opcode & 0x000F0000) >> 16;
2294
-    u32 address = reg[base].I & 0xFFFFFFFC;
2294
+    uint32_t address = reg[base].I & 0xFFFFFFFC;
2295 2295
     int count = 0;
2296
-    u32 temp = reg[base].I +
2296
+    uint32_t temp = reg[base].I +
2297 2297
         4 * (cpuBitsSet[opcode & 0xFF] + cpuBitsSet[(opcode >> 8) & 255]);
2298 2298
     STMW_ALL;
2299 2299
     clockTicks += 1 + codeTicksAccess32(armNextPC);
2300 2300
 }
2301 2301
 
2302 2302
 // LDMIA Rn!, {Rlist}
2303
-static INSN_REGPARM void arm8B0(u32 opcode)
2303
+static INSN_REGPARM void arm8B0(uint32_t opcode)
2304 2304
 {
2305 2305
     if (busPrefetchCount == 0)
2306 2306
         busPrefetch = busPrefetchEnable;
2307 2307
     int base = (opcode & 0x000F0000) >> 16;
2308
-    u32 temp = reg[base].I +
2308
+    uint32_t temp = reg[base].I +
2309 2309
         4 * (cpuBitsSet[opcode & 255] + cpuBitsSet[(opcode >> 8) & 255]);
2310
-    u32 address = reg[base].I & 0xFFFFFFFC;
2310
+    uint32_t address = reg[base].I & 0xFFFFFFFC;
2311 2311
     int count = 0;
2312 2312
     LDM_ALL;
2313 2313
     clockTicks += 2 + codeTicksAccess32(armNextPC);
... ...
@@ -2316,24 +2316,24 @@ static INSN_REGPARM void arm8B0(u32 opcode)
2316 2316
 }
2317 2317
 
2318 2318
 // STMIA Rn, {Rlist}^
2319
-static INSN_REGPARM void arm8C0(u32 opcode)
2319
+static INSN_REGPARM void arm8C0(uint32_t opcode)
2320 2320
 {
2321 2321
     if (busPrefetchCount == 0)
2322 2322
         busPrefetch = busPrefetchEnable;
2323 2323
     int base = (opcode & 0x000F0000) >> 16;
2324
-    u32 address = reg[base].I & 0xFFFFFFFC;
2324
+    uint32_t address = reg[base].I & 0xFFFFFFFC;
2325 2325
     int count = 0;
2326 2326
     STM_ALL_2;
2327 2327
     clockTicks += 1 + codeTicksAccess32(armNextPC);
2328 2328
 }
2329 2329
 
2330 2330
 // LDMIA Rn, {Rlist}^
2331
-static INSN_REGPARM void arm8D0(u32 opcode)
2331
+static INSN_REGPARM void arm8D0(uint32_t opcode)
2332 2332
 {
2333 2333
     if (busPrefetchCount == 0)
2334 2334
         busPrefetch = busPrefetchEnable;
2335 2335
     int base = (opcode & 0x000F0000) >> 16;
2336
-    u32 address = reg[base].I & 0xFFFFFFFC;
2336
+    uint32_t address = reg[base].I & 0xFFFFFFFC;
2337 2337
     int count = 0;
2338 2338
     LDM_ALL_2;
2339 2339
     LDM_ALL_2B;
... ...
@@ -2341,28 +2341,28 @@ static INSN_REGPARM void arm8D0(u32 opcode)
2341 2341
 }
2342 2342
 
2343 2343
 // STMIA Rn!, {Rlist}^
2344
-static INSN_REGPARM void arm8E0(u32 opcode)
2344
+static INSN_REGPARM void arm8E0(uint32_t opcode)
2345 2345
 {
2346 2346
     if (busPrefetchCount == 0)
2347 2347
         busPrefetch = busPrefetchEnable;
2348 2348
     int base = (opcode & 0x000F0000) >> 16;
2349
-    u32 address = reg[base].I & 0xFFFFFFFC;
2349
+    uint32_t address = reg[base].I & 0xFFFFFFFC;
2350 2350
     int count = 0;
2351
-    u32 temp = reg[base].I +
2351
+    uint32_t temp = reg[base].I +
2352 2352
         4 * (cpuBitsSet[opcode & 0xFF] + cpuBitsSet[(opcode >> 8) & 255]);
2353 2353
     STMW_ALL_2;
2354 2354
     clockTicks += 1 + codeTicksAccess32(armNextPC);
2355 2355
 }
2356 2356
 
2357 2357
 // LDMIA Rn!, {Rlist}^
2358
-static INSN_REGPARM void arm8F0(u32 opcode)
2358
+static INSN_REGPARM void arm8F0(uint32_t opcode)
2359 2359
 {
2360 2360
     if (busPrefetchCount == 0)
2361 2361
         busPrefetch = busPrefetchEnable;
2362 2362
     int base = (opcode & 0x000F0000) >> 16;
2363
-    u32 temp = reg[base].I +
2363
+    uint32_t temp = reg[base].I +
2364 2364
         4 * (cpuBitsSet[opcode & 255] + cpuBitsSet[(opcode >> 8) & 255]);
2365
-    u32 address = reg[base].I & 0xFFFFFFFC;
2365
+    uint32_t address = reg[base].I & 0xFFFFFFFC;
2366 2366
     int count = 0;
2367 2367
     LDM_ALL_2;
2368 2368
     if (!(opcode & (1U << base)))
... ...
@@ -2372,56 +2372,56 @@ static INSN_REGPARM void arm8F0(u32 opcode)
2372 2372
 }
2373 2373
 
2374 2374
 // STMDB Rn, {Rlist}
2375
-static INSN_REGPARM void arm900(u32 opcode)
2375
+static INSN_REGPARM void arm900(uint32_t opcode)
2376 2376
 {
2377 2377
     if (busPrefetchCount == 0)
2378 2378
         busPrefetch = busPrefetchEnable;
2379 2379
     int base = (opcode & 0x000F0000) >> 16;
2380
-    u32 temp = reg[base].I -
2380
+    uint32_t temp = reg[base].I -
2381 2381
         4 * (cpuBitsSet[opcode & 255] + cpuBitsSet[(opcode >> 8) & 255]);
2382
-    u32 address = temp & 0xFFFFFFFC;
2382
+    uint32_t address = temp & 0xFFFFFFFC;
2383 2383
     int count = 0;
2384 2384
     STM_ALL;
2385 2385
     clockTicks += 1 + codeTicksAccess32(armNextPC);
2386 2386
 }
2387 2387
 
2388 2388
 // LDMDB Rn, {Rlist}
2389
-static INSN_REGPARM void arm910(u32 opcode)
2389
+static INSN_REGPARM void arm910(uint32_t opcode)
2390 2390
 {
2391 2391
     if (busPrefetchCount == 0)
2392 2392
         busPrefetch = busPrefetchEnable;
2393 2393
     int base = (opcode & 0x000F0000) >> 16;
2394
-    u32 temp = reg[base].I -
2394
+    uint32_t temp = reg[base].I -
2395 2395
         4 * (cpuBitsSet[opcode & 255] + cpuBitsSet[(opcode >> 8) & 255]);
2396
-    u32 address = temp & 0xFFFFFFFC;
2396
+    uint32_t address = temp & 0xFFFFFFFC;
2397 2397
     int count = 0;
2398 2398
     LDM_ALL;
2399 2399
     clockTicks += 2 + codeTicksAccess32(armNextPC);
2400 2400
 }
2401 2401
 
2402 2402
 // STMDB Rn!, {Rlist}
2403
-static INSN_REGPARM void arm920(u32 opcode)
2403
+static INSN_REGPARM void arm920(uint32_t opcode)
2404 2404
 {
2405 2405
     if (busPrefetchCount == 0)
2406 2406
         busPrefetch = busPrefetchEnable;
2407 2407
     int base = (opcode & 0x000F0000) >> 16;
2408
-    u32 temp = reg[base].I -
2408
+    uint32_t temp = reg[base].I -
2409 2409
         4 * (cpuBitsSet[opcode & 255] + cpuBitsSet[(opcode >> 8) & 255]);
2410
-    u32 address = temp & 0xFFFFFFFC;
2410
+    uint32_t address = temp & 0xFFFFFFFC;
2411 2411
     int count = 0;
2412 2412
     STMW_ALL;
2413 2413
     clockTicks += 1 + codeTicksAccess32(armNextPC);
2414 2414
 }
2415 2415
 
2416 2416
 // LDMDB Rn!, {Rlist}
2417
-static INSN_REGPARM void arm930(u32 opcode)
2417
+static INSN_REGPARM void arm930(uint32_t opcode)
2418 2418
 {
2419 2419
     if (busPrefetchCount == 0)
2420 2420
         busPrefetch = busPrefetchEnable;
2421 2421
     int base = (opcode & 0x000F0000) >> 16;
2422
-    u32 temp = reg[base].I -
2422
+    uint32_t temp = reg[base].I -
2423 2423
         4 * (cpuBitsSet[opcode & 255] + cpuBitsSet[(opcode >> 8) & 255]);
2424
-    u32 address = temp & 0xFFFFFFFC;
2424
+    uint32_t address = temp & 0xFFFFFFFC;
2425 2425
     int count = 0;
2426 2426
     LDM_ALL;
2427 2427
     clockTicks += 2 + codeTicksAccess32(armNextPC);
... ...
@@ -2430,28 +2430,28 @@ static INSN_REGPARM void arm930(u32 opcode)
2430 2430
 }
2431 2431
 
2432 2432
 // STMDB Rn, {Rlist}^
2433
-static INSN_REGPARM void arm940(u32 opcode)
2433
+static INSN_REGPARM void arm940(uint32_t opcode)
2434 2434
 {
2435 2435
     if (busPrefetchCount == 0)
2436 2436
         busPrefetch = busPrefetchEnable;
2437 2437
     int base = (opcode & 0x000F0000) >> 16;
2438
-    u32 temp = reg[base].I -
2438
+    uint32_t temp = reg[base].I -
2439 2439
         4 * (cpuBitsSet[opcode & 255] + cpuBitsSet[(opcode >> 8) & 255]);
2440
-    u32 address = temp & 0xFFFFFFFC;
2440
+    uint32_t address = temp & 0xFFFFFFFC;
2441 2441
     int count = 0;
2442 2442
     STM_ALL_2;
2443 2443
     clockTicks += 1 + codeTicksAccess32(armNextPC);
2444 2444
 }
2445 2445
 
2446 2446
 // LDMDB Rn, {Rlist}^
2447
-static INSN_REGPARM void arm950(u32 opcode)
2447
+static INSN_REGPARM void arm950(uint32_t opcode)
2448 2448
 {
2449 2449
     if (busPrefetchCount == 0)
2450 2450
         busPrefetch = busPrefetchEnable;
2451 2451
     int base = (opcode & 0x000F0000) >> 16;
2452
-    u32 temp = reg[base].I -
2452
+    uint32_t temp = reg[base].I -
2453 2453
         4 * (cpuBitsSet[opcode & 255] + cpuBitsSet[(opcode >> 8) & 255]);
2454
-    u32 address = temp & 0xFFFFFFFC;
2454
+    uint32_t address = temp & 0xFFFFFFFC;
2455 2455
     int count = 0;
2456 2456
     LDM_ALL_2;
2457 2457
     LDM_ALL_2B;
... ...
@@ -2459,28 +2459,28 @@ static INSN_REGPARM void arm950(u32 opcode)
2459 2459
 }
2460 2460
 
2461 2461
 // STMDB Rn!, {Rlist}^
2462
-static INSN_REGPARM void arm960(u32 opcode)
2462
+static INSN_REGPARM void arm960(uint32_t opcode)
2463 2463
 {
2464 2464
     if (busPrefetchCount == 0)
2465 2465
         busPrefetch = busPrefetchEnable;
2466 2466
     int base = (opcode & 0x000F0000) >> 16;
2467
-    u32 temp = reg[base].I -
2467
+    uint32_t temp = reg[base].I -
2468 2468
         4 * (cpuBitsSet[opcode & 255] + cpuBitsSet[(opcode >> 8) & 255]);
2469
-    u32 address = temp & 0xFFFFFFFC;
2469
+    uint32_t address = temp & 0xFFFFFFFC;
2470 2470
     int count = 0;
2471 2471
     STMW_ALL_2;
2472 2472
     clockTicks += 1 + codeTicksAccess32(armNextPC);
2473 2473
 }
2474 2474
 
2475 2475
 // LDMDB Rn!, {Rlist}^
2476
-static INSN_REGPARM void arm970(u32 opcode)
2476
+static INSN_REGPARM void arm970(uint32_t opcode)
2477 2477
 {
2478 2478
     if (busPrefetchCount == 0)
2479 2479
         busPrefetch = busPrefetchEnable;
2480 2480
     int base = (opcode & 0x000F0000) >> 16;
2481
-    u32 temp = reg[base].I -
2481
+    uint32_t temp = reg[base].I -
2482 2482
         4 * (cpuBitsSet[opcode & 255] + cpuBitsSet[(opcode >> 8) & 255]);
2483
-    u32 address = temp & 0xFFFFFFFC;
2483
+    uint32_t address = temp & 0xFFFFFFFC;
2484 2484
     int count = 0;
2485 2485
     LDM_ALL_2;
2486 2486
     if (!(opcode & (1U << base)))
... ...
@@ -2490,52 +2490,52 @@ static INSN_REGPARM void arm970(u32 opcode)
2490 2490
 }
2491 2491
 
2492 2492
 // STMIB Rn, {Rlist}
2493
-static INSN_REGPARM void arm980(u32 opcode)
2493
+static INSN_REGPARM void arm980(uint32_t opcode)
2494 2494
 {
2495 2495
     if (busPrefetchCount == 0)
2496 2496
         busPrefetch = busPrefetchEnable;
2497 2497
     int base = (opcode & 0x000F0000) >> 16;
2498
-    u32 address = (reg[base].I+4) & 0xFFFFFFFC;
2498
+    uint32_t address = (reg[base].I+4) & 0xFFFFFFFC;
2499 2499
     int count = 0;
2500 2500
     STM_ALL;
2501 2501
     clockTicks += 1 + codeTicksAccess32(armNextPC);
2502 2502
 }
2503 2503
 
2504 2504
 // LDMIB Rn, {Rlist}
2505
-static INSN_REGPARM void arm990(u32 opcode)
2505
+static INSN_REGPARM void arm990(uint32_t opcode)
2506 2506
 {
2507 2507
     if (busPrefetchCount == 0)
2508 2508
         busPrefetch = busPrefetchEnable;
2509 2509
     int base = (opcode & 0x000F0000) >> 16;
2510
-    u32 address = (reg[base].I+4) & 0xFFFFFFFC;
2510
+    uint32_t address = (reg[base].I+4) & 0xFFFFFFFC;
2511 2511
     int count = 0;
2512 2512
     LDM_ALL;
2513 2513
     clockTicks += 2 + codeTicksAccess32(armNextPC);
2514 2514
 }
2515 2515
 
2516 2516
 // STMIB Rn!, {Rlist}
2517
-static INSN_REGPARM void arm9A0(u32 opcode)
2517
+static INSN_REGPARM void arm9A0(uint32_t opcode)
2518 2518
 {
2519 2519
     if (busPrefetchCount == 0)
2520 2520
         busPrefetch = busPrefetchEnable;
2521 2521
     int base = (opcode & 0x000F0000) >> 16;
2522
-    u32 address = (reg[base].I+4) & 0xFFFFFFFC;
2522
+    uint32_t address = (reg[base].I+4) & 0xFFFFFFFC;
2523 2523
     int count = 0;
2524
-    u32 temp = reg[base].I +
2524
+    uint32_t temp = reg[base].I +
2525 2525
         4 * (cpuBitsSet[opcode & 0xFF] + cpuBitsSet[(opcode >> 8) & 255]);
2526 2526
     STMW_ALL;
2527 2527
     clockTicks += 1 + codeTicksAccess32(armNextPC);
2528 2528
 }
2529 2529
 
2530 2530
 // LDMIB Rn!, {Rlist}
2531
-static INSN_REGPARM void arm9B0(u32 opcode)
2531
+static INSN_REGPARM void arm9B0(uint32_t opcode)
2532 2532
 {
2533 2533
     if (busPrefetchCount == 0)
2534 2534
         busPrefetch = busPrefetchEnable;
2535 2535
     int base = (opcode & 0x000F0000) >> 16;
2536
-    u32 temp = reg[base].I +
2536
+    uint32_t temp = reg[base].I +
2537 2537
         4 * (cpuBitsSet[opcode & 255] + cpuBitsSet[(opcode >> 8) & 255]);
2538
-    u32 address = (reg[base].I+4) & 0xFFFFFFFC;
2538
+    uint32_t address = (reg[base].I+4) & 0xFFFFFFFC;
2539 2539
     int count = 0;
2540 2540
     LDM_ALL;
2541 2541
     clockTicks += 2 + codeTicksAccess32(armNextPC);
... ...
@@ -2544,24 +2544,24 @@ static INSN_REGPARM void arm9B0(u32 opcode)
2544 2544
 }
2545 2545
 
2546 2546
 // STMIB Rn, {Rlist}^
2547
-static INSN_REGPARM void arm9C0(u32 opcode)
2547
+static INSN_REGPARM void arm9C0(uint32_t opcode)
2548 2548
 {
2549 2549
     if (busPrefetchCount == 0)
2550 2550
         busPrefetch = busPrefetchEnable;
2551 2551
     int base = (opcode & 0x000F0000) >> 16;
2552
-    u32 address = (reg[base].I+4) & 0xFFFFFFFC;
2552
+    uint32_t address = (reg[base].I+4) & 0xFFFFFFFC;
2553 2553
     int count = 0;
2554 2554
     STM_ALL_2;
2555 2555
     clockTicks += 1 + codeTicksAccess32(armNextPC);
2556 2556
 }
2557 2557
 
2558 2558
 // LDMIB Rn, {Rlist}^
2559
-static INSN_REGPARM void arm9D0(u32 opcode)
2559
+static INSN_REGPARM void arm9D0(uint32_t opcode)
2560 2560
 {
2561 2561
     if (busPrefetchCount == 0)
2562 2562
         busPrefetch = busPrefetchEnable;
2563 2563
     int base = (opcode & 0x000F0000) >> 16;
2564
-    u32 address = (reg[base].I+4) & 0xFFFFFFFC;
2564
+    uint32_t address = (reg[base].I+4) & 0xFFFFFFFC;
2565 2565
     int count = 0;
2566 2566
     LDM_ALL_2;
2567 2567
     LDM_ALL_2B;
... ...
@@ -2569,28 +2569,28 @@ static INSN_REGPARM void arm9D0(u32 opcode)
2569 2569
 }
2570 2570
 
2571 2571
 // STMIB Rn!, {Rlist}^
2572
-static INSN_REGPARM void arm9E0(u32 opcode)
2572
+static INSN_REGPARM void arm9E0(uint32_t opcode)
2573 2573
 {
2574 2574
     if (busPrefetchCount == 0)
2575 2575
         busPrefetch = busPrefetchEnable;
2576 2576
     int base = (opcode & 0x000F0000) >> 16;
2577
-    u32 address = (reg[base].I+4) & 0xFFFFFFFC;
2577
+    uint32_t address = (reg[base].I+4) & 0xFFFFFFFC;
2578 2578
     int count = 0;
2579
-    u32 temp = reg[base].I +
2579
+    uint32_t temp = reg[base].I +
2580 2580
         4 * (cpuBitsSet[opcode & 0xFF] + cpuBitsSet[(opcode >> 8) & 255]);
2581 2581
     STMW_ALL_2;
2582 2582
     clockTicks += 1 + codeTicksAccess32(armNextPC);
2583 2583
 }
2584 2584
 
2585 2585
 // LDMIB Rn!, {Rlist}^
2586
-static INSN_REGPARM void arm9F0(u32 opcode)
2586
+static INSN_REGPARM void arm9F0(uint32_t opcode)
2587 2587
 {
2588 2588
     if (busPrefetchCount == 0)
2589 2589
         busPrefetch = busPrefetchEnable;
2590 2590
     int base = (opcode & 0x000F0000) >> 16;
2591
-    u32 temp = reg[base].I +
2591
+    uint32_t temp = reg[base].I +
2592 2592
         4 * (cpuBitsSet[opcode & 255] + cpuBitsSet[(opcode >> 8) & 255]);
2593
-    u32 address = (reg[base].I+4) & 0xFFFFFFFC;
2593
+    uint32_t address = (reg[base].I+4) & 0xFFFFFFFC;
2594 2594
     int count = 0;
2595 2595
     LDM_ALL_2;
2596 2596
     if (!(opcode & (1U << base)))
... ...
@@ -2602,7 +2602,7 @@ static INSN_REGPARM void arm9F0(u32 opcode)
2602 2602
 // B/BL/SWI and (unimplemented) coproc support ////////////////////////////
2603 2603
 
2604 2604
 // B <offset>
2605
-static INSN_REGPARM void armA00(u32 opcode)
2605
+static INSN_REGPARM void armA00(uint32_t opcode)
2606 2606
 {
2607 2607
     int offset = opcode & 0x00FFFFFF;
2608 2608
     if (offset & 0x00800000)
... ...
@@ -2617,7 +2617,7 @@ static INSN_REGPARM void armA00(u32 opcode)
2617 2617
 }
2618 2618
 
2619 2619
 // BL <offset>
2620
-static INSN_REGPARM void armB00(u32 opcode)
2620
+static INSN_REGPARM void armB00(uint32_t opcode)
2621 2621
 {
2622 2622
     int offset = opcode & 0x00FFFFFF;
2623 2623
     if (offset & 0x00800000)
... ...
@@ -2636,7 +2636,7 @@ static INSN_REGPARM void armB00(u32 opcode)
2636 2636
 
2637 2637
 #ifdef GP_SUPPORT
2638 2638
 // MRC
2639
-static INSN_REGPARM void armE01(u32 opcode)
2639
+static INSN_REGPARM void armE01(uint32_t opcode)
2640 2640
 {
2641 2641
 }
2642 2642
 #else
... ...
@@ -2645,7 +2645,7 @@ static INSN_REGPARM void armE01(u32 opcode)
2645 2645
 
2646 2646
 
2647 2647
 // SWI <comment>
2648
-static INSN_REGPARM void armF00(u32 opcode)
2648
+static INSN_REGPARM void armF00(uint32_t opcode)
2649 2649
 {
2650 2650
     clockTicks = codeTicksAccessSeq32(armNextPC) + 1;
2651 2651
         clockTicks = (clockTicks * 2) + codeTicksAccess32(armNextPC) + 1;
... ...
@@ -2655,7 +2655,7 @@ static INSN_REGPARM void armF00(u32 opcode)
2655 2655
 
2656 2656
 // Instruction table //////////////////////////////////////////////////////
2657 2657
 
2658
-typedef INSN_REGPARM void (*insnfunc_t)(u32 opcode);
2658
+typedef INSN_REGPARM void (*insnfunc_t)(uint32_t opcode);
2659 2659
 #define REP16(insn) \
2660 2660
     insn,insn,insn,insn,insn,insn,insn,insn,\
2661 2661
     insn,insn,insn,insn,insn,insn,insn,insn
... ...
@@ -2874,7 +2874,7 @@ int armExecute()
2874 2874
         if ((armNextPC & 0x0803FFFF) == 0x08020000)
2875 2875
           busPrefetchCount = 0x100;
2876 2876
 
2877
-        u32 opcode = cpuPrefetch[0];
2877
+        uint32_t opcode = cpuPrefetch[0];
2878 2878
         cpuPrefetch[0] = cpuPrefetch[1];
2879 2879
 
2880 2880
         busPrefetch = false;
... ...
@@ -31,7 +31,7 @@
31 31
 
32 32
 static int clockTicks;
33 33
 
34
-static INSN_REGPARM void thumbUnknownInsn(u32 opcode)
34
+static INSN_REGPARM void thumbUnknownInsn(uint32_t opcode)
35 35
 {
36 36
 #ifdef GBA_LOGGING
37 37
   if(systemVerbose & VERBOSE_UNDEFINED)
... ...
@@ -41,7 +41,7 @@ static INSN_REGPARM void thumbUnknownInsn(u32 opcode)
41 41
 }
42 42
 
43 43
 #ifdef BKPT_SUPPORT
44
-static INSN_REGPARM void thumbBreakpoint(u32 opcode)
44
+static INSN_REGPARM void thumbBreakpoint(uint32_t opcode)
45 45
 {
46 46
   reg[15].I -= 2;
47 47
   armNextPC -= 2;
... ...
@@ -745,9 +745,9 @@ static INSN_REGPARM void thumbBreakpoint(u32 opcode)
745 745
 #ifndef ADD_RD_RS_RN
746 746
  #define ADD_RD_RS_RN(N) \
747 747
    {\
748
-     u32 lhs = reg[source].I;\
749
-     u32 rhs = reg[N].I;\
750
-     u32 res = lhs + rhs;\
748
+     uint32_t lhs = reg[source].I;\
749
+     uint32_t rhs = reg[N].I;\
750
+     uint32_t res = lhs + rhs;\
751 751
      reg[dest].I = res;\
752 752
      Z_FLAG = (res == 0) ? true : false;\
753 753
      N_FLAG = NEG(res) ? true : false;\
... ...
@@ -758,9 +758,9 @@ static INSN_REGPARM void thumbBreakpoint(u32 opcode)
758 758
 #ifndef ADD_RD_RS_O3
759 759
  #define ADD_RD_RS_O3(N) \
760 760
    {\
761
-     u32 lhs = reg[source].I;\
762
-     u32 rhs = N;\
763
-     u32 res = lhs + rhs;\
761
+     uint32_t lhs = reg[source].I;\
762
+     uint32_t rhs = N;\
763
+     uint32_t res = lhs + rhs;\
764 764
      reg[dest].I = res;\
765 765
      Z_FLAG = (res == 0) ? true : false;\
766 766
      N_FLAG = NEG(res) ? true : false;\
... ...
@@ -774,9 +774,9 @@ static INSN_REGPARM void thumbBreakpoint(u32 opcode)
774 774
 #ifndef ADD_RN_O8
775 775
  #define ADD_RN_O8(d) \
776 776
    {\
777
-     u32 lhs = reg[(d)].I;\
778
-     u32 rhs = (opcode & 255);\
779
-     u32 res = lhs + rhs;\
777
+     uint32_t lhs = reg[(d)].I;\
778
+     uint32_t rhs = (opcode & 255);\
779
+     uint32_t res = lhs + rhs;\
780 780
      reg[(d)].I = res;\
781 781
      Z_FLAG = (res == 0) ? true : false;\
782 782
      N_FLAG = NEG(res) ? true : false;\
... ...
@@ -787,9 +787,9 @@ static INSN_REGPARM void thumbBreakpoint(u32 opcode)
787 787
 #ifndef CMN_RD_RS
788 788
  #define CMN_RD_RS \
789 789
    {\
790
-     u32 lhs = reg[dest].I;\
791
-     u32 rhs = value;\
792
-     u32 res = lhs + rhs;\
790
+     uint32_t lhs = reg[dest].I;\
791
+     uint32_t rhs = value;\
792
+     uint32_t res = lhs + rhs;\
793 793
      Z_FLAG = (res == 0) ? true : false;\
794 794
      N_FLAG = NEG(res) ? true : false;\
795 795
      ADDCARRY(lhs, rhs, res);\
... ...
@@ -799,9 +799,9 @@ static INSN_REGPARM void thumbBreakpoint(u32 opcode)
799 799
 #ifndef ADC_RD_RS
800 800
  #define ADC_RD_RS \
801 801
    {\
802
-     u32 lhs = reg[dest].I;\
803
-     u32 rhs = value;\
804
-     u32 res = lhs + rhs + (u32)C_FLAG;\
802
+     uint32_t lhs = reg[dest].I;\
803
+     uint32_t rhs = value;\
804
+     uint32_t res = lhs + rhs + (uint32_t)C_FLAG;\
805 805
      reg[dest].I = res;\
806 806
      Z_FLAG = (res == 0) ? true : false;\
807 807
      N_FLAG = NEG(res) ? true : false;\
... ...
@@ -812,9 +812,9 @@ static INSN_REGPARM void thumbBreakpoint(u32 opcode)
812 812
 #ifndef SUB_RD_RS_RN
813 813
  #define SUB_RD_RS_RN(N) \
814 814
    {\
815
-     u32 lhs = reg[source].I;\
816
-     u32 rhs = reg[N].I;\
817
-     u32 res = lhs - rhs;\
815
+     uint32_t lhs = reg[source].I;\
816
+     uint32_t rhs = reg[N].I;\
817
+     uint32_t res = lhs - rhs;\
818 818
      reg[dest].I = res;\
819 819
      Z_FLAG = (res == 0) ? true : false;\
820 820
      N_FLAG = NEG(res) ? true : false;\
... ...
@@ -825,9 +825,9 @@ static INSN_REGPARM void thumbBreakpoint(u32 opcode)
825 825
 #ifndef SUB_RD_RS_O3
826 826
  #define SUB_RD_RS_O3(N) \
827 827
    {\
828
-     u32 lhs = reg[source].I;\
829
-     u32 rhs = N;\
830
-     u32 res = lhs - rhs;\
828
+     uint32_t lhs = reg[source].I;\
829
+     uint32_t rhs = N;\
830
+     uint32_t res = lhs - rhs;\
831 831
      reg[dest].I = res;\
832 832
      Z_FLAG = (res == 0) ? true : false;\
833 833
      N_FLAG = NEG(res) ? true : false;\
... ...
@@ -841,9 +841,9 @@ static INSN_REGPARM void thumbBreakpoint(u32 opcode)
841 841
 #ifndef SUB_RN_O8
842 842
  #define SUB_RN_O8(d) \
843 843
    {\
844
-     u32 lhs = reg[(d)].I;\
845
-     u32 rhs = (opcode & 255);\
846
-     u32 res = lhs - rhs;\
844
+     uint32_t lhs = reg[(d)].I;\
845
+     uint32_t rhs = (opcode & 255);\
846
+     uint32_t res = lhs - rhs;\
847 847
      reg[(d)].I = res;\
848 848
      Z_FLAG = (res == 0) ? true : false;\
849 849
      N_FLAG = NEG(res) ? true : false;\
... ...
@@ -862,9 +862,9 @@ static INSN_REGPARM void thumbBreakpoint(u32 opcode)
862 862
 #ifndef CMP_RN_O8
863 863
  #define CMP_RN_O8(d) \
864 864
    {\
865
-     u32 lhs = reg[(d)].I;\
866
-     u32 rhs = (opcode & 255);\
867
-     u32 res = lhs - rhs;\
865
+     uint32_t lhs = reg[(d)].I;\
866
+     uint32_t rhs = (opcode & 255);\
867
+     uint32_t res = lhs - rhs;\
868 868
      Z_FLAG = (res == 0) ? true : false;\
869 869
      N_FLAG = NEG(res) ? true : false;\
870 870
      SUBCARRY(lhs, rhs, res);\
... ...
@@ -874,9 +874,9 @@ static INSN_REGPARM void thumbBreakpoint(u32 opcode)
874 874
 #ifndef SBC_RD_RS
875 875
  #define SBC_RD_RS \
876 876
    {\
877
-     u32 lhs = reg[dest].I;\
878
-     u32 rhs = value;\
879
-     u32 res = lhs - rhs - !((u32)C_FLAG);\
877
+     uint32_t lhs = reg[dest].I;\
878
+     uint32_t rhs = value;\
879
+     uint32_t res = lhs - rhs - !((uint32_t)C_FLAG);\
880 880
      reg[dest].I = res;\
881 881
      Z_FLAG = (res == 0) ? true : false;\
882 882
      N_FLAG = NEG(res) ? true : false;\
... ...
@@ -915,15 +915,15 @@ static INSN_REGPARM void thumbBreakpoint(u32 opcode)
915 915
 #ifndef ASR_RD_RM_I5
916 916
  #define ASR_RD_RM_I5 \
917 917
    {\
918
-     C_FLAG = ((s32)reg[source].I >> (int)(shift - 1)) & 1 ? true : false;\
919
-     value = (s32)reg[source].I >> (int)shift;\
918
+     C_FLAG = ((int32_t)reg[source].I >> (int)(shift - 1)) & 1 ? true : false;\
919
+     value = (int32_t)reg[source].I >> (int)shift;\
920 920
    }
921 921
 #endif
922 922
 #ifndef ASR_RD_RS
923 923
  #define ASR_RD_RS \
924 924
    {\
925
-     C_FLAG = ((s32)reg[dest].I >> (int)(value - 1)) & 1 ? true : false;\
926
-     value = (s32)reg[dest].I >> (int)value;\
925
+     C_FLAG = ((int32_t)reg[dest].I >> (int)(value - 1)) & 1 ? true : false;\
926
+     value = (int32_t)reg[dest].I >> (int)value;\
927 927
    }
928 928
 #endif
929 929
 #ifndef ROR_RD_RS
... ...
@@ -937,9 +937,9 @@ static INSN_REGPARM void thumbBreakpoint(u32 opcode)
937 937
 #ifndef NEG_RD_RS
938 938
  #define NEG_RD_RS \
939 939
    {\
940
-     u32 lhs = reg[source].I;\
941
-     u32 rhs = 0;\
942
-     u32 res = rhs - lhs;\
940
+     uint32_t lhs = reg[source].I;\
941
+     uint32_t rhs = 0;\
942
+     uint32_t res = rhs - lhs;\
943 943
      reg[dest].I = res;\
944 944
      Z_FLAG = (res == 0) ? true : false;\
945 945
      N_FLAG = NEG(res) ? true : false;\
... ...
@@ -950,9 +950,9 @@ static INSN_REGPARM void thumbBreakpoint(u32 opcode)
950 950
 #ifndef CMP_RD_RS
951 951
  #define CMP_RD_RS \
952 952
    {\
953
-     u32 lhs = reg[dest].I;\
954
-     u32 rhs = value;\
955
-     u32 res = lhs - rhs;\
953
+     uint32_t lhs = reg[dest].I;\
954
+     uint32_t rhs = value;\
955
+     uint32_t res = lhs - rhs;\
956 956
      Z_FLAG = (res == 0) ? true : false;\
957 957
      N_FLAG = NEG(res) ? true : false;\
958 958
      SUBCARRY(lhs, rhs, res);\
... ...
@@ -963,7 +963,7 @@ static INSN_REGPARM void thumbBreakpoint(u32 opcode)
963 963
  #define IMM5_INSN(OP,N) \
964 964
   int dest = opcode & 0x07;\
965 965
   int source = (opcode >> 3) & 0x07;\
966
-  u32 value;\
966
+  uint32_t value;\
967 967
   OP(N);\
968 968
   reg[dest].I = value;\
969 969
   N_FLAG = (value & 0x80000000 ? true : false);\
... ...
@@ -971,7 +971,7 @@ static INSN_REGPARM void thumbBreakpoint(u32 opcode)
971 971
  #define IMM5_INSN_0(OP) \
972 972
   int dest = opcode & 0x07;\
973 973
   int source = (opcode >> 3) & 0x07;\
974
-  u32 value;\
974
+  uint32_t value;\
975 975
   OP;\
976 976
   reg[dest].I = value;\
977 977
   N_FLAG = (value & 0x80000000 ? true : false);\
... ...
@@ -1009,38 +1009,38 @@ static INSN_REGPARM void thumbBreakpoint(u32 opcode)
1009 1009
 // Shift instructions /////////////////////////////////////////////////////
1010 1010
 
1011 1011
 #define DEFINE_IMM5_INSN(OP,BASE) \
1012
-  static INSN_REGPARM void thumb##BASE##_00(u32 opcode) { IMM5_INSN_0(OP##_0); } \
1013
-  static INSN_REGPARM void thumb##BASE##_01(u32 opcode) { IMM5_INSN(OP, 1); } \
1014
-  static INSN_REGPARM void thumb##BASE##_02(u32 opcode) { IMM5_INSN(OP, 2); } \
1015
-  static INSN_REGPARM void thumb##BASE##_03(u32 opcode) { IMM5_INSN(OP, 3); } \
1016
-  static INSN_REGPARM void thumb##BASE##_04(u32 opcode) { IMM5_INSN(OP, 4); } \
1017
-  static INSN_REGPARM void thumb##BASE##_05(u32 opcode) { IMM5_INSN(OP, 5); } \
1018
-  static INSN_REGPARM void thumb##BASE##_06(u32 opcode) { IMM5_INSN(OP, 6); } \
1019
-  static INSN_REGPARM void thumb##BASE##_07(u32 opcode) { IMM5_INSN(OP, 7); } \
1020
-  static INSN_REGPARM void thumb##BASE##_08(u32 opcode) { IMM5_INSN(OP, 8); } \
1021
-  static INSN_REGPARM void thumb##BASE##_09(u32 opcode) { IMM5_INSN(OP, 9); } \
1022
-  static INSN_REGPARM void thumb##BASE##_0A(u32 opcode) { IMM5_INSN(OP,10); } \
1023
-  static INSN_REGPARM void thumb##BASE##_0B(u32 opcode) { IMM5_INSN(OP,11); } \
1024
-  static INSN_REGPARM void thumb##BASE##_0C(u32 opcode) { IMM5_INSN(OP,12); } \
1025
-  static INSN_REGPARM void thumb##BASE##_0D(u32 opcode) { IMM5_INSN(OP,13); } \
1026
-  static INSN_REGPARM void thumb##BASE##_0E(u32 opcode) { IMM5_INSN(OP,14); } \
1027
-  static INSN_REGPARM void thumb##BASE##_0F(u32 opcode) { IMM5_INSN(OP,15); } \
1028
-  static INSN_REGPARM void thumb##BASE##_10(u32 opcode) { IMM5_INSN(OP,16); } \
1029
-  static INSN_REGPARM void thumb##BASE##_11(u32 opcode) { IMM5_INSN(OP,17); } \
1030
-  static INSN_REGPARM void thumb##BASE##_12(u32 opcode) { IMM5_INSN(OP,18); } \
1031
-  static INSN_REGPARM void thumb##BASE##_13(u32 opcode) { IMM5_INSN(OP,19); } \
1032
-  static INSN_REGPARM void thumb##BASE##_14(u32 opcode) { IMM5_INSN(OP,20); } \
1033
-  static INSN_REGPARM void thumb##BASE##_15(u32 opcode) { IMM5_INSN(OP,21); } \
1034
-  static INSN_REGPARM void thumb##BASE##_16(u32 opcode) { IMM5_INSN(OP,22); } \
1035
-  static INSN_REGPARM void thumb##BASE##_17(u32 opcode) { IMM5_INSN(OP,23); } \
1036
-  static INSN_REGPARM void thumb##BASE##_18(u32 opcode) { IMM5_INSN(OP,24); } \
1037
-  static INSN_REGPARM void thumb##BASE##_19(u32 opcode) { IMM5_INSN(OP,25); } \
1038
-  static INSN_REGPARM void thumb##BASE##_1A(u32 opcode) { IMM5_INSN(OP,26); } \
1039
-  static INSN_REGPARM void thumb##BASE##_1B(u32 opcode) { IMM5_INSN(OP,27); } \
1040
-  static INSN_REGPARM void thumb##BASE##_1C(u32 opcode) { IMM5_INSN(OP,28); } \
1041
-  static INSN_REGPARM void thumb##BASE##_1D(u32 opcode) { IMM5_INSN(OP,29); } \
1042
-  static INSN_REGPARM void thumb##BASE##_1E(u32 opcode) { IMM5_INSN(OP,30); } \
1043
-  static INSN_REGPARM void thumb##BASE##_1F(u32 opcode) { IMM5_INSN(OP,31); }
1012
+  static INSN_REGPARM void thumb##BASE##_00(uint32_t opcode) { IMM5_INSN_0(OP##_0); } \
1013
+  static INSN_REGPARM void thumb##BASE##_01(uint32_t opcode) { IMM5_INSN(OP, 1); } \
1014
+  static INSN_REGPARM void thumb##BASE##_02(uint32_t opcode) { IMM5_INSN(OP, 2); } \
1015
+  static INSN_REGPARM void thumb##BASE##_03(uint32_t opcode) { IMM5_INSN(OP, 3); } \
1016
+  static INSN_REGPARM void thumb##BASE##_04(uint32_t opcode) { IMM5_INSN(OP, 4); } \
1017
+  static INSN_REGPARM void thumb##BASE##_05(uint32_t opcode) { IMM5_INSN(OP, 5); } \
1018
+  static INSN_REGPARM void thumb##BASE##_06(uint32_t opcode) { IMM5_INSN(OP, 6); } \
1019
+  static INSN_REGPARM void thumb##BASE##_07(uint32_t opcode) { IMM5_INSN(OP, 7); } \
1020
+  static INSN_REGPARM void thumb##BASE##_08(uint32_t opcode) { IMM5_INSN(OP, 8); } \
1021
+  static INSN_REGPARM void thumb##BASE##_09(uint32_t opcode) { IMM5_INSN(OP, 9); } \
1022
+  static INSN_REGPARM void thumb##BASE##_0A(uint32_t opcode) { IMM5_INSN(OP,10); } \
1023
+  static INSN_REGPARM void thumb##BASE##_0B(uint32_t opcode) { IMM5_INSN(OP,11); } \
1024
+  static INSN_REGPARM void thumb##BASE##_0C(uint32_t opcode) { IMM5_INSN(OP,12); } \
1025
+  static INSN_REGPARM void thumb##BASE##_0D(uint32_t opcode) { IMM5_INSN(OP,13); } \
1026
+  static INSN_REGPARM void thumb##BASE##_0E(uint32_t opcode) { IMM5_INSN(OP,14); } \
1027
+  static INSN_REGPARM void thumb##BASE##_0F(uint32_t opcode) { IMM5_INSN(OP,15); } \
1028
+  static INSN_REGPARM void thumb##BASE##_10(uint32_t opcode) { IMM5_INSN(OP,16); } \
1029
+  static INSN_REGPARM void thumb##BASE##_11(uint32_t opcode) { IMM5_INSN(OP,17); } \
1030
+  static INSN_REGPARM void thumb##BASE##_12(uint32_t opcode) { IMM5_INSN(OP,18); } \
1031
+  static INSN_REGPARM void thumb##BASE##_13(uint32_t opcode) { IMM5_INSN(OP,19); } \
1032
+  static INSN_REGPARM void thumb##BASE##_14(uint32_t opcode) { IMM5_INSN(OP,20); } \
1033
+  static INSN_REGPARM void thumb##BASE##_15(uint32_t opcode) { IMM5_INSN(OP,21); } \
1034
+  static INSN_REGPARM void thumb##BASE##_16(uint32_t opcode) { IMM5_INSN(OP,22); } \
1035
+  static INSN_REGPARM void thumb##BASE##_17(uint32_t opcode) { IMM5_INSN(OP,23); } \
1036
+  static INSN_REGPARM void thumb##BASE##_18(uint32_t opcode) { IMM5_INSN(OP,24); } \
1037
+  static INSN_REGPARM void thumb##BASE##_19(uint32_t opcode) { IMM5_INSN(OP,25); } \
1038
+  static INSN_REGPARM void thumb##BASE##_1A(uint32_t opcode) { IMM5_INSN(OP,26); } \
1039
+  static INSN_REGPARM void thumb##BASE##_1B(uint32_t opcode) { IMM5_INSN(OP,27); } \
1040
+  static INSN_REGPARM void thumb##BASE##_1C(uint32_t opcode) { IMM5_INSN(OP,28); } \
1041
+  static INSN_REGPARM void thumb##BASE##_1D(uint32_t opcode) { IMM5_INSN(OP,29); } \
1042
+  static INSN_REGPARM void thumb##BASE##_1E(uint32_t opcode) { IMM5_INSN(OP,30); } \
1043
+  static INSN_REGPARM void thumb##BASE##_1F(uint32_t opcode) { IMM5_INSN(OP,31); }
1044 1044
 
1045 1045
 // LSL Rd, Rm, #Imm 5
1046 1046
 DEFINE_IMM5_INSN(IMM5_LSL,00)
... ...
@@ -1052,24 +1052,24 @@ DEFINE_IMM5_INSN(IMM5_ASR,10)
1052 1052
 // 3-argument ADD/SUB /////////////////////////////////////////////////////
1053 1053
 
1054 1054
 #define DEFINE_REG3_INSN(OP,BASE) \
1055
-  static INSN_REGPARM void thumb##BASE##_0(u32 opcode) { THREEARG_INSN(OP,0); } \
1056
-  static INSN_REGPARM void thumb##BASE##_1(u32 opcode) { THREEARG_INSN(OP,1); } \
1057
-  static INSN_REGPARM void thumb##BASE##_2(u32 opcode) { THREEARG_INSN(OP,2); } \
1058
-  static INSN_REGPARM void thumb##BASE##_3(u32 opcode) { THREEARG_INSN(OP,3); } \
1059
-  static INSN_REGPARM void thumb##BASE##_4(u32 opcode) { THREEARG_INSN(OP,4); } \
1060
-  static INSN_REGPARM void thumb##BASE##_5(u32 opcode) { THREEARG_INSN(OP,5); } \
1061
-  static INSN_REGPARM void thumb##BASE##_6(u32 opcode) { THREEARG_INSN(OP,6); } \
1062
-  static INSN_REGPARM void thumb##BASE##_7(u32 opcode) { THREEARG_INSN(OP,7); }
1055
+  static INSN_REGPARM void thumb##BASE##_0(uint32_t opcode) { THREEARG_INSN(OP,0); } \
1056
+  static INSN_REGPARM void thumb##BASE##_1(uint32_t opcode) { THREEARG_INSN(OP,1); } \
1057
+  static INSN_REGPARM void thumb##BASE##_2(uint32_t opcode) { THREEARG_INSN(OP,2); } \
1058
+  static INSN_REGPARM void thumb##BASE##_3(uint32_t opcode) { THREEARG_INSN(OP,3); } \
1059
+  static INSN_REGPARM void thumb##BASE##_4(uint32_t opcode) { THREEARG_INSN(OP,4); } \
1060
+  static INSN_REGPARM void thumb##BASE##_5(uint32_t opcode) { THREEARG_INSN(OP,5); } \
1061
+  static INSN_REGPARM void thumb##BASE##_6(uint32_t opcode) { THREEARG_INSN(OP,6); } \
1062
+  static INSN_REGPARM void thumb##BASE##_7(uint32_t opcode) { THREEARG_INSN(OP,7); }
1063 1063
 
1064 1064
 #define DEFINE_IMM3_INSN(OP,BASE) \
1065
-  static INSN_REGPARM void thumb##BASE##_0(u32 opcode) { THREEARG_INSN(OP##_0,0); } \
1066
-  static INSN_REGPARM void thumb##BASE##_1(u32 opcode) { THREEARG_INSN(OP,1); } \
1067
-  static INSN_REGPARM void thumb##BASE##_2(u32 opcode) { THREEARG_INSN(OP,2); } \
1068
-  static INSN_REGPARM void thumb##BASE##_3(u32 opcode) { THREEARG_INSN(OP,3); } \
1069
-  static INSN_REGPARM void thumb##BASE##_4(u32 opcode) { THREEARG_INSN(OP,4); } \
1070
-  static INSN_REGPARM void thumb##BASE##_5(u32 opcode) { THREEARG_INSN(OP,5); } \
1071
-  static INSN_REGPARM void thumb##BASE##_6(u32 opcode) { THREEARG_INSN(OP,6); } \
1072
-  static INSN_REGPARM void thumb##BASE##_7(u32 opcode) { THREEARG_INSN(OP,7); }
1065
+  static INSN_REGPARM void thumb##BASE##_0(uint32_t opcode) { THREEARG_INSN(OP##_0,0); } \
1066
+  static INSN_REGPARM void thumb##BASE##_1(uint32_t opcode) { THREEARG_INSN(OP,1); } \
1067
+  static INSN_REGPARM void thumb##BASE##_2(uint32_t opcode) { THREEARG_INSN(OP,2); } \
1068
+  static INSN_REGPARM void thumb##BASE##_3(uint32_t opcode) { THREEARG_INSN(OP,3); } \
1069
+  static INSN_REGPARM void thumb##BASE##_4(uint32_t opcode) { THREEARG_INSN(OP,4); } \
1070
+  static INSN_REGPARM void thumb##BASE##_5(uint32_t opcode) { THREEARG_INSN(OP,5); } \
1071
+  static INSN_REGPARM void thumb##BASE##_6(uint32_t opcode) { THREEARG_INSN(OP,6); } \
1072
+  static INSN_REGPARM void thumb##BASE##_7(uint32_t opcode) { THREEARG_INSN(OP,7); }
1073 1073
 
1074 1074
 // ADD Rd, Rs, Rn
1075 1075
 DEFINE_REG3_INSN(ADD_RD_RS_RN,18)
... ...
@@ -1083,77 +1083,77 @@ DEFINE_IMM3_INSN(SUB_RD_RS_O3,1E)
1083 1083
 // MOV/CMP/ADD/SUB immediate //////////////////////////////////////////////
1084 1084
 
1085 1085
 // MOV R0, #Offset8
1086
-static INSN_REGPARM void thumb20(u32 opcode) { MOV_RN_O8(0); }
1086
+static INSN_REGPARM void thumb20(uint32_t opcode) { MOV_RN_O8(0); }
1087 1087
 // MOV R1, #Offset8
1088
-static INSN_REGPARM void thumb21(u32 opcode) { MOV_RN_O8(1); }
1088
+static INSN_REGPARM void thumb21(uint32_t opcode) { MOV_RN_O8(1); }
1089 1089
 // MOV R2, #Offset8
1090
-static INSN_REGPARM void thumb22(u32 opcode) { MOV_RN_O8(2); }
1090
+static INSN_REGPARM void thumb22(uint32_t opcode) { MOV_RN_O8(2); }
1091 1091
 // MOV R3, #Offset8
1092
-static INSN_REGPARM void thumb23(u32 opcode) { MOV_RN_O8(3); }
1092
+static INSN_REGPARM void thumb23(uint32_t opcode) { MOV_RN_O8(3); }
1093 1093
 // MOV R4, #Offset8
1094
-static INSN_REGPARM void thumb24(u32 opcode) { MOV_RN_O8(4); }
1094
+static INSN_REGPARM void thumb24(uint32_t opcode) { MOV_RN_O8(4); }
1095 1095
 // MOV R5, #Offset8
1096
-static INSN_REGPARM void thumb25(u32 opcode) { MOV_RN_O8(5); }
1096
+static INSN_REGPARM void thumb25(uint32_t opcode) { MOV_RN_O8(5); }
1097 1097
 // MOV R6, #Offset8
1098
-static INSN_REGPARM void thumb26(u32 opcode) { MOV_RN_O8(6); }
1098
+static INSN_REGPARM void thumb26(uint32_t opcode) { MOV_RN_O8(6); }
1099 1099
 // MOV R7, #Offset8
1100
-static INSN_REGPARM void thumb27(u32 opcode) { MOV_RN_O8(7); }
1100
+static INSN_REGPARM void thumb27(uint32_t opcode) { MOV_RN_O8(7); }
1101 1101
 
1102 1102
 // CMP R0, #Offset8
1103
-static INSN_REGPARM void thumb28(u32 opcode) { CMP_RN_O8(0); }
1103
+static INSN_REGPARM void thumb28(uint32_t opcode) { CMP_RN_O8(0); }
1104 1104
 // CMP R1, #Offset8
1105
-static INSN_REGPARM void thumb29(u32 opcode) { CMP_RN_O8(1); }
1105
+static INSN_REGPARM void thumb29(uint32_t opcode) { CMP_RN_O8(1); }
1106 1106
 // CMP R2, #Offset8
1107
-static INSN_REGPARM void thumb2A(u32 opcode) { CMP_RN_O8(2); }
1107
+static INSN_REGPARM void thumb2A(uint32_t opcode) { CMP_RN_O8(2); }
1108 1108
 // CMP R3, #Offset8
1109
-static INSN_REGPARM void thumb2B(u32 opcode) { CMP_RN_O8(3); }
1109
+static INSN_REGPARM void thumb2B(uint32_t opcode) { CMP_RN_O8(3); }
1110 1110
 // CMP R4, #Offset8
1111
-static INSN_REGPARM void thumb2C(u32 opcode) { CMP_RN_O8(4); }
1111
+static INSN_REGPARM void thumb2C(uint32_t opcode) { CMP_RN_O8(4); }
1112 1112
 // CMP R5, #Offset8
1113
-static INSN_REGPARM void thumb2D(u32 opcode) { CMP_RN_O8(5); }
1113
+static INSN_REGPARM void thumb2D(uint32_t opcode) { CMP_RN_O8(5); }
1114 1114
 // CMP R6, #Offset8
1115
-static INSN_REGPARM void thumb2E(u32 opcode) { CMP_RN_O8(6); }
1115
+static INSN_REGPARM void thumb2E(uint32_t opcode) { CMP_RN_O8(6); }
1116 1116
 // CMP R7, #Offset8
1117
-static INSN_REGPARM void thumb2F(u32 opcode) { CMP_RN_O8(7); }
1117
+static INSN_REGPARM void thumb2F(uint32_t opcode) { CMP_RN_O8(7); }
1118 1118
 
1119 1119
 // ADD R0,#Offset8
1120
-static INSN_REGPARM void thumb30(u32 opcode) { ADD_RN_O8(0); }
1120
+static INSN_REGPARM void thumb30(uint32_t opcode) { ADD_RN_O8(0); }
1121 1121
 // ADD R1,#Offset8
1122
-static INSN_REGPARM void thumb31(u32 opcode) { ADD_RN_O8(1); }
1122
+static INSN_REGPARM void thumb31(uint32_t opcode) { ADD_RN_O8(1); }
1123 1123
 // ADD R2,#Offset8
1124
-static INSN_REGPARM void thumb32(u32 opcode) { ADD_RN_O8(2); }
1124
+static INSN_REGPARM void thumb32(uint32_t opcode) { ADD_RN_O8(2); }
1125 1125
 // ADD R3,#Offset8
1126
-static INSN_REGPARM void thumb33(u32 opcode) { ADD_RN_O8(3); }
1126
+static INSN_REGPARM void thumb33(uint32_t opcode) { ADD_RN_O8(3); }
1127 1127
 // ADD R4,#Offset8
1128
-static INSN_REGPARM void thumb34(u32 opcode) { ADD_RN_O8(4); }
1128
+static INSN_REGPARM void thumb34(uint32_t opcode) { ADD_RN_O8(4); }
1129 1129
 // ADD R5,#Offset8
1130
-static INSN_REGPARM void thumb35(u32 opcode) { ADD_RN_O8(5); }
1130
+static INSN_REGPARM void thumb35(uint32_t opcode) { ADD_RN_O8(5); }
1131 1131
 // ADD R6,#Offset8
1132
-static INSN_REGPARM void thumb36(u32 opcode) { ADD_RN_O8(6); }
1132
+static INSN_REGPARM void thumb36(uint32_t opcode) { ADD_RN_O8(6); }
1133 1133
 // ADD R7,#Offset8
1134
-static INSN_REGPARM void thumb37(u32 opcode) { ADD_RN_O8(7); }
1134
+static INSN_REGPARM void thumb37(uint32_t opcode) { ADD_RN_O8(7); }
1135 1135
 
1136 1136
 // SUB R0,#Offset8
1137
-static INSN_REGPARM void thumb38(u32 opcode) { SUB_RN_O8(0); }
1137
+static INSN_REGPARM void thumb38(uint32_t opcode) { SUB_RN_O8(0); }
1138 1138
 // SUB R1,#Offset8
1139
-static INSN_REGPARM void thumb39(u32 opcode) { SUB_RN_O8(1); }
1139
+static INSN_REGPARM void thumb39(uint32_t opcode) { SUB_RN_O8(1); }
1140 1140
 // SUB R2,#Offset8
1141
-static INSN_REGPARM void thumb3A(u32 opcode) { SUB_RN_O8(2); }
1141
+static INSN_REGPARM void thumb3A(uint32_t opcode) { SUB_RN_O8(2); }
1142 1142
 // SUB R3,#Offset8
1143
-static INSN_REGPARM void thumb3B(u32 opcode) { SUB_RN_O8(3); }
1143
+static INSN_REGPARM void thumb3B(uint32_t opcode) { SUB_RN_O8(3); }
1144 1144
 // SUB R4,#Offset8
1145
-static INSN_REGPARM void thumb3C(u32 opcode) { SUB_RN_O8(4); }
1145
+static INSN_REGPARM void thumb3C(uint32_t opcode) { SUB_RN_O8(4); }
1146 1146
 // SUB R5,#Offset8
1147
-static INSN_REGPARM void thumb3D(u32 opcode) { SUB_RN_O8(5); }
1147
+static INSN_REGPARM void thumb3D(uint32_t opcode) { SUB_RN_O8(5); }
1148 1148
 // SUB R6,#Offset8
1149
-static INSN_REGPARM void thumb3E(u32 opcode) { SUB_RN_O8(6); }
1149
+static INSN_REGPARM void thumb3E(uint32_t opcode) { SUB_RN_O8(6); }
1150 1150
 // SUB R7,#Offset8
1151
-static INSN_REGPARM void thumb3F(u32 opcode) { SUB_RN_O8(7); }
1151
+static INSN_REGPARM void thumb3F(uint32_t opcode) { SUB_RN_O8(7); }
1152 1152
 
1153 1153
 // ALU operations /////////////////////////////////////////////////////////
1154 1154
 
1155 1155
 // AND Rd, Rs
1156
-static INSN_REGPARM void thumb40_0(u32 opcode)
1156
+static INSN_REGPARM void thumb40_0(uint32_t opcode)
1157 1157
 {
1158 1158
   int dest = opcode & 7;
1159 1159
   reg[dest].I &= reg[(opcode >> 3)&7].I;
... ...
@@ -1163,7 +1163,7 @@ static INSN_REGPARM void thumb40_0(u32 opcode)
1163 1163
 }
1164 1164
 
1165 1165
 // EOR Rd, Rs
1166
-static INSN_REGPARM void thumb40_1(u32 opcode)
1166
+static INSN_REGPARM void thumb40_1(uint32_t opcode)
1167 1167
 {
1168 1168
   int dest = opcode & 7;
1169 1169
   reg[dest].I ^= reg[(opcode >> 3)&7].I;
... ...
@@ -1172,10 +1172,10 @@ static INSN_REGPARM void thumb40_1(u32 opcode)
1172 1172
 }
1173 1173
 
1174 1174
 // LSL Rd, Rs
1175
-static INSN_REGPARM void thumb40_2(u32 opcode)
1175
+static INSN_REGPARM void thumb40_2(uint32_t opcode)
1176 1176
 {
1177 1177
   int dest = opcode & 7;
1178
-  u32 value = reg[(opcode >> 3)&7].B.B0;
1178
+  uint32_t value = reg[(opcode >> 3)&7].B.B0;
1179 1179
   if(value) {
1180 1180
     if(value == 32) {
1181 1181
       value = 0;
... ...
@@ -1194,10 +1194,10 @@ static INSN_REGPARM void thumb40_2(u32 opcode)
1194 1194
 }
1195 1195
 
1196 1196
 // LSR Rd, Rs
1197
-static INSN_REGPARM void thumb40_3(u32 opcode)
1197
+static INSN_REGPARM void thumb40_3(uint32_t opcode)
1198 1198
 {
1199 1199
   int dest = opcode & 7;
1200
-  u32 value = reg[(opcode >> 3)&7].B.B0;
1200
+  uint32_t value = reg[(opcode >> 3)&7].B.B0;
1201 1201
   if(value) {
1202 1202
     if(value == 32) {
1203 1203
       value = 0;
... ...
@@ -1216,10 +1216,10 @@ static INSN_REGPARM void thumb40_3(u32 opcode)
1216 1216
 }
1217 1217
 
1218 1218
 // ASR Rd, Rs
1219
-static INSN_REGPARM void thumb41_0(u32 opcode)
1219
+static INSN_REGPARM void thumb41_0(uint32_t opcode)
1220 1220
 {
1221 1221
   int dest = opcode & 7;
1222
-  u32 value = reg[(opcode >> 3)&7].B.B0;
1222
+  uint32_t value = reg[(opcode >> 3)&7].B.B0;
1223 1223
   if(value) {
1224 1224
     if(value < 32) {
1225 1225
       ASR_RD_RS;
... ...
@@ -1240,26 +1240,26 @@ static INSN_REGPARM void thumb41_0(u32 opcode)
1240 1240
 }
1241 1241
 
1242 1242
 // ADC Rd, Rs
1243
-static INSN_REGPARM void thumb41_1(u32 opcode)
1243
+static INSN_REGPARM void thumb41_1(uint32_t opcode)
1244 1244
 {
1245 1245
   int dest = opcode & 0x07;
1246
-  u32 value = reg[(opcode >> 3)&7].I;
1246
+  uint32_t value = reg[(opcode >> 3)&7].I;
1247 1247
   ADC_RD_RS;
1248 1248
 }
1249 1249
 
1250 1250
 // SBC Rd, Rs
1251
-static INSN_REGPARM void thumb41_2(u32 opcode)
1251
+static INSN_REGPARM void thumb41_2(uint32_t opcode)
1252 1252
 {
1253 1253
   int dest = opcode & 0x07;
1254
-  u32 value = reg[(opcode >> 3)&7].I;
1254
+  uint32_t value = reg[(opcode >> 3)&7].I;
1255 1255
   SBC_RD_RS;
1256 1256
 }
1257 1257
 
1258 1258
 // ROR Rd, Rs
1259
-static INSN_REGPARM void thumb41_3(u32 opcode)
1259
+static INSN_REGPARM void thumb41_3(uint32_t opcode)
1260 1260
 {
1261 1261
   int dest = opcode & 7;
1262
-  u32 value = reg[(opcode >> 3)&7].B.B0;
1262
+  uint32_t value = reg[(opcode >> 3)&7].B.B0;
1263 1263
 
1264 1264
   if(value) {
1265 1265
     value = value & 0x1f;
... ...
@@ -1276,15 +1276,15 @@ static INSN_REGPARM void thumb41_3(u32 opcode)
1276 1276
 }
1277 1277
 
1278 1278
 // TST Rd, Rs
1279
-static INSN_REGPARM void thumb42_0(u32 opcode)
1279
+static INSN_REGPARM void thumb42_0(uint32_t opcode)
1280 1280
 {
1281
-  u32 value = reg[opcode & 7].I & reg[(opcode >> 3) & 7].I;
1281
+  uint32_t value = reg[opcode & 7].I & reg[(opcode >> 3) & 7].I;
1282 1282
   N_FLAG = value & 0x80000000 ? true : false;
1283 1283
   Z_FLAG = value ? false : true;
1284 1284
 }
1285 1285
 
1286 1286
 // NEG Rd, Rs
1287
-static INSN_REGPARM void thumb42_1(u32 opcode)
1287
+static INSN_REGPARM void thumb42_1(uint32_t opcode)
1288 1288
 {
1289 1289
   int dest = opcode & 7;
1290 1290
   int source = (opcode >> 3) & 7;
... ...
@@ -1292,23 +1292,23 @@ static INSN_REGPARM void thumb42_1(u32 opcode)
1292 1292
 }
1293 1293
 
1294 1294
 // CMP Rd, Rs
1295
-static INSN_REGPARM void thumb42_2(u32 opcode)
1295
+static INSN_REGPARM void thumb42_2(uint32_t opcode)
1296 1296
 {
1297 1297
   int dest = opcode & 7;
1298
-  u32 value = reg[(opcode >> 3)&7].I;
1298
+  uint32_t value = reg[(opcode >> 3)&7].I;
1299 1299
   CMP_RD_RS;
1300 1300
 }
1301 1301
 
1302 1302
 // CMN Rd, Rs
1303
-static INSN_REGPARM void thumb42_3(u32 opcode)
1303
+static INSN_REGPARM void thumb42_3(uint32_t opcode)
1304 1304
 {
1305 1305
   int dest = opcode & 7;
1306
-  u32 value = reg[(opcode >> 3)&7].I;
1306
+  uint32_t value = reg[(opcode >> 3)&7].I;
1307 1307
   CMN_RD_RS;
1308 1308
 }
1309 1309
 
1310 1310
 // ORR Rd, Rs
1311
-static INSN_REGPARM void thumb43_0(u32 opcode)
1311
+static INSN_REGPARM void thumb43_0(uint32_t opcode)
1312 1312
 {
1313 1313
   int dest = opcode & 7;
1314 1314
   reg[dest].I |= reg[(opcode >> 3) & 7].I;
... ...
@@ -1317,13 +1317,13 @@ static INSN_REGPARM void thumb43_0(u32 opcode)
1317 1317
 }
1318 1318
 
1319 1319
 // MUL Rd, Rs
1320
-static INSN_REGPARM void thumb43_1(u32 opcode)
1320
+static INSN_REGPARM void thumb43_1(uint32_t opcode)
1321 1321
 {
1322 1322
   clockTicks = 1;
1323 1323
   int dest = opcode & 7;
1324
-  u32 rm = reg[dest].I;
1324
+  uint32_t rm = reg[dest].I;
1325 1325
   reg[dest].I = reg[(opcode >> 3) & 7].I * rm;
1326
-  if (((s32)rm) < 0)
1326
+  if (((int32_t)rm) < 0)
1327 1327
     rm = ~rm;
1328 1328
   if ((rm & 0xFFFFFF00) == 0)
1329 1329
     clockTicks += 0;
... ...
@@ -1340,7 +1340,7 @@ static INSN_REGPARM void thumb43_1(u32 opcode)
1340 1340
 }
1341 1341
 
1342 1342
 // BIC Rd, Rs
1343
-static INSN_REGPARM void thumb43_2(u32 opcode)
1343
+static INSN_REGPARM void thumb43_2(uint32_t opcode)
1344 1344
 {
1345 1345
   int dest = opcode & 7;
1346 1346
   reg[dest].I &= (~reg[(opcode >> 3) & 7].I);
... ...
@@ -1349,7 +1349,7 @@ static INSN_REGPARM void thumb43_2(u32 opcode)
1349 1349
 }
1350 1350
 
1351 1351
 // MVN Rd, Rs
1352
-static INSN_REGPARM void thumb43_3(u32 opcode)
1352
+static INSN_REGPARM void thumb43_3(uint32_t opcode)
1353 1353
 {
1354 1354
   int dest = opcode & 7;
1355 1355
   reg[dest].I = ~reg[(opcode >> 3) & 7].I;
... ...
@@ -1360,13 +1360,13 @@ static INSN_REGPARM void thumb43_3(u32 opcode)
1360 1360
 // High-register instructions and BX //////////////////////////////////////
1361 1361
 
1362 1362
 // ADD Rd, Hs
1363
-static INSN_REGPARM void thumb44_1(u32 opcode)
1363
+static INSN_REGPARM void thumb44_1(uint32_t opcode)
1364 1364
 {
1365 1365
   reg[opcode&7].I += reg[((opcode>>3)&7)+8].I;
1366 1366
 }
1367 1367
 
1368 1368
 // ADD Hd, Rs
1369
-static INSN_REGPARM void thumb44_2(u32 opcode)
1369
+static INSN_REGPARM void thumb44_2(uint32_t opcode)
1370 1370
 {
1371 1371
   reg[(opcode&7)+8].I += reg[(opcode>>3)&7].I;
1372 1372
   if((opcode&7) == 7) {
... ...
@@ -1380,7 +1380,7 @@ static INSN_REGPARM void thumb44_2(u32 opcode)
1380 1380
 }
1381 1381
 
1382 1382
 // ADD Hd, Hs
1383
-static INSN_REGPARM void thumb44_3(u32 opcode)
1383
+static INSN_REGPARM void thumb44_3(uint32_t opcode)
1384 1384
 {
1385 1385
   reg[(opcode&7)+8].I += reg[((opcode>>3)&7)+8].I;
1386 1386
   if((opcode&7) == 7) {
... ...
@@ -1394,45 +1394,45 @@ static INSN_REGPARM void thumb44_3(u32 opcode)
1394 1394
 }
1395 1395
 
1396 1396
 // CMP Rd, Hs
1397
-static INSN_REGPARM void thumb45_1(u32 opcode)
1397
+static INSN_REGPARM void thumb45_1(uint32_t opcode)
1398 1398
 {
1399 1399
   int dest = opcode & 7;
1400
-  u32 value = reg[((opcode>>3)&7)+8].I;
1400
+  uint32_t value = reg[((opcode>>3)&7)+8].I;
1401 1401
   CMP_RD_RS;
1402 1402
 }
1403 1403
 
1404 1404
 // CMP Hd, Rs
1405
-static INSN_REGPARM void thumb45_2(u32 opcode)
1405
+static INSN_REGPARM void thumb45_2(uint32_t opcode)
1406 1406
 {
1407 1407
   int dest = (opcode & 7) + 8;
1408
-  u32 value = reg[(opcode>>3)&7].I;
1408
+  uint32_t value = reg[(opcode>>3)&7].I;
1409 1409
   CMP_RD_RS;
1410 1410
 }
1411 1411
 
1412 1412
 // CMP Hd, Hs
1413
-static INSN_REGPARM void thumb45_3(u32 opcode)
1413
+static INSN_REGPARM void thumb45_3(uint32_t opcode)
1414 1414
 {
1415 1415
   int dest = (opcode & 7) + 8;
1416
-  u32 value = reg[((opcode>>3)&7)+8].I;
1416
+  uint32_t value = reg[((opcode>>3)&7)+8].I;
1417 1417
   CMP_RD_RS;
1418 1418
 }
1419 1419
 
1420 1420
 // MOV Rd, Rs
1421
-static INSN_REGPARM void thumb46_0(u32 opcode)
1421
+static INSN_REGPARM void thumb46_0(uint32_t opcode)
1422 1422
 {
1423 1423
         reg[opcode&7].I = reg[((opcode>>3)&7)].I;
1424 1424
         clockTicks = codeTicksAccessSeq16(armNextPC) + 1;
1425 1425
 }
1426 1426
 
1427 1427
 // MOV Rd, Hs
1428
-static INSN_REGPARM void thumb46_1(u32 opcode)
1428
+static INSN_REGPARM void thumb46_1(uint32_t opcode)
1429 1429
 {
1430 1430
   reg[opcode&7].I = reg[((opcode>>3)&7)+8].I;
1431 1431
   clockTicks = codeTicksAccessSeq16(armNextPC) + 1;
1432 1432
 }
1433 1433
 
1434 1434
 // MOV Hd, Rs
1435
-static INSN_REGPARM void thumb46_2(u32 opcode)
1435
+static INSN_REGPARM void thumb46_2(uint32_t opcode)
1436 1436
 {
1437 1437
   reg[(opcode&7)+8].I = reg[(opcode>>3)&7].I;
1438 1438
   if((opcode&7) == 7) {
... ...
@@ -1447,7 +1447,7 @@ static INSN_REGPARM void thumb46_2(u32 opcode)
1447 1447
 }
1448 1448
 
1449 1449
 // MOV Hd, Hs
1450
-static INSN_REGPARM void thumb46_3(u32 opcode)
1450
+static INSN_REGPARM void thumb46_3(uint32_t opcode)
1451 1451
 {
1452 1452
   reg[(opcode&7)+8].I = reg[((opcode>>3)&7)+8].I;
1453 1453
   if((opcode&7) == 7) {
... ...
@@ -1463,7 +1463,7 @@ static INSN_REGPARM void thumb46_3(u32 opcode)
1463 1463
 
1464 1464
 
1465 1465
 // BX Rs
1466
-static INSN_REGPARM void thumb47(u32 opcode)
1466
+static INSN_REGPARM void thumb47(uint32_t opcode)
1467 1467
 {
1468 1468
   int base = (opcode >> 3) & 15;
1469 1469
   busPrefetchCount=0;
... ...
@@ -1489,175 +1489,175 @@ static INSN_REGPARM void thumb47(u32 opcode)
1489 1489
 // Load/store instructions ////////////////////////////////////////////////
1490 1490
 
1491 1491
 // LDR R0~R7,[PC, #Imm]
1492
-static INSN_REGPARM void thumb48(u32 opcode)
1492
+static INSN_REGPARM void thumb48(uint32_t opcode)
1493 1493
 {
1494
-  u8 regist = (opcode >> 8) & 7;
1494
+  uint8_t regist = (opcode >> 8) & 7;
1495 1495
   if (busPrefetchCount == 0)
1496 1496
     busPrefetch = busPrefetchEnable;
1497
-  u32 address = (reg[15].I & 0xFFFFFFFC) + ((opcode & 0xFF) << 2);
1497
+  uint32_t address = (reg[15].I & 0xFFFFFFFC) + ((opcode & 0xFF) << 2);
1498 1498
   reg[regist].I = CPUReadMemoryQuick(address);
1499 1499
   busPrefetchCount=0;
1500 1500
   clockTicks = 3 + dataTicksAccess32(address) + codeTicksAccess16(armNextPC);
1501 1501
 }
1502 1502
 
1503 1503
 // STR Rd, [Rs, Rn]
1504
-static INSN_REGPARM void thumb50(u32 opcode)
1504
+static INSN_REGPARM void thumb50(uint32_t opcode)
1505 1505
 {
1506 1506
   if (busPrefetchCount == 0)
1507 1507
     busPrefetch = busPrefetchEnable;
1508
-  u32 address = reg[(opcode>>3)&7].I + reg[(opcode>>6)&7].I;
1508
+  uint32_t address = reg[(opcode>>3)&7].I + reg[(opcode>>6)&7].I;
1509 1509
   CPUWriteMemory(address, reg[opcode & 7].I);
1510 1510
   clockTicks = dataTicksAccess32(address) + codeTicksAccess16(armNextPC) + 2;
1511 1511
 }
1512 1512
 
1513 1513
 // STRH Rd, [Rs, Rn]
1514
-static INSN_REGPARM void thumb52(u32 opcode)
1514
+static INSN_REGPARM void thumb52(uint32_t opcode)
1515 1515
 {
1516 1516
   if (busPrefetchCount == 0)
1517 1517
     busPrefetch = busPrefetchEnable;
1518
-  u32 address = reg[(opcode>>3)&7].I + reg[(opcode>>6)&7].I;
1518
+  uint32_t address = reg[(opcode>>3)&7].I + reg[(opcode>>6)&7].I;
1519 1519
   CPUWriteHalfWord(address, reg[opcode&7].W.W0);
1520 1520
   clockTicks = dataTicksAccess16(address) + codeTicksAccess16(armNextPC) + 2;
1521 1521
 }
1522 1522
 
1523 1523
 // STRB Rd, [Rs, Rn]
1524
-static INSN_REGPARM void thumb54(u32 opcode)
1524
+static INSN_REGPARM void thumb54(uint32_t opcode)
1525 1525
 {
1526 1526
   if (busPrefetchCount == 0)
1527 1527
     busPrefetch = busPrefetchEnable;
1528
-  u32 address = reg[(opcode>>3)&7].I + reg[(opcode >>6)&7].I;
1528
+  uint32_t address = reg[(opcode>>3)&7].I + reg[(opcode >>6)&7].I;
1529 1529
   CPUWriteByte(address, reg[opcode & 7].B.B0);
1530 1530
   clockTicks = dataTicksAccess16(address) + codeTicksAccess16(armNextPC) + 2;
1531 1531
 }
1532 1532
 
1533 1533
 // LDSB Rd, [Rs, Rn]
1534
-static INSN_REGPARM void thumb56(u32 opcode)
1534
+static INSN_REGPARM void thumb56(uint32_t opcode)
1535 1535
 {
1536 1536
   if (busPrefetchCount == 0)
1537 1537
     busPrefetch = busPrefetchEnable;
1538
-  u32 address = reg[(opcode>>3)&7].I + reg[(opcode>>6)&7].I;
1539
-  reg[opcode&7].I = (s8)CPUReadByte(address);
1538
+  uint32_t address = reg[(opcode>>3)&7].I + reg[(opcode>>6)&7].I;
1539
+  reg[opcode&7].I = (int8_t)CPUReadByte(address);
1540 1540
   clockTicks = 3 + dataTicksAccess16(address) + codeTicksAccess16(armNextPC);
1541 1541
 }
1542 1542
 
1543 1543
 // LDR Rd, [Rs, Rn]
1544
-static INSN_REGPARM void thumb58(u32 opcode)
1544
+static INSN_REGPARM void thumb58(uint32_t opcode)
1545 1545
 {
1546 1546
   if (busPrefetchCount == 0)
1547 1547
     busPrefetch = busPrefetchEnable;
1548
-  u32 address = reg[(opcode>>3)&7].I + reg[(opcode>>6)&7].I;
1548
+  uint32_t address = reg[(opcode>>3)&7].I + reg[(opcode>>6)&7].I;
1549 1549
   reg[opcode&7].I = CPUReadMemory(address);
1550 1550
   clockTicks = 3 + dataTicksAccess32(address) + codeTicksAccess16(armNextPC);
1551 1551
 }
1552 1552
 
1553 1553
 // LDRH Rd, [Rs, Rn]
1554
-static INSN_REGPARM void thumb5A(u32 opcode)
1554
+static INSN_REGPARM void thumb5A(uint32_t opcode)
1555 1555
 {
1556 1556
   if (busPrefetchCount == 0)
1557 1557
     busPrefetch = busPrefetchEnable;
1558
-  u32 address = reg[(opcode>>3)&7].I + reg[(opcode>>6)&7].I;
1558
+  uint32_t address = reg[(opcode>>3)&7].I + reg[(opcode>>6)&7].I;
1559 1559
   reg[opcode&7].I = CPUReadHalfWord(address);
1560 1560
   clockTicks = 3 + dataTicksAccess32(address) + codeTicksAccess16(armNextPC);
1561 1561
 }
1562 1562
 
1563 1563
 // LDRB Rd, [Rs, Rn]
1564
-static INSN_REGPARM void thumb5C(u32 opcode)
1564
+static INSN_REGPARM void thumb5C(uint32_t opcode)
1565 1565
 {
1566 1566
   if (busPrefetchCount == 0)
1567 1567
     busPrefetch = busPrefetchEnable;
1568
-  u32 address = reg[(opcode>>3)&7].I + reg[(opcode>>6)&7].I;
1568
+  uint32_t address = reg[(opcode>>3)&7].I + reg[(opcode>>6)&7].I;
1569 1569
   reg[opcode&7].I = CPUReadByte(address);
1570 1570
   clockTicks = 3 + dataTicksAccess16(address) + codeTicksAccess16(armNextPC);
1571 1571
 }
1572 1572
 
1573 1573
 // LDSH Rd, [Rs, Rn]
1574
-static INSN_REGPARM void thumb5E(u32 opcode)
1574
+static INSN_REGPARM void thumb5E(uint32_t opcode)
1575 1575
 {
1576 1576
   if (busPrefetchCount == 0)
1577 1577
     busPrefetch = busPrefetchEnable;
1578
-  u32 address = reg[(opcode>>3)&7].I + reg[(opcode>>6)&7].I;
1579
-  reg[opcode&7].I = (u32)CPUReadHalfWordSigned(address);
1578
+  uint32_t address = reg[(opcode>>3)&7].I + reg[(opcode>>6)&7].I;
1579
+  reg[opcode&7].I = (uint32_t)CPUReadHalfWordSigned(address);
1580 1580
   clockTicks = 3 + dataTicksAccess16(address) + codeTicksAccess16(armNextPC);
1581 1581
 }
1582 1582
 
1583 1583
 // STR Rd, [Rs, #Imm]
1584
-static INSN_REGPARM void thumb60(u32 opcode)
1584
+static INSN_REGPARM void thumb60(uint32_t opcode)
1585 1585
 {
1586 1586
   if (busPrefetchCount == 0)
1587 1587
     busPrefetch = busPrefetchEnable;
1588
-  u32 address = reg[(opcode>>3)&7].I + (((opcode>>6)&31)<<2);
1588
+  uint32_t address = reg[(opcode>>3)&7].I + (((opcode>>6)&31)<<2);
1589 1589
   CPUWriteMemory(address, reg[opcode&7].I);
1590 1590
   clockTicks = dataTicksAccess32(address) + codeTicksAccess16(armNextPC) + 2;
1591 1591
 }
1592 1592
 
1593 1593
 // LDR Rd, [Rs, #Imm]
1594
-static INSN_REGPARM void thumb68(u32 opcode)
1594
+static INSN_REGPARM void thumb68(uint32_t opcode)
1595 1595
 {
1596 1596
   if (busPrefetchCount == 0)
1597 1597
     busPrefetch = busPrefetchEnable;
1598
-  u32 address = reg[(opcode>>3)&7].I + (((opcode>>6)&31)<<2);
1598
+  uint32_t address = reg[(opcode>>3)&7].I + (((opcode>>6)&31)<<2);
1599 1599
   reg[opcode&7].I = CPUReadMemory(address);
1600 1600
   clockTicks = 3 + dataTicksAccess32(address) + codeTicksAccess16(armNextPC);
1601 1601
 }
1602 1602
 
1603 1603
 // STRB Rd, [Rs, #Imm]
1604
-static INSN_REGPARM void thumb70(u32 opcode)
1604
+static INSN_REGPARM void thumb70(uint32_t opcode)
1605 1605
 {
1606 1606
   if (busPrefetchCount == 0)
1607 1607
     busPrefetch = busPrefetchEnable;
1608
-  u32 address = reg[(opcode>>3)&7].I + (((opcode>>6)&31));
1608
+  uint32_t address = reg[(opcode>>3)&7].I + (((opcode>>6)&31));
1609 1609
   CPUWriteByte(address, reg[opcode&7].B.B0);
1610 1610
   clockTicks = dataTicksAccess16(address) + codeTicksAccess16(armNextPC) + 2;
1611 1611
 }
1612 1612
 
1613 1613
 // LDRB Rd, [Rs, #Imm]
1614
-static INSN_REGPARM void thumb78(u32 opcode)
1614
+static INSN_REGPARM void thumb78(uint32_t opcode)
1615 1615
 {
1616 1616
   if (busPrefetchCount == 0)
1617 1617
     busPrefetch = busPrefetchEnable;
1618
-  u32 address = reg[(opcode>>3)&7].I + (((opcode>>6)&31));
1618
+  uint32_t address = reg[(opcode>>3)&7].I + (((opcode>>6)&31));
1619 1619
   reg[opcode&7].I = CPUReadByte(address);
1620 1620
   clockTicks = 3 + dataTicksAccess16(address) + codeTicksAccess16(armNextPC);
1621 1621
 }
1622 1622
 
1623 1623
 // STRH Rd, [Rs, #Imm]
1624
-static INSN_REGPARM void thumb80(u32 opcode)
1624
+static INSN_REGPARM void thumb80(uint32_t opcode)
1625 1625
 {
1626 1626
   if (busPrefetchCount == 0)
1627 1627
     busPrefetch = busPrefetchEnable;
1628
-  u32 address = reg[(opcode>>3)&7].I + (((opcode>>6)&31)<<1);
1628
+  uint32_t address = reg[(opcode>>3)&7].I + (((opcode>>6)&31)<<1);
1629 1629
   CPUWriteHalfWord(address, reg[opcode&7].W.W0);
1630 1630
   clockTicks = dataTicksAccess16(address) + codeTicksAccess16(armNextPC) + 2;
1631 1631
 }
1632 1632
 
1633 1633
 // LDRH Rd, [Rs, #Imm]
1634
-static INSN_REGPARM void thumb88(u32 opcode)
1634
+static INSN_REGPARM void thumb88(uint32_t opcode)
1635 1635
 {
1636 1636
   if (busPrefetchCount == 0)
1637 1637
     busPrefetch = busPrefetchEnable;
1638
-  u32 address = reg[(opcode>>3)&7].I + (((opcode>>6)&31)<<1);
1638
+  uint32_t address = reg[(opcode>>3)&7].I + (((opcode>>6)&31)<<1);
1639 1639
   reg[opcode&7].I = CPUReadHalfWord(address);
1640 1640
   clockTicks = 3 + dataTicksAccess16(address) + codeTicksAccess16(armNextPC);
1641 1641
 }
1642 1642
 
1643 1643
 // STR R0~R7, [SP, #Imm]
1644
-static INSN_REGPARM void thumb90(u32 opcode)
1644
+static INSN_REGPARM void thumb90(uint32_t opcode)
1645 1645
 {
1646
-  u8 regist = (opcode >> 8) & 7;
1646
+  uint8_t regist = (opcode >> 8) & 7;
1647 1647
   if (busPrefetchCount == 0)
1648 1648
     busPrefetch = busPrefetchEnable;
1649
-  u32 address = reg[13].I + ((opcode&255)<<2);
1649
+  uint32_t address = reg[13].I + ((opcode&255)<<2);
1650 1650
   CPUWriteMemory(address, reg[regist].I);
1651 1651
   clockTicks = dataTicksAccess32(address) + codeTicksAccess16(armNextPC) + 2;
1652 1652
 }
1653 1653
 
1654 1654
 // LDR R0~R7, [SP, #Imm]
1655
-static INSN_REGPARM void thumb98(u32 opcode)
1655
+static INSN_REGPARM void thumb98(uint32_t opcode)
1656 1656
 {
1657
-  u8 regist = (opcode >> 8) & 7;
1657
+  uint8_t regist = (opcode >> 8) & 7;
1658 1658
   if (busPrefetchCount == 0)
1659 1659
     busPrefetch = busPrefetchEnable;
1660
-  u32 address = reg[13].I + ((opcode&255)<<2);
1660
+  uint32_t address = reg[13].I + ((opcode&255)<<2);
1661 1661
   reg[regist].I = CPUReadMemoryQuick(address);
1662 1662
   clockTicks = 3 + dataTicksAccess32(address) + codeTicksAccess16(armNextPC);
1663 1663
 }
... ...
@@ -1665,23 +1665,23 @@ static INSN_REGPARM void thumb98(u32 opcode)
1665 1665
 // PC/stack-related ///////////////////////////////////////////////////////
1666 1666
 
1667 1667
 // ADD R0~R7, PC, Imm
1668
-static INSN_REGPARM void thumbA0(u32 opcode)
1668
+static INSN_REGPARM void thumbA0(uint32_t opcode)
1669 1669
 {
1670
-  u8 regist = (opcode >> 8) & 7;
1670
+  uint8_t regist = (opcode >> 8) & 7;
1671 1671
   reg[regist].I = (reg[15].I & 0xFFFFFFFC) + ((opcode&255)<<2);
1672 1672
   clockTicks = 1 + codeTicksAccess16(armNextPC);
1673 1673
 }
1674 1674
 
1675 1675
 // ADD R0~R7, SP, Imm
1676
-static INSN_REGPARM void thumbA8(u32 opcode)
1676
+static INSN_REGPARM void thumbA8(uint32_t opcode)
1677 1677
 {
1678
-  u8 regist = (opcode >> 8) & 7;
1678
+  uint8_t regist = (opcode >> 8) & 7;
1679 1679
   reg[regist].I = reg[13].I + ((opcode&255)<<2);
1680 1680
   clockTicks = 1 + codeTicksAccess16(armNextPC);
1681 1681
 }
1682 1682
 
1683 1683
 // ADD SP, Imm
1684
-static INSN_REGPARM void thumbB0(u32 opcode)
1684
+static INSN_REGPARM void thumbB0(uint32_t opcode)
1685 1685
 {
1686 1686
   int offset = (opcode & 127) << 2;
1687 1687
   if(opcode & 0x80)
... ...
@@ -1717,13 +1717,13 @@ static INSN_REGPARM void thumbB0(u32 opcode)
1717 1717
   }
1718 1718
 
1719 1719
 // PUSH {Rlist}
1720
-static INSN_REGPARM void thumbB4(u32 opcode)
1720
+static INSN_REGPARM void thumbB4(uint32_t opcode)
1721 1721
 {
1722 1722
   if (busPrefetchCount == 0)
1723 1723
     busPrefetch = busPrefetchEnable;
1724 1724
   int count = 0;
1725
-  u32 temp = reg[13].I - 4 * cpuBitsSet[opcode & 0xff];
1726
-  u32 address = temp & 0xFFFFFFFC;
1725
+  uint32_t temp = reg[13].I - 4 * cpuBitsSet[opcode & 0xff];
1726
+  uint32_t address = temp & 0xFFFFFFFC;
1727 1727
   PUSH_REG(1, 0);
1728 1728
   PUSH_REG(2, 1);
1729 1729
   PUSH_REG(4, 2);
... ...
@@ -1737,13 +1737,13 @@ static INSN_REGPARM void thumbB4(u32 opcode)
1737 1737
 }
1738 1738
 
1739 1739
 // PUSH {Rlist, LR}
1740
-static INSN_REGPARM void thumbB5(u32 opcode)
1740
+static INSN_REGPARM void thumbB5(uint32_t opcode)
1741 1741
 {
1742 1742
   if (busPrefetchCount == 0)
1743 1743
     busPrefetch = busPrefetchEnable;
1744 1744
   int count = 0;
1745
-  u32 temp = reg[13].I - 4 - 4 * cpuBitsSet[opcode & 0xff];
1746
-  u32 address = temp & 0xFFFFFFFC;
1745
+  uint32_t temp = reg[13].I - 4 - 4 * cpuBitsSet[opcode & 0xff];
1746
+  uint32_t address = temp & 0xFFFFFFFC;
1747 1747
   PUSH_REG(1, 0);
1748 1748
   PUSH_REG(2, 1);
1749 1749
   PUSH_REG(4, 2);
... ...
@@ -1758,13 +1758,13 @@ static INSN_REGPARM void thumbB5(u32 opcode)
1758 1758
 }
1759 1759
 
1760 1760
 // POP {Rlist}
1761
-static INSN_REGPARM void thumbBC(u32 opcode)
1761
+static INSN_REGPARM void thumbBC(uint32_t opcode)
1762 1762
 {
1763 1763
   if (busPrefetchCount == 0)
1764 1764
     busPrefetch = busPrefetchEnable;
1765 1765
   int count = 0;
1766
-  u32 address = reg[13].I & 0xFFFFFFFC;
1767
-  u32 temp = reg[13].I + 4*cpuBitsSet[opcode & 0xFF];
1766
+  uint32_t address = reg[13].I & 0xFFFFFFFC;
1767
+  uint32_t temp = reg[13].I + 4*cpuBitsSet[opcode & 0xFF];
1768 1768
   POP_REG(1, 0);
1769 1769
   POP_REG(2, 1);
1770 1770
   POP_REG(4, 2);
... ...
@@ -1778,13 +1778,13 @@ static INSN_REGPARM void thumbBC(u32 opcode)
1778 1778
 }
1779 1779
 
1780 1780
 // POP {Rlist, PC}
1781
-static INSN_REGPARM void thumbBD(u32 opcode)
1781
+static INSN_REGPARM void thumbBD(uint32_t opcode)
1782 1782
 {
1783 1783
   if (busPrefetchCount == 0)
1784 1784
     busPrefetch = busPrefetchEnable;
1785 1785
   int count = 0;
1786
-  u32 address = reg[13].I & 0xFFFFFFFC;
1787
-  u32 temp = reg[13].I + 4 + 4*cpuBitsSet[opcode & 0xFF];
1786
+  uint32_t address = reg[13].I & 0xFFFFFFFC;
1787
+  uint32_t temp = reg[13].I + 4 + 4*cpuBitsSet[opcode & 0xFF];
1788 1788
   POP_REG(1, 0);
1789 1789
   POP_REG(2, 1);
1790 1790
   POP_REG(4, 2);
... ...
@@ -1836,13 +1836,13 @@ static INSN_REGPARM void thumbBD(u32 opcode)
1836 1836
   }
1837 1837
 
1838 1838
 // STM R0~7!, {Rlist}
1839
-static INSN_REGPARM void thumbC0(u32 opcode)
1839
+static INSN_REGPARM void thumbC0(uint32_t opcode)
1840 1840
 {
1841
-  u8 regist = (opcode >> 8) & 7;
1841
+  uint8_t regist = (opcode >> 8) & 7;
1842 1842
   if (busPrefetchCount == 0)
1843 1843
     busPrefetch = busPrefetchEnable;
1844
-  u32 address = reg[regist].I & 0xFFFFFFFC;
1845
-  u32 temp = reg[regist].I + 4*cpuBitsSet[opcode & 0xff];
1844
+  uint32_t address = reg[regist].I & 0xFFFFFFFC;
1845
+  uint32_t temp = reg[regist].I + 4*cpuBitsSet[opcode & 0xff];
1846 1846
   int count = 0;
1847 1847
   // store
1848 1848
   THUMB_STM_REG(1, 0, regist);
... ...
@@ -1857,13 +1857,13 @@ static INSN_REGPARM void thumbC0(u32 opcode)
1857 1857
 }
1858 1858
 
1859 1859
 // LDM R0~R7!, {Rlist}
1860
-static INSN_REGPARM void thumbC8(u32 opcode)
1860
+static INSN_REGPARM void thumbC8(uint32_t opcode)
1861 1861
 {
1862
-  u8 regist = (opcode >> 8) & 7;
1862
+  uint8_t regist = (opcode >> 8) & 7;
1863 1863
   if (busPrefetchCount == 0)
1864 1864
     busPrefetch = busPrefetchEnable;
1865
-  u32 address = reg[regist].I & 0xFFFFFFFC;
1866
-  u32 temp = reg[regist].I + 4*cpuBitsSet[opcode & 0xFF];
1865
+  uint32_t address = reg[regist].I & 0xFFFFFFFC;
1866
+  uint32_t temp = reg[regist].I + 4*cpuBitsSet[opcode & 0xFF];
1867 1867
   int count = 0;
1868 1868
   // load
1869 1869
   THUMB_LDM_REG(1, 0);
... ...
@@ -1882,12 +1882,12 @@ static INSN_REGPARM void thumbC8(u32 opcode)
1882 1882
 // Conditional branches ///////////////////////////////////////////////////
1883 1883
 
1884 1884
 // BEQ offset
1885
-static INSN_REGPARM void thumbD0(u32 opcode)
1885
+static INSN_REGPARM void thumbD0(uint32_t opcode)
1886 1886
 {
1887 1887
   UPDATE_OLDREG;
1888 1888
   clockTicks = codeTicksAccessSeq16(armNextPC) + 1;
1889 1889
   if(Z_FLAG) {
1890
-    reg[15].I += ((s8)(opcode & 0xFF)) << 1;
1890
+    reg[15].I += ((int8_t)(opcode & 0xFF)) << 1;
1891 1891
     armNextPC = reg[15].I;
1892 1892
     reg[15].I += 2;
1893 1893
     THUMB_PREFETCH;
... ...
@@ -1897,12 +1897,12 @@ static INSN_REGPARM void thumbD0(u32 opcode)
1897 1897
 }
1898 1898
 
1899 1899
 // BNE offset
1900
-static INSN_REGPARM void thumbD1(u32 opcode)
1900
+static INSN_REGPARM void thumbD1(uint32_t opcode)
1901 1901
 {
1902 1902
   UPDATE_OLDREG;
1903 1903
   clockTicks = codeTicksAccessSeq16(armNextPC) + 1;
1904 1904
   if(!Z_FLAG) {
1905
-    reg[15].I += ((s8)(opcode & 0xFF)) << 1;
1905
+    reg[15].I += ((int8_t)(opcode & 0xFF)) << 1;
1906 1906
     armNextPC = reg[15].I;
1907 1907
     reg[15].I += 2;
1908 1908
     THUMB_PREFETCH;
... ...
@@ -1912,12 +1912,12 @@ static INSN_REGPARM void thumbD1(u32 opcode)
1912 1912
 }
1913 1913
 
1914 1914
 // BCS offset
1915
-static INSN_REGPARM void thumbD2(u32 opcode)
1915
+static INSN_REGPARM void thumbD2(uint32_t opcode)
1916 1916
 {
1917 1917
   UPDATE_OLDREG;
1918 1918
   clockTicks = codeTicksAccessSeq16(armNextPC) + 1;
1919 1919
   if(C_FLAG) {
1920
-    reg[15].I += ((s8)(opcode & 0xFF)) << 1;
1920
+    reg[15].I += ((int8_t)(opcode & 0xFF)) << 1;
1921 1921
     armNextPC = reg[15].I;
1922 1922
     reg[15].I += 2;
1923 1923
     THUMB_PREFETCH;
... ...
@@ -1927,12 +1927,12 @@ static INSN_REGPARM void thumbD2(u32 opcode)
1927 1927
 }
1928 1928
 
1929 1929
 // BCC offset
1930
-static INSN_REGPARM void thumbD3(u32 opcode)
1930
+static INSN_REGPARM void thumbD3(uint32_t opcode)
1931 1931
 {
1932 1932
   UPDATE_OLDREG;
1933 1933
   clockTicks = codeTicksAccessSeq16(armNextPC) + 1;
1934 1934
   if(!C_FLAG) {
1935
-    reg[15].I += ((s8)(opcode & 0xFF)) << 1;
1935
+    reg[15].I += ((int8_t)(opcode & 0xFF)) << 1;
1936 1936
     armNextPC = reg[15].I;
1937 1937
     reg[15].I += 2;
1938 1938
     THUMB_PREFETCH;
... ...
@@ -1942,12 +1942,12 @@ static INSN_REGPARM void thumbD3(u32 opcode)
1942 1942
 }
1943 1943
 
1944 1944
 // BMI offset
1945
-static INSN_REGPARM void thumbD4(u32 opcode)
1945
+static INSN_REGPARM void thumbD4(uint32_t opcode)
1946 1946
 {
1947 1947
   UPDATE_OLDREG;
1948 1948
   clockTicks = codeTicksAccessSeq16(armNextPC) + 1;
1949 1949
   if(N_FLAG) {
1950
-    reg[15].I += ((s8)(opcode & 0xFF)) << 1;
1950
+    reg[15].I += ((int8_t)(opcode & 0xFF)) << 1;
1951 1951
     armNextPC = reg[15].I;
1952 1952
     reg[15].I += 2;
1953 1953
     THUMB_PREFETCH;
... ...
@@ -1957,12 +1957,12 @@ static INSN_REGPARM void thumbD4(u32 opcode)
1957 1957
 }
1958 1958
 
1959 1959
 // BPL offset
1960
-static INSN_REGPARM void thumbD5(u32 opcode)
1960
+static INSN_REGPARM void thumbD5(uint32_t opcode)
1961 1961
 {
1962 1962
   UPDATE_OLDREG;
1963 1963
   clockTicks = codeTicksAccessSeq16(armNextPC) + 1;
1964 1964
   if(!N_FLAG) {
1965
-    reg[15].I += ((s8)(opcode & 0xFF)) << 1;
1965
+    reg[15].I += ((int8_t)(opcode & 0xFF)) << 1;
1966 1966
     armNextPC = reg[15].I;
1967 1967
     reg[15].I += 2;
1968 1968
     THUMB_PREFETCH;
... ...
@@ -1972,12 +1972,12 @@ static INSN_REGPARM void thumbD5(u32 opcode)
1972 1972
 }
1973 1973
 
1974 1974
 // BVS offset
1975
-static INSN_REGPARM void thumbD6(u32 opcode)
1975
+static INSN_REGPARM void thumbD6(uint32_t opcode)
1976 1976
 {
1977 1977
   UPDATE_OLDREG;
1978 1978
   clockTicks = codeTicksAccessSeq16(armNextPC) + 1;
1979 1979
   if(V_FLAG) {
1980
-    reg[15].I += ((s8)(opcode & 0xFF)) << 1;
1980
+    reg[15].I += ((int8_t)(opcode & 0xFF)) << 1;
1981 1981
     armNextPC = reg[15].I;
1982 1982
     reg[15].I += 2;
1983 1983
     THUMB_PREFETCH;
... ...
@@ -1987,12 +1987,12 @@ static INSN_REGPARM void thumbD6(u32 opcode)
1987 1987
 }
1988 1988
 
1989 1989
 // BVC offset
1990
-static INSN_REGPARM void thumbD7(u32 opcode)
1990
+static INSN_REGPARM void thumbD7(uint32_t opcode)
1991 1991
 {
1992 1992
   UPDATE_OLDREG;
1993 1993
   clockTicks = codeTicksAccessSeq16(armNextPC) + 1;
1994 1994
   if(!V_FLAG) {
1995
-    reg[15].I += ((s8)(opcode & 0xFF)) << 1;
1995
+    reg[15].I += ((int8_t)(opcode & 0xFF)) << 1;
1996 1996
     armNextPC = reg[15].I;
1997 1997
     reg[15].I += 2;
1998 1998
     THUMB_PREFETCH;
... ...
@@ -2002,12 +2002,12 @@ static INSN_REGPARM void thumbD7(u32 opcode)
2002 2002
 }
2003 2003
 
2004 2004
 // BHI offset
2005
-static INSN_REGPARM void thumbD8(u32 opcode)
2005
+static INSN_REGPARM void thumbD8(uint32_t opcode)
2006 2006
 {
2007 2007
   UPDATE_OLDREG;
2008 2008
   clockTicks = codeTicksAccessSeq16(armNextPC) + 1;
2009 2009
   if(C_FLAG && !Z_FLAG) {
2010
-    reg[15].I += ((s8)(opcode & 0xFF)) << 1;
2010
+    reg[15].I += ((int8_t)(opcode & 0xFF)) << 1;
2011 2011
     armNextPC = reg[15].I;
2012 2012
     reg[15].I += 2;
2013 2013
     THUMB_PREFETCH;
... ...
@@ -2017,12 +2017,12 @@ static INSN_REGPARM void thumbD8(u32 opcode)
2017 2017
 }
2018 2018
 
2019 2019
 // BLS offset
2020
-static INSN_REGPARM void thumbD9(u32 opcode)
2020
+static INSN_REGPARM void thumbD9(uint32_t opcode)
2021 2021
 {
2022 2022
   UPDATE_OLDREG;
2023 2023
   clockTicks = codeTicksAccessSeq16(armNextPC) + 1;
2024 2024
   if(!C_FLAG || Z_FLAG) {
2025
-    reg[15].I += ((s8)(opcode & 0xFF)) << 1;
2025
+    reg[15].I += ((int8_t)(opcode & 0xFF)) << 1;
2026 2026
     armNextPC = reg[15].I;
2027 2027
     reg[15].I += 2;
2028 2028
     THUMB_PREFETCH;
... ...
@@ -2032,12 +2032,12 @@ static INSN_REGPARM void thumbD9(u32 opcode)
2032 2032
 }
2033 2033
 
2034 2034
 // BGE offset
2035
-static INSN_REGPARM void thumbDA(u32 opcode)
2035
+static INSN_REGPARM void thumbDA(uint32_t opcode)
2036 2036
 {
2037 2037
   UPDATE_OLDREG;
2038 2038
   clockTicks = codeTicksAccessSeq16(armNextPC) + 1;
2039 2039
   if(N_FLAG == V_FLAG) {
2040
-    reg[15].I += ((s8)(opcode & 0xFF)) << 1;
2040
+    reg[15].I += ((int8_t)(opcode & 0xFF)) << 1;
2041 2041
     armNextPC = reg[15].I;
2042 2042
     reg[15].I += 2;
2043 2043
     THUMB_PREFETCH;
... ...
@@ -2047,12 +2047,12 @@ static INSN_REGPARM void thumbDA(u32 opcode)
2047 2047
 }
2048 2048
 
2049 2049
 // BLT offset
2050
-static INSN_REGPARM void thumbDB(u32 opcode)
2050
+static INSN_REGPARM void thumbDB(uint32_t opcode)
2051 2051
 {
2052 2052
   UPDATE_OLDREG;
2053 2053
   clockTicks = codeTicksAccessSeq16(armNextPC) + 1;
2054 2054
   if(N_FLAG != V_FLAG) {
2055
-    reg[15].I += ((s8)(opcode & 0xFF)) << 1;
2055
+    reg[15].I += ((int8_t)(opcode & 0xFF)) << 1;
2056 2056
     armNextPC = reg[15].I;
2057 2057
     reg[15].I += 2;
2058 2058
     THUMB_PREFETCH;
... ...
@@ -2062,12 +2062,12 @@ static INSN_REGPARM void thumbDB(u32 opcode)
2062 2062
 }
2063 2063
 
2064 2064
 // BGT offset
2065
-static INSN_REGPARM void thumbDC(u32 opcode)
2065
+static INSN_REGPARM void thumbDC(uint32_t opcode)
2066 2066
 {
2067 2067
   UPDATE_OLDREG;
2068 2068
   clockTicks = codeTicksAccessSeq16(armNextPC) + 1;
2069 2069
   if(!Z_FLAG && (N_FLAG == V_FLAG)) {
2070
-    reg[15].I += ((s8)(opcode & 0xFF)) << 1;
2070
+    reg[15].I += ((int8_t)(opcode & 0xFF)) << 1;
2071 2071
     armNextPC = reg[15].I;
2072 2072
     reg[15].I += 2;
2073 2073
     THUMB_PREFETCH;
... ...
@@ -2077,12 +2077,12 @@ static INSN_REGPARM void thumbDC(u32 opcode)
2077 2077
 }
2078 2078
 
2079 2079
 // BLE offset
2080
-static INSN_REGPARM void thumbDD(u32 opcode)
2080
+static INSN_REGPARM void thumbDD(uint32_t opcode)
2081 2081
 {
2082 2082
   UPDATE_OLDREG;
2083 2083
   clockTicks = codeTicksAccessSeq16(armNextPC);
2084 2084
   if(Z_FLAG || (N_FLAG != V_FLAG)) {
2085
-    reg[15].I += ((s8)(opcode & 0xFF)) << 1;
2085
+    reg[15].I += ((int8_t)(opcode & 0xFF)) << 1;
2086 2086
     armNextPC = reg[15].I;
2087 2087
     reg[15].I += 2;
2088 2088
     THUMB_PREFETCH;
... ...
@@ -2094,9 +2094,9 @@ static INSN_REGPARM void thumbDD(u32 opcode)
2094 2094
 // SWI, B, BL /////////////////////////////////////////////////////////////
2095 2095
 
2096 2096
 // SWI #comment
2097
-static INSN_REGPARM void thumbDF(u32 opcode)
2097
+static INSN_REGPARM void thumbDF(uint32_t opcode)
2098 2098
 {
2099
-  u32 address = 0;
2099
+  uint32_t address = 0;
2100 2100
   //clockTicks = codeTicksAccessSeq16(address)*2 + codeTicksAccess16(address)+3;
2101 2101
   clockTicks = 3;
2102 2102
   busPrefetchCount=0;
... ...
@@ -2104,7 +2104,7 @@ static INSN_REGPARM void thumbDF(u32 opcode)
2104 2104
 }
2105 2105
 
2106 2106
 // B offset
2107
-static INSN_REGPARM void thumbE0(u32 opcode)
2107
+static INSN_REGPARM void thumbE0(uint32_t opcode)
2108 2108
 {
2109 2109
   int offset = (opcode & 0x3FF) << 1;
2110 2110
   if(opcode & 0x0400)
... ...
@@ -2118,7 +2118,7 @@ static INSN_REGPARM void thumbE0(u32 opcode)
2118 2118
 }
2119 2119
 
2120 2120
 // BLL #offset (forward)
2121
-static INSN_REGPARM void thumbF0(u32 opcode)
2121
+static INSN_REGPARM void thumbF0(uint32_t opcode)
2122 2122
 {
2123 2123
   int offset = (opcode & 0x7FF);
2124 2124
   reg[14].I = reg[15].I + (offset << 12);
... ...
@@ -2126,7 +2126,7 @@ static INSN_REGPARM void thumbF0(u32 opcode)
2126 2126
 }
2127 2127
 
2128 2128
 // BLL #offset (backward)
2129
-static INSN_REGPARM void thumbF4(u32 opcode)
2129
+static INSN_REGPARM void thumbF4(uint32_t opcode)
2130 2130
 {
2131 2131
   int offset = (opcode & 0x7FF);
2132 2132
   reg[14].I = reg[15].I + ((offset << 12) | 0xFF800000);
... ...
@@ -2134,10 +2134,10 @@ static INSN_REGPARM void thumbF4(u32 opcode)
2134 2134
 }
2135 2135
 
2136 2136
 // BLH #offset
2137
-static INSN_REGPARM void thumbF8(u32 opcode)
2137
+static INSN_REGPARM void thumbF8(uint32_t opcode)
2138 2138
 {
2139 2139
   int offset = (opcode & 0x7FF);
2140
-  u32 temp = reg[15].I-2;
2140
+  uint32_t temp = reg[15].I-2;
2141 2141
   reg[15].I = (reg[14].I + (offset<<1))&0xFFFFFFFE;
2142 2142
   armNextPC = reg[15].I;
2143 2143
   reg[15].I += 2;
... ...
@@ -2149,7 +2149,7 @@ static INSN_REGPARM void thumbF8(u32 opcode)
2149 2149
 
2150 2150
 // Instruction table //////////////////////////////////////////////////////
2151 2151
 
2152
-typedef INSN_REGPARM void (*insnfunc_t)(u32 opcode);
2152
+typedef INSN_REGPARM void (*insnfunc_t)(uint32_t opcode);
2153 2153
 #define thumbUI thumbUnknownInsn
2154 2154
 #ifdef BKPT_SUPPORT
2155 2155
  #define thumbBP thumbBreakpoint
... ...
@@ -2299,14 +2299,14 @@ int thumbExecute()
2299 2299
     //if ((armNextPC & 0x0803FFFF) == 0x08020000)
2300 2300
     //    busPrefetchCount=0x100;
2301 2301
 
2302
-    u32 opcode = cpuPrefetch[0];
2302
+    uint32_t opcode = cpuPrefetch[0];
2303 2303
     cpuPrefetch[0] = cpuPrefetch[1];
2304 2304
 
2305 2305
     busPrefetch = false;
2306 2306
     if (busPrefetchCount & 0xFFFFFF00)
2307 2307
       busPrefetchCount = 0x100 | (busPrefetchCount & 0xFF);
2308 2308
     clockTicks = 0;
2309
-    u32 oldArmNextPC = armNextPC;
2309
+    uint32_t oldArmNextPC = armNextPC;
2310 2310
 #ifndef FINAL_VERSION
2311 2311
     if(armNextPC == stop) {
2312 2312
       armNextPC++;
... ...
@@ -22,7 +22,7 @@
22 22
 //#include "agbprint.h"
23 23
 //#include "GBALink.h"
24 24
 
25
-extern int mapgsf(u8* a, int l, int &s);
25
+extern int mapgsf(uint8_t* a, int l, int &s);
26 26
 
27 27
 #ifdef PROFILING
28 28
 #include "prof/prof.h"
... ...
@@ -37,14 +37,14 @@ extern int emulating;
37 37
 int SWITicks = 0;
38 38
 int IRQTicks = 0;
39 39
 
40
-u32 mastercode = 0;
40
+uint32_t mastercode = 0;
41 41
 int layerEnableDelay = 0;
42 42
 bool busPrefetch = false;
43 43
 bool busPrefetchEnable = false;
44
-u32 busPrefetchCount = 0;
44
+uint32_t busPrefetchCount = 0;
45 45
 int cpuDmaTicksToUpdate = 0;
46 46
 int cpuDmaCount = 0;
47
-u32 cpuDmaLast = 0;
47
+uint32_t cpuDmaLast = 0;
48 48
 int dummyAddress = 0;
49 49
 
50 50
 bool cpuBreakLoop = false;
... ...
@@ -60,7 +60,7 @@ bool cpuFlashEnabled = true;
60 60
 bool cpuEEPROMEnabled = true;
61 61
 bool cpuEEPROMSensorEnabled = false;
62 62
 
63
-u32 cpuPrefetch[2];
63
+uint32_t cpuPrefetch[2];
64 64
 
65 65
 int cpuTotalTicks = 0;
66 66
 #ifdef PROFILING
... ...
@@ -70,51 +70,51 @@ static profile_segment *profilSegment = NULL;
70 70
 #endif
71 71
 
72 72
 #ifdef BKPT_SUPPORT
73
-u8 freezeWorkRAM[0x40000];
74
-u8 freezeInternalRAM[0x8000];
75
-u8 freezeVRAM[0x18000];
76
-u8 freezePRAM[0x400];
77
-u8 freezeOAM[0x400];
73
+uint8_t freezeWorkRAM[0x40000];
74
+uint8_t freezeInternalRAM[0x8000];
75
+uint8_t freezeVRAM[0x18000];
76
+uint8_t freezePRAM[0x400];
77
+uint8_t freezeOAM[0x400];
78 78
 bool debugger_last;
79 79
 #endif
80 80
 
81 81
 int lcdTicks = (useBios && !skipBios) ? 1008 : 208;
82
-u8 timerOnOffDelay = 0;
83
-u16 timer0Value = 0;
82
+uint8_t timerOnOffDelay = 0;
83
+uint16_t timer0Value = 0;
84 84
 bool timer0On = false;
85 85
 int timer0Ticks = 0;
86 86
 int timer0Reload = 0;
87 87
 int timer0ClockReload  = 0;
88
-u16 timer1Value = 0;
88
+uint16_t timer1Value = 0;
89 89
 bool timer1On = false;
90 90
 int timer1Ticks = 0;
91 91
 int timer1Reload = 0;
92 92
 int timer1ClockReload  = 0;
93
-u16 timer2Value = 0;
93
+uint16_t timer2Value = 0;
94 94
 bool timer2On = false;
95 95
 int timer2Ticks = 0;
96 96
 int timer2Reload = 0;
97 97
 int timer2ClockReload  = 0;
98
-u16 timer3Value = 0;
98
+uint16_t timer3Value = 0;
99 99
 bool timer3On = false;
100 100
 int timer3Ticks = 0;
101 101
 int timer3Reload = 0;
102 102
 int timer3ClockReload  = 0;
103
-u32 dma0Source = 0;
104
-u32 dma0Dest = 0;
105
-u32 dma1Source = 0;
106
-u32 dma1Dest = 0;
107
-u32 dma2Source = 0;
108
-u32 dma2Dest = 0;
109
-u32 dma3Source = 0;
110
-u32 dma3Dest = 0;
103
+uint32_t dma0Source = 0;
104
+uint32_t dma0Dest = 0;
105
+uint32_t dma1Source = 0;
106
+uint32_t dma1Dest = 0;
107
+uint32_t dma2Source = 0;
108
+uint32_t dma2Dest = 0;
109
+uint32_t dma3Source = 0;
110
+uint32_t dma3Dest = 0;
111 111
 //void (*cpuSaveGameFunc)(u32,u8) = /*flashSaveDecide*/0;
112 112
 //void (*renderLine)() = /*mode0RenderLine*/0;
113 113
 bool fxOn = false;
114 114
 bool windowOn = false;
115 115
 int frameCount = 0;
116 116
 char buffer[1024];
117
-u32 lastTime = 0;
117
+uint32_t lastTime = 0;
118 118
 int count = 0;
119 119
 
120 120
 int capture = 0;
... ...
@@ -128,23 +128,23 @@ const int TIMER_TICKS[4] = {
128 128
   10
129 129
 };
130 130
 
131
-const u32  objTilesAddress [3] = {0x010000, 0x014000, 0x014000};
132
-const u8 gamepakRamWaitState[4] = { 4, 3, 2, 8 };
133
-const u8 gamepakWaitState[4] =  { 4, 3, 2, 8 };
134
-const u8 gamepakWaitState0[2] = { 2, 1 };
135
-const u8 gamepakWaitState1[2] = { 4, 1 };
136
-const u8 gamepakWaitState2[2] = { 8, 1 };
131
+const uint32_t  objTilesAddress [3] = {0x010000, 0x014000, 0x014000};
132
+const uint8_t gamepakRamWaitState[4] = { 4, 3, 2, 8 };
133
+const uint8_t gamepakWaitState[4] =  { 4, 3, 2, 8 };
134
+const uint8_t gamepakWaitState0[2] = { 2, 1 };
135
+const uint8_t gamepakWaitState1[2] = { 4, 1 };
136
+const uint8_t gamepakWaitState2[2] = { 8, 1 };
137 137
 const bool isInRom [16]=
138 138
   { false, false, false, false, false, false, false, false,
139 139
     true, true, true, true, true, true, false, false };
140 140
 
141
-u8 memoryWait[16] =
141
+uint8_t memoryWait[16] =
142 142
   { 0, 0, 2, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 0 };
143
-u8 memoryWait32[16] =
143
+uint8_t memoryWait32[16] =
144 144
   { 0, 0, 5, 0, 0, 1, 1, 0, 7, 7, 9, 9, 13, 13, 4, 0 };
145
-u8 memoryWaitSeq[16] =
145
+uint8_t memoryWaitSeq[16] =
146 146
   { 0, 0, 2, 0, 0, 0, 0, 0, 2, 2, 4, 4, 8, 8, 4, 0 };
147
-u8 memoryWaitSeq32[16] =
147
+uint8_t memoryWaitSeq32[16] =
148 148
   { 0, 0, 5, 0, 0, 1, 1, 0, 5, 5, 9, 9, 17, 17, 4, 0 };
149 149
 
150 150
 // The videoMemoryWait constants are used to add some waitstates
... ...
@@ -155,13 +155,13 @@ u8 memoryWaitSeq32[16] =
155 155
 //  {0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0};
156 156
 
157 157
 
158
-u8 biosProtected[4];
158
+uint8_t biosProtected[4];
159 159
 
160 160
 #ifdef WORDS_BIGENDIAN
161 161
 bool cpuBiosSwapped = false;
162 162
 #endif
163 163
 
164
-u32 myROM[] = {
164
+uint32_t myROM[] = {
165 165
 0xEA000006,
166 166
 0xEA000093,
167 167
 0xEA000006,
... ...
@@ -546,10 +546,10 @@ inline int CPUUpdateTicks()
546 546
   }
547 547
 }*/
548 548
 
549
-extern u32 line0[240];
550
-extern u32 line1[240];
551
-extern u32 line2[240];
552
-extern u32 line3[240];
549
+/*extern uint32_t line0[240];
550
+extern uint32_t line1[240];
551
+extern uint32_t line2[240];
552
+extern uint32_t line3[240];
553 553
 
554 554
 #define CLEAR_ARRAY(a) \
555 555
   {\
... ...
@@ -557,7 +557,7 @@ extern u32 line3[240];
557 557
     for(int i = 0; i < 240; i++) {\
558 558
       *array++ = 0x80000000;\
559 559
     }\
560
-  }\
560
+  }\*/
561 561
 
562 562
 /*void CPUUpdateRenderBuffers(bool force)
563 563
 {
... ...
@@ -1339,13 +1339,13 @@ int CPULoadRom(const char *szFile)
1339 1339
 
1340 1340
   //systemSaveUpdateCounter = SYSTEM_SAVE_NOT_UPDATED;
1341 1341
 
1342
-  rom = (u8 *)malloc(0x2000000);
1342
+  rom = (uint8_t *)malloc(0x2000000);
1343 1343
   if(rom == NULL) {
1344 1344
     /*systemMessage(MSG_OUT_OF_MEMORY, N_("Failed to allocate memory for %s"),
1345 1345
                   "ROM");*/
1346 1346
     return 0;
1347 1347
   }
1348
-  workRAM = (u8 *)calloc(1, 0x40000);
1348
+  workRAM = (uint8_t *)calloc(1, 0x40000);
1349 1349
   if(workRAM == NULL) {
1350 1350
     /*systemMessage(MSG_OUT_OF_MEMORY, N_("Failed to allocate memory for %s"),
1351 1351
                   "WRAM");*/
... ...
@@ -1395,56 +1395,56 @@ int CPULoadRom(const char *szFile)
1395 1395
 	else
1396 1396
 		mapgsf(rom, 0x2000000,romSize);
1397 1397
 
1398
-  u16 *temp = (u16 *)(rom+((romSize+1)&~1));
1398
+  uint16_t *temp = (uint16_t *)(rom+((romSize+1)&~1));
1399 1399
   int i;
1400 1400
   for(i = (romSize+1)&~1; i < 0x2000000; i+=2) {
1401 1401
     WRITE16LE(temp, (i >> 1) & 0xFFFF);
1402 1402
     temp++;
1403 1403
   }
1404 1404
 
1405
-  bios = (u8 *)calloc(1,0x4000);
1405
+  bios = (uint8_t *)calloc(1,0x4000);
1406 1406
   if(bios == NULL) {
1407 1407
     /*systemMessage(MSG_OUT_OF_MEMORY, N_("Failed to allocate memory for %s"),
1408 1408
                   "BIOS");*/
1409 1409
     CPUCleanUp();
1410 1410
     return 0;
1411 1411
   }
1412
-  internalRAM = (u8 *)calloc(1,0x8000);
1412
+  internalRAM = (uint8_t *)calloc(1,0x8000);
1413 1413
   if(internalRAM == NULL) {
1414 1414
     /*systemMessage(MSG_OUT_OF_MEMORY, N_("Failed to allocate memory for %s"),
1415 1415
                   "IRAM");*/
1416 1416
     CPUCleanUp();
1417 1417
     return 0;
1418 1418
   }
1419
-  paletteRAM = (u8 *)calloc(1,0x400);
1419
+  paletteRAM = (uint8_t *)calloc(1,0x400);
1420 1420
   if(paletteRAM == NULL) {
1421 1421
     /*systemMessage(MSG_OUT_OF_MEMORY, N_("Failed to allocate memory for %s"),
1422 1422
                   "PRAM");*/
1423 1423
     CPUCleanUp();
1424 1424
     return 0;
1425 1425
   }
1426
-  vram = (u8 *)calloc(1, 0x20000);
1426
+  vram = (uint8_t *)calloc(1, 0x20000);
1427 1427
   if(vram == NULL) {
1428 1428
     /*systemMessage(MSG_OUT_OF_MEMORY, N_("Failed to allocate memory for %s"),
1429 1429
                   "VRAM");*/
1430 1430
     CPUCleanUp();
1431 1431
     return 0;
1432 1432
   }
1433
-  oam = (u8 *)calloc(1, 0x400);
1433
+  oam = (uint8_t *)calloc(1, 0x400);
1434 1434
   if(oam == NULL) {
1435 1435
     /*systemMessage(MSG_OUT_OF_MEMORY, N_("Failed to allocate memory for %s"),
1436 1436
                   "OAM");*/
1437 1437
     CPUCleanUp();
1438 1438
     return 0;
1439 1439
   }
1440
-  pix = (u8 *)calloc(1, 4 * 241 * 162);
1440
+  pix = (uint8_t *)calloc(1, 4 * 241 * 162);
1441 1441
   if(pix == NULL) {
1442 1442
     /*systemMessage(MSG_OUT_OF_MEMORY, N_("Failed to allocate memory for %s"),
1443 1443
                   "PIX");*/
1444 1444
     CPUCleanUp();
1445 1445
     return 0;
1446 1446
   }
1447
-  ioMem = (u8 *)calloc(1, 0x400);
1447
+  ioMem = (uint8_t *)calloc(1, 0x400);
1448 1448
   if(ioMem == NULL) {
1449 1449
     /*systemMessage(MSG_OUT_OF_MEMORY, N_("Failed to allocate memory for %s"),
1450 1450
                   "IO");*/
... ...
@@ -1462,8 +1462,8 @@ int CPULoadRom(const char *szFile)
1462 1462
 
1463 1463
 void doMirroring (bool b)
1464 1464
 {
1465
-  u32 mirroredRomSize = (((romSize)>>20) & 0x3F)<<20;
1466
-  u32 mirroredRomAddress = romSize;
1465
+  uint32_t mirroredRomSize = (((romSize)>>20) & 0x3F)<<20;
1466
+  uint32_t mirroredRomAddress = romSize;
1467 1467
   if ((mirroredRomSize <=0x800000) && (b))
1468 1468
   {
1469 1469
     mirroredRomAddress = mirroredRomSize;
... ...
@@ -1471,7 +1471,7 @@ void doMirroring (bool b)
1471 1471
         mirroredRomSize=0x100000;
1472 1472
     while (mirroredRomAddress<0x01000000)
1473 1473
     {
1474
-      memcpy ((u16 *)(rom+mirroredRomAddress), (u16 *)(rom), mirroredRomSize);
1474
+      memcpy ((uint16_t *)(rom+mirroredRomAddress), (uint16_t *)(rom), mirroredRomSize);
1475 1475
       mirroredRomAddress+=mirroredRomSize;
1476 1476
     }
1477 1477
   }
... ...
@@ -1540,7 +1540,7 @@ void doMirroring (bool b)
1540 1540
 
1541 1541
 void CPUUpdateCPSR()
1542 1542
 {
1543
-  u32 CPSR = reg[16].I & 0x40;
1543
+  uint32_t CPSR = reg[16].I & 0x40;
1544 1544
   if(N_FLAG)
1545 1545
     CPSR |= 0x80000000;
1546 1546
   if(Z_FLAG)
... ...
@@ -1559,7 +1559,7 @@ void CPUUpdateCPSR()
1559 1559
 
1560 1560
 void CPUUpdateFlags(bool breakLoop)
1561 1561
 {
1562
-  u32 CPSR = reg[16].I;
1562
+  uint32_t CPSR = reg[16].I;
1563 1563
 
1564 1564
   N_FLAG = (CPSR & 0x80000000) ? true: false;
1565 1565
   Z_FLAG = (CPSR & 0x40000000) ? true: false;
... ...
@@ -1579,16 +1579,16 @@ void CPUUpdateFlags()
1579 1579
 }
1580 1580
 
1581 1581
 #ifdef WORDS_BIGENDIAN
1582
-static void CPUSwap(volatile u32 *a, volatile u32 *b)
1582
+static void CPUSwap(volatile uint32_t *a, volatile uint32_t *b)
1583 1583
 {
1584
-  volatile u32 c = *b;
1584
+  volatile uint32_t c = *b;
1585 1585
   *b = *a;
1586 1586
   *a = c;
1587 1587
 }
1588 1588
 #else
1589
-static void CPUSwap(u32 *a, u32 *b)
1589
+static void CPUSwap(uint32_t *a, uint32_t *b)
1590 1590
 {
1591
-  u32 c = *b;
1591
+  uint32_t c = *b;
1592 1592
   *b = *a;
1593 1593
   *a = c;
1594 1594
 }
... ...
@@ -1640,8 +1640,8 @@ void CPUSwitchMode(int mode, bool saveState, bool breakLoop)
1640 1640
     break;
1641 1641
   }
1642 1642
 
1643
-  u32 CPSR = reg[16].I;
1644
-  u32 SPSR = reg[17].I;
1643
+  uint32_t CPSR = reg[16].I;
1644
+  uint32_t SPSR = reg[17].I;
1645 1645
 
1646 1646
   switch(mode) {
1647 1647
   case 0x10:
... ...
@@ -1715,7 +1715,7 @@ void CPUSwitchMode(int mode, bool saveState)
1715 1715
 
1716 1716
 void CPUUndefinedException()
1717 1717
 {
1718
-  u32 PC = reg[15].I;
1718
+  uint32_t PC = reg[15].I;
1719 1719
   bool savedArmState = armState;
1720 1720
   CPUSwitchMode(0x1b, true, false);
1721 1721
   reg[14].I = PC - (savedArmState ? 4 : 2);
... ...
@@ -1729,7 +1729,7 @@ void CPUUndefinedException()
1729 1729
 
1730 1730
 void CPUSoftwareInterrupt()
1731 1731
 {
1732
-  u32 PC = reg[15].I;
1732
+  uint32_t PC = reg[15].I;
1733 1733
   bool savedArmState = armState;
1734 1734
   CPUSwitchMode(0x13, true, false);
1735 1735
   reg[14].I = PC - (savedArmState ? 4 : 2);
... ...
@@ -1930,7 +1930,7 @@ void CPUSoftwareInterrupt(int comment)
1930 1930
     break;
1931 1931
   case 0x11:
1932 1932
     {
1933
-      u32 len = CPUReadMemory(reg[0].I) >> 8;
1933
+      uint32_t len = CPUReadMemory(reg[0].I) >> 8;
1934 1934
       if(!(((reg[0].I & 0xe000000) == 0) ||
1935 1935
           ((reg[0].I + (len & 0x1fffff)) & 0xe000000) == 0))
1936 1936
         SWITicks = (9 + memoryWait[(reg[1].I>>24) & 0xF]) * len;
... ...
@@ -1939,7 +1939,7 @@ void CPUSoftwareInterrupt(int comment)
1939 1939
     break;
1940 1940
   case 0x12:
1941 1941
     {
1942
-      u32 len = CPUReadMemory(reg[0].I) >> 8;
1942
+      uint32_t len = CPUReadMemory(reg[0].I) >> 8;
1943 1943
       if(!(((reg[0].I & 0xe000000) == 0) ||
1944 1944
           ((reg[0].I + (len & 0x1fffff)) & 0xe000000) == 0))
1945 1945
         SWITicks = (19 + memoryWait[(reg[1].I>>24) & 0xF]) * len;
... ...
@@ -1948,7 +1948,7 @@ void CPUSoftwareInterrupt(int comment)
1948 1948
     break;
1949 1949
   case 0x13:
1950 1950
     {
1951
-      u32 len = CPUReadMemory(reg[0].I) >> 8;
1951
+      uint32_t len = CPUReadMemory(reg[0].I) >> 8;
1952 1952
       if(!(((reg[0].I & 0xe000000) == 0) ||
1953 1953
           ((reg[0].I + (len & 0x1fffff)) & 0xe000000) == 0))
1954 1954
         SWITicks = (29 + (memoryWait[(reg[0].I>>24) & 0xF]<<1)) * len;
... ...
@@ -1957,7 +1957,7 @@ void CPUSoftwareInterrupt(int comment)
1957 1957
     break;
1958 1958
   case 0x14:
1959 1959
     {
1960
-      u32 len = CPUReadMemory(reg[0].I) >> 8;
1960
+      uint32_t len = CPUReadMemory(reg[0].I) >> 8;
1961 1961
       if(!(((reg[0].I & 0xe000000) == 0) ||
1962 1962
           ((reg[0].I + (len & 0x1fffff)) & 0xe000000) == 0))
1963 1963
         SWITicks = (11 + memoryWait[(reg[0].I>>24) & 0xF] +
... ...
@@ -1967,7 +1967,7 @@ void CPUSoftwareInterrupt(int comment)
1967 1967
     break;
1968 1968
   case 0x15:
1969 1969
     {
1970
-      u32 len = CPUReadMemory(reg[0].I) >> 9;
1970
+      uint32_t len = CPUReadMemory(reg[0].I) >> 9;
1971 1971
       if(!(((reg[0].I & 0xe000000) == 0) ||
1972 1972
           ((reg[0].I + (len & 0x1fffff)) & 0xe000000) == 0))
1973 1973
         SWITicks = (34 + (memoryWait[(reg[0].I>>24) & 0xF] << 1) +
... ...
@@ -1977,7 +1977,7 @@ void CPUSoftwareInterrupt(int comment)
1977 1977
     break;
1978 1978
   case 0x16:
1979 1979
     {
1980
-      u32 len = CPUReadMemory(reg[0].I) >> 8;
1980
+      uint32_t len = CPUReadMemory(reg[0].I) >> 8;
1981 1981
       if(!(((reg[0].I & 0xe000000) == 0) ||
1982 1982
           ((reg[0].I + (len & 0x1fffff)) & 0xe000000) == 0))
1983 1983
         SWITicks = (13 + memoryWait[(reg[0].I>>24) & 0xF] +
... ...
@@ -1987,7 +1987,7 @@ void CPUSoftwareInterrupt(int comment)
1987 1987
     break;
1988 1988
   case 0x17:
1989 1989
     {
1990
-      u32 len = CPUReadMemory(reg[0].I) >> 9;
1990
+      uint32_t len = CPUReadMemory(reg[0].I) >> 9;
1991 1991
       if(!(((reg[0].I & 0xe000000) == 0) ||
1992 1992
           ((reg[0].I + (len & 0x1fffff)) & 0xe000000) == 0))
1993 1993
         SWITicks = (39 + (memoryWait[(reg[0].I>>24) & 0xF]<<1) +
... ...
@@ -1997,7 +1997,7 @@ void CPUSoftwareInterrupt(int comment)
1997 1997
     break;
1998 1998
   case 0x18:
1999 1999
     {
2000
-      u32 len = CPUReadMemory(reg[0].I) >> 9;
2000
+      uint32_t len = CPUReadMemory(reg[0].I) >> 9;
2001 2001
       if(!(((reg[0].I & 0xe000000) == 0) ||
2002 2002
           ((reg[0].I + (len & 0x1fffff)) & 0xe000000) == 0))
2003 2003
         SWITicks = (13 + memoryWait[(reg[0].I>>24) & 0xF] +
... ...
@@ -2070,7 +2070,7 @@ void CPUCompareVCOUNT()
2070 2070
 
2071 2071
 }
2072 2072
 
2073
-void doDMA(u32 &s, u32 &d, u32 si, u32 di, u32 c, int transfer32)
2073
+void doDMA(uint32_t &s, uint32_t &d, uint32_t si, uint32_t di, uint32_t c, int transfer32)
2074 2074
 {
2075 2075
   int sm = s >> 24;
2076 2076
   int dm = d >> 24;
... ...
@@ -2154,13 +2154,13 @@ void CPUCheckDMA(int reason, int dmamask)
2154 2154
   // DMA 0
2155 2155
   if((DM0CNT_H & 0x8000) && (dmamask & 1)) {
2156 2156
     if(((DM0CNT_H >> 12) & 3) == reason) {
2157
-      u32 sourceIncrement = 4;
2158
-      u32 destIncrement = 4;
2157
+      uint32_t sourceIncrement = 4;
2158
+      uint32_t destIncrement = 4;
2159 2159
       switch((DM0CNT_H >> 7) & 3) {
2160 2160
       case 0:
2161 2161
         break;
2162 2162
       case 1:
2163
-        sourceIncrement = (u32)-4;
2163
+        sourceIncrement = (uint32_t)-4;
2164 2164
         break;
2165 2165
       case 2:
2166 2166
         sourceIncrement = 0;
... ...
@@ -2170,7 +2170,7 @@ void CPUCheckDMA(int reason, int dmamask)
2170 2170
       case 0:
2171 2171
         break;
2172 2172
       case 1:
2173
-        destIncrement = (u32)-4;
2173
+        destIncrement = (uint32_t)-4;
2174 2174
         break;
2175 2175
       case 2:
2176 2176
         destIncrement = 0;
... ...
@@ -2210,13 +2210,13 @@ void CPUCheckDMA(int reason, int dmamask)
2210 2210
   // DMA 1
2211 2211
   if((DM1CNT_H & 0x8000) && (dmamask & 2)) {
2212 2212
     if(((DM1CNT_H >> 12) & 3) == reason) {
2213
-      u32 sourceIncrement = 4;
2214
-      u32 destIncrement = 4;
2213
+      uint32_t sourceIncrement = 4;
2214
+      uint32_t destIncrement = 4;
2215 2215
       switch((DM1CNT_H >> 7) & 3) {
2216 2216
       case 0:
2217 2217
         break;
2218 2218
       case 1:
2219
-        sourceIncrement = (u32)-4;
2219
+        sourceIncrement = (uint32_t)-4;
2220 2220
         break;
2221 2221
       case 2:
2222 2222
         sourceIncrement = 0;
... ...
@@ -2226,7 +2226,7 @@ void CPUCheckDMA(int reason, int dmamask)
2226 2226
       case 0:
2227 2227
         break;
2228 2228
       case 1:
2229
-        destIncrement = (u32)-4;
2229
+        destIncrement = (uint32_t)-4;
2230 2230
         break;
2231 2231
       case 2:
2232 2232
         destIncrement = 0;
... ...
@@ -2278,13 +2278,13 @@ void CPUCheckDMA(int reason, int dmamask)
2278 2278
   // DMA 2
2279 2279
   if((DM2CNT_H & 0x8000) && (dmamask & 4)) {
2280 2280
     if(((DM2CNT_H >> 12) & 3) == reason) {
2281
-      u32 sourceIncrement = 4;
2282
-      u32 destIncrement = 4;
2281
+      uint32_t sourceIncrement = 4;
2282
+      uint32_t destIncrement = 4;
2283 2283
       switch((DM2CNT_H >> 7) & 3) {
2284 2284
       case 0:
2285 2285
         break;
2286 2286
       case 1:
2287
-        sourceIncrement = (u32)-4;
2287
+        sourceIncrement = (uint32_t)-4;
2288 2288
         break;
2289 2289
       case 2:
2290 2290
         sourceIncrement = 0;
... ...
@@ -2294,7 +2294,7 @@ void CPUCheckDMA(int reason, int dmamask)
2294 2294
       case 0:
2295 2295
         break;
2296 2296
       case 1:
2297
-        destIncrement = (u32)-4;
2297
+        destIncrement = (uint32_t)-4;
2298 2298
         break;
2299 2299
       case 2:
2300 2300
         destIncrement = 0;
... ...
@@ -2347,13 +2347,13 @@ void CPUCheckDMA(int reason, int dmamask)
2347 2347
   // DMA 3
2348 2348
   if((DM3CNT_H & 0x8000) && (dmamask & 8)) {
2349 2349
     if(((DM3CNT_H >> 12) & 3) == reason) {
2350
-      u32 sourceIncrement = 4;
2351
-      u32 destIncrement = 4;
2350
+      uint32_t sourceIncrement = 4;
2351
+      uint32_t destIncrement = 4;
2352 2352
       switch((DM3CNT_H >> 7) & 3) {
2353 2353
       case 0:
2354 2354
         break;
2355 2355
       case 1:
2356
-        sourceIncrement = (u32)-4;
2356
+        sourceIncrement = (uint32_t)-4;
2357 2357
         break;
2358 2358
       case 2:
2359 2359
         sourceIncrement = 0;
... ...
@@ -2363,7 +2363,7 @@ void CPUCheckDMA(int reason, int dmamask)
2363 2363
       case 0:
2364 2364
         break;
2365 2365
       case 1:
2366
-        destIncrement = (u32)-4;
2366
+        destIncrement = (uint32_t)-4;
2367 2367
         break;
2368 2368
       case 2:
2369 2369
         destIncrement = 0;
... ...
@@ -2400,7 +2400,7 @@ void CPUCheckDMA(int reason, int dmamask)
2400 2400
   }
2401 2401
 }
2402 2402
 
2403
-void CPUUpdateRegister(u32 address, u16 value)
2403
+void CPUUpdateRegister(uint32_t address, uint16_t value)
2404 2404
 {
2405 2405
   switch(address)
2406 2406
   {
... ...
@@ -2412,7 +2412,7 @@ void CPUUpdateRegister(u32 address, u16 value)
2412 2412
       }
2413 2413
       bool change = (0 != ((DISPCNT ^ value) & 0x80));
2414 2414
       bool changeBG = (0 != ((DISPCNT ^ value) & 0x0F00));
2415
-      u16 changeBGon = ((~DISPCNT) & value) & 0x0F00; // these layers are being activated
2415
+      uint16_t changeBGon = ((~DISPCNT) & value) & 0x0F00; // these layers are being activated
2416 2416
 
2417 2417
       DISPCNT = (value & 0xFFF7); // bit 3 can only be accessed by the BIOS to enable GBC mode
2418 2418
       UPDATE_REG(0x00, DISPCNT);
... ...
@@ -2627,8 +2627,8 @@ void CPUUpdateRegister(u32 address, u16 value)
2627 2627
   case 0x7c:
2628 2628
   case 0x80:
2629 2629
   case 0x84:
2630
-    soundEvent(address&0xFF, (u8)(value & 0xFF));
2631
-    soundEvent((address&0xFF)+1, (u8)(value>>8));
2630
+    soundEvent(address&0xFF, (uint8_t)(value & 0xFF));
2631
+    soundEvent((address&0xFF)+1, (uint8_t)(value>>8));
2632 2632
     break;
2633 2633
   case 0x82:
2634 2634
   case 0x88:
... ...
@@ -3013,8 +3013,8 @@ void applyTimer ()
3013 3013
   timerOnOffDelay = 0;
3014 3014
 }
3015 3015
 
3016
-u8 cpuBitsSet[256];
3017
-u8 cpuLowestBitSet[256];
3016
+uint8_t cpuBitsSet[256];
3017
+uint8_t cpuLowestBitSet[256];
3018 3018
 
3019 3019
 void CPUInit(const char *biosFileName, bool useBiosFile)
3020 3020
 {
... ...
@@ -3105,8 +3105,8 @@ void CPUInit(const char *biosFileName, bool useBiosFile)
3105 3105
     ioReadable[i] = false;
3106 3106
 
3107 3107
   if(romSize < 0x1fe2000) {
3108
-    *((u16 *)&rom[0x1fe209c]) = 0xdffa; // SWI 0xFA
3109
-    *((u16 *)&rom[0x1fe209e]) = 0x4770; // BX LR
3108
+    *((uint16_t *)&rom[0x1fe209c]) = 0xdffa; // SWI 0xFA
3109
+    *((uint16_t *)&rom[0x1fe209e]) = 0x4770; // BX LR
3110 3110
   } else {
3111 3111
     //agbPrintEnable(false);
3112 3112
   }
... ...
@@ -3306,7 +3306,7 @@ void CPUReset()
3306 3306
   //CPUUpdateRenderBuffers(true);
3307 3307
 
3308 3308
   for(int i = 0; i < 256; i++) {
3309
-    map[i].address = (u8 *)&dummyAddress;
3309
+    map[i].address = (uint8_t *)&dummyAddress;
3310 3310
     map[i].mask = 0;
3311 3311
   }
3312 3312
 
... ...
@@ -3415,7 +3415,7 @@ void CPUReset()
3415 3415
 
3416 3416
 void CPUInterrupt()
3417 3417
 {
3418
-  u32 PC = reg[15].I;
3418
+  uint32_t PC = reg[15].I;
3419 3419
   bool savedState = armState;
3420 3420
   CPUSwitchMode(0x12, true, false);
3421 3421
   reg[14].I = PC;
... ...
@@ -3547,9 +3547,9 @@ void CPULoop(int ticks)
3547 3547
             CPUCompareVCOUNT();
3548 3548
           }
3549 3549
         } else {
3550
-          int framesToSkip = /*systemFrameSkip*/0;
3550
+          /*int framesToSkip = *//*systemFrameSkip*//*0;
3551 3551
           if(speedup)
3552
-            framesToSkip = 9; // try 6 FPS during speedup
3552
+            framesToSkip = 9;*/ // try 6 FPS during speedup
3553 3553
 
3554 3554
           if(DISPSTAT & 2) {
3555 3555
             // if in H-Blank, leave it and move to drawing mode
... ...
@@ -3562,28 +3562,28 @@ void CPULoop(int ticks)
3562 3562
               count++;
3563 3563
               //systemFrame();
3564 3564
 
3565
-              if((count % 10) == 0) {
3565
+              /*if((count % 10) == 0) {
3566 3566
                 //system10Frames(60);
3567
-              }
3567
+              }*/
3568 3568
               if(count == 60) {
3569
-                u32 time = /*systemGetClock()*/0;
3569
+                /*u32 time = *//*systemGetClock()*//*0;
3570 3570
                 if(time != lastTime) {
3571 3571
                   //u32 t = 100000/(time - lastTime);
3572 3572
                   //systemShowSpeed(t);
3573 3573
                 } else
3574 3574
                   //systemShowSpeed(0);
3575
-                lastTime = time;
3575
+                lastTime = time;*/
3576 3576
                 count = 0;
3577 3577
               }
3578
-              u32 joy = 0;
3578
+              //u32 joy = 0;
3579 3579
               // update joystick information
3580 3580
               /*if(systemReadJoypads())
3581 3581
                 // read default joystick
3582 3582
                 joy = systemReadJoypad(-1);*/
3583
-              P1 = 0x03FF ^ (joy & 0x3FF);
3583
+              //P1 = 0x03FF ^ (joy & 0x3FF);
3584 3584
               /*if(cpuEEPROMSensorEnabled)
3585 3585
                 systemUpdateMotionSensor();*/
3586
-              UPDATE_REG(0x130, P1);
3586
+              /*UPDATE_REG(0x130, P1);
3587 3587
               u16 P1CNT = READ16LE(((u16 *)&ioMem[0x132]));
3588 3588
               // this seems wrong, but there are cases where the game
3589 3589
               // can enter the stop state without requesting an IRQ from
... ...
@@ -3603,18 +3603,18 @@ void CPULoop(int ticks)
3603 3603
                 }
3604 3604
               }
3605 3605
 
3606
-              u32 ext = (joy >> 10);
3606
+              u32 ext = (joy >> 10);*/
3607 3607
               // If no (m) code is enabled, apply the cheats at each LCDline
3608 3608
               /*if((cheatsEnabled) && (mastercode==0))
3609 3609
                 remainingTicks += cheatsCheckKeys(P1^0x3FF, ext);*/
3610
-              speedup = (ext & 1) ? true : false;
3610
+              /*speedup = (ext & 1) ? true : false;
3611 3611
               capture = (ext & 2) ? true : false;
3612 3612
 
3613 3613
               if(capture && !capturePrevious) {
3614 3614
                 captureNumber++;
3615 3615
                 //systemScreenCapture(captureNumber);
3616 3616
               }
3617
-              capturePrevious = capture;
3617
+              capturePrevious = capture;*/
3618 3618
 
3619 3619
               DISPSTAT |= 1;
3620 3620
               DISPSTAT &= 0xFFFD;
... ...
@@ -3624,10 +3624,10 @@ void CPULoop(int ticks)
3624 3624
                 UPDATE_REG(0x202, IF);
3625 3625
               }
3626 3626
               CPUCheckDMA(1, 0x0f);
3627
-              if(frameCount >= framesToSkip) {
3627
+              /*if(frameCount >= framesToSkip) {
3628 3628
                 //systemDrawScreen();
3629 3629
                 frameCount = 0;
3630
-              } else
3630
+              } else*/
3631 3631
                 frameCount++;
3632 3632
               /*if(systemPauseOnFrame())
3633 3633
                 ticks = 0;*/
... ...
@@ -3637,8 +3637,8 @@ void CPULoop(int ticks)
3637 3637
             CPUCompareVCOUNT();
3638 3638
 
3639 3639
           } else {
3640
-            if(frameCount >= framesToSkip)
3641
-            {
3640
+            /*if(frameCount >= framesToSkip)
3641
+            {*/
3642 3642
               /*(*renderLine)();
3643 3643
               switch(systemColorDepth) {
3644 3644
                 case 16:
... ...
@@ -3738,7 +3738,7 @@ void CPULoop(int ticks)
3738 3738
                 }
3739 3739
                 break;
3740 3740
               }*/
3741
-            }
3741
+            /*}*/
3742 3742
             // entering H-Blank
3743 3743
             DISPSTAT |= 2;
3744 3744
             UPDATE_REG(0x04, DISPSTAT);
... ...
@@ -3876,7 +3876,7 @@ void CPULoop(int ticks)
3876 3876
         if(profilSegment) {
3877 3877
 	  profile_segment *seg = profilSegment;
3878 3878
 	  do {
3879
-	    u16 *b = (u16 *)seg->sbuf;
3879
+	    uint16_t *b = (uint16_t *)seg->sbuf;
3880 3880
 	    int pc = ((reg[15].I - seg->s_lowpc) * seg->s_scale)/0x10000;
3881 3881
 	    if(pc >= 0 && pc < seg->ssiz) {
3882 3882
             b[pc]++;
... ...
@@ -4,7 +4,7 @@
4 4
 //#include "../System.h"
5 5
 #include "../common/Types.h"
6 6
 
7
-#define SAVE_GAME_VERSION_1 1
7
+/*#define SAVE_GAME_VERSION_1 1
8 8
 #define SAVE_GAME_VERSION_2 2
9 9
 #define SAVE_GAME_VERSION_3 3
10 10
 #define SAVE_GAME_VERSION_4 4
... ...
@@ -14,40 +14,40 @@
14 14
 #define SAVE_GAME_VERSION_8 8
15 15
 #define SAVE_GAME_VERSION_9 9
16 16
 #define SAVE_GAME_VERSION_10 10
17
-#define SAVE_GAME_VERSION  SAVE_GAME_VERSION_10
17
+#define SAVE_GAME_VERSION  SAVE_GAME_VERSION_10*/
18 18
 
19 19
 typedef struct {
20
-  u8 *address;
21
-  u32 mask;
20
+  uint8_t *address;
21
+  uint32_t mask;
22 22
 } memoryMap;
23 23
 
24 24
 typedef union {
25 25
   struct {
26 26
 #ifdef WORDS_BIGENDIAN
27
-    u8 B3;
28
-    u8 B2;
29
-    u8 B1;
30
-    u8 B0;
27
+    uint8_t B3;
28
+    uint8_t B2;
29
+    uint8_t B1;
30
+    uint8_t B0;
31 31
 #else
32
-    u8 B0;
33
-    u8 B1;
34
-    u8 B2;
35
-    u8 B3;
32
+    uint8_t B0;
33
+    uint8_t B1;
34
+    uint8_t B2;
35
+    uint8_t B3;
36 36
 #endif
37 37
   } B;
38 38
   struct {
39 39
 #ifdef WORDS_BIGENDIAN
40
-    u16 W1;
41
-    u16 W0;
40
+    uint16_t W1;
41
+    uint16_t W0;
42 42
 #else
43
-    u16 W0;
44
-    u16 W1;
43
+    uint16_t W0;
44
+    uint16_t W1;
45 45
 #endif
46 46
   } W;
47 47
 #ifdef WORDS_BIGENDIAN
48
-  volatile u32 I;
48
+  volatile uint32_t I;
49 49
 #else
50
-	u32 I;
50
+	uint32_t I;
51 51
 #endif
52 52
 } reg_pair;
53 53
 
... ...
@@ -56,7 +56,7 @@ extern memoryMap map[256];
56 56
 #endif
57 57
 
58 58
 extern reg_pair reg[45];
59
-extern u8 biosProtected[4];
59
+extern uint8_t biosProtected[4];
60 60
 
61 61
 extern bool N_FLAG;
62 62
 extern bool Z_FLAG;
... ...
@@ -68,11 +68,11 @@ extern int armMode;
68 68
 //extern void (*cpuSaveGameFunc)(u32,u8);
69 69
 
70 70
 #ifdef BKPT_SUPPORT
71
-extern u8 freezeWorkRAM[0x40000];
72
-extern u8 freezeInternalRAM[0x8000];
73
-extern u8 freezeVRAM[0x18000];
74
-extern u8 freezeOAM[0x400];
75
-extern u8 freezePRAM[0x400];
71
+extern uint8_t freezeWorkRAM[0x40000];
72
+extern uint8_t freezeInternalRAM[0x8000];
73
+extern uint8_t freezeVRAM[0x18000];
74
+extern uint8_t freezeOAM[0x400];
75
+extern uint8_t freezePRAM[0x400];
76 76
 extern bool debugger_last;
77 77
 extern int  oldreg[18];
78 78
 extern char oldbuffer[10];
... ...
@@ -96,7 +96,7 @@ extern bool CPUWriteMemState(char *, int);
96 96
 extern bool CPUWriteState(const char *);
97 97
 extern int CPULoadRom(const char *);
98 98
 extern void doMirroring(bool);
99
-extern void CPUUpdateRegister(u32, u16);
99
+extern void CPUUpdateRegister(uint32_t, uint16_t);
100 100
 extern void applyTimer ();
101 101
 extern void CPUInit(const char *,bool);
102 102
 extern void CPUReset();
... ...
@@ -20,7 +20,7 @@ extern int thumbExecute();
20 20
 
21 21
 #define UPDATE_REG(address, value)\
22 22
   {\
23
-    WRITE16LE(((u16 *)&ioMem[address]),value);\
23
+    WRITE16LE(((uint16_t *)&ioMem[address]),value);\
24 24
   }\
25 25
 
26 26
 #define ARM_PREFETCH \
... ...
@@ -43,20 +43,20 @@ extern int thumbExecute();
43 43
 
44 44
 
45 45
 extern int SWITicks;
46
-extern u32 mastercode;
46
+extern uint32_t mastercode;
47 47
 extern bool busPrefetch;
48 48
 extern bool busPrefetchEnable;
49
-extern u32 busPrefetchCount;
49
+extern uint32_t busPrefetchCount;
50 50
 extern int cpuNextEvent;
51 51
 extern bool holdState;
52
-extern u32 cpuPrefetch[2];
52
+extern uint32_t cpuPrefetch[2];
53 53
 extern int cpuTotalTicks;
54
-extern u8 memoryWait[16];
55
-extern u8 memoryWait32[16];
56
-extern u8 memoryWaitSeq[16];
57
-extern u8 memoryWaitSeq32[16];
58
-extern u8 cpuBitsSet[256];
59
-extern u8 cpuLowestBitSet[256];
54
+extern uint8_t memoryWait[16];
55
+extern uint8_t memoryWait32[16];
56
+extern uint8_t memoryWaitSeq[16];
57
+extern uint8_t memoryWaitSeq32[16];
58
+extern uint8_t cpuBitsSet[256];
59
+extern uint8_t cpuLowestBitSet[256];
60 60
 extern void CPUSwitchMode(int mode, bool saveState, bool breakLoop);
61 61
 extern void CPUSwitchMode(int mode, bool saveState);
62 62
 extern void CPUUpdateCPSR();
... ...
@@ -68,7 +68,7 @@ extern void CPUSoftwareInterrupt(int comment);
68 68
 
69 69
 
70 70
 // Waitstates when accessing data
71
-inline int dataTicksAccess16(u32 address) // DATA 8/16bits NON SEQ
71
+inline int dataTicksAccess16(uint32_t address) // DATA 8/16bits NON SEQ
72 72
 {
73 73
   int addr = (address>>24)&15;
74 74
   int value =  memoryWait[addr];
... ...
@@ -89,7 +89,7 @@ inline int dataTicksAccess16(u32 address) // DATA 8/16bits NON SEQ
89 89
   return value;
90 90
 }
91 91
 
92
-inline int dataTicksAccess32(u32 address) // DATA 32bits NON SEQ
92
+inline int dataTicksAccess32(uint32_t address) // DATA 32bits NON SEQ
93 93
 {
94 94
   int addr = (address>>24)&15;
95 95
   int value = memoryWait32[addr];
... ...
@@ -110,7 +110,7 @@ inline int dataTicksAccess32(u32 address) // DATA 32bits NON SEQ
110 110
   return value;
111 111
 }
112 112
 
113
-inline int dataTicksAccessSeq16(u32 address)// DATA 8/16bits SEQ
113
+inline int dataTicksAccessSeq16(uint32_t address)// DATA 8/16bits SEQ
114 114
 {
115 115
   int addr = (address>>24)&15;
116 116
   int value = memoryWaitSeq[addr];
... ...
@@ -131,7 +131,7 @@ inline int dataTicksAccessSeq16(u32 address)// DATA 8/16bits SEQ
131 131
   return value;
132 132
 }
133 133
 
134
-inline int dataTicksAccessSeq32(u32 address)// DATA 32bits SEQ
134
+inline int dataTicksAccessSeq32(uint32_t address)// DATA 32bits SEQ
135 135
 {
136 136
   int addr = (address>>24)&15;
137 137
   int value =  memoryWaitSeq32[addr];
... ...
@@ -154,7 +154,7 @@ inline int dataTicksAccessSeq32(u32 address)// DATA 32bits SEQ
154 154
 
155 155
 
156 156
 // Waitstates when executing opcode
157
-inline int codeTicksAccess16(u32 address) // THUMB NON SEQ
157
+inline int codeTicksAccess16(uint32_t address) // THUMB NON SEQ
158 158
 {
159 159
   int addr = (address>>24)&15;
160 160
 
... ...
@@ -183,7 +183,7 @@ inline int codeTicksAccess16(u32 address) // THUMB NON SEQ
183 183
   }
184 184
 }
185 185
 
186
-inline int codeTicksAccess32(u32 address) // ARM NON SEQ
186
+inline int codeTicksAccess32(uint32_t address) // ARM NON SEQ
187 187
 {
188 188
   int addr = (address>>24)&15;
189 189
 
... ...
@@ -212,7 +212,7 @@ inline int codeTicksAccess32(u32 address) // ARM NON SEQ
212 212
   }
213 213
 }
214 214
 
215
-inline int codeTicksAccessSeq16(u32 address) // THUMB SEQ
215
+inline int codeTicksAccessSeq16(uint32_t address) // THUMB SEQ
216 216
 {
217 217
   int addr = (address>>24)&15;
218 218
 
... ...
@@ -239,7 +239,7 @@ inline int codeTicksAccessSeq16(u32 address) // THUMB SEQ
239 239
   }
240 240
 }
241 241
 
242
-inline int codeTicksAccessSeq32(u32 address) // ARM SEQ
242
+inline int codeTicksAccessSeq32(uint32_t address) // ARM SEQ
243 243
 {
244 244
   int addr = (address>>24)&15;
245 245
 
... ...
@@ -9,7 +9,7 @@
9 9
 #include "GBAcpu.h"
10 10
 //#include "GBALink.h"
11 11
 
12
-extern const u32 objTilesAddress[3];
12
+extern const uint32_t objTilesAddress[3];
13 13
 
14 14
 extern bool stopState;
15 15
 extern bool holdState;
... ...
@@ -19,7 +19,7 @@ extern bool cpuSramEnabled;
19 19
 extern bool cpuFlashEnabled;
20 20
 extern bool cpuEEPROMEnabled;
21 21
 extern bool cpuEEPROMSensorEnabled;
22
-extern u32 cpuDmaLast;
22
+extern uint32_t cpuDmaLast;
23 23
 extern bool timer0On;
24 24
 extern int timer0Ticks;
25 25
 extern int timer0ClockReload;
... ...
@@ -38,15 +38,15 @@ extern int cpuTotalTicks;
38 38
   map[(addr)>>24].address[(addr) & map[(addr)>>24].mask]
39 39
 
40 40
 #define CPUReadHalfWordQuick(addr) \
41
-  READ16LE(((u16*)&map[(addr)>>24].address[(addr) & map[(addr)>>24].mask]))
41
+  READ16LE(((uint16_t*)&map[(addr)>>24].address[(addr) & map[(addr)>>24].mask]))
42 42
 
43 43
 #define CPUReadMemoryQuick(addr) \
44
-  READ32LE(((u32*)&map[(addr)>>24].address[(addr) & map[(addr)>>24].mask]))
44
+  READ32LE(((uint32_t*)&map[(addr)>>24].address[(addr) & map[(addr)>>24].mask]))
45 45
 
46
-static inline u32 CPUReadMemory(u32 address)
46
+static inline uint32_t CPUReadMemory(uint32_t address)
47 47
 {
48
-  u32 value;
49
-  u32 oldAddress = address;
48
+  uint32_t value;
49
+  uint32_t oldAddress = address;
50 50
 
51 51
   if(address & 3) {
52 52
            address &= ~0x03;
... ...
@@ -63,33 +63,33 @@ static inline u32 CPUReadMemory(u32 address)
63 63
         }
64 64
 #endif
65 65
 
66
-        value = READ32LE(((u32 *)&biosProtected));
66
+        value = READ32LE(((uint32_t *)&biosProtected));
67 67
       }
68 68
       else goto unreadable;
69 69
     } else
70
-      value = READ32LE(((u32 *)&bios[address & 0x3FFC]));
70
+      value = READ32LE(((uint32_t *)&bios[address & 0x3FFC]));
71 71
     break;
72 72
   case 2:
73
-    value = READ32LE(((u32 *)&workRAM[address & 0x3FFFC]));
73
+    value = READ32LE(((uint32_t *)&workRAM[address & 0x3FFFC]));
74 74
     break;
75 75
   case 3:
76
-    value = READ32LE(((u32 *)&internalRAM[address & 0x7ffC]));
76
+    value = READ32LE(((uint32_t *)&internalRAM[address & 0x7ffC]));
77 77
     break;
78 78
   case 4:
79 79
 	  if((address < 0x4000400) && ioReadable[address & 0x3fc]) {
80 80
 		  if(ioReadable[(address & 0x3fc) + 2]) {
81
-			  value = READ32LE(((u32 *)&ioMem[address & 0x3fC]));
81
+			  value = READ32LE(((uint32_t *)&ioMem[address & 0x3fC]));
82 82
 			  /*if ((address & 0x3fc) == COMM_JOY_RECV_L)
83 83
 				  UPDATE_REG(COMM_JOYSTAT, READ16LE(&ioMem[COMM_JOYSTAT]) & ~JOYSTAT_RECV);*/
84 84
 		  } else {
85
-			  value = READ16LE(((u16 *)&ioMem[address & 0x3fc]));
85
+			  value = READ16LE(((uint16_t *)&ioMem[address & 0x3fc]));
86 86
 		  }
87 87
 	  }
88 88
 	  else
89 89
 		  goto unreadable;
90 90
 	  break;
91 91
   case 5:
92
-    value = READ32LE(((u32 *)&paletteRAM[address & 0x3fC]));
92
+    value = READ32LE(((uint32_t *)&paletteRAM[address & 0x3fC]));
93 93
     break;
94 94
   case 6:
95 95
     address = (address & 0x1fffc);
... ...
@@ -100,17 +100,17 @@ static inline u32 CPUReadMemory(u32 address)
100 100
     }
101 101
     if ((address & 0x18000) == 0x18000)
102 102
       address &= 0x17fff;
103
-    value = READ32LE(((u32 *)&vram[address]));
103
+    value = READ32LE(((uint32_t *)&vram[address]));
104 104
     break;
105 105
   case 7:
106
-    value = READ32LE(((u32 *)&oam[address & 0x3FC]));
106
+    value = READ32LE(((uint32_t *)&oam[address & 0x3FC]));
107 107
     break;
108 108
   case 8:
109 109
   case 9:
110 110
   case 10:
111 111
   case 11:
112 112
   case 12:
113
-    value = READ32LE(((u32 *)&rom[address&0x1FFFFFC]));
113
+    value = READ32LE(((uint32_t *)&rom[address&0x1FFFFFC]));
114 114
     break;
115 115
   case 13:
116 116
     if(cpuEEPROMEnabled)
... ...
@@ -172,12 +172,12 @@ unreadable:
172 172
   return value;
173 173
 }
174 174
 
175
-extern u32 myROM[];
175
+extern uint32_t myROM[];
176 176
 
177
-static inline u32 CPUReadHalfWord(u32 address)
177
+static inline uint32_t CPUReadHalfWord(uint32_t address)
178 178
 {
179
-  u32 value;
180
-  u32 oldAddress = address;
179
+  uint32_t value;
180
+  uint32_t oldAddress = address;
181 181
 
182 182
   if(address & 1) {
183 183
           address &= ~0x01;
... ...
@@ -193,21 +193,21 @@ static inline u32 CPUReadHalfWord(u32 address)
193 193
             armNextPC - 4 : armNextPC - 2);
194 194
         }
195 195
 #endif
196
-        value = READ16LE(((u16 *)&biosProtected[address&2]));
196
+        value = READ16LE(((uint16_t *)&biosProtected[address&2]));
197 197
       } else goto unreadable;
198 198
     } else
199
-      value = READ16LE(((u16 *)&bios[address & 0x3FFE]));
199
+      value = READ16LE(((uint16_t *)&bios[address & 0x3FFE]));
200 200
     break;
201 201
   case 2:
202
-    value = READ16LE(((u16 *)&workRAM[address & 0x3FFFE]));
202
+    value = READ16LE(((uint16_t *)&workRAM[address & 0x3FFFE]));
203 203
     break;
204 204
   case 3:
205
-    value = READ16LE(((u16 *)&internalRAM[address & 0x7ffe]));
205
+    value = READ16LE(((uint16_t *)&internalRAM[address & 0x7ffe]));
206 206
     break;
207 207
   case 4:
208 208
     if((address < 0x4000400) && ioReadable[address & 0x3fe])
209 209
     {
210
-      value =  READ16LE(((u16 *)&ioMem[address & 0x3fe]));
210
+      value =  READ16LE(((uint16_t *)&ioMem[address & 0x3fe]));
211 211
       if (((address & 0x3fe)>0xFF) && ((address & 0x3fe)<0x10E))
212 212
       {
213 213
         if (((address & 0x3fe) == 0x100) && timer0On)
... ...
@@ -226,7 +226,7 @@ static inline u32 CPUReadHalfWord(u32 address)
226 226
     else goto unreadable;
227 227
     break;
228 228
   case 5:
229
-    value = READ16LE(((u16 *)&paletteRAM[address & 0x3fe]));
229
+    value = READ16LE(((uint16_t *)&paletteRAM[address & 0x3fe]));
230 230
     break;
231 231
   case 6:
232 232
     address = (address & 0x1fffe);
... ...
@@ -237,10 +237,10 @@ static inline u32 CPUReadHalfWord(u32 address)
237 237
     }
238 238
     if ((address & 0x18000) == 0x18000)
239 239
       address &= 0x17fff;
240
-    value = READ16LE(((u16 *)&vram[address]));
240
+    value = READ16LE(((uint16_t *)&vram[address]));
241 241
     break;
242 242
   case 7:
243
-    value = READ16LE(((u16 *)&oam[address & 0x3fe]));
243
+    value = READ16LE(((uint16_t *)&oam[address & 0x3fe]));
244 244
     break;
245 245
   case 8:
246 246
   case 9:
... ...
@@ -250,7 +250,7 @@ static inline u32 CPUReadHalfWord(u32 address)
250 250
     if(address == 0x80000c4 || address == 0x80000c6 || address == 0x80000c8)
251 251
       value = /*rtcRead(address)*/0;
252 252
     else
253
-      value = READ16LE(((u16 *)&rom[address & 0x1FFFFFE]));
253
+      value = READ16LE(((uint16_t *)&rom[address & 0x1FFFFFE]));
254 254
     break;
255 255
   case 13:
256 256
     if(cpuEEPROMEnabled)
... ...
@@ -291,16 +291,16 @@ unreadable:
291 291
   return value;
292 292
 }
293 293
 
294
-static inline s16 CPUReadHalfWordSigned(u32 address)
294
+static inline int16_t CPUReadHalfWordSigned(uint32_t address)
295 295
 {
296
-  u32 oldAddress = address;
296
+  uint32_t oldAddress = address;
297 297
   if(address & 1) {
298 298
     address &= ~0x01;
299 299
   }
300
-  s16 value = (s16)CPUReadHalfWord(address);
300
+  int16_t value = (int16_t)CPUReadHalfWord(address);
301 301
   if((oldAddress & 1))
302 302
   {
303
-    value = (s8)value;
303
+    value = (int8_t)value;
304 304
 #ifdef GBA_LOGGING
305 305
         if(systemVerbose & VERBOSE_UNALIGNED_MEMORY) {
306 306
                 log("Unaligned signed halfword read from: %08x at %08x (%08x)\n", oldAddress, armMode ?
... ...
@@ -311,7 +311,7 @@ static inline s16 CPUReadHalfWordSigned(u32 address)
311 311
   return value;
312 312
 }
313 313
 
314
-static inline u8 CPUReadByte(u32 address)
314
+static inline uint8_t CPUReadByte(uint32_t address)
315 315
 {
316 316
   switch(address >> 24) {
317 317
   case 0:
... ...
@@ -389,7 +389,7 @@ unreadable:
389 389
     }
390 390
 }
391 391
 
392
-static inline void CPUWriteMemory(u32 address, u32 value)
392
+static inline void CPUWriteMemory(uint32_t address, uint32_t value)
393 393
 {
394 394
 
395 395
 #ifdef GBA_LOGGING
... ...
@@ -408,21 +408,21 @@ static inline void CPUWriteMemory(u32 address, u32 value)
408 408
   switch(address >> 24) {
409 409
   case 0x02:
410 410
 #ifdef BKPT_SUPPORT
411
-    if(*((u32 *)&freezeWorkRAM[address & 0x3FFFC]))
411
+    if(*((uint32_t *)&freezeWorkRAM[address & 0x3FFFC]))
412 412
       cheatsWriteMemory(address & 0x203FFFC,
413 413
       value);
414 414
     else
415 415
 #endif
416
-      WRITE32LE(((u32 *)&workRAM[address & 0x3FFFC]), value);
416
+      WRITE32LE(((uint32_t *)&workRAM[address & 0x3FFFC]), value);
417 417
     break;
418 418
   case 0x03:
419 419
 #ifdef BKPT_SUPPORT
420
-    if(*((u32 *)&freezeInternalRAM[address & 0x7ffc]))
420
+    if(*((uint32_t *)&freezeInternalRAM[address & 0x7ffc]))
421 421
       cheatsWriteMemory(address & 0x3007FFC,
422 422
       value);
423 423
     else
424 424
 #endif
425
-      WRITE32LE(((u32 *)&internalRAM[address & 0x7ffC]), value);
425
+      WRITE32LE(((uint32_t *)&internalRAM[address & 0x7ffC]), value);
426 426
     break;
427 427
   case 0x04:
428 428
     if(address < 0x4000400) {
... ...
@@ -432,12 +432,12 @@ static inline void CPUWriteMemory(u32 address, u32 value)
432 432
     break;
433 433
   case 0x05:
434 434
 #ifdef BKPT_SUPPORT
435
-    if(*((u32 *)&freezePRAM[address & 0x3fc]))
435
+    if(*((uint32_t *)&freezePRAM[address & 0x3fc]))
436 436
       cheatsWriteMemory(address & 0x70003FC,
437 437
       value);
438 438
     else
439 439
 #endif
440
-      WRITE32LE(((u32 *)&paletteRAM[address & 0x3FC]), value);
440
+      WRITE32LE(((uint32_t *)&paletteRAM[address & 0x3FC]), value);
441 441
     break;
442 442
   case 0x06:
443 443
     address = (address & 0x1fffc);
... ...
@@ -447,21 +447,21 @@ static inline void CPUWriteMemory(u32 address, u32 value)
447 447
       address &= 0x17fff;
448 448
 
449 449
 #ifdef BKPT_SUPPORT
450
-    if(*((u32 *)&freezeVRAM[address]))
450
+    if(*((uint32_t *)&freezeVRAM[address]))
451 451
       cheatsWriteMemory(address + 0x06000000, value);
452 452
     else
453 453
 #endif
454 454
 
455
-      WRITE32LE(((u32 *)&vram[address]), value);
455
+      WRITE32LE(((uint32_t *)&vram[address]), value);
456 456
     break;
457 457
   case 0x07:
458 458
 #ifdef BKPT_SUPPORT
459
-    if(*((u32 *)&freezeOAM[address & 0x3fc]))
459
+    if(*((uint32_t *)&freezeOAM[address & 0x3fc]))
460 460
       cheatsWriteMemory(address & 0x70003FC,
461 461
       value);
462 462
     else
463 463
 #endif
464
-      WRITE32LE(((u32 *)&oam[address & 0x3fc]), value);
464
+      WRITE32LE(((uint32_t *)&oam[address & 0x3fc]), value);
465 465
     break;
466 466
   case 0x0D:
467 467
     if(cpuEEPROMEnabled) {
... ...
@@ -469,11 +469,11 @@ static inline void CPUWriteMemory(u32 address, u32 value)
469 469
       break;
470 470
     }
471 471
     goto unwritable;
472
-  case 0x0E:
473
-    if(/*(!eepromInUse) | */cpuSramEnabled | cpuFlashEnabled) {
472
+  /*case 0x0E:
473
+    if(*//*(!eepromInUse) | *//*cpuSramEnabled | cpuFlashEnabled) {
474 474
       //(*cpuSaveGameFunc)(address, (u8)value);
475 475
       break;
476
-    }
476
+    }*/
477 477
     // default
478 478
   default:
479 479
 unwritable:
... ...
@@ -489,7 +489,7 @@ unwritable:
489 489
   }
490 490
 }
491 491
 
492
-static inline void CPUWriteHalfWord(u32 address, u16 value)
492
+static inline void CPUWriteHalfWord(uint32_t address, uint16_t value)
493 493
 {
494 494
 #ifdef GBA_LOGGING
495 495
   if(address & 1) {
... ...
@@ -507,21 +507,21 @@ static inline void CPUWriteHalfWord(u32 address, u16 value)
507 507
   switch(address >> 24) {
508 508
   case 2:
509 509
 #ifdef BKPT_SUPPORT
510
-    if(*((u16 *)&freezeWorkRAM[address & 0x3FFFE]))
510
+    if(*((uint16_t *)&freezeWorkRAM[address & 0x3FFFE]))
511 511
       cheatsWriteHalfWord(address & 0x203FFFE,
512 512
       value);
513 513
     else
514 514
 #endif
515
-      WRITE16LE(((u16 *)&workRAM[address & 0x3FFFE]),value);
515
+      WRITE16LE(((uint16_t *)&workRAM[address & 0x3FFFE]),value);
516 516
     break;
517 517
   case 3:
518 518
 #ifdef BKPT_SUPPORT
519
-    if(*((u16 *)&freezeInternalRAM[address & 0x7ffe]))
519
+    if(*((uint16_t *)&freezeInternalRAM[address & 0x7ffe]))
520 520
       cheatsWriteHalfWord(address & 0x3007ffe,
521 521
       value);
522 522
     else
523 523
 #endif
524
-      WRITE16LE(((u16 *)&internalRAM[address & 0x7ffe]), value);
524
+      WRITE16LE(((uint16_t *)&internalRAM[address & 0x7ffe]), value);
525 525
     break;
526 526
   case 4:
527 527
     if(address < 0x4000400)
... ...
@@ -530,12 +530,12 @@ static inline void CPUWriteHalfWord(u32 address, u16 value)
530 530
     break;
531 531
   case 5:
532 532
 #ifdef BKPT_SUPPORT
533
-    if(*((u16 *)&freezePRAM[address & 0x03fe]))
533
+    if(*((uint16_t *)&freezePRAM[address & 0x03fe]))
534 534
       cheatsWriteHalfWord(address & 0x70003fe,
535 535
       value);
536 536
     else
537 537
 #endif
538
-      WRITE16LE(((u16 *)&paletteRAM[address & 0x3fe]), value);
538
+      WRITE16LE(((uint16_t *)&paletteRAM[address & 0x3fe]), value);
539 539
     break;
540 540
   case 6:
541 541
     address = (address & 0x1fffe);
... ...
@@ -544,21 +544,21 @@ static inline void CPUWriteHalfWord(u32 address, u16 value)
544 544
     if ((address & 0x18000) == 0x18000)
545 545
       address &= 0x17fff;
546 546
 #ifdef BKPT_SUPPORT
547
-    if(*((u16 *)&freezeVRAM[address]))
547
+    if(*((uint16_t *)&freezeVRAM[address]))
548 548
       cheatsWriteHalfWord(address + 0x06000000,
549 549
       value);
550 550
     else
551 551
 #endif
552
-      WRITE16LE(((u16 *)&vram[address]), value);
552
+      WRITE16LE(((uint16_t *)&vram[address]), value);
553 553
     break;
554 554
   case 7:
555 555
 #ifdef BKPT_SUPPORT
556
-    if(*((u16 *)&freezeOAM[address & 0x03fe]))
556
+    if(*((uint16_t *)&freezeOAM[address & 0x03fe]))
557 557
       cheatsWriteHalfWord(address & 0x70003fe,
558 558
       value);
559 559
     else
560 560
 #endif
561
-      WRITE16LE(((u16 *)&oam[address & 0x3fe]), value);
561
+      WRITE16LE(((uint16_t *)&oam[address & 0x3fe]), value);
562 562
     break;
563 563
   case 8:
564 564
   case 9:
... ...
@@ -573,12 +573,12 @@ static inline void CPUWriteHalfWord(u32 address, u16 value)
573 573
       break;
574 574
     }
575 575
     goto unwritable;
576
-  case 14:
577
-    if(/*(!eepromInUse) | */cpuSramEnabled | cpuFlashEnabled) {
576
+  /*case 14:
577
+    if(*//*(!eepromInUse) | *//*cpuSramEnabled | cpuFlashEnabled) {
578 578
       //(*cpuSaveGameFunc)(address, (u8)value);
579 579
       break;
580 580
     }
581
-    goto unwritable;
581
+    goto unwritable;*/
582 582
   default:
583 583
 unwritable:
584 584
 #ifdef GBA_LOGGING
... ...
@@ -593,7 +593,7 @@ unwritable:
593 593
   }
594 594
 }
595 595
 
596
-static inline void CPUWriteByte(u32 address, u8 b)
596
+static inline void CPUWriteByte(uint32_t address, uint8_t b)
597 597
 {
598 598
   switch(address >> 24) {
599 599
   case 2:
... ...
@@ -665,7 +665,7 @@ static inline void CPUWriteByte(u32 address, u8 b)
665 665
         cpuNextEvent = cpuTotalTicks;
666 666
         break;
667 667
       default: // every other register
668
-        u32 lowerBits = address & 0x3fe;
668
+        uint32_t lowerBits = address & 0x3fe;
669 669
         if(address & 1) {
670 670
           CPUUpdateRegister(lowerBits, (READ16LE(&ioMem[lowerBits]) & 0x00FF) | (b << 8));
671 671
         } else {
... ...
@@ -677,7 +677,7 @@ static inline void CPUWriteByte(u32 address, u8 b)
677 677
     break;
678 678
   case 5:
679 679
     // no need to switch
680
-    *((u16 *)&paletteRAM[address & 0x3FE]) = (b << 8) | b;
680
+    *((uint16_t *)&paletteRAM[address & 0x3FE]) = (b << 8) | b;
681 681
     break;
682 682
   case 6:
683 683
     address = (address & 0x1fffe);
... ...
@@ -695,13 +695,13 @@ static inline void CPUWriteByte(u32 address, u8 b)
695 695
         cheatsWriteByte(address + 0x06000000, b);
696 696
       else
697 697
 #endif
698
-        *((u16 *)&vram[address]) = (b << 8) | b;
698
+        *((uint16_t *)&vram[address]) = (b << 8) | b;
699 699
     }
700 700
     break;
701 701
   case 7:
702 702
     // no need to switch
703 703
     // byte writes to OAM are ignored
704
-    //    *((u16 *)&oam[address & 0x3FE]) = (b << 8) | b;
704
+    //    *((uint16_t *)&oam[address & 0x3FE]) = (b << 8) | b;
705 705
     break;
706 706
   case 13:
707 707
     if(cpuEEPROMEnabled) {
... ...
@@ -709,14 +709,14 @@ static inline void CPUWriteByte(u32 address, u8 b)
709 709
       break;
710 710
     }
711 711
     goto unwritable;
712
-  case 14:
713
-    if ((saveType != 5) && (/*(!eepromInUse) | */cpuSramEnabled | cpuFlashEnabled)) {
712
+  /*case 14:
713
+    if ((saveType != 5) && (*//*(!eepromInUse) | *//*cpuSramEnabled | cpuFlashEnabled)) {
714 714
 
715 715
       //if(!cpuEEPROMEnabled && (cpuSramEnabled | cpuFlashEnabled)) {
716 716
 
717 717
       //(*cpuSaveGameFunc)(address, b);
718 718
       break;
719
-    }
719
+    }*/
720 720
     // default
721 721
   default:
722 722
 unwritable:
... ...
@@ -14,9 +14,9 @@ bool Z_FLAG = 0;
14 14
 bool V_FLAG = 0;
15 15
 bool armState = true;
16 16
 bool armIrqEnable = true;
17
-u32 armNextPC = 0x00000000;
17
+uint32_t armNextPC = 0x00000000;
18 18
 int armMode = 0x1f;
19
-u32 stop = 0x08000568;
19
+uint32_t stop = 0x08000568;
20 20
 int saveType = 0;
21 21
 bool useBios = false;
22 22
 bool skipBios = false;
... ...
@@ -40,90 +40,90 @@ bool skipSaveGameCheats = false;
40 40
 // 0x0000 to 0x7FFF: set custom 15 bit color
41 41
 int customBackdropColor = -1;
42 42
 
43
-u8 *bios = 0;
44
-u8 *rom = 0;
45
-u8 *internalRAM = 0;
46
-u8 *workRAM = 0;
47
-u8 *paletteRAM = 0;
48
-u8 *vram = 0;
49
-u8 *pix = 0;
50
-u8 *oam = 0;
51
-u8 *ioMem = 0;
43
+uint8_t *bios = 0;
44
+uint8_t *rom = 0;
45
+uint8_t *internalRAM = 0;
46
+uint8_t *workRAM = 0;
47
+uint8_t *paletteRAM = 0;
48
+uint8_t *vram = 0;
49
+uint8_t *pix = 0;
50
+uint8_t *oam = 0;
51
+uint8_t *ioMem = 0;
52 52
 
53
-u16 DISPCNT  = 0x0080;
54
-u16 DISPSTAT = 0x0000;
55
-u16 VCOUNT   = 0x0000;
56
-u16 BG0CNT   = 0x0000;
57
-u16 BG1CNT   = 0x0000;
58
-u16 BG2CNT   = 0x0000;
59
-u16 BG3CNT   = 0x0000;
60
-u16 BG0HOFS  = 0x0000;
61
-u16 BG0VOFS  = 0x0000;
62
-u16 BG1HOFS  = 0x0000;
63
-u16 BG1VOFS  = 0x0000;
64
-u16 BG2HOFS  = 0x0000;
65
-u16 BG2VOFS  = 0x0000;
66
-u16 BG3HOFS  = 0x0000;
67
-u16 BG3VOFS  = 0x0000;
68
-u16 BG2PA    = 0x0100;
69
-u16 BG2PB    = 0x0000;
70
-u16 BG2PC    = 0x0000;
71
-u16 BG2PD    = 0x0100;
72
-u16 BG2X_L   = 0x0000;
73
-u16 BG2X_H   = 0x0000;
74
-u16 BG2Y_L   = 0x0000;
75
-u16 BG2Y_H   = 0x0000;
76
-u16 BG3PA    = 0x0100;
77
-u16 BG3PB    = 0x0000;
78
-u16 BG3PC    = 0x0000;
79
-u16 BG3PD    = 0x0100;
80
-u16 BG3X_L   = 0x0000;
81
-u16 BG3X_H   = 0x0000;
82
-u16 BG3Y_L   = 0x0000;
83
-u16 BG3Y_H   = 0x0000;
84
-u16 WIN0H    = 0x0000;
85
-u16 WIN1H    = 0x0000;
86
-u16 WIN0V    = 0x0000;
87
-u16 WIN1V    = 0x0000;
88
-u16 WININ    = 0x0000;
89
-u16 WINOUT   = 0x0000;
90
-u16 MOSAIC   = 0x0000;
91
-u16 BLDMOD   = 0x0000;
92
-u16 COLEV    = 0x0000;
93
-u16 COLY     = 0x0000;
94
-u16 DM0SAD_L = 0x0000;
95
-u16 DM0SAD_H = 0x0000;
96
-u16 DM0DAD_L = 0x0000;
97
-u16 DM0DAD_H = 0x0000;
98
-u16 DM0CNT_L = 0x0000;
99
-u16 DM0CNT_H = 0x0000;
100
-u16 DM1SAD_L = 0x0000;
101
-u16 DM1SAD_H = 0x0000;
102
-u16 DM1DAD_L = 0x0000;
103
-u16 DM1DAD_H = 0x0000;
104
-u16 DM1CNT_L = 0x0000;
105
-u16 DM1CNT_H = 0x0000;
106
-u16 DM2SAD_L = 0x0000;
107
-u16 DM2SAD_H = 0x0000;
108
-u16 DM2DAD_L = 0x0000;
109
-u16 DM2DAD_H = 0x0000;
110
-u16 DM2CNT_L = 0x0000;
111
-u16 DM2CNT_H = 0x0000;
112
-u16 DM3SAD_L = 0x0000;
113
-u16 DM3SAD_H = 0x0000;
114
-u16 DM3DAD_L = 0x0000;
115
-u16 DM3DAD_H = 0x0000;
116
-u16 DM3CNT_L = 0x0000;
117
-u16 DM3CNT_H = 0x0000;
118
-u16 TM0D     = 0x0000;
119
-u16 TM0CNT   = 0x0000;
120
-u16 TM1D     = 0x0000;
121
-u16 TM1CNT   = 0x0000;
122
-u16 TM2D     = 0x0000;
123
-u16 TM2CNT   = 0x0000;
124
-u16 TM3D     = 0x0000;
125
-u16 TM3CNT   = 0x0000;
126
-u16 P1       = 0xFFFF;
127
-u16 IE       = 0x0000;
128
-u16 IF       = 0x0000;
129
-u16 IME      = 0x0000;
53
+uint16_t DISPCNT  = 0x0080;
54
+uint16_t DISPSTAT = 0x0000;
55
+uint16_t VCOUNT   = 0x0000;
56
+uint16_t BG0CNT   = 0x0000;
57
+uint16_t BG1CNT   = 0x0000;
58
+uint16_t BG2CNT   = 0x0000;
59
+uint16_t BG3CNT   = 0x0000;
60
+uint16_t BG0HOFS  = 0x0000;
61
+uint16_t BG0VOFS  = 0x0000;
62
+uint16_t BG1HOFS  = 0x0000;
63
+uint16_t BG1VOFS  = 0x0000;
64
+uint16_t BG2HOFS  = 0x0000;
65
+uint16_t BG2VOFS  = 0x0000;
66
+uint16_t BG3HOFS  = 0x0000;
67
+uint16_t BG3VOFS  = 0x0000;
68
+uint16_t BG2PA    = 0x0100;
69
+uint16_t BG2PB    = 0x0000;
70
+uint16_t BG2PC    = 0x0000;
71
+uint16_t BG2PD    = 0x0100;
72
+uint16_t BG2X_L   = 0x0000;
73
+uint16_t BG2X_H   = 0x0000;
74
+uint16_t BG2Y_L   = 0x0000;
75
+uint16_t BG2Y_H   = 0x0000;
76
+uint16_t BG3PA    = 0x0100;
77
+uint16_t BG3PB    = 0x0000;
78
+uint16_t BG3PC    = 0x0000;
79
+uint16_t BG3PD    = 0x0100;
80
+uint16_t BG3X_L   = 0x0000;
81
+uint16_t BG3X_H   = 0x0000;
82
+uint16_t BG3Y_L   = 0x0000;
83
+uint16_t BG3Y_H   = 0x0000;
84
+uint16_t WIN0H    = 0x0000;
85
+uint16_t WIN1H    = 0x0000;
86
+uint16_t WIN0V    = 0x0000;
87
+uint16_t WIN1V    = 0x0000;
88
+uint16_t WININ    = 0x0000;
89
+uint16_t WINOUT   = 0x0000;
90
+uint16_t MOSAIC   = 0x0000;
91
+uint16_t BLDMOD   = 0x0000;
92
+uint16_t COLEV    = 0x0000;
93
+uint16_t COLY     = 0x0000;
94
+uint16_t DM0SAD_L = 0x0000;
95
+uint16_t DM0SAD_H = 0x0000;
96
+uint16_t DM0DAD_L = 0x0000;
97
+uint16_t DM0DAD_H = 0x0000;
98
+uint16_t DM0CNT_L = 0x0000;
99
+uint16_t DM0CNT_H = 0x0000;
100
+uint16_t DM1SAD_L = 0x0000;
101
+uint16_t DM1SAD_H = 0x0000;
102
+uint16_t DM1DAD_L = 0x0000;
103
+uint16_t DM1DAD_H = 0x0000;
104
+uint16_t DM1CNT_L = 0x0000;
105
+uint16_t DM1CNT_H = 0x0000;
106
+uint16_t DM2SAD_L = 0x0000;
107
+uint16_t DM2SAD_H = 0x0000;
108
+uint16_t DM2DAD_L = 0x0000;
109
+uint16_t DM2DAD_H = 0x0000;
110
+uint16_t DM2CNT_L = 0x0000;
111
+uint16_t DM2CNT_H = 0x0000;
112
+uint16_t DM3SAD_L = 0x0000;
113
+uint16_t DM3SAD_H = 0x0000;
114
+uint16_t DM3DAD_L = 0x0000;
115
+uint16_t DM3DAD_H = 0x0000;
116
+uint16_t DM3CNT_L = 0x0000;
117
+uint16_t DM3CNT_H = 0x0000;
118
+uint16_t TM0D     = 0x0000;
119
+uint16_t TM0CNT   = 0x0000;
120
+uint16_t TM1D     = 0x0000;
121
+uint16_t TM1CNT   = 0x0000;
122
+uint16_t TM2D     = 0x0000;
123
+uint16_t TM2CNT   = 0x0000;
124
+uint16_t TM3D     = 0x0000;
125
+uint16_t TM3CNT   = 0x0000;
126
+uint16_t P1       = 0xFFFF;
127
+uint16_t IE       = 0x0000;
128
+uint16_t IF       = 0x0000;
129
+uint16_t IME      = 0x0000;
... ...
@@ -24,9 +24,9 @@ extern bool Z_FLAG;
24 24
 extern bool V_FLAG;
25 25
 extern bool armState;
26 26
 extern bool armIrqEnable;
27
-extern u32 armNextPC;
27
+extern uint32_t armNextPC;
28 28
 extern int armMode;
29
-extern u32 stop;
29
+extern uint32_t stop;
30 30
 extern int saveType;
31 31
 extern bool useBios;
32 32
 extern bool skipBios;
... ...
@@ -46,92 +46,92 @@ extern bool skipSaveGameBattery; // skip battery data when reading save states
46 46
 extern bool skipSaveGameCheats;  // skip cheat list data when reading save states
47 47
 extern int customBackdropColor;
48 48
 
49
-extern u8 *bios;
50
-extern u8 *rom;
51
-extern u8 *internalRAM;
52
-extern u8 *workRAM;
53
-extern u8 *paletteRAM;
54
-extern u8 *vram;
55
-extern u8 *pix;
56
-extern u8 *oam;
57
-extern u8 *ioMem;
49
+extern uint8_t *bios;
50
+extern uint8_t *rom;
51
+extern uint8_t *internalRAM;
52
+extern uint8_t *workRAM;
53
+extern uint8_t *paletteRAM;
54
+extern uint8_t *vram;
55
+extern uint8_t *pix;
56
+extern uint8_t *oam;
57
+extern uint8_t *ioMem;
58 58
 
59
-extern u16 DISPCNT;
60
-extern u16 DISPSTAT;
61
-extern u16 VCOUNT;
62
-extern u16 BG0CNT;
63
-extern u16 BG1CNT;
64
-extern u16 BG2CNT;
65
-extern u16 BG3CNT;
66
-extern u16 BG0HOFS;
67
-extern u16 BG0VOFS;
68
-extern u16 BG1HOFS;
69
-extern u16 BG1VOFS;
70
-extern u16 BG2HOFS;
71
-extern u16 BG2VOFS;
72
-extern u16 BG3HOFS;
73
-extern u16 BG3VOFS;
74
-extern u16 BG2PA;
75
-extern u16 BG2PB;
76
-extern u16 BG2PC;
77
-extern u16 BG2PD;
78
-extern u16 BG2X_L;
79
-extern u16 BG2X_H;
80
-extern u16 BG2Y_L;
81
-extern u16 BG2Y_H;
82
-extern u16 BG3PA;
83
-extern u16 BG3PB;
84
-extern u16 BG3PC;
85
-extern u16 BG3PD;
86
-extern u16 BG3X_L;
87
-extern u16 BG3X_H;
88
-extern u16 BG3Y_L;
89
-extern u16 BG3Y_H;
90
-extern u16 WIN0H;
91
-extern u16 WIN1H;
92
-extern u16 WIN0V;
93
-extern u16 WIN1V;
94
-extern u16 WININ;
95
-extern u16 WINOUT;
96
-extern u16 MOSAIC;
97
-extern u16 BLDMOD;
98
-extern u16 COLEV;
99
-extern u16 COLY;
100
-extern u16 DM0SAD_L;
101
-extern u16 DM0SAD_H;
102
-extern u16 DM0DAD_L;
103
-extern u16 DM0DAD_H;
104
-extern u16 DM0CNT_L;
105
-extern u16 DM0CNT_H;
106
-extern u16 DM1SAD_L;
107
-extern u16 DM1SAD_H;
108
-extern u16 DM1DAD_L;
109
-extern u16 DM1DAD_H;
110
-extern u16 DM1CNT_L;
111
-extern u16 DM1CNT_H;
112
-extern u16 DM2SAD_L;
113
-extern u16 DM2SAD_H;
114
-extern u16 DM2DAD_L;
115
-extern u16 DM2DAD_H;
116
-extern u16 DM2CNT_L;
117
-extern u16 DM2CNT_H;
118
-extern u16 DM3SAD_L;
119
-extern u16 DM3SAD_H;
120
-extern u16 DM3DAD_L;
121
-extern u16 DM3DAD_H;
122
-extern u16 DM3CNT_L;
123
-extern u16 DM3CNT_H;
124
-extern u16 TM0D;
125
-extern u16 TM0CNT;
126
-extern u16 TM1D;
127
-extern u16 TM1CNT;
128
-extern u16 TM2D;
129
-extern u16 TM2CNT;
130
-extern u16 TM3D;
131
-extern u16 TM3CNT;
132
-extern u16 P1;
133
-extern u16 IE;
134
-extern u16 IF;
135
-extern u16 IME;
59
+extern uint16_t DISPCNT;
60
+extern uint16_t DISPSTAT;
61
+extern uint16_t VCOUNT;
62
+extern uint16_t BG0CNT;
63
+extern uint16_t BG1CNT;
64
+extern uint16_t BG2CNT;
65
+extern uint16_t BG3CNT;
66
+extern uint16_t BG0HOFS;
67
+extern uint16_t BG0VOFS;
68
+extern uint16_t BG1HOFS;
69
+extern uint16_t BG1VOFS;
70
+extern uint16_t BG2HOFS;
71
+extern uint16_t BG2VOFS;
72
+extern uint16_t BG3HOFS;
73
+extern uint16_t BG3VOFS;
74
+extern uint16_t BG2PA;
75
+extern uint16_t BG2PB;
76
+extern uint16_t BG2PC;
77
+extern uint16_t BG2PD;
78
+extern uint16_t BG2X_L;
79
+extern uint16_t BG2X_H;
80
+extern uint16_t BG2Y_L;
81
+extern uint16_t BG2Y_H;
82
+extern uint16_t BG3PA;
83
+extern uint16_t BG3PB;
84
+extern uint16_t BG3PC;
85
+extern uint16_t BG3PD;
86
+extern uint16_t BG3X_L;
87
+extern uint16_t BG3X_H;
88
+extern uint16_t BG3Y_L;
89
+extern uint16_t BG3Y_H;
90
+extern uint16_t WIN0H;
91
+extern uint16_t WIN1H;
92
+extern uint16_t WIN0V;
93
+extern uint16_t WIN1V;
94
+extern uint16_t WININ;
95
+extern uint16_t WINOUT;
96
+extern uint16_t MOSAIC;
97
+extern uint16_t BLDMOD;
98
+extern uint16_t COLEV;
99
+extern uint16_t COLY;
100
+extern uint16_t DM0SAD_L;
101
+extern uint16_t DM0SAD_H;
102
+extern uint16_t DM0DAD_L;
103
+extern uint16_t DM0DAD_H;
104
+extern uint16_t DM0CNT_L;
105
+extern uint16_t DM0CNT_H;
106
+extern uint16_t DM1SAD_L;
107
+extern uint16_t DM1SAD_H;
108
+extern uint16_t DM1DAD_L;
109
+extern uint16_t DM1DAD_H;
110
+extern uint16_t DM1CNT_L;
111
+extern uint16_t DM1CNT_H;
112
+extern uint16_t DM2SAD_L;
113
+extern uint16_t DM2SAD_H;
114
+extern uint16_t DM2DAD_L;
115
+extern uint16_t DM2DAD_H;
116
+extern uint16_t DM2CNT_L;
117
+extern uint16_t DM2CNT_H;
118
+extern uint16_t DM3SAD_L;
119
+extern uint16_t DM3SAD_H;
120
+extern uint16_t DM3DAD_L;
121
+extern uint16_t DM3DAD_H;
122
+extern uint16_t DM3CNT_L;
123
+extern uint16_t DM3CNT_H;
124
+extern uint16_t TM0D;
125
+extern uint16_t TM0CNT;
126
+extern uint16_t TM1D;
127
+extern uint16_t TM1CNT;
128
+extern uint16_t TM2D;
129
+extern uint16_t TM2CNT;
130
+extern uint16_t TM3D;
131
+extern uint16_t TM3CNT;
132
+extern uint16_t P1;
133
+extern uint16_t IE;
134
+extern uint16_t IF;
135
+extern uint16_t IME;
136 136
 
137 137
 #endif // GLOBALS_H
... ...
@@ -13,6 +13,7 @@
13 13
 #include "../common/SoundDriver.h"
14 14
 
15 15
 extern SoundDriver *systemSoundInit();
16
+bool soundDeclicking = true;
16 17
 
17 18
 #define NR10 0x60
18 19
 #define NR11 0x62
... ...
@@ -42,7 +43,7 @@ extern bool stopState;      // TODO: silence sound when true
42 43
 
43 44
 int const SOUND_CLOCK_TICKS_ = 167772; // 1/100 second
44 45
 
45
-static u16   soundFinalWave [6400];
46
+static uint16_t   soundFinalWave [6400];
46 47
 long  soundSampleRate    = 44100;
47 48
 bool  soundInterpolation = true;
48 49
 bool  soundPaused        = true;
... ...
@@ -84,7 +85,7 @@ public:
84 85
 	int  readIndex;
85 86
 	int  count;
86 87
 	int  writeIndex;
87
-	u8   fifo [32];
88
+	uint8_t   fifo [32];
88 89
 	int  dac;
89 90
 private:
90 91
 
... ...
@@ -155,7 +156,7 @@ void Gba_Pcm::update( int dac )
155 156
 	{
156 157
 		blip_time_t time = blip_time();
157 158
 
158
-		dac = (s8) dac >> shift;
159
+		dac = (int8_t) dac >> shift;
159 160
 		int delta = dac - last_amp;
160 161
 		if ( delta )
161 162
 		{
... ...
@@ -195,8 +196,8 @@ void Gba_Pcm_Fifo::timer_overflowed( int which_timer )
195 196
 				int reg = which ? FIFOB_L : FIFOA_L;
196 197
 				for ( int n = 4; n--; )
197 198
 				{
198
-					soundEvent(reg  , (u16)0);
199
-					soundEvent(reg+2, (u16)0);
199
+					soundEvent(reg  , (uint16_t)0);
200
+					soundEvent(reg+2, (uint16_t)0);
200 201
 				}
201 202
 			}
202 203
 		}
... ...
@@ -260,7 +261,7 @@ static int gba_to_gb_sound( int addr )
260 261
 	return 0;
261 262
 }
262 263
 
263
-void soundEvent(u32 address, u8 data)
264
+void soundEvent(uint32_t address, uint8_t data)
264 265
 {
265 266
 	int gb_addr = gba_to_gb_sound( address );
266 267
 	if ( gb_addr )
... ...
@@ -303,7 +304,7 @@ static void write_SGCNT0_H( int data )
303 304
 	apply_volume( true );
304 305
 }
305 306
 
306
-void soundEvent(u32 address, u16 data)
307
+void soundEvent(uint32_t address, uint16_t data)
307 308
 {
308 309
 	switch ( address )
309 310
 	{
... ...
@@ -329,8 +330,8 @@ void soundEvent(u32 address, u16 data)
329 330
 		break;
330 331
 
331 332
 	default:
332
-		soundEvent( address & ~1, (u8) (data     ) ); // even
333
-		soundEvent( address |  1, (u8) (data >> 8) ); // odd
333
+		soundEvent( address & ~1, (uint8_t) (data     ) ); // even
334
+		soundEvent( address |  1, (uint8_t) (data >> 8) ); // odd
334 335
 		break;
335 336
 	}
336 337
 }
... ...
@@ -435,6 +436,7 @@ static void apply_muting()
435 436
 
436 437
 static void reset_apu()
437 438
 {
439
+	gb_apu->reduce_clicks(soundDeclicking);
438 440
 	gb_apu->reset( gb_apu->mode_agb, true );
439 441
 
440 442
 	if ( stereo_buffer )
... ...
@@ -485,6 +487,20 @@ void soundShutdown()
485 487
 		soundDriver = 0;
486 488
 	}
487 489
 
490
+	// APU
491
+	if ( gb_apu )
492
+	{
493
+		delete gb_apu;
494
+		gb_apu = 0;
495
+	}
496
+
497
+	// Stereo_Buffer
498
+	if (stereo_buffer)
499
+	{
500
+		delete stereo_buffer;
501
+		stereo_buffer = 0;
502
+	}
503
+
488 504
 	//systemOnSoundShutdown();
489 505
 }
490 506
 
... ...
@@ -534,7 +550,7 @@ void soundReset()
534 550
 	SOUND_CLOCK_TICKS = SOUND_CLOCK_TICKS_;
535 551
 	soundTicks        = SOUND_CLOCK_TICKS_;
536 552
 
537
-	soundEvent( NR52, (u8) 0x80 );
553
+	soundEvent( NR52, (uint8_t) 0x80 );
538 554
 }
539 555
 
540 556
 bool soundInit()
... ...
@@ -6,6 +6,8 @@
6 6
 //#include "../System.h"
7 7
 #include "../common/Types.h"
8 8
 
9
+extern bool soundDeclicking;
10
+
9 11
 //// Setup/options (these affect GBA and GB sound)
10 12
 
11 13
 // Initializes sound and returns true if successful. Sets sound quality to
... ...
@@ -60,8 +62,8 @@ extern float soundFiltering;    // 0.0 = none, 1.0 = max
60 62
 void soundReset();
61 63
 
62 64
 // Emulates write to sound hardware
63
-void soundEvent( u32 addr, u8  data );
64
-void soundEvent( u32 addr, u16 data ); // TODO: error-prone to overload like this
65
+void soundEvent( uint32_t addr, uint8_t  data );
66
+void soundEvent( uint32_t addr, uint16_t data ); // TODO: error-prone to overload like this
65 67
 
66 68
 // Notifies emulator that a timer has overflowed
67 69
 void soundTimerOverflow( int which );
... ...
@@ -7,39 +7,39 @@
7 7
 #include "GBAinline.h"
8 8
 #include "Globals.h"
9 9
 
10
-s16 sineTable[256] = {
11
-  (s16)0x0000, (s16)0x0192, (s16)0x0323, (s16)0x04B5, (s16)0x0645, (s16)0x07D5, (s16)0x0964, (s16)0x0AF1,
12
-  (s16)0x0C7C, (s16)0x0E05, (s16)0x0F8C, (s16)0x1111, (s16)0x1294, (s16)0x1413, (s16)0x158F, (s16)0x1708,
13
-  (s16)0x187D, (s16)0x19EF, (s16)0x1B5D, (s16)0x1CC6, (s16)0x1E2B, (s16)0x1F8B, (s16)0x20E7, (s16)0x223D,
14
-  (s16)0x238E, (s16)0x24DA, (s16)0x261F, (s16)0x275F, (s16)0x2899, (s16)0x29CD, (s16)0x2AFA, (s16)0x2C21,
15
-  (s16)0x2D41, (s16)0x2E5A, (s16)0x2F6B, (s16)0x3076, (s16)0x3179, (s16)0x3274, (s16)0x3367, (s16)0x3453,
16
-  (s16)0x3536, (s16)0x3612, (s16)0x36E5, (s16)0x37AF, (s16)0x3871, (s16)0x392A, (s16)0x39DA, (s16)0x3A82,
17
-  (s16)0x3B20, (s16)0x3BB6, (s16)0x3C42, (s16)0x3CC5, (s16)0x3D3E, (s16)0x3DAE, (s16)0x3E14, (s16)0x3E71,
18
-  (s16)0x3EC5, (s16)0x3F0E, (s16)0x3F4E, (s16)0x3F84, (s16)0x3FB1, (s16)0x3FD3, (s16)0x3FEC, (s16)0x3FFB,
19
-  (s16)0x4000, (s16)0x3FFB, (s16)0x3FEC, (s16)0x3FD3, (s16)0x3FB1, (s16)0x3F84, (s16)0x3F4E, (s16)0x3F0E,
20
-  (s16)0x3EC5, (s16)0x3E71, (s16)0x3E14, (s16)0x3DAE, (s16)0x3D3E, (s16)0x3CC5, (s16)0x3C42, (s16)0x3BB6,
21
-  (s16)0x3B20, (s16)0x3A82, (s16)0x39DA, (s16)0x392A, (s16)0x3871, (s16)0x37AF, (s16)0x36E5, (s16)0x3612,
22
-  (s16)0x3536, (s16)0x3453, (s16)0x3367, (s16)0x3274, (s16)0x3179, (s16)0x3076, (s16)0x2F6B, (s16)0x2E5A,
23
-  (s16)0x2D41, (s16)0x2C21, (s16)0x2AFA, (s16)0x29CD, (s16)0x2899, (s16)0x275F, (s16)0x261F, (s16)0x24DA,
24
-  (s16)0x238E, (s16)0x223D, (s16)0x20E7, (s16)0x1F8B, (s16)0x1E2B, (s16)0x1CC6, (s16)0x1B5D, (s16)0x19EF,
25
-  (s16)0x187D, (s16)0x1708, (s16)0x158F, (s16)0x1413, (s16)0x1294, (s16)0x1111, (s16)0x0F8C, (s16)0x0E05,
26
-  (s16)0x0C7C, (s16)0x0AF1, (s16)0x0964, (s16)0x07D5, (s16)0x0645, (s16)0x04B5, (s16)0x0323, (s16)0x0192,
27
-  (s16)0x0000, (s16)0xFE6E, (s16)0xFCDD, (s16)0xFB4B, (s16)0xF9BB, (s16)0xF82B, (s16)0xF69C, (s16)0xF50F,
28
-  (s16)0xF384, (s16)0xF1FB, (s16)0xF074, (s16)0xEEEF, (s16)0xED6C, (s16)0xEBED, (s16)0xEA71, (s16)0xE8F8,
29
-  (s16)0xE783, (s16)0xE611, (s16)0xE4A3, (s16)0xE33A, (s16)0xE1D5, (s16)0xE075, (s16)0xDF19, (s16)0xDDC3,
30
-  (s16)0xDC72, (s16)0xDB26, (s16)0xD9E1, (s16)0xD8A1, (s16)0xD767, (s16)0xD633, (s16)0xD506, (s16)0xD3DF,
31
-  (s16)0xD2BF, (s16)0xD1A6, (s16)0xD095, (s16)0xCF8A, (s16)0xCE87, (s16)0xCD8C, (s16)0xCC99, (s16)0xCBAD,
32
-  (s16)0xCACA, (s16)0xC9EE, (s16)0xC91B, (s16)0xC851, (s16)0xC78F, (s16)0xC6D6, (s16)0xC626, (s16)0xC57E,
33
-  (s16)0xC4E0, (s16)0xC44A, (s16)0xC3BE, (s16)0xC33B, (s16)0xC2C2, (s16)0xC252, (s16)0xC1EC, (s16)0xC18F,
34
-  (s16)0xC13B, (s16)0xC0F2, (s16)0xC0B2, (s16)0xC07C, (s16)0xC04F, (s16)0xC02D, (s16)0xC014, (s16)0xC005,
35
-  (s16)0xC000, (s16)0xC005, (s16)0xC014, (s16)0xC02D, (s16)0xC04F, (s16)0xC07C, (s16)0xC0B2, (s16)0xC0F2,
36
-  (s16)0xC13B, (s16)0xC18F, (s16)0xC1EC, (s16)0xC252, (s16)0xC2C2, (s16)0xC33B, (s16)0xC3BE, (s16)0xC44A,
37
-  (s16)0xC4E0, (s16)0xC57E, (s16)0xC626, (s16)0xC6D6, (s16)0xC78F, (s16)0xC851, (s16)0xC91B, (s16)0xC9EE,
38
-  (s16)0xCACA, (s16)0xCBAD, (s16)0xCC99, (s16)0xCD8C, (s16)0xCE87, (s16)0xCF8A, (s16)0xD095, (s16)0xD1A6,
39
-  (s16)0xD2BF, (s16)0xD3DF, (s16)0xD506, (s16)0xD633, (s16)0xD767, (s16)0xD8A1, (s16)0xD9E1, (s16)0xDB26,
40
-  (s16)0xDC72, (s16)0xDDC3, (s16)0xDF19, (s16)0xE075, (s16)0xE1D5, (s16)0xE33A, (s16)0xE4A3, (s16)0xE611,
41
-  (s16)0xE783, (s16)0xE8F8, (s16)0xEA71, (s16)0xEBED, (s16)0xED6C, (s16)0xEEEF, (s16)0xF074, (s16)0xF1FB,
42
-  (s16)0xF384, (s16)0xF50F, (s16)0xF69C, (s16)0xF82B, (s16)0xF9BB, (s16)0xFB4B, (s16)0xFCDD, (s16)0xFE6E
10
+int16_t sineTable[256] = {
11
+  (int16_t)0x0000, (int16_t)0x0192, (int16_t)0x0323, (int16_t)0x04B5, (int16_t)0x0645, (int16_t)0x07D5, (int16_t)0x0964, (int16_t)0x0AF1,
12
+  (int16_t)0x0C7C, (int16_t)0x0E05, (int16_t)0x0F8C, (int16_t)0x1111, (int16_t)0x1294, (int16_t)0x1413, (int16_t)0x158F, (int16_t)0x1708,
13
+  (int16_t)0x187D, (int16_t)0x19EF, (int16_t)0x1B5D, (int16_t)0x1CC6, (int16_t)0x1E2B, (int16_t)0x1F8B, (int16_t)0x20E7, (int16_t)0x223D,
14
+  (int16_t)0x238E, (int16_t)0x24DA, (int16_t)0x261F, (int16_t)0x275F, (int16_t)0x2899, (int16_t)0x29CD, (int16_t)0x2AFA, (int16_t)0x2C21,
15
+  (int16_t)0x2D41, (int16_t)0x2E5A, (int16_t)0x2F6B, (int16_t)0x3076, (int16_t)0x3179, (int16_t)0x3274, (int16_t)0x3367, (int16_t)0x3453,
16
+  (int16_t)0x3536, (int16_t)0x3612, (int16_t)0x36E5, (int16_t)0x37AF, (int16_t)0x3871, (int16_t)0x392A, (int16_t)0x39DA, (int16_t)0x3A82,
17
+  (int16_t)0x3B20, (int16_t)0x3BB6, (int16_t)0x3C42, (int16_t)0x3CC5, (int16_t)0x3D3E, (int16_t)0x3DAE, (int16_t)0x3E14, (int16_t)0x3E71,
18
+  (int16_t)0x3EC5, (int16_t)0x3F0E, (int16_t)0x3F4E, (int16_t)0x3F84, (int16_t)0x3FB1, (int16_t)0x3FD3, (int16_t)0x3FEC, (int16_t)0x3FFB,
19
+  (int16_t)0x4000, (int16_t)0x3FFB, (int16_t)0x3FEC, (int16_t)0x3FD3, (int16_t)0x3FB1, (int16_t)0x3F84, (int16_t)0x3F4E, (int16_t)0x3F0E,
20
+  (int16_t)0x3EC5, (int16_t)0x3E71, (int16_t)0x3E14, (int16_t)0x3DAE, (int16_t)0x3D3E, (int16_t)0x3CC5, (int16_t)0x3C42, (int16_t)0x3BB6,
21
+  (int16_t)0x3B20, (int16_t)0x3A82, (int16_t)0x39DA, (int16_t)0x392A, (int16_t)0x3871, (int16_t)0x37AF, (int16_t)0x36E5, (int16_t)0x3612,
22
+  (int16_t)0x3536, (int16_t)0x3453, (int16_t)0x3367, (int16_t)0x3274, (int16_t)0x3179, (int16_t)0x3076, (int16_t)0x2F6B, (int16_t)0x2E5A,
23
+  (int16_t)0x2D41, (int16_t)0x2C21, (int16_t)0x2AFA, (int16_t)0x29CD, (int16_t)0x2899, (int16_t)0x275F, (int16_t)0x261F, (int16_t)0x24DA,
24
+  (int16_t)0x238E, (int16_t)0x223D, (int16_t)0x20E7, (int16_t)0x1F8B, (int16_t)0x1E2B, (int16_t)0x1CC6, (int16_t)0x1B5D, (int16_t)0x19EF,
25
+  (int16_t)0x187D, (int16_t)0x1708, (int16_t)0x158F, (int16_t)0x1413, (int16_t)0x1294, (int16_t)0x1111, (int16_t)0x0F8C, (int16_t)0x0E05,
26
+  (int16_t)0x0C7C, (int16_t)0x0AF1, (int16_t)0x0964, (int16_t)0x07D5, (int16_t)0x0645, (int16_t)0x04B5, (int16_t)0x0323, (int16_t)0x0192,
27
+  (int16_t)0x0000, (int16_t)0xFE6E, (int16_t)0xFCDD, (int16_t)0xFB4B, (int16_t)0xF9BB, (int16_t)0xF82B, (int16_t)0xF69C, (int16_t)0xF50F,
28
+  (int16_t)0xF384, (int16_t)0xF1FB, (int16_t)0xF074, (int16_t)0xEEEF, (int16_t)0xED6C, (int16_t)0xEBED, (int16_t)0xEA71, (int16_t)0xE8F8,
29
+  (int16_t)0xE783, (int16_t)0xE611, (int16_t)0xE4A3, (int16_t)0xE33A, (int16_t)0xE1D5, (int16_t)0xE075, (int16_t)0xDF19, (int16_t)0xDDC3,
30
+  (int16_t)0xDC72, (int16_t)0xDB26, (int16_t)0xD9E1, (int16_t)0xD8A1, (int16_t)0xD767, (int16_t)0xD633, (int16_t)0xD506, (int16_t)0xD3DF,
31
+  (int16_t)0xD2BF, (int16_t)0xD1A6, (int16_t)0xD095, (int16_t)0xCF8A, (int16_t)0xCE87, (int16_t)0xCD8C, (int16_t)0xCC99, (int16_t)0xCBAD,
32
+  (int16_t)0xCACA, (int16_t)0xC9EE, (int16_t)0xC91B, (int16_t)0xC851, (int16_t)0xC78F, (int16_t)0xC6D6, (int16_t)0xC626, (int16_t)0xC57E,
33
+  (int16_t)0xC4E0, (int16_t)0xC44A, (int16_t)0xC3BE, (int16_t)0xC33B, (int16_t)0xC2C2, (int16_t)0xC252, (int16_t)0xC1EC, (int16_t)0xC18F,
34
+  (int16_t)0xC13B, (int16_t)0xC0F2, (int16_t)0xC0B2, (int16_t)0xC07C, (int16_t)0xC04F, (int16_t)0xC02D, (int16_t)0xC014, (int16_t)0xC005,
35
+  (int16_t)0xC000, (int16_t)0xC005, (int16_t)0xC014, (int16_t)0xC02D, (int16_t)0xC04F, (int16_t)0xC07C, (int16_t)0xC0B2, (int16_t)0xC0F2,
36
+  (int16_t)0xC13B, (int16_t)0xC18F, (int16_t)0xC1EC, (int16_t)0xC252, (int16_t)0xC2C2, (int16_t)0xC33B, (int16_t)0xC3BE, (int16_t)0xC44A,
37
+  (int16_t)0xC4E0, (int16_t)0xC57E, (int16_t)0xC626, (int16_t)0xC6D6, (int16_t)0xC78F, (int16_t)0xC851, (int16_t)0xC91B, (int16_t)0xC9EE,
38
+  (int16_t)0xCACA, (int16_t)0xCBAD, (int16_t)0xCC99, (int16_t)0xCD8C, (int16_t)0xCE87, (int16_t)0xCF8A, (int16_t)0xD095, (int16_t)0xD1A6,
39
+  (int16_t)0xD2BF, (int16_t)0xD3DF, (int16_t)0xD506, (int16_t)0xD633, (int16_t)0xD767, (int16_t)0xD8A1, (int16_t)0xD9E1, (int16_t)0xDB26,
40
+  (int16_t)0xDC72, (int16_t)0xDDC3, (int16_t)0xDF19, (int16_t)0xE075, (int16_t)0xE1D5, (int16_t)0xE33A, (int16_t)0xE4A3, (int16_t)0xE611,
41
+  (int16_t)0xE783, (int16_t)0xE8F8, (int16_t)0xEA71, (int16_t)0xEBED, (int16_t)0xED6C, (int16_t)0xEEEF, (int16_t)0xF074, (int16_t)0xF1FB,
42
+  (int16_t)0xF384, (int16_t)0xF50F, (int16_t)0xF69C, (int16_t)0xF82B, (int16_t)0xF9BB, (int16_t)0xFB4B, (int16_t)0xFCDD, (int16_t)0xFE6E
43 43
 };
44 44
 
45 45
 void BIOS_ArcTan()
... ...
@@ -52,15 +52,15 @@ void BIOS_ArcTan()
52 52
   }
53 53
 #endif
54 54
 
55
-  s32 a =  -(((s32)(reg[0].I*reg[0].I)) >> 14);
56
-  s32 b = ((0xA9 * a) >> 14) + 0x390;
55
+  int32_t a =  -(((int32_t)(reg[0].I*reg[0].I)) >> 14);
56
+  int32_t b = ((0xA9 * a) >> 14) + 0x390;
57 57
   b = ((b * a) >> 14) + 0x91C;
58 58
   b = ((b * a) >> 14) + 0xFB6;
59 59
   b = ((b * a) >> 14) + 0x16AA;
60 60
   b = ((b * a) >> 14) + 0x2081;
61 61
   b = ((b * a) >> 14) + 0x3651;
62 62
   b = ((b * a) >> 14) + 0xA2F9;
63
-  a = ((s32)reg[0].I * b) >> 16;
63
+  a = ((int32_t)reg[0].I * b) >> 16;
64 64
   reg[0].I = a;
65 65
 
66 66
 #ifdef GBA_LOGGING
... ...
@@ -82,9 +82,9 @@ void BIOS_ArcTan2()
82 82
   }
83 83
 #endif
84 84
 
85
-  s32 x = reg[0].I;
86
-  s32 y = reg[1].I;
87
-  u32 res = 0;
85
+  int32_t x = reg[0].I;
86
+  int32_t y = reg[1].I;
87
+  uint32_t res = 0;
88 88
   if (y == 0) {
89 89
     res = ((x>>16) & 0x8000);
90 90
   } else {
... ...
@@ -130,9 +130,9 @@ void BIOS_BitUnPack()
130 130
   }
131 131
 #endif
132 132
 
133
-  u32 source = reg[0].I;
134
-  u32 dest = reg[1].I;
135
-  u32 header = reg[2].I;
133
+  uint32_t source = reg[0].I;
134
+  uint32_t dest = reg[1].I;
135
+  uint32_t header = reg[2].I;
136 136
 
137 137
   int len = CPUReadHalfWord(header);
138 138
     // check address
... ...
@@ -143,7 +143,7 @@ void BIOS_BitUnPack()
143 143
   int bits = CPUReadByte(header+2);
144 144
   int revbits = 8 - bits;
145 145
   // u32 value = 0;
146
-  u32 base = CPUReadMemory(header+4);
146
+  uint32_t base = CPUReadMemory(header+4);
147 147
   bool addBase = (base & 0x80000000) ? true : false;
148 148
   base &= 0x7fffffff;
149 149
   int dataSize = CPUReadByte(header+3);
... ...
@@ -155,14 +155,14 @@ void BIOS_BitUnPack()
155 155
     if(len < 0)
156 156
       break;
157 157
     int mask = 0xff >> revbits;
158
-    u8 b = CPUReadByte(source);
158
+    uint8_t b = CPUReadByte(source);
159 159
     source++;
160 160
     int bitcount = 0;
161 161
     while(1) {
162 162
       if(bitcount >= 8)
163 163
         break;
164
-      u32 d = b & mask;
165
-      u32 temp = d >> bitcount;
164
+      uint32_t d = b & mask;
165
+      uint32_t temp = d >> bitcount;
166 166
       if(d || addBase) {
167 167
         temp += base;
168 168
       }
... ...
@@ -197,32 +197,32 @@ void BIOS_BgAffineSet()
197 197
   }
198 198
 #endif
199 199
 
200
-  u32 src = reg[0].I;
201
-  u32 dest = reg[1].I;
200
+  uint32_t src = reg[0].I;
201
+  uint32_t dest = reg[1].I;
202 202
   int num = reg[2].I;
203 203
 
204 204
   for(int i = 0; i < num; i++) {
205
-    s32 cx = CPUReadMemory(src);
205
+    int32_t cx = CPUReadMemory(src);
206 206
     src+=4;
207
-    s32 cy = CPUReadMemory(src);
207
+    int32_t cy = CPUReadMemory(src);
208 208
     src+=4;
209
-    s16 dispx = CPUReadHalfWord(src);
209
+    int16_t dispx = CPUReadHalfWord(src);
210 210
     src+=2;
211
-    s16 dispy = CPUReadHalfWord(src);
211
+    int16_t dispy = CPUReadHalfWord(src);
212 212
     src+=2;
213
-    s16 rx = CPUReadHalfWord(src);
213
+    int16_t rx = CPUReadHalfWord(src);
214 214
     src+=2;
215
-    s16 ry = CPUReadHalfWord(src);
215
+    int16_t ry = CPUReadHalfWord(src);
216 216
     src+=2;
217
-    u16 theta = CPUReadHalfWord(src)>>8;
217
+    uint16_t theta = CPUReadHalfWord(src)>>8;
218 218
     src+=4; // keep structure alignment
219
-    s32 a = sineTable[(theta+0x40)&255];
220
-    s32 b = sineTable[theta];
219
+    int32_t a = sineTable[(theta+0x40)&255];
220
+    int32_t b = sineTable[theta];
221 221
 
222
-    s16 dx =  (rx * a)>>14;
223
-    s16 dmx = (rx * b)>>14;
224
-    s16 dy =  (ry * b)>>14;
225
-    s16 dmy = (ry * a)>>14;
222
+    int16_t dx =  (rx * a)>>14;
223
+    int16_t dmx = (rx * b)>>14;
224
+    int16_t dy =  (ry * b)>>14;
225
+    int16_t dmy = (ry * a)>>14;
226 226
 
227 227
     CPUWriteHalfWord(dest, dx);
228 228
     dest += 2;
... ...
@@ -233,8 +233,8 @@ void BIOS_BgAffineSet()
233 233
     CPUWriteHalfWord(dest, dmy);
234 234
     dest += 2;
235 235
 
236
-    s32 startx = cx - dx * dispx + dmx * dispy;
237
-    s32 starty = cy - dy * dispx - dmy * dispy;
236
+    int32_t startx = cx - dx * dispx + dmx * dispy;
237
+    int32_t starty = cy - dy * dispx - dmy * dispy;
238 238
 
239 239
     CPUWriteMemory(dest, startx);
240 240
     dest += 4;
... ...
@@ -252,9 +252,9 @@ void BIOS_CpuSet()
252 252
   }
253 253
 #endif
254 254
 
255
-  u32 source = reg[0].I;
256
-  u32 dest = reg[1].I;
257
-  u32 cnt = reg[2].I;
255
+  uint32_t source = reg[0].I;
256
+  uint32_t dest = reg[1].I;
257
+  uint32_t cnt = reg[2].I;
258 258
 
259 259
   if(((source & 0xe000000) == 0) ||
260 260
      ((source + (((cnt << 11)>>9) & 0x1fffff)) & 0xe000000) == 0)
... ...
@@ -269,7 +269,7 @@ void BIOS_CpuSet()
269 269
     dest &= 0xFFFFFFFC;
270 270
     // fill ?
271 271
     if((cnt >> 24) & 1) {
272
-        u32 value = (source>0x0EFFFFFF ? 0x1CAD1CAD : CPUReadMemory(source));
272
+        uint32_t value = (source>0x0EFFFFFF ? 0x1CAD1CAD : CPUReadMemory(source));
273 273
       while(count) {
274 274
         CPUWriteMemory(dest, value);
275 275
         dest += 4;
... ...
@@ -287,7 +287,7 @@ void BIOS_CpuSet()
287 287
   } else {
288 288
     // 16-bit fill?
289 289
     if((cnt >> 24) & 1) {
290
-      u16 value = (source>0x0EFFFFFF ? 0x1CAD : CPUReadHalfWord(source));
290
+      uint16_t value = (source>0x0EFFFFFF ? 0x1CAD : CPUReadHalfWord(source));
291 291
       while(count) {
292 292
         CPUWriteHalfWord(dest, value);
293 293
         dest += 2;
... ...
@@ -314,9 +314,9 @@ void BIOS_CpuFastSet()
314 314
   }
315 315
 #endif
316 316
 
317
-  u32 source = reg[0].I;
318
-  u32 dest = reg[1].I;
319
-  u32 cnt = reg[2].I;
317
+  uint32_t source = reg[0].I;
318
+  uint32_t dest = reg[1].I;
319
+  uint32_t cnt = reg[2].I;
320 320
 
321 321
   if(((source & 0xe000000) == 0) ||
322 322
      ((source + (((cnt << 11)>>9) & 0x1fffff)) & 0xe000000) == 0)
... ...
@@ -332,7 +332,7 @@ void BIOS_CpuFastSet()
332 332
   if((cnt >> 24) & 1) {
333 333
     while(count > 0) {
334 334
       // BIOS always transfers 32 bytes at a time
335
-      u32 value = (source>0x0EFFFFFF ? 0xBAFFFFFB : CPUReadMemory(source));
335
+      uint32_t value = (source>0x0EFFFFFF ? 0xBAFFFFFB : CPUReadMemory(source));
336 336
       for(int i = 0; i < 8; i++) {
337 337
         CPUWriteMemory(dest, value);
338 338
         dest += 4;
... ...
@@ -362,10 +362,10 @@ void BIOS_Diff8bitUnFilterWram()
362 362
   }
363 363
 #endif
364 364
 
365
-  u32 source = reg[0].I;
366
-  u32 dest = reg[1].I;
365
+  uint32_t source = reg[0].I;
366
+  uint32_t dest = reg[1].I;
367 367
 
368
-  u32 header = CPUReadMemory(source);
368
+  uint32_t header = CPUReadMemory(source);
369 369
   source += 4;
370 370
 
371 371
   if(((source & 0xe000000) == 0) ||
... ...
@@ -374,12 +374,12 @@ void BIOS_Diff8bitUnFilterWram()
374 374
 
375 375
   int len = header >> 8;
376 376
 
377
-  u8 data = CPUReadByte(source++);
377
+  uint8_t data = CPUReadByte(source++);
378 378
   CPUWriteByte(dest++, data);
379 379
   len--;
380 380
 
381 381
   while(len > 0) {
382
-    u8 diff = CPUReadByte(source++);
382
+    uint8_t diff = CPUReadByte(source++);
383 383
     data += diff;
384 384
     CPUWriteByte(dest++, data);
385 385
     len--;
... ...
@@ -395,10 +395,10 @@ void BIOS_Diff8bitUnFilterVram()
395 395
   }
396 396
 #endif
397 397
 
398
-  u32 source = reg[0].I;
399
-  u32 dest = reg[1].I;
398
+  uint32_t source = reg[0].I;
399
+  uint32_t dest = reg[1].I;
400 400
 
401
-  u32 header = CPUReadMemory(source);
401
+  uint32_t header = CPUReadMemory(source);
402 402
   source += 4;
403 403
 
404 404
   if(((source & 0xe000000) == 0) ||
... ...
@@ -407,13 +407,13 @@ void BIOS_Diff8bitUnFilterVram()
407 407
 
408 408
   int len = header >> 8;
409 409
 
410
-  u8 data = CPUReadByte(source++);
411
-  u16 writeData = data;
410
+  uint8_t data = CPUReadByte(source++);
411
+  uint16_t writeData = data;
412 412
   int shift = 8;
413 413
   int bytes = 1;
414 414
 
415 415
   while(len >= 2) {
416
-    u8 diff = CPUReadByte(source++);
416
+    uint8_t diff = CPUReadByte(source++);
417 417
     data += diff;
418 418
     writeData |= (data << shift);
419 419
     bytes++;
... ...
@@ -438,10 +438,10 @@ void BIOS_Diff16bitUnFilter()
438 438
   }
439 439
 #endif
440 440
 
441
-  u32 source = reg[0].I;
442
-  u32 dest = reg[1].I;
441
+  uint32_t source = reg[0].I;
442
+  uint32_t dest = reg[1].I;
443 443
 
444
-  u32 header = CPUReadMemory(source);
444
+  uint32_t header = CPUReadMemory(source);
445 445
   source += 4;
446 446
 
447 447
   if(((source & 0xe000000) == 0) ||
... ...
@@ -450,14 +450,14 @@ void BIOS_Diff16bitUnFilter()
450 450
 
451 451
   int len = header >> 8;
452 452
 
453
-  u16 data = CPUReadHalfWord(source);
453
+  uint16_t data = CPUReadHalfWord(source);
454 454
   source += 2;
455 455
   CPUWriteHalfWord(dest, data);
456 456
   dest += 2;
457 457
   len -= 2;
458 458
 
459 459
   while(len >= 2) {
460
-    u16 diff = CPUReadHalfWord(source);
460
+    uint16_t diff = CPUReadHalfWord(source);
461 461
     source += 2;
462 462
     data += diff;
463 463
     CPUWriteHalfWord(dest, data);
... ...
@@ -483,8 +483,8 @@ void BIOS_Div()
483 483
   if(denom != 0) {
484 484
     reg[0].I = number / denom;
485 485
     reg[1].I = number % denom;
486
-    s32 temp = (s32)reg[0].I;
487
-    reg[3].I = temp < 0 ? (u32)-temp : (u32)temp;
486
+    int32_t temp = (int32_t)reg[0].I;
487
+    reg[3].I = temp < 0 ? (uint32_t)-temp : (uint32_t)temp;
488 488
   }
489 489
 #ifdef GBA_LOGGING
490 490
   if(systemVerbose & VERBOSE_SWI) {
... ...
@@ -506,7 +506,7 @@ void BIOS_DivARM()
506 506
   }
507 507
 #endif
508 508
 
509
-  u32 temp = reg[0].I;
509
+  uint32_t temp = reg[0].I;
510 510
   reg[0].I = reg[1].I;
511 511
   reg[1].I = temp;
512 512
   BIOS_Div();
... ...
@@ -523,35 +523,35 @@ void BIOS_HuffUnComp()
523 523
   }
524 524
 #endif
525 525
 
526
-  u32 source = reg[0].I;
527
-  u32 dest = reg[1].I;
526
+  uint32_t source = reg[0].I;
527
+  uint32_t dest = reg[1].I;
528 528
 
529
-  u32 header = CPUReadMemory(source);
529
+  uint32_t header = CPUReadMemory(source);
530 530
   source += 4;
531 531
 
532 532
   if(((source & 0xe000000) == 0) ||
533 533
      ((source + ((header >> 8) & 0x1fffff)) & 0xe000000) == 0)
534 534
     return;
535 535
 
536
-  u8 treeSize = CPUReadByte(source++);
536
+  uint8_t treeSize = CPUReadByte(source++);
537 537
 
538
-  u32 treeStart = source;
538
+  uint32_t treeStart = source;
539 539
 
540 540
   source += ((treeSize+1)<<1)-1; // minus because we already skipped one byte
541 541
 
542 542
   int len = header >> 8;
543 543
 
544
-  u32 mask = 0x80000000;
545
-  u32 data = CPUReadMemory(source);
544
+  uint32_t mask = 0x80000000;
545
+  uint32_t data = CPUReadMemory(source);
546 546
   source += 4;
547 547
 
548 548
   int pos = 0;
549
-  u8 rootNode = CPUReadByte(treeStart);
550
-  u8 currentNode = rootNode;
549
+  uint8_t rootNode = CPUReadByte(treeStart);
550
+  uint8_t currentNode = rootNode;
551 551
   bool writeData = false;
552 552
   int byteShift = 0;
553 553
   int byteCount = 0;
554
-  u32 writeValue = 0;
554
+  uint32_t writeValue = 0;
555 555
 
556 556
   if((header & 0x0F) == 8) {
557 557
     while(len > 0) {
... ...
@@ -669,10 +669,10 @@ void BIOS_LZ77UnCompVram()
669 669
   }
670 670
 #endif
671 671
 
672
-  u32 source = reg[0].I;
673
-  u32 dest = reg[1].I;
672
+  uint32_t source = reg[0].I;
673
+  uint32_t dest = reg[1].I;
674 674
 
675
-  u32 header = CPUReadMemory(source);
675
+  uint32_t header = CPUReadMemory(source);
676 676
   source += 4;
677 677
 
678 678
   if(((source & 0xe000000) == 0) ||
... ...
@@ -681,21 +681,21 @@ void BIOS_LZ77UnCompVram()
681 681
 
682 682
   int byteCount = 0;
683 683
   int byteShift = 0;
684
-  u32 writeValue = 0;
684
+  uint32_t writeValue = 0;
685 685
 
686 686
   int len = header >> 8;
687 687
 
688 688
   while(len > 0) {
689
-    u8 d = CPUReadByte(source++);
689
+    uint8_t d = CPUReadByte(source++);
690 690
 
691 691
     if(d) {
692 692
       for(int i = 0; i < 8; i++) {
693 693
         if(d & 0x80) {
694
-          u16 data = CPUReadByte(source++) << 8;
694
+          uint16_t data = CPUReadByte(source++) << 8;
695 695
           data |= CPUReadByte(source++);
696 696
           int length = (data >> 12) + 3;
697 697
           int offset = (data & 0x0FFF);
698
-          u32 windowOffset = dest + byteCount - offset - 1;
698
+          uint32_t windowOffset = dest + byteCount - offset - 1;
699 699
           for(int i2 = 0; i2 < length; i2++) {
700 700
             writeValue |= (CPUReadByte(windowOffset++) << byteShift);
701 701
             byteShift += 8;
... ...
@@ -758,10 +758,10 @@ void BIOS_LZ77UnCompWram()
758 758
   }
759 759
 #endif
760 760
 
761
-  u32 source = reg[0].I;
762
-  u32 dest = reg[1].I;
761
+  uint32_t source = reg[0].I;
762
+  uint32_t dest = reg[1].I;
763 763
 
764
-  u32 header = CPUReadMemory(source);
764
+  uint32_t header = CPUReadMemory(source);
765 765
   source += 4;
766 766
 
767 767
   if(((source & 0xe000000) == 0) ||
... ...
@@ -771,16 +771,16 @@ void BIOS_LZ77UnCompWram()
771 771
   int len = header >> 8;
772 772
 
773 773
   while(len > 0) {
774
-    u8 d = CPUReadByte(source++);
774
+    uint8_t d = CPUReadByte(source++);
775 775
 
776 776
     if(d) {
777 777
       for(int i = 0; i < 8; i++) {
778 778
         if(d & 0x80) {
779
-          u16 data = CPUReadByte(source++) << 8;
779
+          uint16_t data = CPUReadByte(source++) << 8;
780 780
           data |= CPUReadByte(source++);
781 781
           int length = (data >> 12) + 3;
782 782
           int offset = (data & 0x0FFF);
783
-          u32 windowOffset = dest - offset - 1;
783
+          uint32_t windowOffset = dest - offset - 1;
784 784
           for(int i2 = 0; i2 < length; i2++) {
785 785
             CPUWriteByte(dest++, CPUReadByte(windowOffset++));
786 786
             len--;
... ...
@@ -819,26 +819,26 @@ void BIOS_ObjAffineSet()
819 819
   }
820 820
 #endif
821 821
 
822
-  u32 src = reg[0].I;
823
-  u32 dest = reg[1].I;
822
+  uint32_t src = reg[0].I;
823
+  uint32_t dest = reg[1].I;
824 824
   int num = reg[2].I;
825 825
   int offset = reg[3].I;
826 826
 
827 827
   for(int i = 0; i < num; i++) {
828
-    s16 rx = CPUReadHalfWord(src);
828
+    int16_t rx = CPUReadHalfWord(src);
829 829
     src+=2;
830
-    s16 ry = CPUReadHalfWord(src);
830
+    int16_t ry = CPUReadHalfWord(src);
831 831
     src+=2;
832
-    u16 theta = CPUReadHalfWord(src)>>8;
832
+    uint16_t theta = CPUReadHalfWord(src)>>8;
833 833
     src+=4; // keep structure alignment
834 834
 
835
-    s32 a = (s32)sineTable[(theta+0x40)&255];
836
-    s32 b = (s32)sineTable[theta];
835
+    int32_t a = (int32_t)sineTable[(theta+0x40)&255];
836
+    int32_t b = (int32_t)sineTable[theta];
837 837
 
838
-    s16 dx =  ((s32)rx * a)>>14;
839
-    s16 dmx = ((s32)rx * b)>>14;
840
-    s16 dy =  ((s32)ry * b)>>14;
841
-    s16 dmy = ((s32)ry * a)>>14;
838
+    int16_t dx =  ((int32_t)rx * a)>>14;
839
+    int16_t dmx = ((int32_t)rx * b)>>14;
840
+    int16_t dy =  ((int32_t)ry * b)>>14;
841
+    int16_t dmy = ((int32_t)ry * a)>>14;
842 842
 
843 843
     CPUWriteHalfWord(dest, dx);
844 844
     dest += offset;
... ...
@@ -851,7 +851,7 @@ void BIOS_ObjAffineSet()
851 851
   }
852 852
 }
853 853
 
854
-void BIOS_RegisterRamReset(u32 flags)
854
+void BIOS_RegisterRamReset(uint32_t flags)
855 855
 {
856 856
   // no need to trace here. this is only called directly from GBA.cpp
857 857
   // to emulate bios initialization
... ...
@@ -951,10 +951,10 @@ void BIOS_RLUnCompVram()
951 951
   }
952 952
 #endif
953 953
 
954
-  u32 source = reg[0].I;
955
-  u32 dest = reg[1].I;
954
+  uint32_t source = reg[0].I;
955
+  uint32_t dest = reg[1].I;
956 956
 
957
-  u32 header = CPUReadMemory(source & 0xFFFFFFFC);
957
+  uint32_t header = CPUReadMemory(source & 0xFFFFFFFC);
958 958
   source += 4;
959 959
 
960 960
   if(((source & 0xe000000) == 0) ||
... ...
@@ -964,13 +964,13 @@ void BIOS_RLUnCompVram()
964 964
   int len = header >> 8;
965 965
   int byteCount = 0;
966 966
   int byteShift = 0;
967
-  u32 writeValue = 0;
967
+  uint32_t writeValue = 0;
968 968
 
969 969
   while(len > 0) {
970
-    u8 d = CPUReadByte(source++);
970
+    uint8_t d = CPUReadByte(source++);
971 971
     int l = d & 0x7F;
972 972
     if(d & 0x80) {
973
-      u8 data = CPUReadByte(source++);
973
+      uint8_t data = CPUReadByte(source++);
974 974
       l += 3;
975 975
       for(int i = 0;i < l; i++) {
976 976
         writeValue |= (data << byteShift);
... ...
@@ -1020,10 +1020,10 @@ void BIOS_RLUnCompWram()
1020 1020
   }
1021 1021
 #endif
1022 1022
 
1023
-  u32 source = reg[0].I;
1024
-  u32 dest = reg[1].I;
1023
+  uint32_t source = reg[0].I;
1024
+  uint32_t dest = reg[1].I;
1025 1025
 
1026
-  u32 header = CPUReadMemory(source & 0xFFFFFFFC);
1026
+  uint32_t header = CPUReadMemory(source & 0xFFFFFFFC);
1027 1027
   source += 4;
1028 1028
 
1029 1029
   if(((source & 0xe000000) == 0) ||
... ...
@@ -1033,10 +1033,10 @@ void BIOS_RLUnCompWram()
1033 1033
   int len = header >> 8;
1034 1034
 
1035 1035
   while(len > 0) {
1036
-    u8 d = CPUReadByte(source++);
1036
+    uint8_t d = CPUReadByte(source++);
1037 1037
     int l = d & 0x7F;
1038 1038
     if(d & 0x80) {
1039
-      u8 data = CPUReadByte(source++);
1039
+      uint8_t data = CPUReadByte(source++);
1040 1040
       l += 3;
1041 1041
       for(int i = 0;i < l; i++) {
1042 1042
         CPUWriteByte(dest++, data);
... ...
@@ -1077,7 +1077,7 @@ void BIOS_SoftReset()
1077 1077
   reg[R13_SVC].I = 0x03007FE0;
1078 1078
   reg[R14_SVC].I = 0x00000000;
1079 1079
   reg[SPSR_SVC].I = 0x00000000;
1080
-  u8 b = internalRAM[0x7ffa];
1080
+  uint8_t b = internalRAM[0x7ffa];
1081 1081
 
1082 1082
   memset(&internalRAM[0x7e00], 0, 0x200);
1083 1083
 
... ...
@@ -1099,7 +1099,7 @@ void BIOS_Sqrt()
1099 1099
         VCOUNT);
1100 1100
   }
1101 1101
 #endif
1102
-  reg[0].I = (u32)sqrt((double)reg[0].I);
1102
+  reg[0].I = (uint32_t)sqrt((double)reg[0].I);
1103 1103
 #ifdef GBA_LOGGING
1104 1104
   if(systemVerbose & VERBOSE_SWI) {
1105 1105
     log("Sqrt: return=%08x\n",
... ...
@@ -18,7 +18,7 @@ extern void BIOS_LZ77UnCompVram();
18 18
 extern void BIOS_LZ77UnCompWram();
19 19
 extern void BIOS_ObjAffineSet();
20 20
 extern void BIOS_RegisterRamReset();
21
-extern void BIOS_RegisterRamReset(u32);
21
+extern void BIOS_RegisterRamReset(uint32_t);
22 22
 extern void BIOS_RLUnCompVram();
23 23
 extern void BIOS_RLUnCompWram();
24 24
 extern void BIOS_SoftReset();