From d90767c49059b76bde4328f30ce344b5c88efabd Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sun, 31 Mar 2019 15:24:46 +0200 Subject: [PATCH] Switch effect and argument fields in BattleMove struct --- asmdiff.ps1 | 114 ---------------------------------------------- include/pokemon.h | 6 +-- 2 files changed, 2 insertions(+), 118 deletions(-) delete mode 100644 asmdiff.ps1 diff --git a/asmdiff.ps1 b/asmdiff.ps1 deleted file mode 100644 index 169f14776b..0000000000 --- a/asmdiff.ps1 +++ /dev/null @@ -1,114 +0,0 @@ -Param -( - [Parameter(Position = 0)] - [string]$Start, - - [Parameter(Position = 1)] - [string]$Offset, - - [Parameter()] - [string[]]$DiffTool -) - -$ErrorActionPreference = "Stop" - -$offset_default_value = "0x100" -$diff_tool_default_value = "diff" - -$help = " -$($args[0]) [OPTIONS] Start [Offset] - -Performs a diff on the assembly of a function in a rom. 'Start' is the start -location of the function, and 'Offset' is the number of bytes to disassemble. -The assembly is saved to *.dump files. - -'Offset' is optional, and defaults to $offset_default_value. If this value is -very large (0x10000+), objdump may hang / freeze. - -Requirements: - - A clean copy of the rom named 'baserom.gba'. - - $$ENV:DEVKITARM to point to the installation of devkitpro. By default, it is - installed to 'C:\devkitpro\devkitARM'. - -Options: - -DiffTool The tool to use for diffing. Defaults to '$diff_tool_default_value'. For VSCode, - you can use -DiffTool 'code --diff'. (Quotes are necessary around 'code --diff') -" - -if ((-not (Test-Path variable:Start)) -or [string]::IsNullOrWhiteSpace($Start)) -{ - Write-Host $help - exit -} - -if (-not (Test-Path variable:DiffTool) -or [string]::IsNullOrWhiteSpace($DiffTool)) -{ - $DiffTool = $diff_tool_default_value -} - -if (-not (Test-Path variable:Offset) -or [string]::IsNullOrWhiteSpace($Offset)) -{ - $Offset = $offset_default_value -} - -if (-Not (Test-Path env:DEVKITARM)) -{ - Write-Host "ENV:DEVKITARM variable not set." - Write-Host $help - exit -} - -if (-Not (Test-Path $env:DEVKITARM)) -{ - Write-Host "DEVKITARM path '$env:DEVKITARM' does not exist." - Write-Host $help - exit -} - -if (-Not (Test-Path ".\pokeemerald.gba")) -{ - Write-Host "File 'pokeemerald.gba' not found." - Write-Host $help - exit -} - -if (-Not (Test-Path ".\baserom.gba")) -{ - Write-Host "File 'baserom.gba' not found." -} - -try -{ - $start_num = [System.Convert]::ToUInt64($Start, 16) -} -catch -{ - Write-Host "Error parsing '$start_num' as a hex number." - Write-Host $help - exit -} - -try -{ - $offset_num = [System.Convert]::ToUInt64($Offset, 16) -} -catch -{ - Write-Host "Error parsing '$offset_num' as a hex number." - Write-Host $help - exit -} - -if ($start_num -gt 0x1000000) -{ - Write-Host "Warning: Start address is larger than the ROM file. Hint: ignore the leading number in the address." -} - -$end_str = [System.Convert]::ToString($start_num + $offset_num, 16) -$end_str = "0x$end_str" - -Write-Host "$Start - $end_str" -$objdump = Join-Path -Path $env:DEVKITARM -ChildPath "arm-none-eabi\bin\objdump.exe" -&$objdump -D -bbinary -marmv4t -Mforce-thumb --start-address="$Start" --stop-address="$end_str" .\baserom.gba > .\baserom.dump -&$objdump -D -bbinary -marmv4t -Mforce-thumb --start-address="$Start" --stop-address="$end_str" .\pokeemerald.gba > .\pokeemerald.dump -Invoke-Expression "$DiffTool .\baserom.dump .\pokeemerald.dump" diff --git a/include/pokemon.h b/include/pokemon.h index 20e329c4a5..e976dc1a4e 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -336,11 +336,9 @@ struct BaseStats u8 noFlip : 1; }; -// Argument and effect field are temporarily switched till functions referencing gBattleMoves are decompiled. - struct BattleMove { - u8 argument; + u16 effect; u8 power; u8 type; u8 accuracy; @@ -350,7 +348,7 @@ struct BattleMove s8 priority; u32 flags; u8 split; - u16 effect; + u8 argument; }; struct SpindaSpot