PKSV has a SVN repository - if you get the source code from there, you should be able to compile it with little problem.score_under, do you plan on releasing PKSV (the command‐line version, at least) for Linux and similar operating systems? I hear it works with Wine, but that option isn't available for all platforms, including mine.
If you do run into a problem, tell me.
…
#include <stdio.h>
[b]#include <windows.h>[/b]
HANDLE LogFile;
#include "pokedef.h"
#include "golddef.h"
#include "textproc.h"
…
Hehe, I could have sworn I removed that...A lot of code uses it as well.Code:… #include <stdio.h> [B]#include <windows.h>[/B] HANDLE LogFile; #include "pokedef.h" #include "golddef.h" #include "textproc.h" …
$ gcc -o pksv.out pksv2.c
In file included from pksv2.c:26:
/usr/include/malloc.h:4:2: warning: #warning "<malloc.h> is obsolete, use <stdlib.h>"
In file included from sulib.h:4,
from pksv2.c:34:
/usr/include/malloc.h:4:2: warning: #warning "<malloc.h> is obsolete, use <stdlib.h>"
In file included from pksv2.c:55:
codeproc.h:370:21: gba_asm.h: No such file or directory
In file included from codeproc.h:371,
from pksv2.c:55:
decompiler.h: In function `DecodeProcLevel':
decompiler.h:3985: error: `VersionOverride' undeclared (first use in this function)
decompiler.h:3985: error: (Each undeclared identifier is reported only once
decompiler.h:3985: error: for each function it appears in.)
decompiler.h:4106: error: `asm_buf' undeclared (first use in this function)
decompiler.h: In function `DecodeProc':
decompiler.h:4135: error: `VersionOverride' undeclared (first use in this function)
decompiler.h:4221: error: `asm_buf' undeclared (first use in this function)
decompiler.h: In function `DecodeProcASM':
decompiler.h:4248: error: `VersionOverride' undeclared (first use in this function)
decompiler.h:4285: error: `asm_buf' undeclared (first use in this function)
$ gcc -v
Reading specs from /usr/lib/gcc-lib/i386-unknown-openbsd4.5/3.3.5/specs
Configured with:
Thread model: single
gcc version 3.3.5 (propolice)
$
pksv -e ScriptFile.txt RomFile.gba -- Debug compile
pksv -r ScriptFile.txt RomFile.gba -- Compile
pksv RomFile.gba HexOffset OutputFile.txt -- Decompile
[COLOR=#000000][FONT=Lucida Console][COLOR=#ff8000]#dyn 0x800000
#define safe-val 0x100[/COLOR]
[COLOR=#008000]'Safe-val is a value definitely larger than the X and Y coords on the map, which is to avoid unsigned integer overflow.[/COLOR]
[COLOR=#ff8000]#org @start[/COLOR]
[B][COLOR=#0000c0]lockall[/COLOR][/B]
getplayerxy [COLOR=#ff0000]0x8000 0x8001[/COLOR]
addvar [COLOR=#ff0000]0x8000 safe-val[/COLOR]
addvar [COLOR=#ff0000]0x8001 safe-val[/COLOR]
subtractvar [COLOR=#ff0000]0x8000 0xA [/COLOR][COLOR=#008000]' Position X to move to[/COLOR]
subtractvar [COLOR=#ff0000]0x8001 0x9 [/COLOR][COLOR=#008000]' Position Y to move to - try this one in Pallet Town.[/COLOR]
compare [COLOR=#ff0000]0x8000 safe-val[/COLOR]
[COLOR=#0000c0][B]if[/B][/COLOR] [COLOR=#ff0000]< jump :loop2[/COLOR]
[B]:loop[/B]
[COLOR=#0000c0][B]if[/B][/COLOR] [COLOR=#ff0000]== jump :loop3_s[/COLOR]
applymovement [COLOR=#ff0000]PLAYER @run-left[/COLOR]
pauseevent [COLOR=#ff0000]0x0[/COLOR]
subtractvar [COLOR=#ff0000]0x8000 1[/COLOR]
compare [COLOR=#ff0000]0x8000 safe-val[/COLOR]
[COLOR=#0000c0][B]jump[/B][/COLOR] [COLOR=#ff0000]:loop[/COLOR]
[B]:loop2[/B]
compare [COLOR=#ff0000]0x8000 safe-val[/COLOR]
[COLOR=#0000c0][B]if[/B][/COLOR] [COLOR=#ff0000]== jump :loop3_s[/COLOR]
applymovement [COLOR=#ff0000]PLAYER @run-right[/COLOR]
pauseevent [COLOR=#ff0000]0x0[/COLOR]
addvar [COLOR=#ff0000]0x8000 1[/COLOR]
[COLOR=#0000c0][B]jump[/B][/COLOR] [COLOR=#ff0000]:loop2[/COLOR]
[B]:loop3_s[/B]
compare [COLOR=#ff0000]0x8001 safe-val[/COLOR]
[COLOR=#0000c0][B]if[/B][/COLOR] [COLOR=#ff0000]< jump :loop4[/COLOR]
[B]:loop3[/B]
[COLOR=#0000c0][B]if[/B][/COLOR] [COLOR=#ff0000]== jump :endloops[/COLOR]
applymovement [COLOR=#ff0000]PLAYER @run-up[/COLOR]
pauseevent [COLOR=#ff0000]0x0[/COLOR]
subtractvar [COLOR=#ff0000]0x8001 1[/COLOR]
compare [COLOR=#ff0000]0x8001 safe-val[/COLOR]
[COLOR=#0000c0][B]jump[/B][/COLOR] [COLOR=#ff0000]:loop3[/COLOR]
[B]:loop4[/B]
compare [COLOR=#ff0000]0x8001 safe-val[/COLOR]
if [COLOR=#ff0000]== jump :endloops[/COLOR]
applymovement [COLOR=#ff0000]PLAYER @run-down[/COLOR]
pauseevent [COLOR=#ff0000]0x0[/COLOR]
addvar [COLOR=#ff0000]0x8001 1[/COLOR]
jump [COLOR=#ff0000]:loop4[/COLOR]
[B]:endloops[COLOR=#0000c0]
releaseall
end[/COLOR][/B]
[COLOR=#ff8000]#org @run-left[/COLOR]
[COLOR=#ff0000]m[/COLOR][COLOR=#008000] run_left end[/COLOR]
[COLOR=#ff8000]#org @run-right[/COLOR]
[COLOR=#ff0000]m[/COLOR][COLOR=#008000] run_right end[/COLOR]
[COLOR=#ff8000]#org @run-up[/COLOR]
[COLOR=#ff0000]m[/COLOR][COLOR=#008000] run_up end[/COLOR]
[COLOR=#ff8000]#org @run-down[/COLOR]
[COLOR=#ff0000]m[/COLOR][COLOR=#008000] run_down end[/COLOR][/FONT][/COLOR]
#org 0x8800638
'-----------------------------------
checkflag 0x9999
if 0x1 jump 0x88006F6 ' Equal To
msgbox 0x8800657 ' I found this helples...
callstd MSG_NORMAL ' Normal message
addpokemon 0x4 0xB 0x0 0x0 0xF000000 0xC300C300
setflag 0x9999
#org 0x88006F6
'-----------------------------------
msgbox 0x88006FF ' Please take it away.
callstd MSG_NORMAL ' Normal message
end
#org 0x8800657
= take this Charmander.
#org 0x88006FF
= Please take it away.
#org 0x8800638
'-----------------------------------
checkflag 0x9999
if 0x1 jump 0x88006F6 ' Equal To
msgbox 0x8800657 ' I found this helples...
callstd MSG_NORMAL ' Normal message
addpokemon 0x4 0xB 0x0 0x0 0xF000000 0xC300C300
nop0 ' #raw 0x0
#raw 0xDA
#raw 0xE3
#raw 0xE9
#raw 0xE2
#raw 0xD8
nop0 ' #raw 0x0
#raw 0xE8
#raw 0xDC
#raw 0xDD
#raw 0xE7
nop0 ' #raw 0x0
#raw 0xDC
#raw 0xD9
#raw 0xE0
#raw 0xE4
#raw 0xE0
#raw 0xD9
#raw 0xE7
#raw 0xE7
CMD_FE 0x0
#raw 0xBD
updatecoins 0xBB 0xCC
textcolor 0xBB 'Sets text color (Fire Red).
#raw 0xC8
#raw 0xBE
#raw 0xBF
checkobedience 0x0 0xE0D5
#raw 0xE3
#raw 0xE2
#raw 0xD9
CMD_FB 0xE2DD00
#raw 0xE9
#raw 0xE4
nop0 ' #raw 0x0
#raw 0xDC
#raw 0xD9
#raw 0xE6
#raw 0xD9
setdoorclosed 0xC300 0xE800
#raw 0xDC
#raw 0xDD
#raw 0xE2
#raw 0xDF
CMD_FE 0x0
#raw 0xDD
#raw 0xE8
nop0 ' #raw 0x0
#raw 0xDA
#raw 0xD9
#raw 0xE0
#raw 0xE0
nop0 ' #raw 0x0
#raw 0xDA
#raw 0xE6
#raw 0xE3
#raw 0xE1
nop0 ' #raw 0x0
#raw 0xE9
#raw 0xE4
nop0 ' #raw 0x0
#raw 0xDC
#raw 0xD9
#raw 0xE6
#raw 0xD9
setdoorclosed 0xC3FB 0xE7E8
nop0 ' #raw 0x0
#raw 0xDC
#raw 0xD9
#raw 0xD5
#raw 0xE0
#raw 0xE8
#raw 0xDC
#raw 0xED
nop0 ' #raw 0x0
#raw 0xE4
#raw 0xE0
#raw 0xD9
#raw 0xD5
#raw 0xE7
#raw 0xD9
nop0 ' #raw 0x0
#raw 0xE8
#raw 0xD5
#raw 0xDF
#raw 0xD9
nop0 ' #raw 0x0
#raw 0xDD
#raw 0xE8
CMD_FE 0x0
#raw 0xEB
#raw 0xDD
#raw 0xE8
#raw 0xDC
nop0 ' #raw 0x0
#raw 0xED
#raw 0xE3
#raw 0xE9
setdoorclosed 0xCAFF 0xD9E0
#raw 0xD5
#raw 0xE7
#raw 0xD9
nop0 ' #raw 0x0
#raw 0xDB
#raw 0xDD
#raw 0xEA
#raw 0xD9
nop0 ' #raw 0x0
#raw 0xBD
updatecoins 0xBB 0xCC
textcolor 0xBB 'Sets text color (Fire Red).
#raw 0xC8
#raw 0xBE
#raw 0xBF
checkobedience 0x0 0xD5FE
nop0 ' #raw 0x0
#raw 0xDB
#raw 0xE3
#raw 0xE3
#raw 0xD8
nop0 ' #raw 0x0
#raw 0xDC
#raw 0xE3
#raw 0xE1
#raw 0xD9
setdoorclosed 0xFFF 0xFF00
if 0x80 jump 0x2060908 ' Unknown IF condition
'Jump not in ROM area
msgboxsign
#raw 0xE0
#raw 0xD9
#raw 0xD5
#raw 0xE7
#raw 0xD9
nop0 ' #raw 0x0
#raw 0xE8
#raw 0xD5
#raw 0xDF
#raw 0xD9
nop0 ' #raw 0x0
#raw 0xDD
#raw 0xE8
nop0 ' #raw 0x0
#raw 0xD5
#raw 0xEB
#raw 0xD5
#raw 0xED
setdoorclosed 0xFFFF 0xFFFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
'Decompiler stopped due to failsafe mechanism (too many #RAW 0xFF commands)
#org 0x88006F6
'-----------------------------------
msgbox 0x88006FF ' Please take it away.
callstd MSG_NORMAL ' Normal message
end
#org 0x8800657
= I found this helpless\n CHARMANDER alone\p in up here. I think\n it fell from up here.\pIts healthy please take it\n with you.
#org 0x88006FF
= Please take it away.
MY code messed up please help
i put in this code
Then it turned into this after i compiled itCode:#org 0x8800638 '----------------------------------- checkflag 0x9999 if 0x1 jump 0x88006F6 ' Equal To msgbox 0x8800657 ' I found this helples... callstd MSG_NORMAL ' Normal message addpokemon 0x4 0xB 0x0 0x0 0xF000000 0xC300C300 setflag 0x9999 #org 0x88006F6 '----------------------------------- msgbox 0x88006FF ' Please take it away. callstd MSG_NORMAL ' Normal message end #org 0x8800657 = take this Charmander. #org 0x88006FF = Please take it away.
#[B]eorg [/B]0x8800638
'-----------------------------------
checkflag 0x9999
if 0x1 jump 0x88006F6 ' Equal To
msgbox 0x8800657 ' I found this helples...
callstd MSG_NORMAL ' Normal message
addpokemon 0x4 0xB 0x0 0x0 0xF000000 0xC300C300
setflag 0x9999
#[B]eorg [/B]0x88006F6
'-----------------------------------
msgbox 0x88006FF ' Please take it away.
callstd MSG_NORMAL ' Normal message
end
#[B]eorg [/B]0x8800657
= take this Charmander.
#[B]eorg [/B]0x88006FF
= Please take it away.
[B]#dynamic 0x800000[/B]
#org [B]@start[/B]
'-----------------------------------
[B]lock
faceplayer[/B]
checkflag 0x251
if true jump [B]@already-have[/B]
msgbox [B]@take-this[/B]
callstd MSG_NORMAL
addpokemon CHARMANDER 0xB 0x0 0x0 [B]0x0000000 0x00000000[/B]
setflag 0x251
[B]release[/B]
[B]end[/B]
#org [B]@already-have[/B]
'-----------------------------------
msgbox [B]@take-it-away[/B]
callstd MSG_NORMAL
[B]release[/B]
end
#org [B]@take-this[/B]
= take this Charmander.
#org [B]@take-it-away[/B]
= Please take it away.
It might be a good idea to make these display when run with no arguments (or --help). Also, the program segfaults when called with any fewer arguments—you might want to fix that. A -v flag for checking the version would be nice too.They're pretty much strictly fixed, but here they are:
Code:pksv -e ScriptFile.txt RomFile.gba -- Debug compile pksv -r ScriptFile.txt RomFile.gba -- Compile pksv RomFile.gba HexOffset OutputFile.txt -- Decompile
No, I was only planning to implement THUMB and ARM. Would it be desirable to implement GB-Z80?It might be a good idea to make these display when run with no arguments (or --help). Also, the program segfaults when called with any fewer arguments—you might want to fix that. A -v flag for checking the version would be nice too.
I do prefer the command‐line version, because I already have a text editor. :P
You mentioned THUMB—are you planning support for GB‐Z80 in the future?
It would be for me, as the GBA games are the ones I don't hack. ;)No, I was only planning to implement THUMB and ARM. Would it be desirable to implement GB-Z80?
Make sure that it's either using a clean offset or a #dynamic offset, and then load it and the ROM into the script editor (you can do both via drag'n'drop) then press F9 inside PKSV.Ive made a new script with this prog. and how can i give this script now in the pokemon game?
Its the first time ive done any script :D