comparison src/haptic/nds/SDL_syshaptic.c @ 4761:bb2e32f5a556

Removed spurious carriage returns
author Sam Lantinga <slouken@libsdl.org>
date Sun, 22 Aug 2010 12:34:31 -0700
parents 8cc00819c8d6
children d6adaafcfb10
comparison
equal deleted inserted replaced
4760:c40027ee6d47 4761:bb2e32f5a556
41 { NONE, OFFICIAL, EZF3IN1 } type; 41 { NONE, OFFICIAL, EZF3IN1 } type;
42 int pos; 42 int pos;
43 } NDS_HapticData; 43 } NDS_HapticData;
44 44
45 45
46
47 void 46 void
48 NDS_EZF_OpenNorWrite() 47 NDS_EZF_OpenNorWrite()
49 { 48 {
50 49 GBA_BUS[0x0FF0000] = 0xD200;
51 GBA_BUS[0x0FF0000] = 0xD200; 50 GBA_BUS[0x0000000] = 0x1500;
52 51 GBA_BUS[0x0010000] = 0xD200;
53 GBA_BUS[0x0000000] = 0x1500; 52 GBA_BUS[0x0020000] = 0x1500;
54 53 GBA_BUS[0x0E20000] = 0x1500;
55 GBA_BUS[0x0010000] = 0xD200; 54 GBA_BUS[0x0FE0000] = 0x1500;
56
57 GBA_BUS[0x0020000] = 0x1500;
58
59 GBA_BUS[0x0E20000] = 0x1500;
60
61 GBA_BUS[0x0FE0000] = 0x1500;
62
63 } 55 }
64 56
65
66 void 57 void
67 58
68 NDS_EZF_CloseNorWrite() 59 NDS_EZF_CloseNorWrite()
69 { 60 {
70 61 GBA_BUS[0x0FF0000] = 0xD200;
71 GBA_BUS[0x0FF0000] = 0xD200; 62 GBA_BUS[0x0000000] = 0x1500;
72 63 GBA_BUS[0x0010000] = 0xD200;
73 GBA_BUS[0x0000000] = 0x1500; 64 GBA_BUS[0x0020000] = 0x1500;
74 65 GBA_BUS[0x0E20000] = 0xD200;
75 GBA_BUS[0x0010000] = 0xD200; 66 GBA_BUS[0x0FE0000] = 0x1500;
76
77 GBA_BUS[0x0020000] = 0x1500;
78
79 GBA_BUS[0x0E20000] = 0xD200;
80
81 GBA_BUS[0x0FE0000] = 0x1500;
82
83 } 67 }
84 68
85 void 69 void
86 NDS_EZF_ChipReset() 70 NDS_EZF_ChipReset()
87 { 71 {
88 72 GBA_BUS[0x0000] = 0x00F0;
89 GBA_BUS[0x0000] = 0x00F0; 73 GBA_BUS[0x1000] = 0x00F0;
90 74 } uint32 NDS_EZF_IsPresent()
91 GBA_BUS[0x1000] = 0x00F0; 75 {
92 } 76 vuint16 id1, id2;
93 uint32 NDS_EZF_IsPresent()
94 {
95
96 vuint16 id1, id2;
97 77
98 NDS_EZF_OpenNorWrite(); 78 NDS_EZF_OpenNorWrite();
99 79
100 GBA_BUS[0x0555] = 0x00AA; 80 GBA_BUS[0x0555] = 0x00AA;
101 GBA_BUS[0x02AA] = 0x0055; 81 GBA_BUS[0x02AA] = 0x0055;
102 GBA_BUS[0x0555] = 0x0090; 82 GBA_BUS[0x0555] = 0x0090;
103 GBA_BUS[0x1555] = 0x00AA; 83 GBA_BUS[0x1555] = 0x00AA;
104 GBA_BUS[0x12AA] = 0x0055; 84 GBA_BUS[0x12AA] = 0x0055;
105 GBA_BUS[0x1555] = 0x0090; 85 GBA_BUS[0x1555] = 0x0090;
106 86 id1 = GBA_BUS[0x0001];
107 id1 = GBA_BUS[0x0001]; 87 id2 = GBA_BUS[0x1001];
108 88 if ((id1 != 0x227E) || (id2 != 0x227E)) {
109 id2 = GBA_BUS[0x1001];
110
111 if ((id1 != 0x227E) || (id2 != 0x227E)) {
112 NDS_EZF_CloseNorWrite(); 89 NDS_EZF_CloseNorWrite();
113 90 return 0;
114 return 0; 91 }
115 } 92 id1 = GBA_BUS[0x000E];
116 93 id2 = GBA_BUS[0x100E];
117
118 id1 = GBA_BUS[0x000E];
119
120 id2 = GBA_BUS[0x100E];
121 94
122 NDS_EZF_CloseNorWrite(); 95 NDS_EZF_CloseNorWrite();
123 96 if (id1 == 0x2218 && id2 == 0x2218) {
124 if (id1 == 0x2218 && id2 == 0x2218) { 97 return 1;
125 98 }
126 return 1; 99 return 0;
127 } 100 }
128
129 return 0;
130
131 }
132
133 void 101 void
134 NDS_EZF_SetShake(u8 pos) 102 NDS_EZF_SetShake(u8 pos)
135 { 103 {
136 u16 data = ((pos % 3) | 0x00F0); 104 u16 data = ((pos % 3) | 0x00F0);
137 105 GBA_BUS[0x0FF0000] = 0xD200;
138 GBA_BUS[0x0FF0000] = 0xD200; 106 GBA_BUS[0x0000000] = 0x1500;
139 107 GBA_BUS[0x0010000] = 0xD200;
140 GBA_BUS[0x0000000] = 0x1500; 108 GBA_BUS[0x0020000] = 0x1500;
141 109 GBA_BUS[0x0F10000] = data;
142 GBA_BUS[0x0010000] = 0xD200; 110 GBA_BUS[0x0FE0000] = 0x1500;
143
144 GBA_BUS[0x0020000] = 0x1500;
145
146 GBA_BUS[0x0F10000] = data;
147
148 GBA_BUS[0x0FE0000] = 0x1500;
149 111
150 GBA_BUS[0] = 0x0000; /* write any value for vibration. */ 112 GBA_BUS[0] = 0x0000; /* write any value for vibration. */
151 GBA_BUS[0] = 0x0002; 113 GBA_BUS[0] = 0x0002;
152
153 } 114 }
154 115
155 static int 116 static int
156 SDL_SYS_LogicError(void) 117 SDL_SYS_LogicError(void)
157 { 118 {