Skip to content

Instantly share code, notes, and snippets.

@PIlin
Created November 26, 2012 19:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PIlin/4150247 to your computer and use it in GitHub Desktop.
Save PIlin/4150247 to your computer and use it in GitHub Desktop.
nxengine double-uchar bug
--- /Users/pavel/tmp/release.asm
+++ /Users/pavel/tmp/release_vol.asm
@@ -37,28 +37,31 @@
Lfunc_begin0:
.loc 1 34 0 @ /Users/pavel/code/NXEngine-iOS/iOS/CaveStory/../../sound/pxt.cpp:34:0
@ BB#0:
+ .loc 1 33 28 prologue_end @ /Users/pavel/code/NXEngine-iOS/iOS/CaveStory/../../sound/pxt.cpp:33:28
+ sub sp, #4
@DEBUG_VALUE: GETWAVEBYTE:wave <- R0+0
@DEBUG_VALUE: GETWAVEBYTE:out <- R1+0
- .loc 1 35 5 prologue_end @ /Users/pavel/code/NXEngine-iOS/iOS/CaveStory/../../sound/pxt.cpp:35:5
+ .loc 1 35 5 @ /Users/pavel/code/NXEngine-iOS/iOS/CaveStory/../../sound/pxt.cpp:35:5
+Ltmp0:
ldrb r2, [r0, #4]
cmp r2, #6
beq LBB0_2
@ BB#1:
@DEBUG_VALUE: GETWAVEBYTE:wave <- R0+0
@DEBUG_VALUE: GETWAVEBYTE:out <- R1+0
- .loc 1 37 73 @ /Users/pavel/code/NXEngine-iOS/iOS/CaveStory/../../sound/pxt.cpp:37:73
-Ltmp0:
+ .loc 1 37 69 @ /Users/pavel/code/NXEngine-iOS/iOS/CaveStory/../../sound/pxt.cpp:37:69
+Ltmp1:
vldr d16, [r0, #8]
- .loc 1 38 9 @ /Users/pavel/code/NXEngine-iOS/iOS/CaveStory/../../sound/pxt.cpp:38:9
- ldr r3, [r0]
- .loc 1 37 73 @ /Users/pavel/code/NXEngine-iOS/iOS/CaveStory/../../sound/pxt.cpp:37:73
vcvt.s32.f64 s0, d16
vmov r2, s0
+ strb.w r2, [sp]
.loc 1 38 9 @ /Users/pavel/code/NXEngine-iOS/iOS/CaveStory/../../sound/pxt.cpp:38:9
+ ldrb.w r2, [sp]
+ ldr r3, [r0]
ldrsb r2, [r3, r2]
str r2, [r1]
b LBB0_3
-Ltmp1:
+Ltmp2:
LBB0_2:
@DEBUG_VALUE: GETWAVEBYTE:wave <- R0+0
@DEBUG_VALUE: GETWAVEBYTE:out <- R1+0
@@ -82,13 +85,13 @@
movge r2, #0
.loc 1 43 45 @ /Users/pavel/code/NXEngine-iOS/iOS/CaveStory/../../sound/pxt.cpp:43:45
strge r2, [r0, #36]
-Ltmp2:
+Ltmp3:
LBB0_3: @ %._crit_edge
@DEBUG_VALUE: GETWAVEBYTE:wave <- R0+0
@DEBUG_VALUE: GETWAVEBYTE:out <- R1+0
.loc 1 45 5 @ /Users/pavel/code/NXEngine-iOS/iOS/CaveStory/../../sound/pxt.cpp:45:5
ldrb.w r0, [r0, #32]
-Ltmp3:
+Ltmp4:
ldr r2, [r1]
muls r0, r2, r0
.loc 1 46 5 @ /Users/pavel/code/NXEngine-iOS/iOS/CaveStory/../../sound/pxt.cpp:46:5
@@ -97,8 +100,8 @@
asrs r0, r0, #6
str r0, [r1]
.loc 1 47 1 @ /Users/pavel/code/NXEngine-iOS/iOS/CaveStory/../../sound/pxt.cpp:47:1
+ add sp, #4
bx lr
-Ltmp4:
+Ltmp5:
Lfunc_end0:
- .cfi_endproc
- + .cfi_endproc
.section __TEXT,__text,regular,pure_instructions
.section __TEXT,__textcoal_nt,coalesced,pure_instructions
.section __TEXT,__const_coal,coalesced
.section __TEXT,__picsymbolstub4,symbol_stubs,none,16
.section __TEXT,__StaticInit,regular,pure_instructions
.syntax unified
.file 1 "/Users/pavel/code/NXEngine-iOS/iOS/CaveStory/../../sound/pxt.cpp"
.file 2 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFByteOrder.h"
.file 3 "/Users/pavel/code/NXEngine-iOS/iOS/CaveStory/../../sound/pxt.h"
.section __DWARF,__debug_info,regular,debug
Lsection_info:
.section __DWARF,__debug_abbrev,regular,debug
Lsection_abbrev:
.section __DWARF,__debug_aranges,regular,debug
.section __DWARF,__debug_macinfo,regular,debug
.section __DWARF,__debug_line,regular,debug
Lsection_line:
.section __DWARF,__debug_loc,regular,debug
.section __DWARF,__debug_pubtypes,regular,debug
.section __DWARF,__debug_str,regular,debug
Lsection_str:
.section __DWARF,__debug_ranges,regular,debug
Ldebug_range:
.section __DWARF,__debug_loc,regular,debug
Lsection_debug_loc:
.section __TEXT,__text,regular,pure_instructions
Ltext_begin:
.section __DATA,__data
.section __TEXT,__text,regular,pure_instructions
.private_extern __Z11GETWAVEBYTEP8stPXWaveRi
.globl __Z11GETWAVEBYTEP8stPXWaveRi
.align 2
.code 16 @ @_Z11GETWAVEBYTEP8stPXWaveRi
.thumb_func __Z11GETWAVEBYTEP8stPXWaveRi
__Z11GETWAVEBYTEP8stPXWaveRi:
.cfi_startproc
Lfunc_begin0:
.loc 1 34 0 @ /Users/pavel/code/NXEngine-iOS/iOS/CaveStory/../../sound/pxt.cpp:34:0
@ BB#0:
.loc 1 33 28 prologue_end @ /Users/pavel/code/NXEngine-iOS/iOS/CaveStory/../../sound/pxt.cpp:33:28
sub sp, #4
@DEBUG_VALUE: GETWAVEBYTE:wave <- R0+0
@DEBUG_VALUE: GETWAVEBYTE:out <- R1+0
.loc 1 35 5 @ /Users/pavel/code/NXEngine-iOS/iOS/CaveStory/../../sound/pxt.cpp:35:5
Ltmp0:
ldrb r2, [r0, #4]
cmp r2, #6
beq LBB0_2
@ BB#1:
@DEBUG_VALUE: GETWAVEBYTE:wave <- R0+0
@DEBUG_VALUE: GETWAVEBYTE:out <- R1+0
.loc 1 37 69 @ /Users/pavel/code/NXEngine-iOS/iOS/CaveStory/../../sound/pxt.cpp:37:69
Ltmp1:
vldr d16, [r0, #8]
vcvt.s32.f64 s0, d16
vmov r2, s0
strb.w r2, [sp]
.loc 1 38 9 @ /Users/pavel/code/NXEngine-iOS/iOS/CaveStory/../../sound/pxt.cpp:38:9
ldrb.w r2, [sp]
ldr r3, [r0]
ldrsb r2, [r3, r2]
str r2, [r1]
b LBB0_3
Ltmp2:
LBB0_2:
@DEBUG_VALUE: GETWAVEBYTE:wave <- R0+0
@DEBUG_VALUE: GETWAVEBYTE:out <- R1+0
.loc 1 42 9 @ /Users/pavel/code/NXEngine-iOS/iOS/CaveStory/../../sound/pxt.cpp:42:9
movw r2, :lower16:(_white-(LPC0_0+4))
movt r2, :upper16:(_white-(LPC0_0+4))
ldr r3, [r0, #36]
LPC0_0:
add r2, pc
ldrsb r2, [r2, r3]
movw r3, #22050
str r2, [r1]
.loc 1 43 9 @ /Users/pavel/code/NXEngine-iOS/iOS/CaveStory/../../sound/pxt.cpp:43:9
ldr r2, [r0, #36]
adds r2, #1
str r2, [r0, #36]
cmp r2, r3
@DEBUG_VALUE: GETWAVEBYTE:wave <- R0+0
@DEBUG_VALUE: GETWAVEBYTE:out <- R1+0
itt ge
movge r2, #0
.loc 1 43 45 @ /Users/pavel/code/NXEngine-iOS/iOS/CaveStory/../../sound/pxt.cpp:43:45
strge r2, [r0, #36]
Ltmp3:
LBB0_3: @ %._crit_edge
@DEBUG_VALUE: GETWAVEBYTE:wave <- R0+0
@DEBUG_VALUE: GETWAVEBYTE:out <- R1+0
.loc 1 45 5 @ /Users/pavel/code/NXEngine-iOS/iOS/CaveStory/../../sound/pxt.cpp:45:5
ldrb.w r0, [r0, #32]
Ltmp4:
ldr r2, [r1]
muls r0, r2, r0
.loc 1 46 5 @ /Users/pavel/code/NXEngine-iOS/iOS/CaveStory/../../sound/pxt.cpp:46:5
asrs r2, r0, #31
add.w r0, r0, r2, lsr #26
asrs r0, r0, #6
str r0, [r1]
.loc 1 47 1 @ /Users/pavel/code/NXEngine-iOS/iOS/CaveStory/../../sound/pxt.cpp:47:1
add sp, #4
bx lr
Ltmp5:
Lfunc_end0:
.cfi_endproc
.section __TEXT,__text,regular,pure_instructions
.section __TEXT,__textcoal_nt,coalesced,pure_instructions
.section __TEXT,__const_coal,coalesced
.section __TEXT,__picsymbolstub4,symbol_stubs,none,16
.section __TEXT,__StaticInit,regular,pure_instructions
.syntax unified
.file 1 "/Users/pavel/code/NXEngine-iOS/iOS/CaveStory/../../sound/pxt.cpp"
.file 2 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFByteOrder.h"
.file 3 "/Users/pavel/code/NXEngine-iOS/iOS/CaveStory/../../sound/pxt.h"
.section __DWARF,__debug_info,regular,debug
Lsection_info:
.section __DWARF,__debug_abbrev,regular,debug
Lsection_abbrev:
.section __DWARF,__debug_aranges,regular,debug
.section __DWARF,__debug_macinfo,regular,debug
.section __DWARF,__debug_line,regular,debug
Lsection_line:
.section __DWARF,__debug_loc,regular,debug
.section __DWARF,__debug_pubtypes,regular,debug
.section __DWARF,__debug_str,regular,debug
Lsection_str:
.section __DWARF,__debug_ranges,regular,debug
Ldebug_range:
.section __DWARF,__debug_loc,regular,debug
Lsection_debug_loc:
.section __TEXT,__text,regular,pure_instructions
Ltext_begin:
.section __DATA,__data
.section __TEXT,__text,regular,pure_instructions
.private_extern __Z11GETWAVEBYTEP8stPXWaveRi
.globl __Z11GETWAVEBYTEP8stPXWaveRi
.align 2
.code 16 @ @_Z11GETWAVEBYTEP8stPXWaveRi
.thumb_func __Z11GETWAVEBYTEP8stPXWaveRi
__Z11GETWAVEBYTEP8stPXWaveRi:
.cfi_startproc
Lfunc_begin0:
.loc 1 34 0 @ /Users/pavel/code/NXEngine-iOS/iOS/CaveStory/../../sound/pxt.cpp:34:0
@ BB#0:
@DEBUG_VALUE: GETWAVEBYTE:wave <- R0+0
@DEBUG_VALUE: GETWAVEBYTE:out <- R1+0
.loc 1 35 5 prologue_end @ /Users/pavel/code/NXEngine-iOS/iOS/CaveStory/../../sound/pxt.cpp:35:5
ldrb r2, [r0, #4]
cmp r2, #6
beq LBB0_2
@ BB#1:
@DEBUG_VALUE: GETWAVEBYTE:wave <- R0+0
@DEBUG_VALUE: GETWAVEBYTE:out <- R1+0
.loc 1 37 73 @ /Users/pavel/code/NXEngine-iOS/iOS/CaveStory/../../sound/pxt.cpp:37:73
Ltmp0:
vldr d16, [r0, #8]
.loc 1 38 9 @ /Users/pavel/code/NXEngine-iOS/iOS/CaveStory/../../sound/pxt.cpp:38:9
ldr r3, [r0]
.loc 1 37 73 @ /Users/pavel/code/NXEngine-iOS/iOS/CaveStory/../../sound/pxt.cpp:37:73
vcvt.s32.f64 s0, d16
vmov r2, s0
.loc 1 38 9 @ /Users/pavel/code/NXEngine-iOS/iOS/CaveStory/../../sound/pxt.cpp:38:9
ldrsb r2, [r3, r2]
str r2, [r1]
b LBB0_3
Ltmp1:
LBB0_2:
@DEBUG_VALUE: GETWAVEBYTE:wave <- R0+0
@DEBUG_VALUE: GETWAVEBYTE:out <- R1+0
.loc 1 42 9 @ /Users/pavel/code/NXEngine-iOS/iOS/CaveStory/../../sound/pxt.cpp:42:9
movw r2, :lower16:(_white-(LPC0_0+4))
movt r2, :upper16:(_white-(LPC0_0+4))
ldr r3, [r0, #36]
LPC0_0:
add r2, pc
ldrsb r2, [r2, r3]
movw r3, #22050
str r2, [r1]
.loc 1 43 9 @ /Users/pavel/code/NXEngine-iOS/iOS/CaveStory/../../sound/pxt.cpp:43:9
ldr r2, [r0, #36]
adds r2, #1
str r2, [r0, #36]
cmp r2, r3
@DEBUG_VALUE: GETWAVEBYTE:wave <- R0+0
@DEBUG_VALUE: GETWAVEBYTE:out <- R1+0
itt ge
movge r2, #0
.loc 1 43 45 @ /Users/pavel/code/NXEngine-iOS/iOS/CaveStory/../../sound/pxt.cpp:43:45
strge r2, [r0, #36]
Ltmp2:
LBB0_3: @ %._crit_edge
@DEBUG_VALUE: GETWAVEBYTE:wave <- R0+0
@DEBUG_VALUE: GETWAVEBYTE:out <- R1+0
.loc 1 45 5 @ /Users/pavel/code/NXEngine-iOS/iOS/CaveStory/../../sound/pxt.cpp:45:5
ldrb.w r0, [r0, #32]
Ltmp3:
ldr r2, [r1]
muls r0, r2, r0
.loc 1 46 5 @ /Users/pavel/code/NXEngine-iOS/iOS/CaveStory/../../sound/pxt.cpp:46:5
asrs r2, r0, #31
add.w r0, r0, r2, lsr #26
asrs r0, r0, #6
str r0, [r1]
.loc 1 47 1 @ /Users/pavel/code/NXEngine-iOS/iOS/CaveStory/../../sound/pxt.cpp:47:1
bx lr
Ltmp4:
Lfunc_end0:
.cfi_endproc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment