1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-12-26 14:46:16 +00:00

Update asm processor and migrate/improve rodata for a few files (#209)

* Update asm processor

* Migrate or improve rodata for a few files
This commit is contained in:
Roman971 2020-06-15 01:24:09 +02:00 committed by GitHub
parent 1c98ac27eb
commit 229e0c8629
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
37 changed files with 964 additions and 870 deletions

View file

@ -4956,7 +4956,6 @@ glabel L800E569C
/* B5C83C 800E569C 8E090004 */ lw $t1, 4($s0) /* B5C83C 800E569C 8E090004 */ lw $t1, 4($s0)
/* B5C840 800E56A0 3C078017 */ lui $a3, %hi(gAudioContext) # $a3, 0x8017 /* B5C840 800E56A0 3C078017 */ lui $a3, %hi(gAudioContext) # $a3, 0x8017
/* B5C844 800E56A4 24E7F180 */ addiu $a3, %lo(gAudioContext) # addiu $a3, $a3, -0xe80 /* B5C844 800E56A4 24E7F180 */ addiu $a3, %lo(gAudioContext) # addiu $a3, $a3, -0xe80
glabel L00E5944
/* B5C848 800E56A8 100000A6 */ b .L800E5944 /* B5C848 800E56A8 100000A6 */ b .L800E5944
/* B5C84C 800E56AC A0E9289A */ sb $t1, 0x289a($a3) /* B5C84C 800E56AC A0E9289A */ sb $t1, 0x289a($a3)
glabel L800E56B0 glabel L800E56B0

View file

@ -1,4 +1,3 @@
.rdata .rdata
glabel D_80147E58 glabel D_80147E58
.asciz "%08x:" .asciz "%08x:"
@ -49,7 +48,7 @@ glabel D_80147F5C
.balign 4 .balign 4
glabel D_80147F90 glabel D_80147F90
.asciz "\x23\x23\x23 TileSync\n" .asciz "### TileSync\n"
# EUC-JP: | Is required. # EUC-JP: | Is required.
.balign 4 .balign 4
@ -62,7 +61,7 @@ glabel D_80147FCC
.balign 4 .balign 4
glabel D_80147FEC glabel D_80147FEC
.asciz "\x23\x23\x23 LoadSync\n" .asciz "### LoadSync\n"
# EUC-JP: | Is required. # EUC-JP: | Is required.
.balign 4 .balign 4
@ -79,6 +78,6 @@ glabel D_80148044
.balign 4 .balign 4
glabel D_8014808C glabel D_8014808C
.asciz "\x23\x23\x23 PipeSync\n" .asciz "### PipeSync\n"
# EUC-JP: | Is required. # EUC-JP: | Is required.
.balign 4 .balign 4

View file

@ -1,4 +1,3 @@
.rdata .rdata
glabel D_80148374 glabel D_80148374
.asciz "gsDP%s(%s)," .asciz "gsDP%s(%s),"
@ -9,6 +8,6 @@ glabel D_80148380
.balign 4 .balign 4
glabel D_801483A4 glabel D_801483A4
.asciz "\x23\x23\x23 PipeSync\n" .asciz "### PipeSync\n"
# EUC-JP: | Is required. # EUC-JP: | Is required.
.balign 4 .balign 4

View file

@ -18,7 +18,7 @@ glabel D_8014845C
.balign 4 .balign 4
glabel D_80148480 glabel D_80148480
.asciz "\x23\x23\x23 PipeSync\n" .asciz "### PipeSync\n"
# EUC-JP: | Is required. # EUC-JP: | Is required.
.balign 4 .balign 4
@ -27,7 +27,7 @@ glabel D_8014849C
.balign 4 .balign 4
glabel D_801484C0 glabel D_801484C0
.asciz "\x23\x23\x23 PipeSync\n" .asciz "### PipeSync\n"
# EUC-JP: | Is required. # EUC-JP: | Is required.
.balign 4 .balign 4
@ -99,7 +99,7 @@ glabel D_801485F4
.balign 4 .balign 4
glabel D_801485F8 glabel D_801485F8
.asciz "\x23\x23\x23 PipeSync\n" .asciz "### PipeSync\n"
# EUC-JP: | Is required. # EUC-JP: | Is required.
.balign 4 .balign 4
@ -108,7 +108,7 @@ glabel D_80148614
.balign 4 .balign 4
glabel D_80148638 glabel D_80148638
.asciz "\x23\x23\x23 PipeSync\n" .asciz "### PipeSync\n"
# EUC-JP: | Is required. # EUC-JP: | Is required.
.balign 4 .balign 4
@ -157,7 +157,7 @@ glabel D_801486C0
.balign 4 .balign 4
glabel D_801486E4 glabel D_801486E4
.asciz "\x23\x23\x23 PipeSync\n" .asciz "### PipeSync\n"
# EUC-JP: | Is required. # EUC-JP: | Is required.
.balign 4 .balign 4
@ -166,7 +166,7 @@ glabel D_80148700
.balign 4 .balign 4
glabel D_80148724 glabel D_80148724
.asciz "\x23\x23\x23 PipeSync\n" .asciz "### PipeSync\n"
# EUC-JP: | Is required. # EUC-JP: | Is required.
.balign 4 .balign 4
@ -175,7 +175,7 @@ glabel D_80148740
.balign 4 .balign 4
glabel D_80148764 glabel D_80148764
.asciz "\x23\x23\x23 PipeSync\n" .asciz "### PipeSync\n"
# EUC-JP: | Is required. # EUC-JP: | Is required.
.balign 4 .balign 4
@ -184,7 +184,7 @@ glabel D_80148780
.balign 4 .balign 4
glabel D_8014879C glabel D_8014879C
.asciz "\x23\x23\x23 PipeSync\n" .asciz "### PipeSync\n"
# EUC-JP: | Is required. # EUC-JP: | Is required.
.balign 4 .balign 4
@ -193,7 +193,7 @@ glabel D_801487B8
.balign 4 .balign 4
glabel D_801487D4 glabel D_801487D4
.asciz "\x23\x23\x23 PipeSync\n" .asciz "### PipeSync\n"
# EUC-JP: | Is required. # EUC-JP: | Is required.
.balign 4 .balign 4
@ -206,7 +206,7 @@ glabel D_8014881C
.balign 4 .balign 4
glabel D_8014882C glabel D_8014882C
.asciz "\x23\x23\x23 PipeSync\n" .asciz "### PipeSync\n"
# EUC-JP: | Is required. # EUC-JP: | Is required.
.balign 4 .balign 4
@ -450,7 +450,7 @@ glabel D_80148EA8
.balign 4 .balign 4
glabel D_80148EC8 glabel D_80148EC8
.asciz " \x23 vscale=[%d %d %d %d], " .asciz " # vscale=[%d %d %d %d], "
.balign 4 .balign 4
glabel D_80148EE4 glabel D_80148EE4

View file

@ -1,3 +1,18 @@
.rdata
glabel D_8013C240
.asciz "\x1b[43;30m\n\nフィールド常駐以外、太陽設定よって強制解除\n\x1b[m"
# EUC-JP: | "Sun setting except field resident! So forced release!"?
.balign 4
.late_rodata
glabel jtbl_8013C790
.word L8006F4A8
.word L8006F4CC
.word L8006F4CC
.word L8006F4CC
.word L8006F4F0
.text
glabel func_8006F140 glabel func_8006F140
/* AE62E0 8006F140 3C088016 */ lui $t0, %hi(gSaveContext) # $t0, 0x8016 /* AE62E0 8006F140 3C088016 */ lui $t0, %hi(gSaveContext) # $t0, 0x8016
/* AE62E4 8006F144 2508E660 */ addiu $t0, %lo(gSaveContext) # addiu $t0, $t0, -0x19a0 /* AE62E4 8006F144 2508E660 */ addiu $t0, %lo(gSaveContext) # addiu $t0, $t0, -0x19a0

View file

@ -1,3 +1,14 @@
.rdata
glabel D_8013C280
.asciz "\x1b[41;37m\nend_frameとstart_frameのフレーム関係がおかしい!!!\x1b[m"
# EUC-JP: start_frame!!! | The frame relation between end_frame and start_frame is wrong
.balign 4
glabel D_8013C2C0
.asciz "\x1b[41;37m\nby get_parcent_forAccelBrake!!!!!!!!!\x1b[m"
.balign 4
.text
glabel func_8006F9BC glabel func_8006F9BC
/* AE6B5C 8006F9BC 27BDFFC0 */ addiu $sp, $sp, -0x40 /* AE6B5C 8006F9BC 27BDFFC0 */ addiu $sp, $sp, -0x40
/* AE6B60 8006F9C0 30A3FFFF */ andi $v1, $a1, 0xffff /* AE6B60 8006F9C0 30A3FFFF */ andi $v1, $a1, 0xffff

View file

@ -1,3 +1,34 @@
.rdata
glabel D_8013C2F4
.asciz "\x1b[41;37m\n環境データ取得失敗 ささきまでご報告を!\x1b[m"
# EUC-JP: | Environment VR data acquisition failed! Report to Sasaki!
.balign 4
glabel D_8013C330
.asciz "../z_kankyo.c"
.balign 4
glabel D_8013C340
.asciz "../z_kankyo.c"
.balign 4
glabel D_8013C350
.asciz "../z_kankyo.c"
.balign 4
glabel D_8013C360
.asciz "../z_kankyo.c"
.balign 4
glabel D_8013C370
.asciz "../z_kankyo.c"
.balign 4
glabel D_8013C380
.asciz "../z_kankyo.c"
.balign 4
.text
glabel func_8006FC88 glabel func_8006FC88
/* AE6E28 8006FC88 27BDFFA0 */ addiu $sp, $sp, -0x60 /* AE6E28 8006FC88 27BDFFA0 */ addiu $sp, $sp, -0x60
/* AE6E2C 8006FC8C AFB00030 */ sw $s0, 0x30($sp) /* AE6E2C 8006FC8C AFB00030 */ sw $s0, 0x30($sp)

View file

@ -1,3 +1,10 @@
.rdata
glabel D_8013C390
.asciz "\x1b[43;30m\n水ポリゴンデータに水中カラーが設定されておりません!\x1b[m"
# EUC-JP: | Underwater color is not set in the water poly data
.balign 4
.text
glabel func_80070600 glabel func_80070600
/* AE77A0 80070600 27BDFFE8 */ addiu $sp, $sp, -0x18 /* AE77A0 80070600 27BDFFE8 */ addiu $sp, $sp, -0x18
/* AE77A4 80070604 2401001F */ li $at, 31 /* AE77A4 80070604 2401001F */ li $at, 31

View file

@ -1,3 +1,93 @@
.rdata
glabel D_8013C3D0
.asciz "T%03d "
.balign 4
glabel D_8013C3D8
.asciz "E%03d"
.balign 4
glabel D_8013C3E0
.asciz "%s"
.balign 4
glabel D_8013C3E4
.asciz "ZELDATIME "
.balign 4
glabel D_8013C3F0
.asciz "%02d"
.balign 4
glabel D_8013C3F8
.asciz "%s"
.balign 4
glabel D_8013C3FC
.asciz ":"
.balign 4
glabel D_8013C400
.asciz "%s"
.balign 4
glabel D_8013C404
.asciz " "
.balign 4
glabel D_8013C408
.asciz "%02d"
.balign 4
glabel D_8013C410
.asciz "%s"
.balign 4
glabel D_8013C414
.asciz "VRBOXTIME "
.balign 4
glabel D_8013C420
.asciz "%02d"
.balign 4
glabel D_8013C428
.asciz "%s"
.balign 4
glabel D_8013C42C
.asciz ":"
.balign 4
glabel D_8013C430
.asciz "%s"
.balign 4
glabel D_8013C434
.asciz " "
.balign 4
glabel D_8013C438
.asciz "%02d"
.balign 4
glabel D_8013C440
.asciz "%s"
.balign 4
glabel D_8013C444
.asciz "YORU"
.balign 4
glabel D_8013C44C
.asciz "%s"
.balign 4
glabel D_8013C450
.asciz "HIRU"
.balign 4
.text
glabel func_80070718 glabel func_80070718
/* AE78B8 80070718 27BDFF98 */ addiu $sp, $sp, -0x68 /* AE78B8 80070718 27BDFF98 */ addiu $sp, $sp, -0x68
/* AE78BC 8007071C AFB00020 */ sw $s0, 0x20($sp) /* AE78BC 8007071C AFB00020 */ sw $s0, 0x20($sp)

View file

@ -1,3 +1,44 @@
.rdata
glabel D_8013C458
.asciz "\nnext_zelda_time=[%x]"
.balign 4
glabel D_8013C470
.asciz "../z_kankyo.c"
.balign 4
glabel D_8013C480
.asciz "../z_kankyo.c"
.balign 4
glabel D_8013C490
.asciz "\x1b[41;37m\nカラーパレットの設定がおかしいようです\x1b[m"
# EUC-JP: | The color palette settings seem to be wrong!
.balign 4
glabel D_8013C4C8
.asciz "\x1b[41;37m\n設定パレット[%d] 最後パレット番号=[%d]\n\x1b[m"
# EUC-JP: [%d] | Set pallet = [% d] Last pallet number =
.balign 4
glabel D_8013C500
.asciz "\n\x1b[31m"
# EUC-JP: | The color palette seems strange!
.balign 4
glabel D_8013C52C
.asciz "\n\x1b[33m[%d] [%d]\n\x1b[m"
# EUC-JP: [%d] [%d] | Set pallet = [% d] Number of pallets = [% d]
.balign 4
.late_rodata
glabel D_8013C7A4
.float 0.001
glabel D_8013C7A8
.float 0.005
.text
glabel func_80070C24 glabel func_80070C24
/* AE7DC4 80070C24 27BDFF70 */ addiu $sp, $sp, -0x90 /* AE7DC4 80070C24 27BDFF70 */ addiu $sp, $sp, -0x90
/* AE7DC8 80070C28 3C0D8016 */ lui $t5, %hi(gSaveContext) # $t5, 0x8016 /* AE7DC8 80070C28 3C0D8016 */ lui $t5, %hi(gSaveContext) # $t5, 0x8016

View file

@ -1,3 +1,31 @@
.rdata
glabel D_8013C55C
.asciz "../z_kankyo.c"
.balign 4
glabel D_8013C56C
.asciz "../z_kankyo.c"
.balign 4
glabel D_8013C57C
.asciz "../z_kankyo.c"
.balign 4
glabel D_8013C58C
.asciz "../z_kankyo.c"
.balign 4
.late_rodata
glabel D_8013C7AC
.float 0.8
glabel D_8013C7B0
.float 0.8
glabel D_8013C7B4
.float 0.8
.text
glabel func_800730DC glabel func_800730DC
/* AEA27C 800730DC 27BDFF78 */ addiu $sp, $sp, -0x88 /* AEA27C 800730DC 27BDFF78 */ addiu $sp, $sp, -0x88
/* AEA280 800730E0 AFBF0024 */ sw $ra, 0x24($sp) /* AEA280 800730E0 AFBF0024 */ sw $ra, 0x24($sp)

View file

@ -1,3 +1,40 @@
.rdata
glabel D_8013C59C
.asciz "../z_kankyo.c"
.balign 4
glabel D_8013C5AC
.asciz "../z_kankyo.c"
.balign 4
glabel D_8013C5BC
.asciz "../z_kankyo.c"
.balign 4
.late_rodata
glabel D_8013C7B8
.float 630
.word 0 # forced padding
glabel D_8013C7C0
.double 0.001
glabel D_8013C7C8
.float 1.0E-4
glabel D_8013C7CC
.float 0.001
glabel D_8013C7D0
.float 0.001
glabel D_8013C7D4
.float 0.1
glabel D_8013C7D8
.float 0.1
.text
glabel func_80073A5C glabel func_80073A5C
/* AEABFC 80073A5C 27BDFE50 */ addiu $sp, $sp, -0x1b0 /* AEABFC 80073A5C 27BDFE50 */ addiu $sp, $sp, -0x1b0
/* AEAC00 80073A60 3C0B8012 */ lui $t3, %hi(D_8011FE00) # $t3, 0x8012 /* AEAC00 80073A60 3C0B8012 */ lui $t3, %hi(D_8011FE00) # $t3, 0x8012

View file

@ -1,3 +1,40 @@
.rdata
glabel D_8013C5CC
.asciz "../z_kankyo.c"
.balign 4
glabel D_8013C5DC
.asciz "../z_kankyo.c"
.balign 4
glabel D_8013C5EC
.asciz "../z_kankyo.c"
.balign 4
glabel D_8013C5FC
.asciz "../z_kankyo.c"
.balign 4
.late_rodata
glabel D_8013C7DC
.float 0.4
glabel D_8013C7E0
.float 0.7
glabel D_8013C7E4
.float 1.5707964 # M_PI / 2
glabel D_8013C7E8
.float 1.2
glabel D_8013C7EC
.float 0.1
glabel D_8013C7F0
.float 0.02
.text
glabel func_80074704 glabel func_80074704
/* AEB8A4 80074704 27BDFED8 */ addiu $sp, $sp, -0x128 /* AEB8A4 80074704 27BDFED8 */ addiu $sp, $sp, -0x128
/* AEB8A8 80074708 3C0F8012 */ lui $t7, %hi(D_8011FE70) # $t7, 0x8012 /* AEB8A8 80074708 3C0F8012 */ lui $t7, %hi(D_8011FE70) # $t7, 0x8012

View file

@ -1,3 +1,25 @@
.rdata
glabel D_8013C60C
.asciz "../z_kankyo.c"
.balign 4
glabel D_8013C61C
.asciz "../z_kankyo.c"
.balign 4
glabel D_8013C62C
.asciz "../z_kankyo.c"
.balign 4
glabel D_8013C63C
.asciz "../z_kankyo.c"
.balign 4
.late_rodata
glabel D_8013C7F4
.float 0.02
.text
glabel func_80074D6C glabel func_80074D6C
/* AEBF0C 80074D6C 27BDFF98 */ addiu $sp, $sp, -0x68 /* AEBF0C 80074D6C 27BDFF98 */ addiu $sp, $sp, -0x68
/* AEBF10 80074D70 3C010001 */ lui $at, 1 /* AEBF10 80074D70 3C010001 */ lui $at, 1

View file

@ -1,3 +1,13 @@
.rdata
glabel D_8013C64C
.asciz "../z_kankyo.c"
.balign 4
glabel D_8013C65C
.asciz "../z_kankyo.c"
.balign 4
.text
glabel func_80074FF4 glabel func_80074FF4
/* AEC194 80074FF4 27BDFFC8 */ addiu $sp, $sp, -0x38 /* AEC194 80074FF4 27BDFFC8 */ addiu $sp, $sp, -0x38
/* AEC198 80074FF8 AFBF0014 */ sw $ra, 0x14($sp) /* AEC198 80074FF8 AFBF0014 */ sw $ra, 0x14($sp)

View file

@ -1,3 +1,11 @@
.late_rodata
glabel D_8013C7F8
.float 0.1
glabel D_8013C7FC
.float 2.9
.text
glabel func_800750C0 glabel func_800750C0
/* AEC260 800750C0 27BDFFE0 */ addiu $sp, $sp, -0x20 /* AEC260 800750C0 27BDFFE0 */ addiu $sp, $sp, -0x20
/* AEC264 800750C4 3C010001 */ lui $at, 1 /* AEC264 800750C4 3C010001 */ lui $at, 1

View file

@ -1,3 +1,27 @@
.rdata
glabel D_8013C66C
.asciz "../z_kankyo.c"
.balign 4
glabel D_8013C67C
.asciz "../z_kankyo.c"
.balign 4
glabel D_8013C68C
.asciz "../z_kankyo.c"
.balign 4
.late_rodata
glabel D_8013C800
.float 5000
glabel D_8013C804
.float 9500
glabel D_8013C808
.float 0.017453292
.text
glabel func_8007542C glabel func_8007542C
/* AEC5CC 8007542C 27BDFF20 */ addiu $sp, $sp, -0xe0 /* AEC5CC 8007542C 27BDFF20 */ addiu $sp, $sp, -0xe0
/* AEC5D0 80075430 3C0F8012 */ lui $t7, %hi(D_8011FE88) # $t7, 0x8012 /* AEC5D0 80075430 3C0F8012 */ lui $t7, %hi(D_8011FE88) # $t7, 0x8012

View file

@ -1,3 +1,33 @@
.rdata
glabel D_8013C69C
.asciz "\n\n\nBGMgame_play->sound_info.BGM=[%d] old_bgm=[%d]\n\n"
# EUC-JP: | Configuration
.balign 4
glabel D_8013C6D4
.asciz "\n-----------------\n"
.balign 4
glabel D_8013C6E8
.asciz "\n =[%d]"
# EUC-JP: | Forced BGM
.balign 4
glabel D_8013C6FC
.asciz "\n =[%d]"
# EUC-JP:
.balign 4
glabel D_8013C710
.asciz "\n =[%d]"
# EUC-JP: | Emblem?
.balign 4
glabel D_8013C724
.asciz "\n status=[%d]"
.balign 4
.text
glabel func_800758AC glabel func_800758AC
/* AECA4C 800758AC 27BDFFE0 */ addiu $sp, $sp, -0x20 /* AECA4C 800758AC 27BDFFE0 */ addiu $sp, $sp, -0x20
/* AECA50 800758B0 3C010001 */ lui $at, 1 /* AECA50 800758B0 3C010001 */ lui $at, 1

View file

@ -1,3 +1,21 @@
.rdata
glabel D_8013C738
.asciz "\n\n\nNa_StartMorinigBgm\n\n"
.balign 4
.late_rodata
glabel jtbl_8013C80C
.word L80075B84
.word L80075BD8
.word L80075C30
.word L80075C6C
.word L80075CB4
.word L80075CE0
.word L80075D30
.word L80075DE4
.word L80075E34
.text
glabel func_80075B44 glabel func_80075B44
/* AECCE4 80075B44 27BDFFE0 */ addiu $sp, $sp, -0x20 /* AECCE4 80075B44 27BDFFE0 */ addiu $sp, $sp, -0x20
/* AECCE8 80075B48 AFB00014 */ sw $s0, 0x14($sp) /* AECCE8 80075B48 AFB00014 */ sw $s0, 0x14($sp)

View file

@ -1,3 +1,13 @@
.rdata
glabel D_8013C750
.asciz "../z_kankyo.c"
.balign 4
glabel D_8013C760
.asciz "../z_kankyo.c"
.balign 4
.text
glabel func_8007672C glabel func_8007672C
/* AED8CC 8007672C 27BDFFA0 */ addiu $sp, $sp, -0x60 /* AED8CC 8007672C 27BDFFA0 */ addiu $sp, $sp, -0x60
/* AED8D0 80076730 93AE0073 */ lbu $t6, 0x73($sp) /* AED8D0 80076730 93AE0073 */ lbu $t6, 0x73($sp)

View file

@ -1,3 +1,20 @@
.rdata
glabel D_8013C770
.asciz "../z_kankyo.c"
.balign 4
glabel D_8013C780
.asciz "../z_kankyo.c"
.balign 4
.late_rodata
glabel D_8013C830
.float 0.16666667
glabel D_8013C834
.float 1.8333334
.text
glabel func_80076934 glabel func_80076934
/* AEDAD4 80076934 27BDFF48 */ addiu $sp, $sp, -0xb8 /* AEDAD4 80076934 27BDFF48 */ addiu $sp, $sp, -0xb8
/* AEDAD8 80076938 3C010001 */ lui $at, 1 /* AEDAD8 80076938 3C010001 */ lui $at, 1

View file

@ -1,3 +1,101 @@
.rdata
glabel D_80140850
.asciz "\n"
# EUC-JP: | Create personal file
.balign 4
glabel D_80140864
.asciz "%x(%d)\n"
# EUC-JP: | Point=
.balign 4
glabel D_80140878
.asciz "\x1b[33m"
.balign 4
glabel D_80140880
.asciz "SCENE_DATA_ID = %d SceneNo = %d\n"
.balign 4
glabel D_801408A4
.asciz "scene_no = %d\n"
.balign 4
glabel D_801408B4
.asciz "\x1b[m"
.balign 4
glabel D_801408B8
.asciz "\x1b[34m"
.balign 4
glabel D_801408C0
.asciz "\n====================================================================\n"
.balign 4
glabel D_80140908
.asciz "%d, "
.balign 4
glabel D_80140910
.asciz "\n====================================================================\n"
.balign 4
glabel D_80140958
.asciz "\x1b[m"
.balign 4
glabel D_8014095C
.asciz "\x1b[32m"
.balign 4
glabel D_80140964
.asciz "\n====================================================================\n"
.balign 4
glabel D_801409AC
.asciz "%d, "
.balign 4
glabel D_801409B4
.asciz "\n====================================================================\n"
.balign 4
glabel D_801409FC
.asciz "\x1b[m"
.balign 4
.late_rodata
glabel jtbl_80140FB8
.word L800A854C
.word L800A854C
.word L800A854C
.word L800A854C
.word L800A854C
.word L800A854C
.word L800A854C
.word L800A854C
.word L800A854C
.word L800A854C
.word L800A854C
.word L800A854C
.word L800A854C
.word L800A854C
.word L800A85C0
.word L800A85C0
.word L800A85CC
.word L800A8564
.word L800A856C
.word L800A8578
.word L800A8584
.word L800A8590
.word L800A859C
.word L800A85A8
.word L800A85B4
.word L800A85C0
.word L800A85C0
.text
glabel func_800A8484 glabel func_800A8484
/* B1F624 800A8484 27BDFFD8 */ addiu $sp, $sp, -0x28 /* B1F624 800A8484 27BDFFD8 */ addiu $sp, $sp, -0x28
/* B1F628 800A8488 AFB00014 */ sw $s0, 0x14($sp) /* B1F628 800A8488 AFB00014 */ sw $s0, 0x14($sp)

View file

@ -1,3 +1,99 @@
.rdata
glabel D_80140A00
.asciz " \n"
# EUC-JP:
.balign 4
glabel D_80140A20
.asciz "%x(%d) SAVE_MAX=%d\n"
# EUC-JP: | Point=
.balign 4
glabel D_80140A44
.asciz "\n %d \n"
# EUC-JP: %d
.balign 4
glabel D_80140A88
.asciz "\n j=%x mmm=%x "
# EUC-JP: | SAVE checksum calculation
.balign 4
glabel D_80140AB4
.asciz " %x(%d)\n"
# EUC-JP:
.balign 4
glabel D_80140AD0
.asciz "================= ========================\n"
# EUC-JP:
.balign 4
glabel D_80140B0C
.asciz "\n j=%x mmm=%x "
# EUC-JP: | (B) SAVE checksum calculation
.balign 4
glabel D_80140B3C
.asciz " %x(%d+3)\n"
#EUR-JP:
.balign 4
glabel D_80140B5C
.asciz "newf=%x,%x,%x,%x,%x,%x\n"
.balign 4
glabel D_80140B74
.asciz "\n--------------------------------------------------------------\n"
.balign 4
glabel D_80140BB8
.asciz "%x "
.balign 4
glabel D_80140BBC
.asciz "\n"
.balign 4
glabel D_80140BC0
.asciz "\nCheck_Sum=%x(%x)\n"
.balign 4
glabel D_80140BD4
.asciz "????#%x,%x,%x,%x,%x,%x\n"
.balign 4
glabel D_80140BEC
.asciz "\n%x(%d+3) check_sum=%x(%x)\n"
# EUC-JP: | Point =
.balign 4
glabel D_80140C14
.asciz "%x(%d) check_sum=%x(%x)\n"
.balign 4
glabel D_80140C38
.asciz "\n \n"
# EUC-JP: | SAVE data OK! ! ! !
.balign 4
glabel D_80140C58
.asciz "SAVECT=%x, NAME=%x, LIFE=%x, ITEM=%x, 64DD=%x, HEART=%x\n"
.balign 4
glabel D_80140C94
.asciz "f_64dd=%d, %d, %d\n"
.balign 4
glabel D_80140CA8
.asciz "heart_status=%d, %d, %d\n"
.balign 4
glabel D_80140CC4
.asciz "now_life=%d, %d, %d\n"
.balign 4
.text
glabel func_800A8A20 glabel func_800A8A20
/* B1FBC0 800A8A20 27BDFF88 */ addiu $sp, $sp, -0x78 /* B1FBC0 800A8A20 27BDFF88 */ addiu $sp, $sp, -0x78
/* B1FBC4 800A8A24 AFA40078 */ sw $a0, 0x78($sp) /* B1FBC4 800A8A24 AFA40078 */ sw $a0, 0x78($sp)

View file

@ -1,3 +1,64 @@
.rdata
glabel D_80140CDC
.asciz "=%d\n"
# EUC-JP: | 64DD flag
.balign 4
glabel D_80140CF0
.asciz "newf=%x,%x,%x,%x,%x,%x\n"
.balign 4
glabel D_80140D08
.asciz "\n$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$\n"
.balign 4
glabel D_80140D58
.asciz "%x "
.balign 4
glabel D_80140D5C
.asciz "\n"
.balign 4
glabel D_80140D60
.asciz "\n%x\n"
# EUC-JP: %x | Checksum
.balign 4
glabel D_80140D74
.asciz "I=%x no=%d\n"
.balign 4
glabel D_80140D80
.asciz "I=%x no=%d\n"
.balign 4
glabel D_80140D8C
.asciz "\n"
# EUC-JP: | SAVE end
.balign 4
glabel D_80140D9C
.asciz "z_common_data.file_no = %d\n"
.balign 4
glabel D_80140DB8
.asciz "SAVECT=%x, NAME=%x, LIFE=%x, ITEM=%x, SAVE_64DD=%x\n"
.balign 4
glabel D_80140DF0
.asciz "f_64dd[%d]=%d\n"
.balign 4
glabel D_80140E00
.asciz "heart_status[%d]=%d\n"
.balign 4
glabel D_80140E18
.asciz "now_life[%d]=%d\n"
.balign 4
.text
glabel func_800A9258 glabel func_800A9258
/* B203F8 800A9258 27BDFFB8 */ addiu $sp, $sp, -0x48 /* B203F8 800A9258 27BDFFB8 */ addiu $sp, $sp, -0x48
/* B203FC 800A925C AFB60040 */ sw $s6, 0x40($sp) /* B203FC 800A925C AFB60040 */ sw $s6, 0x40($sp)

View file

@ -1,3 +1,10 @@
.rdata
glabel D_80140E2C
.asciz "\n"
# EUC-JP: | Clear End
.balign 4
.text
glabel func_800A96D0 glabel func_800A96D0
/* B20870 800A96D0 27BDFFD8 */ addiu $sp, $sp, -0x28 /* B20870 800A96D0 27BDFFD8 */ addiu $sp, $sp, -0x28
/* B20874 800A96D4 AFBF001C */ sw $ra, 0x1c($sp) /* B20874 800A96D4 AFBF001C */ sw $ra, 0x1c($sp)

View file

@ -1,3 +1,23 @@
.rdata
glabel D_80140E3C
.asciz "=%d(%x) =%d(%x)\n"
# EUC-JP: =%d(%x) =%d
.balign 4
glabel D_80140E60
.asciz "f_64dd[%d]=%d\n"
.balign 4
glabel D_80140E70
.asciz "heart_status[%d]=%d\n"
.balign 4
glabel D_80140E88
.asciz "\n"
# EUC-JP: | Copy end
.balign 4
.text
glabel func_800A97F0 glabel func_800A97F0
/* B20990 800A97F0 27BDFFC8 */ addiu $sp, $sp, -0x38 /* B20990 800A97F0 27BDFFC8 */ addiu $sp, $sp, -0x38
/* B20994 800A97F4 AFB3002C */ sw $s3, 0x2c($sp) /* B20994 800A97F4 AFB3002C */ sw $s3, 0x2c($sp)

View file

@ -1,3 +1,44 @@
.rdata
glabel D_80140E98
.asciz "sram_initialize( Game *game, Sram *sram )\n"
.balign 4
glabel D_80140EC4
.asciz "\n"
# EUC-JP: | SRAM destruction! ! ! ! ! !
.balign 4
glabel D_80140EE0
.asciz "\n"
# EUC-JP: | SRAM destruction! ! ! ! ! !
.balign 4
glabel D_80140EFC
.asciz " %d + %d %d\n"
# EUC-JP: %d + %d %d | GOOD! GOOD! Size =% d +% d =% d
.balign 4
glabel D_80140F28
.asciz "\x1b[34m"
.balign 4
glabel D_80140F30
.asciz "Na_SetSoundOutputMode = %d\n"
.balign 4
glabel D_80140F4C
.asciz "Na_SetSoundOutputMode = %d\n"
.balign 4
glabel D_80140F68
.asciz "Na_SetSoundOutputMode = %d\n"
.balign 4
glabel D_80140F84
.asciz "\x1b[m"
.balign 4
.text
glabel func_800A9AD0 glabel func_800A9AD0
/* B20C70 800A9AD0 27BDFFD0 */ addiu $sp, $sp, -0x30 /* B20C70 800A9AD0 27BDFFD0 */ addiu $sp, $sp, -0x30
/* B20C74 800A9AD4 AFA40030 */ sw $a0, 0x30($sp) /* B20C74 800A9AD4 AFA40030 */ sw $a0, 0x30($sp)

View file

@ -1,3 +1,17 @@
.rdata
glabel D_80140F88
.asciz "../z_sram.c"
.balign 4
glabel D_80140F94
.asciz "sram->read_buff != NULL"
.balign 4
glabel D_80140FAC
.asciz "../z_sram.c"
.balign 4
.text
glabel func_800A9CD4 glabel func_800A9CD4
/* B20E74 800A9CD4 27BDFFE8 */ addiu $sp, $sp, -0x18 /* B20E74 800A9CD4 27BDFFE8 */ addiu $sp, $sp, -0x18
/* B20E78 800A9CD8 AFBF0014 */ sw $ra, 0x14($sp) /* B20E78 800A9CD8 AFBF0014 */ sw $ra, 0x14($sp)

View file

@ -51,3 +51,73 @@ glabel osSetIntMask
/* 005BD4 80004FD4 00000000 */ nop /* 005BD4 80004FD4 00000000 */ nop
/* 005BD8 80004FD8 03E00008 */ jr $ra /* 005BD8 80004FD8 03E00008 */ jr $ra
/* 005BDC 80004FDC 00000000 */ nop /* 005BDC 80004FDC 00000000 */ nop
.section .rodata
.balign 16
glabel __osRcpImTable
.half 0x0555
.half 0x0556
.half 0x0559
.half 0x055A
.half 0x0565
.half 0x0566
.half 0x0569
.half 0x056A
.half 0x0595
.half 0x0596
.half 0x0599
.half 0x059A
.half 0x05A5
.half 0x05A6
.half 0x05A9
.half 0x05AA
.half 0x0655
.half 0x0656
.half 0x0659
.half 0x065A
.half 0x0665
.half 0x0666
.half 0x0669
.half 0x066A
.half 0x0695
.half 0x0696
.half 0x0699
.half 0x069A
.half 0x06A5
.half 0x06A6
.half 0x06A9
.half 0x06AA
.half 0x0955
.half 0x0956
.half 0x0959
.half 0x095A
.half 0x0965
.half 0x0966
.half 0x0969
.half 0x096A
.half 0x0995
.half 0x0996
.half 0x0999
.half 0x099A
.half 0x09A5
.half 0x09A6
.half 0x09A9
.half 0x09AA
.half 0x0A55
.half 0x0A56
.half 0x0A59
.half 0x0A5A
.half 0x0A65
.half 0x0A66
.half 0x0A69
.half 0x0A6A
.half 0x0A95
.half 0x0A96
.half 0x0A99
.half 0x0A9A
.half 0x0AA5
.half 0x0AA6
.half 0x0AA9
.half 0x0AAA

View file

@ -8,6 +8,7 @@
.section .data .section .data
.balign 16 .balign 16
glabel D_8012CED0 glabel D_8012CED0
.incbin "baserom.z64", 0xBA4070, 0x4 .incbin "baserom.z64", 0xBA4070, 0x4
@ -23,7 +24,6 @@ glabel D_8012CEE0
glabel D_8012CEE4 glabel D_8012CEE4
.word D_80143184 .word D_80143184
glabel D_8012CEE8 glabel D_8012CEE8
.word D_80143194 .word D_80143194

View file

@ -78,13 +78,11 @@ glabel D_80143254
.balign 4 .balign 4
glabel D_80143264 glabel D_80143264
.byte 0x8C .asciz "\x8C\E-\x8D ソ"
.asciz "E-\x8D ソ"
.balign 4 .balign 4
glabel D_80143278 glabel D_80143278
.byte 0x8C .asciz "\x8C\E-\x8D"
.asciz "E-\x8D"
.balign 4 .balign 4
glabel D_80143290 glabel D_80143290
@ -239,8 +237,7 @@ glabel D_801434B4
.balign 4 .balign 4
glabel D_801434C4 glabel D_801434C4
.byte 0x8C .asciz "\x8C\E-\x8D "
.asciz "E-\x8D "
.balign 4 .balign 4
glabel D_801434D8 glabel D_801434D8
@ -549,7 +546,6 @@ glabel D_80143C40
glabel D_80143C54 glabel D_80143C54
.float 0.15 .float 0.15
.balign 4
glabel D_80143C58 glabel D_80143C58
.float 0.2 .float 0.2

View file

@ -1,74 +0,0 @@
.include "macro.inc"
# assembler directives
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
.set gp=64 # allow use of 64-bit general purpose registers
.section .rodata
glabel __osRcpImTable
.hword 0x0555
.hword 0x0556
.hword 0x0559
.hword 0x055A
.hword 0x0565
.hword 0x0566
.hword 0x0569
.hword 0x056A
.hword 0x0595
.hword 0x0596
.hword 0x0599
.hword 0x059A
.hword 0x05A5
.hword 0x05A6
.hword 0x05A9
.hword 0x05AA
.hword 0x0655
.hword 0x0656
.hword 0x0659
.hword 0x065A
.hword 0x0665
.hword 0x0666
.hword 0x0669
.hword 0x066A
.hword 0x0695
.hword 0x0696
.hword 0x0699
.hword 0x069A
.hword 0x06A5
.hword 0x06A6
.hword 0x06A9
.hword 0x06AA
.hword 0x0955
.hword 0x0956
.hword 0x0959
.hword 0x095A
.hword 0x0965
.hword 0x0966
.hword 0x0969
.hword 0x096A
.hword 0x0995
.hword 0x0996
.hword 0x0999
.hword 0x099A
.hword 0x09A5
.hword 0x09A6
.hword 0x09A9
.hword 0x09AA
.hword 0x0A55
.hword 0x0A56
.hword 0x0A59
.hword 0x0A5A
.hword 0x0A65
.hword 0x0A66
.hword 0x0A69
.hword 0x0A6A
.hword 0x0A95
.hword 0x0A96
.hword 0x0A99
.hword 0x0A9A
.hword 0x0AA5
.hword 0x0AA6
.hword 0x0AA9
.hword 0x0AAA

View file

@ -1,403 +0,0 @@
.include "macro.inc"
# assembler directives
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
.set gp=64 # allow use of 64-bit general purpose registers
.section .rodata
.balign 16
glabel D_8013C240
.asciz "\x1b[43;30m\n\nフィールド常駐以外、太陽設定よって強制解除\n\x1b[m"
# EUC-JP: | "Sun setting except field resident! So forced release!"?
.balign 4
glabel D_8013C280
.asciz "\x1b[41;37m\nend_frameとstart_frameのフレーム関係がおかしい!!!\x1b[m"
# EUC-JP: start_frame!!! | The frame relation between end_frame and start_frame is wrong
.balign 4
glabel D_8013C2C0
.asciz "\x1b[41;37m\nby get_parcent_forAccelBrake!!!!!!!!!\x1b[m"
.balign 4
glabel D_8013C2F4
.asciz "\x1b[41;37m\n環境データ取得失敗 ささきまでご報告を!\x1b[m"
# EUC-JP: | Environment VR data acquisition failed! Report to Sasaki!
.balign 4
glabel D_8013C330
.asciz "../z_kankyo.c"
.balign 4
glabel D_8013C340
.asciz "../z_kankyo.c"
.balign 4
glabel D_8013C350
.asciz "../z_kankyo.c"
.balign 4
glabel D_8013C360
.asciz "../z_kankyo.c"
.balign 4
glabel D_8013C370
.asciz "../z_kankyo.c"
.balign 4
glabel D_8013C380
.asciz "../z_kankyo.c"
.balign 4
glabel D_8013C390
.asciz "\x1b[43;30m\n水ポリゴンデータに水中カラーが設定されておりません!\x1b[m"
# EUC-JP: | Underwater color is not set in the water poly data
.balign 4
glabel D_8013C3D0
.asciz "T%03d "
.balign 4
glabel D_8013C3D8
.asciz "E%03d"
.balign 4
glabel D_8013C3E0
.asciz "%s"
.balign 4
glabel D_8013C3E4
.asciz "ZELDATIME "
.balign 4
glabel D_8013C3F0
.asciz "%02d"
.balign 4
glabel D_8013C3F8
.asciz "%s"
.balign 4
glabel D_8013C3FC
.asciz ":"
.balign 4
glabel D_8013C400
.asciz "%s"
.balign 4
glabel D_8013C404
.asciz " "
.balign 4
glabel D_8013C408
.asciz "%02d"
.balign 4
glabel D_8013C410
.asciz "%s"
.balign 4
glabel D_8013C414
.asciz "VRBOXTIME "
.balign 4
glabel D_8013C420
.asciz "%02d"
.balign 4
glabel D_8013C428
.asciz "%s"
.balign 4
glabel D_8013C42C
.asciz ":"
.balign 4
glabel D_8013C430
.asciz "%s"
.balign 4
glabel D_8013C434
.asciz " "
.balign 4
glabel D_8013C438
.asciz "%02d"
.balign 4
glabel D_8013C440
.asciz "%s"
.balign 4
glabel D_8013C444
.asciz "YORU"
.balign 4
glabel D_8013C44C
.asciz "%s"
.balign 4
glabel D_8013C450
.asciz "HIRU"
.balign 4
glabel D_8013C458
.asciz "\nnext_zelda_time=[%x]"
.balign 4
glabel D_8013C470
.asciz "../z_kankyo.c"
.balign 4
glabel D_8013C480
.asciz "../z_kankyo.c"
.balign 4
glabel D_8013C490
.asciz "\x1b[41;37m\nカラーパレットの設定がおかしいようです\x1b[m"
# EUC-JP: | The color palette settings seem to be wrong!
.balign 4
glabel D_8013C4C8
.asciz "\x1b[41;37m\n設定パレット[%d] 最後パレット番号=[%d]\n\x1b[m"
# EUC-JP: [%d] | Set pallet = [% d] Last pallet number =
.balign 4
glabel D_8013C500
.asciz "\n\x1b[31m"
# EUC-JP: | The color palette seems strange!
.balign 4
glabel D_8013C52C
.asciz "\n\x1b[33m[%d] [%d]\n\x1b[m"
# EUC-JP: [%d] [%d] | Set pallet = [% d] Number of pallets = [% d]
.balign 4
glabel D_8013C55C
.asciz "../z_kankyo.c"
.balign 4
glabel D_8013C56C
.asciz "../z_kankyo.c"
.balign 4
glabel D_8013C57C
.asciz "../z_kankyo.c"
.balign 4
glabel D_8013C58C
.asciz "../z_kankyo.c"
.balign 4
glabel D_8013C59C
.asciz "../z_kankyo.c"
.balign 4
glabel D_8013C5AC
.asciz "../z_kankyo.c"
.balign 4
glabel D_8013C5BC
.asciz "../z_kankyo.c"
.balign 4
glabel D_8013C5CC
.asciz "../z_kankyo.c"
.balign 4
glabel D_8013C5DC
.asciz "../z_kankyo.c"
.balign 4
glabel D_8013C5EC
.asciz "../z_kankyo.c"
.balign 4
glabel D_8013C5FC
.asciz "../z_kankyo.c"
.balign 4
glabel D_8013C60C
.asciz "../z_kankyo.c"
.balign 4
glabel D_8013C61C
.asciz "../z_kankyo.c"
.balign 4
glabel D_8013C62C
.asciz "../z_kankyo.c"
.balign 4
glabel D_8013C63C
.asciz "../z_kankyo.c"
.balign 4
glabel D_8013C64C
.asciz "../z_kankyo.c"
.balign 4
glabel D_8013C65C
.asciz "../z_kankyo.c"
.balign 4
glabel D_8013C66C
.asciz "../z_kankyo.c"
.balign 4
glabel D_8013C67C
.asciz "../z_kankyo.c"
.balign 4
glabel D_8013C68C
.asciz "../z_kankyo.c"
.balign 4
glabel D_8013C69C
.asciz "\n\n\nBGMgame_play->sound_info.BGM=[%d] old_bgm=[%d]\n\n"
# EUC-JP: | Configuration
.balign 4
glabel D_8013C6D4
.asciz "\n-----------------\n"
.balign 4
glabel D_8013C6E8
.asciz "\n =[%d]"
# EUC-JP: | Forced BGM
.balign 4
glabel D_8013C6FC
.asciz "\n =[%d]"
# EUC-JP:
.balign 4
glabel D_8013C710
.asciz "\n =[%d]"
# EUC-JP: | Emblem?
.balign 4
glabel D_8013C724
.asciz "\n status=[%d]"
.balign 4
glabel D_8013C738
.asciz "\n\n\nNa_StartMorinigBgm\n\n"
.balign 4
glabel D_8013C750
.asciz "../z_kankyo.c"
.balign 4
glabel D_8013C760
.asciz "../z_kankyo.c"
.balign 4
glabel D_8013C770
.asciz "../z_kankyo.c"
.balign 4
glabel D_8013C780
.asciz "../z_kankyo.c"
.balign 4
glabel jtbl_8013C790
.word L8006F4A8
.word L8006F4CC
.word L8006F4CC
.word L8006F4CC
.word L8006F4F0
glabel D_8013C7A4
.float 0.001
glabel D_8013C7A8
.float 0.005
glabel D_8013C7AC
.float 0.8
glabel D_8013C7B0
.float 0.8
glabel D_8013C7B4
.float 0.8
glabel D_8013C7B8
.float 630
.balign 8
glabel D_8013C7C0
.double 0.001
glabel D_8013C7C8
.float 1.0E-4
glabel D_8013C7CC
.float 0.001
glabel D_8013C7D0
.float 0.001
glabel D_8013C7D4
.float 0.1
glabel D_8013C7D8
.float 0.1
glabel D_8013C7DC
.float 0.4
glabel D_8013C7E0
.float 0.7
glabel D_8013C7E4
.float 1.5707964 # M_PI / 2
glabel D_8013C7E8
.float 1.2
glabel D_8013C7EC
.float 0.1
glabel D_8013C7F0
.float 0.02
glabel D_8013C7F4
.float 0.02
glabel D_8013C7F8
.float 0.1
glabel D_8013C7FC
.float 2.9
glabel D_8013C800
.float 5000
glabel D_8013C804
.float 9500
glabel D_8013C808
.float 0.017453292
glabel jtbl_8013C80C
.word L80075B84
.word L80075BD8
.word L80075C30
.word L80075C6C
.word L80075CB4
.word L80075CE0
.word L80075D30
.word L80075DE4
.word L80075E34
glabel D_8013C830
.float 0.16666667
glabel D_8013C834
.float 1.8333334

View file

@ -86,28 +86,28 @@ glabel D_8015394C
.word 0x00000000, 0x00000000, 0x00000000 .word 0x00000000, 0x00000000, 0x00000000
glabel D_80153958 glabel D_80153958
.hword 0x0000 .half 0x0000
glabel D_8015395A glabel D_8015395A
.hword 0x0000 .half 0x0000
glabel D_8015395C glabel D_8015395C
.hword 0x0000 .half 0x0000
glabel D_8015395E glabel D_8015395E
.hword 0x0000 .half 0x0000
glabel D_80153960 glabel D_80153960
.hword 0x0000 .half 0x0000
glabel D_80153962 glabel D_80153962
.hword 0x0000 .half 0x0000
glabel D_80153964 glabel D_80153964
.hword 0x0000 .half 0x0000
glabel D_80153966 glabel D_80153966
.hword 0x0000 .half 0x0000
glabel D_80153968 glabel D_80153968
.word 0x00000000 .word 0x00000000
@ -164,16 +164,16 @@ glabel D_80153C48
.word 0x00480048, 0x00480000 .word 0x00480048, 0x00480000
glabel D_80153C50 glabel D_80153C50
.hword 0x0000 .half 0x0000
glabel D_80153C52 glabel D_80153C52
.hword 0x0001 .half 0x0001
glabel D_80153C54 glabel D_80153C54
.hword 0x0003 .half 0x0003
glabel D_80153C56 glabel D_80153C56
.hword 0x0002 .half 0x0002
glabel D_80153C58 glabel D_80153C58
.word 0x00010002, 0x00040008, 0x00100020, 0x01000080 .word 0x00010002, 0x00040008, 0x00100020, 0x01000080
@ -234,8 +234,9 @@ glabel D_80153D74
glabel D_80153D78 glabel D_80153D78
.word 0x00000000 .word 0x00000000
.balign 16
glabel D_80153D7C
.word 0x00000000
glabel D_80153D80 glabel D_80153D80
.word 0x00000000 .word 0x00000000
.balign 16

View file

@ -1,332 +0,0 @@
.include "macro.inc"
# assembler directives
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
.set gp=64 # allow use of 64-bit general purpose registers
.section .rodata
.balign 16
glabel D_80140850
.asciz "\n"
# EUC-JP: | Create personal file
.balign 4
glabel D_80140864
.asciz "%x(%d)\n"
# EUC-JP: | Point=
.balign 4
glabel D_80140878
.asciz "\x1b[33m"
.balign 4
glabel D_80140880
.asciz "SCENE_DATA_ID = %d SceneNo = %d\n"
.balign 4
glabel D_801408A4
.asciz "scene_no = %d\n"
.balign 4
glabel D_801408B4
.asciz "\x1b[m"
.balign 4
glabel D_801408B8
.asciz "\x1b[34m"
.balign 4
glabel D_801408C0
.asciz "\n====================================================================\n"
.balign 4
glabel D_80140908
.asciz "%d, "
.balign 4
glabel D_80140910
.asciz "\n====================================================================\n"
.balign 4
glabel D_80140958
.asciz "\x1b[m"
.balign 4
glabel D_8014095C
.asciz "\x1b[32m"
.balign 4
glabel D_80140964
.asciz "\n====================================================================\n"
.balign 4
glabel D_801409AC
.asciz "%d, "
.balign 4
glabel D_801409B4
.asciz "\n====================================================================\n"
.balign 4
glabel D_801409FC
.asciz "\x1b[m"
.balign 4
glabel D_80140A00
.asciz " \n"
# EUC-JP:
.balign 4
glabel D_80140A20
.asciz "%x(%d) SAVE_MAX=%d\n"
# EUC-JP: | Point=
.balign 4
glabel D_80140A44
.asciz "\n %d \n"
# EUC-JP: %d
.balign 4
glabel D_80140A88
.asciz "\n j=%x mmm=%x "
# EUC-JP: | SAVE checksum calculation
.balign 4
glabel D_80140AB4
.asciz " %x(%d)\n"
# EUC-JP:
.balign 4
glabel D_80140AD0
.asciz "================= ========================\n"
# EUC-JP:
.balign 4
glabel D_80140B0C
.asciz "\n j=%x mmm=%x "
# EUC-JP: | (B) SAVE checksum calculation
.balign 4
glabel D_80140B3C
.asciz " %x(%d+3)\n"
#EUR-JP:
.balign 4
glabel D_80140B5C
.asciz "newf=%x,%x,%x,%x,%x,%x\n"
.balign 4
glabel D_80140B74
.asciz "\n--------------------------------------------------------------\n"
.balign 4
glabel D_80140BB8
.asciz "%x "
.balign 4
glabel D_80140BBC
.asciz "\n"
.balign 4
glabel D_80140BC0
.asciz "\nCheck_Sum=%x(%x)\n"
.balign 4
glabel D_80140BD4
.asciz "????#%x,%x,%x,%x,%x,%x\n"
.balign 4
glabel D_80140BEC
.asciz "\n%x(%d+3) check_sum=%x(%x)\n"
# EUC-JP: | Point =
.balign 4
glabel D_80140C14
.asciz "%x(%d) check_sum=%x(%x)\n"
.balign 4
glabel D_80140C38
.asciz "\n \n"
# EUC-JP: | SAVE data OK! ! ! !
.balign 4
glabel D_80140C58
.asciz "SAVECT=%x, NAME=%x, LIFE=%x, ITEM=%x, 64DD=%x, HEART=%x\n"
.balign 4
glabel D_80140C94
.asciz "f_64dd=%d, %d, %d\n"
.balign 4
glabel D_80140CA8
.asciz "heart_status=%d, %d, %d\n"
.balign 4
glabel D_80140CC4
.asciz "now_life=%d, %d, %d\n"
.balign 4
glabel D_80140CDC
.asciz "=%d\n"
# EUC-JP: | 64DD flag
.balign 4
glabel D_80140CF0
.asciz "newf=%x,%x,%x,%x,%x,%x\n"
.balign 4
glabel D_80140D08
.asciz "\n$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$\n"
.balign 4
glabel D_80140D58
.asciz "%x "
.balign 4
glabel D_80140D5C
.asciz "\n"
.balign 4
glabel D_80140D60
.asciz "\n%x\n"
# EUC-JP: %x | Checksum
.balign 4
glabel D_80140D74
.asciz "I=%x no=%d\n"
.balign 4
glabel D_80140D80
.asciz "I=%x no=%d\n"
.balign 4
glabel D_80140D8C
.asciz "\n"
# EUC-JP: | SAVE end
.balign 4
glabel D_80140D9C
.asciz "z_common_data.file_no = %d\n"
.balign
glabel D_80140DB8
.asciz "SAVECT=%x, NAME=%x, LIFE=%x, ITEM=%x, SAVE_64DD=%x\n"
.balign 4
glabel D_80140DF0
.asciz "f_64dd[%d]=%d\n"
.balign 4
glabel D_80140E00
.asciz "heart_status[%d]=%d\n"
.balign 4
glabel D_80140E18
.asciz "now_life[%d]=%d\n"
.balign 4
glabel D_80140E2C
.asciz "\n"
# EUC-JP: | Clear End
.balign 4
glabel D_80140E3C
.asciz "=%d(%x) =%d(%x)\n"
# EUC-JP: =%d(%x) =%d
.balign 4
glabel D_80140E60
.asciz "f_64dd[%d]=%d\n"
.balign 4
glabel D_80140E70
.asciz "heart_status[%d]=%d\n"
.balign 4
glabel D_80140E88
.asciz "\n"
# EUC-JP: | Copy end
.balign 4
glabel D_80140E98
.asciz "sram_initialize( Game *game, Sram *sram )\n"
.balign 4
glabel D_80140EC4
.asciz "\n"
# EUC-JP: | SRAM destruction! ! ! ! ! !
.balign 4
glabel D_80140EE0
.asciz "\n"
# EUC-JP: | SRAM destruction! ! ! ! ! !
.balign 4
glabel D_80140EFC
.asciz " %d + %d %d\n"
# EUC-JP: %d + %d %d | GOOD! GOOD! Size =% d +% d =% d
.balign 4
glabel D_80140F28
.asciz "\x1b[34m"
.balign 4
glabel D_80140F30
.asciz "Na_SetSoundOutputMode = %d\n"
.balign 4
glabel D_80140F4C
.asciz "Na_SetSoundOutputMode = %d\n"
.balign 4
glabel D_80140F68
.asciz "Na_SetSoundOutputMode = %d\n"
.balign 4
glabel D_80140F84
.asciz "\x1b[m"
.balign 4
glabel D_80140F88
.asciz "../z_sram.c"
.balign 4
glabel D_80140F94
.asciz "sram->read_buff != NULL"
.balign 4
glabel D_80140FAC
.asciz "../z_sram.c"
.balign 4
glabel jtbl_80140FB8
.word L800A854C
.word L800A854C
.word L800A854C
.word L800A854C
.word L800A854C
.word L800A854C
.word L800A854C
.word L800A854C
.word L800A854C
.word L800A854C
.word L800A854C
.word L800A854C
.word L800A854C
.word L800A854C
.word L800A85C0
.word L800A85C0
.word L800A85CC
.word L800A8564
.word L800A856C
.word L800A8578
.word L800A8584
.word L800A8590
.word L800A859C
.word L800A85A8
.word L800A85B4
.word L800A85C0
.word L800A85C0

3
spec
View file

@ -53,7 +53,6 @@ beginseg
include "build/src/libultra_boot_O2/__osSiRawReadIo.o" include "build/src/libultra_boot_O2/__osSiRawReadIo.o"
include "build/src/libultra_boot_O1/osGetThreadId.o" include "build/src/libultra_boot_O1/osGetThreadId.o"
include "build/asm/osSetIntMask.o" include "build/asm/osSetIntMask.o"
include "build/data/osSetIntMask.rodata.o"
include "build/src/libultra_boot_O2/osViSetMode.o" include "build/src/libultra_boot_O2/osViSetMode.o"
include "build/asm/__osProbeTLB.o" include "build/asm/__osProbeTLB.o"
include "build/src/libultra_boot_O1/osGetMemSize.o" include "build/src/libultra_boot_O1/osGetMemSize.o"
@ -318,7 +317,6 @@ beginseg
include "build/src/code/z_kanfont.o" include "build/src/code/z_kanfont.o"
include "build/src/code/z_kankyo.o" include "build/src/code/z_kankyo.o"
include "build/data/z_kankyo.data.o" include "build/data/z_kankyo.data.o"
include "build/data/z_kankyo.rodata.o"
include "build/data/z_kankyo.bss.o" include "build/data/z_kankyo.bss.o"
include "build/src/code/z_lib.o" include "build/src/code/z_lib.o"
include "build/src/code/z_lifemeter.o" include "build/src/code/z_lifemeter.o"
@ -358,7 +356,6 @@ beginseg
include "build/data/z_skin_matrix.data.o" include "build/data/z_skin_matrix.data.o"
include "build/src/code/z_sram.o" include "build/src/code/z_sram.o"
include "build/data/z_sram.data.o" include "build/data/z_sram.data.o"
include "build/data/z_sram.rodata.o"
include "build/src/code/code_800A9D40.o" include "build/src/code/code_800A9D40.o"
include "build/src/code/code_800A9F30.o" include "build/src/code/code_800A9F30.o"
include "build/data/z_text.data.o" include "build/data/z_text.data.o"

View file

@ -10,6 +10,7 @@ from collections import namedtuple
from io import StringIO from io import StringIO
MAX_FN_SIZE = 100 MAX_FN_SIZE = 100
SLOW_CHECKS = False
EI_NIDENT = 16 EI_NIDENT = 16
EI_CLASS = 4 EI_CLASS = 4
@ -348,6 +349,20 @@ def is_temp_name(name):
return name.startswith('_asmpp_') return name.startswith('_asmpp_')
# https://stackoverflow.com/a/241506
def re_comment_replacer(match):
s = match.group(0)
if s[0] in "/#":
return " "
else:
return s
re_comment_or_string = re.compile(
r'#.*|/\*.*?\*/|"(?:\\.|[^\\"])*"'
)
class Failure(Exception): class Failure(Exception):
def __init__(self, message): def __init__(self, message):
self.message = message self.message = message
@ -357,13 +372,14 @@ class Failure(Exception):
class GlobalState: class GlobalState:
def __init__(self, min_instr_count, skip_instr_count): def __init__(self, min_instr_count, skip_instr_count, use_jtbl_for_rodata):
# A value that hopefully never appears as a 32-bit rodata constant (or we # A value that hopefully never appears as a 32-bit rodata constant (or we
# miscompile late rodata). Increases by 1 in each step. # miscompile late rodata). Increases by 1 in each step.
self.late_rodata_hex = 0xE0123456 self.late_rodata_hex = 0xE0123456
self.namectr = 0 self.namectr = 0
self.min_instr_count = min_instr_count self.min_instr_count = min_instr_count
self.skip_instr_count = skip_instr_count self.skip_instr_count = skip_instr_count
self.use_jtbl_for_rodata = use_jtbl_for_rodata
def next_late_rodata_hex(self): def next_late_rodata_hex(self):
dummy_bytes = struct.pack('>I', self.late_rodata_hex) dummy_bytes = struct.pack('>I', self.late_rodata_hex)
@ -378,7 +394,7 @@ class GlobalState:
return '_asmpp_{}{}'.format(cat, self.namectr) return '_asmpp_{}{}'.format(cat, self.namectr)
Function = namedtuple('Function', ['text_glabels', 'asm_conts', 'late_rodata_dummy_bytes', 'late_rodata_asm_conts', 'fn_desc', 'data']) Function = namedtuple('Function', ['text_glabels', 'asm_conts', 'late_rodata_dummy_bytes', 'jtbl_rodata_size', 'late_rodata_asm_conts', 'fn_desc', 'data'])
class GlobalAsmBlock: class GlobalAsmBlock:
@ -476,8 +492,7 @@ class GlobalAsmBlock:
self.glued_line = '' self.glued_line = ''
real_line = line real_line = line
line = re.sub(r'/\*.*?\*/', '', line) line = re.sub(re_comment_or_string, re_comment_replacer, line)
line = re.sub(r'#.*', '', line)
line = line.strip() line = line.strip()
line = re.sub(r'^[a-zA-Z0-9_]+:\s*', '', line) line = re.sub(r'^[a-zA-Z0-9_]+:\s*', '', line)
changed_section = False changed_section = False
@ -536,6 +551,8 @@ class GlobalAsmBlock:
elif line.startswith('.asci'): elif line.startswith('.asci'):
z = (line.startswith('.asciz') or line.startswith('.asciiz')) z = (line.startswith('.asciz') or line.startswith('.asciiz'))
self.add_sized(self.count_quoted_size(line, z, real_line, output_enc), real_line) self.add_sized(self.count_quoted_size(line, z, real_line, output_enc), real_line)
elif line.startswith('.byte'):
self.add_sized(len(line.split(',')), real_line)
elif line.startswith('.'): elif line.startswith('.'):
# .macro, ... # .macro, ...
self.fail("asm directive not supported", real_line) self.fail("asm directive not supported", real_line)
@ -564,8 +581,11 @@ class GlobalAsmBlock:
def finish(self, state): def finish(self, state):
src = [''] * (self.num_lines + 1) src = [''] * (self.num_lines + 1)
late_rodata_dummy_bytes = [] late_rodata_dummy_bytes = []
jtbl_rodata_size = 0
late_rodata_fn_output = [] late_rodata_fn_output = []
num_instr = self.fn_section_sizes['.text'] // 4
if self.fn_section_sizes['.late_rodata'] > 0: if self.fn_section_sizes['.late_rodata'] > 0:
# Generate late rodata by emitting unique float constants. # Generate late rodata by emitting unique float constants.
# This requires 3 instructions for each 4 bytes of rodata. # This requires 3 instructions for each 4 bytes of rodata.
@ -573,10 +593,29 @@ class GlobalAsmBlock:
# instructions for 8 bytes of rodata. # instructions for 8 bytes of rodata.
size = self.fn_section_sizes['.late_rodata'] // 4 size = self.fn_section_sizes['.late_rodata'] // 4
skip_next = False skip_next = False
needs_double = (self.late_rodata_alignment != 0)
for i in range(size): for i in range(size):
if skip_next: if skip_next:
skip_next = False skip_next = False
continue continue
# Jump tables give 9 instructions for >= 5 words of rodata, and should be
# emitted when:
# - -O2 or -O2 -g3 are used, which give the right codegen
# - we have emitted our first .float/.double (to ensure that we find the
# created rodata in the binary)
# - we have emitted our first .double, if any (to ensure alignment of doubles
# in shifted rodata sections)
# - we have at least 5 words of rodata left to emit (otherwise IDO does not
# generate a jump table)
# - we have at least 10 more instructions to go in this function (otherwise our
# function size computation will be wrong since the delay slot goes unused)
if (not needs_double and state.use_jtbl_for_rodata and i >= 1 and
size - i >= 5 and num_instr - len(late_rodata_fn_output) >= 10):
cases = " ".join("case {}:".format(case) for case in range(size - i))
late_rodata_fn_output.append("switch (*(volatile int*)0) { " + cases + " ; }")
late_rodata_fn_output.extend([""] * 8)
jtbl_rodata_size = (size - i) * 4
break
dummy_bytes = state.next_late_rodata_hex() dummy_bytes = state.next_late_rodata_hex()
late_rodata_dummy_bytes.append(dummy_bytes) late_rodata_dummy_bytes.append(dummy_bytes)
if self.late_rodata_alignment == 4 * ((i + 1) % 2 + 1) and i + 1 < size: if self.late_rodata_alignment == 4 * ((i + 1) % 2 + 1) and i + 1 < size:
@ -585,6 +624,7 @@ class GlobalAsmBlock:
fval, = struct.unpack('>d', dummy_bytes + dummy_bytes2) fval, = struct.unpack('>d', dummy_bytes + dummy_bytes2)
late_rodata_fn_output.append('*(volatile double*)0 = {};'.format(fval)) late_rodata_fn_output.append('*(volatile double*)0 = {};'.format(fval))
skip_next = True skip_next = True
needs_double = True
else: else:
fval, = struct.unpack('>f', dummy_bytes) fval, = struct.unpack('>f', dummy_bytes)
late_rodata_fn_output.append('*(volatile float*)0 = {}f;'.format(fval)) late_rodata_fn_output.append('*(volatile float*)0 = {}f;'.format(fval))
@ -651,6 +691,7 @@ class GlobalAsmBlock:
text_glabels=self.text_glabels, text_glabels=self.text_glabels,
asm_conts=self.asm_conts, asm_conts=self.asm_conts,
late_rodata_dummy_bytes=late_rodata_dummy_bytes, late_rodata_dummy_bytes=late_rodata_dummy_bytes,
jtbl_rodata_size=jtbl_rodata_size,
late_rodata_asm_conts=self.late_rodata_asm_conts, late_rodata_asm_conts=self.late_rodata_asm_conts,
fn_desc=self.fn_desc, fn_desc=self.fn_desc,
data={ data={
@ -661,6 +702,9 @@ class GlobalAsmBlock:
}) })
return src, fn return src, fn
cutscene_data_regexpr = re.compile(r"CutsceneData (.|\n)*\[\] = {")
float_regexpr = re.compile(r"[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?f")
def repl_float_hex(m): def repl_float_hex(m):
return str(struct.unpack(">I", struct.pack(">f", float(m.group(0).strip().rstrip("f"))))[0]) return str(struct.unpack(">I", struct.pack(">f", float(m.group(0).strip().rstrip("f"))))[0])
@ -689,13 +733,18 @@ def parse_source(f, opt, framepointer, input_enc, output_enc, print_source=None)
min_instr_count = 2 min_instr_count = 2
skip_instr_count = 2 skip_instr_count = 2
state = GlobalState(min_instr_count, skip_instr_count) use_jtbl_for_rodata = False
if opt in ['O2', 'g3'] and not framepointer:
use_jtbl_for_rodata = True
state = GlobalState(min_instr_count, skip_instr_count, use_jtbl_for_rodata)
global_asm = None global_asm = None
is_cutscene_data = False
asm_functions = [] asm_functions = []
output_lines = [] output_lines = []
is_cutscene_data = False
for line_no, raw_line in enumerate(f, 1): for line_no, raw_line in enumerate(f, 1):
raw_line = raw_line.rstrip() raw_line = raw_line.rstrip()
line = raw_line.lstrip() line = raw_line.lstrip()
@ -730,6 +779,8 @@ def parse_source(f, opt, framepointer, input_enc, output_enc, print_source=None)
asm_functions.append(fn) asm_functions.append(fn)
global_asm = None global_asm = None
elif ((line.startswith('#include "')) and line.endswith('" EARLY')): elif ((line.startswith('#include "')) and line.endswith('" EARLY')):
# C includes qualified with EARLY (i.e. #include "file.c" EARLY) will be
# processed recursively when encountered
fpath = os.path.dirname(f.name) fpath = os.path.dirname(f.name)
fname = line[line.index(' ') + 2 : -7] fname = line[line.index(' ') + 2 : -7]
include_src = StringIO() include_src = StringIO()
@ -739,12 +790,14 @@ def parse_source(f, opt, framepointer, input_enc, output_enc, print_source=None)
include_src.write('#line ' + str(line_no) + '\n') include_src.write('#line ' + str(line_no) + '\n')
include_src.close() include_src.close()
else: else:
if re.compile(r"(CutsceneData (.|\n)*\[\] = {)").search(line) is not None: # This is a hack to replace all floating-point numbers in an array of a particular type
# (in this case CutsceneData) with their corresponding IEEE-754 hexadecimal representation
if cutscene_data_regexpr.search(line) is not None:
is_cutscene_data = True is_cutscene_data = True
elif line.endswith("};"): elif line.endswith("};"):
is_cutscene_data = False is_cutscene_data = False
if is_cutscene_data: if is_cutscene_data:
raw_line = re.sub(re.compile(r"[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?f"), repl_float_hex, raw_line) raw_line = re.sub(float_regexpr, repl_float_hex, raw_line)
output_lines[-1] = raw_line output_lines[-1] = raw_line
if print_source: if print_source:
@ -779,7 +832,8 @@ def fixup_objfile(objfile_name, functions, asm_prelude, assembler, output_enc):
'.bss': [], '.bss': [],
} }
asm = [] asm = []
late_rodata_dummy_bytes = [] all_late_rodata_dummy_bytes = []
all_jtbl_rodata_size = []
late_rodata_asm = [] late_rodata_asm = []
late_rodata_source_name_start = None late_rodata_source_name_start = None
late_rodata_source_name_end = None late_rodata_source_name_end = None
@ -800,7 +854,8 @@ def fixup_objfile(objfile_name, functions, asm_prelude, assembler, output_enc):
break break
loc = loc[1] loc = loc[1]
prev_loc = prev_locs[sectype] prev_loc = prev_locs[sectype]
assert loc >= prev_loc, sectype if loc < prev_loc:
raise Failure("Wrongly computed size for section {} (diff {}). This is an asm-processor bug!".format(sectype, prev_loc- loc))
if loc != prev_loc: if loc != prev_loc:
asm.append('.section ' + sectype) asm.append('.section ' + sectype)
if sectype == '.text': if sectype == '.text':
@ -812,7 +867,8 @@ def fixup_objfile(objfile_name, functions, asm_prelude, assembler, output_enc):
prev_locs[sectype] = loc + size prev_locs[sectype] = loc + size
if not ifdefed: if not ifdefed:
all_text_glabels.update(function.text_glabels) all_text_glabels.update(function.text_glabels)
late_rodata_dummy_bytes.append(function.late_rodata_dummy_bytes) all_late_rodata_dummy_bytes.append(function.late_rodata_dummy_bytes)
all_jtbl_rodata_size.append(function.jtbl_rodata_size)
late_rodata_asm.append(function.late_rodata_asm_conts) late_rodata_asm.append(function.late_rodata_asm_conts)
for sectype, (temp_name, size) in function.data.items(): for sectype, (temp_name, size) in function.data.items():
if temp_name is not None: if temp_name is not None:
@ -863,6 +919,7 @@ def fixup_objfile(objfile_name, functions, asm_prelude, assembler, output_enc):
# Move over section contents # Move over section contents
modified_text_positions = set() modified_text_positions = set()
jtbl_rodata_positions = set()
last_rodata_pos = 0 last_rodata_pos = 0
for sectype in SECTIONS: for sectype in SECTIONS:
if not to_copy[sectype]: if not to_copy[sectype]:
@ -894,18 +951,19 @@ def fixup_objfile(objfile_name, functions, asm_prelude, assembler, output_enc):
# Move over late rodata. This is heuristic, sadly, since I can't think # Move over late rodata. This is heuristic, sadly, since I can't think
# of another way of doing it. # of another way of doing it.
moved_late_rodata = {} moved_late_rodata = {}
if any(late_rodata_dummy_bytes): if any(all_late_rodata_dummy_bytes) or any(all_jtbl_rodata_size):
source = asm_objfile.find_section('.rodata') source = asm_objfile.find_section('.rodata')
target = objfile.find_section('.rodata') target = objfile.find_section('.rodata')
source_pos = asm_objfile.symtab.find_symbol_in_section(late_rodata_source_name_start, source) source_pos = asm_objfile.symtab.find_symbol_in_section(late_rodata_source_name_start, source)
source_end = asm_objfile.symtab.find_symbol_in_section(late_rodata_source_name_end, source) source_end = asm_objfile.symtab.find_symbol_in_section(late_rodata_source_name_end, source)
if source_end - source_pos != sum(map(len, late_rodata_dummy_bytes)) * 4: if source_end - source_pos != sum(map(len, all_late_rodata_dummy_bytes)) * 4 + sum(all_jtbl_rodata_size):
raise Failure("computed wrong size of .late_rodata") raise Failure("computed wrong size of .late_rodata")
new_data = list(target.data) new_data = list(target.data)
for dummy_bytes_list in late_rodata_dummy_bytes: for dummy_bytes_list, jtbl_rodata_size in zip(all_late_rodata_dummy_bytes, all_jtbl_rodata_size):
for index, dummy_bytes in enumerate(dummy_bytes_list): for index, dummy_bytes in enumerate(dummy_bytes_list):
pos = target.data.index(dummy_bytes, last_rodata_pos) pos = target.data.index(dummy_bytes, last_rodata_pos)
if target.data.find(dummy_bytes, pos + 4) != -1: # This check is nice, but makes time complexity worse for large files:
if SLOW_CHECKS and target.data.find(dummy_bytes, pos + 4) != -1:
raise Failure("multiple occurrences of late_rodata hex magic. Change asm-processor to use something better than 0xE0123456!") raise Failure("multiple occurrences of late_rodata hex magic. Change asm-processor to use something better than 0xE0123456!")
if index == 0 and len(dummy_bytes_list) > 1 and target.data[pos+4:pos+8] == b'\0\0\0\0': if index == 0 and len(dummy_bytes_list) > 1 and target.data[pos+4:pos+8] == b'\0\0\0\0':
# Ugly hack to handle double alignment for non-matching builds. # Ugly hack to handle double alignment for non-matching builds.
@ -920,6 +978,16 @@ def fixup_objfile(objfile_name, functions, asm_prelude, assembler, output_enc):
moved_late_rodata[source_pos] = pos moved_late_rodata[source_pos] = pos
last_rodata_pos = pos + 4 last_rodata_pos = pos + 4
source_pos += 4 source_pos += 4
if jtbl_rodata_size > 0:
assert dummy_bytes_list, "should always have dummy bytes before jtbl data"
pos = last_rodata_pos
new_data[pos : pos + jtbl_rodata_size] = \
source.data[source_pos : source_pos + jtbl_rodata_size]
for i in range(0, jtbl_rodata_size, 4):
moved_late_rodata[source_pos + i] = pos + i
jtbl_rodata_positions.add(pos + i)
last_rodata_pos += jtbl_rodata_size
source_pos += jtbl_rodata_size
target.data = bytes(new_data) target.data = bytes(new_data)
# Merge strtab data. # Merge strtab data.
@ -981,7 +1049,8 @@ def fixup_objfile(objfile_name, functions, asm_prelude, assembler, output_enc):
for reltab in target.relocated_by: for reltab in target.relocated_by:
nrels = [] nrels = []
for rel in reltab.relocations: for rel in reltab.relocations:
if sectype == '.text' and rel.r_offset in modified_text_positions: if (sectype == '.text' and rel.r_offset in modified_text_positions or
sectype == '.rodata' and rel.r_offset in jtbl_rodata_positions):
# don't include relocations for late_rodata dummy code # don't include relocations for late_rodata dummy code
continue continue
# hopefully we don't have relocations for local or # hopefully we don't have relocations for local or