Browse Source

more work on push, sin and cos fixed

tags/v0.1
parent
commit
afc187c8be
Signed by: govanify GPG Key ID: DE62E1E2A6145556
2 changed files with 20 additions and 15 deletions
  1. +19
    -13
      data/languages/kh2ai.sinc
  2. +1
    -2
      notes.txt

+ 19
- 13
data/languages/kh2ai.sinc View File

@@ -57,20 +57,22 @@ define pcodeop system_call;
:push2_unk0 is opcode_ext=0 & sub_opc_ext=2 & opesub=0 ; opcode {
}

# push and add
:pusha rn, ope2 is opcode_ext=0 & sub_opc_ext=2 & opesub=1 & ope2 & rn {
# push and add to pointer
:pushap rn, ope2 is opcode_ext=0 & sub_opc_ext=2 & opesub=1 & ope2 & rn {
}

:push2_unk2 is opcode_ext=0 & sub_opc_ext=2 & opesub=2 {
}

:push LABEL02 is opcode_ext=0 & sub_opc_ext=2 & opesub=3 & LABEL02 {
}

#push and add
:push3_unk0 is opcode_ext=0 & sub_opc_ext=3 & opesub=0 {
}

#push and add
:push3_unk1 is opcode_ext=0 & sub_opc_ext=3 & opesub=1 {
:pusha rn, ope2 is opcode_ext=0 & sub_opc_ext=3 & opesub=1 & ope2 & rn {
}

#push and add
@@ -81,6 +83,9 @@ define pcodeop system_call;
:push3_unk3 is opcode_ext=0 & sub_opc_ext=3 & opesub=3 {
}




# sometimes it has arguments, to check!
:pop is opcode_ext=1 {
}
@@ -255,13 +260,16 @@ define pcodeop system_call;
# 0x6 =========


:jmp7_unk1 is opcode_ext=7 & ope3=0 {
:jmp7_unk1 LABEL8 is opcode_ext=7 & ope3=0 & LABEL8 {
call LABEL8;
}

:jmp7_unk2 is opcode_ext=7 & ope3=1 {
:jmp7_unk2 LABEL8 is opcode_ext=7 & ope3=1 & LABEL8 {
call LABEL8;
}

:jmp7_unk3 is opcode_ext=7 & ope3=2 {
:jmp7_unk3 LABEL8 is opcode_ext=7 & ope3=2 & LABEL8 {
call LABEL8;
}

# jump
@@ -289,14 +297,12 @@ define pcodeop system_call;
:pushc is opcode=9 & ssub_opc=5{
}

# cosinus
# small note: i might have inversed sinus and cosinus as i did not reverse
# either functions, they were pretty batshit insane
:cos is opcode=9 & ssub_opc=6{
# sinus; arg in radians
:sin is opcode=9 & ssub_opc=6{
}

# sinus
:sin is opcode=9 & ssub_opc=7{
# cosinus; arg in radians
:cos is opcode=9 & ssub_opc=7{
}

# degrees to radians


+ 1
- 2
notes.txt View File

@@ -74,8 +74,7 @@ TODO:
0x2: to reverse
0x3: to reverse
0x4: to reverse
0x7: to reverse, 2 ops
0xB: to reverse
-----
0x8: figure out first arg of jmp, offset?
0x9: verify which is sin and which is cos
0x7: figure out args and diff between 3 jmp

Loading…
Cancel
Save