Browse Source

changed compiler optimization, fixed debug

SBird1337 7 years ago
parent
commit
8be8a3160a
2 changed files with 20 additions and 12 deletions
  1. 1
    1
      makefile
  2. 19
    11
      src/agb_debug/agb_debug.c

+ 1
- 1
makefile View File

14
 
14
 
15
 DEFINES   := -DBPRE -DSOFTWARE_VERSION=0
15
 DEFINES   := -DBPRE -DSOFTWARE_VERSION=0
16
 ASFLAGS   := -mthumb
16
 ASFLAGS   := -mthumb
17
-CFLAGS    := -mthumb -mthumb-interwork -g -mcpu=arm7tdmi -fno-inline -mlong-calls -march=armv4t -O3 -std=c99 -Wall -Wextra -Wunreachable-code -Isrc/include $(DEFINES)
17
+CFLAGS    := -mthumb -mthumb-interwork -g -mcpu=arm7tdmi -fno-inline -mlong-calls -march=armv4t -O0 -std=c99 -Wall -Wextra -Wunreachable-code -Isrc/include $(DEFINES)
18
 GRITFLAGS := -ftc -fa
18
 GRITFLAGS := -ftc -fa
19
 LDFLAGS   := -z muldefs
19
 LDFLAGS   := -z muldefs
20
 BLDPATH   := object
20
 BLDPATH   := object

+ 19
- 11
src/agb_debug/agb_debug.c View File

34
 {
34
 {
35
     __asm__ __volatile__(
35
     __asm__ __volatile__(
36
         "mov r2, %0\n"
36
         "mov r2, %0\n"
37
-        "ldr r0, =0xc0ded00d\n"
37
+        "mov r0, #0xC0\n"
38
+        "lsl r0, #0x8\n"
39
+        "mov r1, #0xDE\n"
40
+        "orr r0, r1\n"
41
+        "lsl r0, #0x8\n"
42
+        "mov r1, #0xD0\n"
43
+        "orr r0, r1\n"
44
+        "lsl r0, #8\n"
45
+        "mov r1, #0x0D\n"
46
+        "orr r0, r1\n"
38
         "mov r1, #0\n"
47
         "mov r1, #0\n"
39
         "and r0, r0, r0\n":
48
         "and r0, r0, r0\n":
40
         :
49
         :
155
 }
164
 }
156
 
165
 
157
 void dprintf(const char * str, ...)
166
 void dprintf(const char * str, ...)
158
-    //---------------------------------------------------------------------------------
159
-    {
160
-        char* __outstr = malloc(256);
161
-        va_list args;
162
-        va_start(args, str);
163
-        mini_vsnprintf(__outstr, 256, str, args);
164
-        va_end(args);
165
-        dprint(__outstr);
166
-        free(__outstr);
167
-    }
167
+{
168
+    char* __outstr = malloc(256);
169
+    va_list args;
170
+    va_start(args, str);
171
+    mini_vsnprintf(__outstr, 256, str, args);
172
+    va_end(args);
173
+    dprint(__outstr);
174
+    free(__outstr);
175
+}