Announcement

Collapse
No announcement yet.

(Artemis) Code Types

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • (Artemis) Code Types

    Hi everyone,

    I'm currently (re)implementing the code types for Artemis' cheat engine. As this project is a community effort, I'm asking you for feedback and suggestions on new code types.

    Here's the current list of supported types. As you'll notice, this is heavily inspired by CodeBreaker.

    Code:
    Code Types supported by Artemis
    written by misfire <[email protected]>
    Last update: Jul 22 2009
    
    
    Overview:
    
    0 - 8-bit constant write
    1 - 16-bit constant write
    2 - 32-bit constant write
    3 - Increment / Decrement
    4 - 32-bit constant serial write
    5 - Copy bytes
    6 - Pointer write
    7 - Boolean operation
    8 - TODO
    9 - Hook code
    A - TODO
    B - TODO
    C - 32-bit do all following codes if equal to
    D - Do multi-lines if conditional
    E - should be converted to D code type for backwards compatibility
    F - TODO
    
    
    "8-bit constant write"
    
    0-aaaaaaa 000000vv
    
    a = address (25 bits)
    v = value (8 bits)
    
    Constantly writes the 8-bit value @v to address @a.
    The address can be odd or even.
    
    Example:
    002BAA31 00000063
    The 8-bit value 0x63 is repeatedly written to memory location 0x002BAA31.
    
    --------------------
    
    "16-bit constant write"
    
    1-aaaaaaa 0000vvvv
    
    a = address (25 bits)
    v = value (16 bits)
    
    Constantly writes the 16-bit value @v to address @a.
    The address must be aligned to 2.
    
    Example:
    107657B2 0000FFFF
    The 16-bit value 0xFFFF is repeatedly written to memory location 0x007657B2.
    
    --------------------
    
    "32-bit constant write"
    
    2-aaaaaaa vvvvvvvv
    
    a = address (25 bits)
    v = value (32 bits)
    
    Constantly writes the 32-bit value @v to address @a.
    The address must be aligned to 4.
    
    Example:
    20417A64 42C80000
    The 32-bit value 0x42C80000 is repeatedly written to memory location 0x00417A64.
    
    --------------------
    
    "Increment / Decrement"
    
    8-bit increment
    3-00000vv 0aaaaaaa
    
    8-bit decrement
    3-01000vv 0aaaaaaa
    
    16-bit increment
    3-020vvvv 0aaaaaaa
    
    16-bit decrement
    3-030vvvv 0aaaaaaa
    
    32-bit increment
    3-0400000 0aaaaaaa
    vvvvvvvv 00000000
    
    32-bit decrement
    3-0500000 0aaaaaaa
    vvvvvvvv 00000000
    
    a = address (25 bit)
    v = value (8/16/32 bit)
    
    It increments/decrements the current value at address @a by value @v.
    Only used with a joker code above it!
    
    Example:
    30000005 0012AC29
    This will add the 8-bit value 0x05 to the value at address 0x0012AC29.
    
    --------------------
    
    "32-bit constant serial write"
    
    4-aaaaaaa nnnnssss
    vvvvvvvv iiiiiiii
    
    a = start address (25 bits)
    n = number of times to write (16 bits)
    s = size of address step (divided by 4) (16 bits)
    v = start value (32 bits)
    i = size of value step (32 bits)
    
    Starting with address @a, this code type will write the 32-bit value @v to @n
    addresses. In each cycle, the address is incremented by @s * 4 and the value is
    incremented by @i.
    
    Example 1:
    402E8390 00040001
    FFFFFFFF 00000000
    - writes 0xFFFFFFFF to 0x002E8390
    - writes 0xFFFFFFFF to 0x002E8394
    - writes 0xFFFFFFFF to 0x002E8398
    - writes 0xFFFFFFFF to 0x002E839C
    
    Example 2:
    4099A20C 00060002
    00000000 00100000
    - writes 0x00000000 to 0x0099A20C
    - writes 0x00100000 to 0x0099A214
    - writes 0x00200000 to 0x0099A21C
    - writes 0x00300000 to 0x0099A224
    - writes 0x00400000 to 0x0099A22C
    - writes 0x00500000 to 0x0099A234
    
    --------------------
    
    "Copy bytes"
    
    5-sssssss nnnnnnnn
    0ddddddd 00000000
    
    s = address to copy from (25 bits)
    n = number of bytes to copy (32 bits)
    d = address to copy to (25 bits)
    
    Copies a block of @n bytes from source address @s to destination address @d.
    This is done repeatedly, so you need a D code in front of it to only copy stuff
    once.
    
    Example:
    50339328 00000008
    0036AED4 00000000
    Copy 8 bytes from memory location 0x00339328 to 0x0036AED4.
    
    --------------------
    
    "Pointer write"
    
    8-bit write
    6-aaaaaaa 000000vv
    00000000 iiiiiiii
    
    16-bit write
    6-aaaaaaa 0000vvvv
    00010000 iiiiiiii
    
    32-bit write
    6-aaaaaaa vvvvvvvv
    00020000 iiiiiiii
    
    a = address to load 32-bit base address from (25 bits)
    v = value to store at base + offset (8/16/32 bits)
    i = 32-bit offset to be added to base
    
    Loads 32-bit base address from address @a, adds offset @i to it, and constantly
    writes the value @v to the final address.
    Note that execution stops if base is equal to 0.
    
    Example:
    6018F6D4 000003E7
    00010000 00000156
    - loads base address from address 0x0018F6D4, say base is 0x001A0000
    - adds offset 0x00000156 to base to make final address 0x001A0156 where 16-bit
    value 0x03E7 will be written to
    
    --------------------
    
    "Boolean operation"
    
    8-bit OR
    7-aaaaaaa 000000vv
    
    16-bit OR
    7-aaaaaaa 0010vvvv
    
    8-bit AND
    7-aaaaaaa 002000vv
    
    16-bit AND
    7-aaaaaaa 0030vvvv
    
    8-bit XOR
    7-aaaaaaa 004000vv
    
    16-bit XOR
    7-aaaaaaa 0050vvvv
    
    a = address (25 bits)
    v = value (8/16 bits)
    
    Performs a bitwise logical operation between value @v and the value stored at
    address @a.
    
    Example:
    7048D402 005014A9
    0x14A9 is XORed to the 16-bit value at address 0x0048D402.
    
    --------------------
    
    "Hook code"
    
    9-aaaaaaa vvvvvvvv
    
    a = address (25 bits)
    v = value (32 bits)
    
    This code will "hook" the game and is essential for most of the other types to
    work. It hard-codes a jal to the cheat engine at address @a if the 32-bit value
    at @a is equal to value @v. The address @a needs to be inside a function which
    is called many times a second, e.g. scePadRead().
    To cheat on multi-ELF games, create a 9 code for each ELF.
    
    Example:
    902D51F8 0C0B95F6
    Insert hook if 32-bit value at address 0x002D51F8 is equal to 0x0C0B95F6.
    
    --------------------
    
    "32-bit do all following codes if equal to"
    
    C-aaaaaaa vvvvvvvv
    
    a = address (25 bits)
    v = value (32 bits)
    
    All following codes will be executed only if 32-bit value at address @a is equal
    to value @v. Can be used to exit the code sequence at any point. To act on all
    codes (like traditional "Auto Activation") put it at the top of the code list.
    
    Example:
    C0153880 03E00008
    If the 32-bit value 0x03E00008 is at address 0x00153880, then activate all
    following codes; otherwise, do nothing.
    
    --------------------
    
    "Do multi-lines if conditional"
    
    16-bit test
    D-aaaaaaa nnt0vvvv
    
    8-bit test
    D-aaaaaaa nnt100vv
    
    a = address (25 bits)
    n = number of lines to execute (8 bits)
    t = test condition (3 bits)
        0 equal      1 not equal
        2 less than  3 greater than
        4 NAND       5 AND
        6 NOR        7 OR
    v = value (8/16 bits)
    
    Compares value at address @a to value @v, and executes next @n code lines only
    if the test condition @t is true.
    
    Example:
    D00802CC 07002882
    200802CC 8C860000
    200802D0 10C00033
    200802D4 00050C02
    200802D8 00C13021
    200802DC 10000030
    200802E0 A4C50000
    100800BC 00000083
    Activate next 7 lines of code if 16-bit value at address 0x000802CC is equal to
    0x2882; otherwise, skip the 7 code lines.
    Last edited by misfire; 07-22-2009, 12:58:41 PM.

  • #2
    I'll look through the old tentative specs, and make some suggestions later today.
    I may be lazy, but I can...zzzZZZzzzZZZzzzZZZ...

    Comment


    • #3
      Ok, here're the code types I'm planning to add:

      3 - Increment/Decrement
      6 - Pointer code
      8 - 16-bit do multi-lines on boot if equal to
      A - 32-bit write on boot

      Also, I think we can move the functionality of the C code to D and use it for other things (I've never seen the C code in use.)

      Comment


      • #4
        Pyriel have used the C type on Sega Genesis Collection for PS2
        Last edited by lee4; 07-21-2009, 08:28:38 AM.
        lee4 Does Not Accept Codes Requests !
        When lee4 asks a question it does not mean lee4 will look at your game
        *How to create and use SegaCD codes >click here<*
        >)

        Comment


        • #5
          Thanks for the information. He also used the 6 type a lot which is on the to-do list.

          Comment


          • #6
            These are just copied and pasted from the old code types spec sheet, so the actual code type number is not relevant.

            03 - Single Increment

            Increment (increase) value at address specified by value specified ONCE, then stop. This will generally be used with an If, Then code above it, as such:

            10 0004A6B4 00000008 (if value at 0004A6B4 is 00000008...)
            03 00053468 00000005 (Increase value at 00053468 by 5, then stop)

            For incrementation to occur again, the condition must be made untrue, then true again. For example, the above code would decrease the value at the address 00053468 by 5 (again, just once, not in constant write). The value at 00053468 would not be incremented again unless the value at 0004A6B4 was changed to something else, then back to 00000008 again.
            __________________________________________________ _______






            04 - Single Decrement

            Decrement (decrease) value at address specified by value specified ONCE, then stop. This will generally be used with an If, X code above it, as such:

            10 0004A6B4 00000008 (if value at 0004A6B4 is 00000008...)
            04 00053468 00000005 (decrease value at 00053468 by 5, then stop)

            For decrementation to occur again, the condition must be made untrue, then true again. For example, the above code would decrease the value at the address 00053468 by 5 (again, just once, not in constant write). The value at 00053468 would not be decremented again unless the value at 0004A6B4 was changed to something else, then back to 00000008 again.




            07 - Increment, Controlled

            Increment (increase) value at address specified by amount specified, at rate specified.


            07 ZZZZZZZZ xxxxyyyy

            ZZZZZZZZ = Address

            xxxx = How fast (how often) the value is incremented.

            0001 = once every 5 seconds. FFFF = insanely fast

            yyyy = How much the value is incremented by.

            Example:

            10 0004A6B4 00000008 (if 0004A6B4's value is 00000008...)
            07 0004AA28 00010001 (then increase address 0004AA28 by 00000001 every 5 seconds.)
            __________________________________________________ ___________













            08 - Decrement, Controlled

            Decrement (decrease) value at address specified by amount specified, at rate specified.


            08 zzzzzzzz xxxxyyyy

            ZZZZZZZZ = Address

            xxxx = How fast (how often) the value is decremented. 0001 = once every 5 seconds. FFFF = insanely fast

            yyyy = How much the value is decremented by.

            Example:

            10 0004A6B4 00000008 (if 0004A6B4's value is 00000008...)
            08 0004AA28 00010001 (then decrease address 0004AA28 by 00000001 every 5 seconds.
            __________________________________________________ __________________________




            There should also be a 32-bit conditional of some sort...
            I may be lazy, but I can...zzzZZZzzzZZZzzzZZZ...

            Comment


            • #7
              Increment and decrement will be handled by code type 3 (8/16/32 bit).

              Comment


              • #8
                Ah.

                Specifically, I'm concerned with single and controlled increment/decrement (I'm not even sure how we could achieve a single increment/decrement, but it would be a great feature...but controlled increment/decrement should definitely be implemented).
                I may be lazy, but I can...zzzZZZzzzZZZzzzZZZ...

                Comment


                • #9
                  Originally posted by misfire View Post
                  Ok, here're the code types I'm planning to add:
                  8 - 16-bit do multi-lines on boot if equal to
                  A - 32-bit write on boot
                  I personally never see 8, A and B type been use on Codebreaker.
                  Originally posted by Lazy Bastard View Post
                  Ah.

                  Specifically, I'm concerned with single and controlled increment/decrement (I'm not even sure how we could achieve a single increment/decrement, but it would be a great feature...but controlled increment/decrement should definitely be implemented).
                  The B type would be handy in this matter use as delay timer
                  lee4 Does Not Accept Codes Requests !
                  When lee4 asks a question it does not mean lee4 will look at your game
                  *How to create and use SegaCD codes >click here<*
                  >)

                  Comment


                  • #10
                    CodeBreaker's code type B-0000000 vvvvvvvv puts a delay on all following codes for @v cycles.

                    When you hook a game's scePadRead() with a 9 code, you really need the A code in order to patch the video mode, for instance. The 2 code would be called too late (i.e. when the GS is already initialized).

                    I haven't seen the 8 code in use either.

                    Comment


                    • #11
                      Originally posted by Lazy Bastard View Post
                      Ah.

                      Specifically, I'm concerned with single and controlled increment/decrement (I'm not even sure how we could achieve a single increment/decrement, but it would be a great feature...but controlled increment/decrement should definitely be implemented).
                      If you mean by using the controller to increment / decrement, then controlling is rather simple. You need a Boolean check to see if you are holding down the button on the controller or not. If it reads True, it will not increment/decrement, if it reads False, it will increment/decrement then set the Boolean value to True. When you let go of the button, it returns it to false. In my programming I also set the variable name as "hold" to see if I am holding the button or not. For a cheat code, write a small routine for the extra checks.

                      Comment


                      • #12
                        Ah, yes. I somehow didn't even consider that, and I've used it in PS2 GUI development, heh (Parasyte pointed it out to me, in fact).
                        I may be lazy, but I can...zzzZZZzzzZZZzzzZZZ...

                        Comment


                        • #13
                          Are you sure Codebreaker's vcycle command isn't just a one timed delayed activator the same Action Replay's C type?


                          C1000000 YYYY - Delays codes from being on by YYYY time when the game starts. 4000-5000 should give 20-30 seconds.

                          I often wondered why you can't just hook the sceGsSyncV instead of scePadRead and scesifsendcmd it's called before them.
                          Last edited by kh2k4; 07-21-2009, 04:28:51 PM.
                          http://bh-re-db.pcriot.com/ <- Biohazard / Resident Evil
                          Code Database

                          Comment


                          • #14
                            Would there be a way to modify the serial repeater 4 code type?
                            Need a way to specify whether to modify 1, 2, or 4 bytes, and then to modify if it is constant write, constant OR, constant AND, or constant XOR. I've never actually seen an XOR code type used, otherwise I have this in mind:

                            4(???a)aaaaaa
                            The address is still 25 bits, those ?'s are bits to change that. The problem is there isn't room for the 1 byte constant AND, and no XORs if anyone wants those.

                            40000000 to 41ffffff are 4 byte constant writes.
                            42000000 to 43ffffff are 4 byte constant ORs.
                            44000000 to 45ffffff are 4 byte constant ANDs.

                            46000000 to 47ffffff are 2 byte constant writes.
                            48000000 to 49ffffff are 2 byte constant ORs.
                            4a000000 to 4bffffff are 2 byte constant ANDs.

                            4c000000 to 4dffffff are 1 byte constant writes.
                            4e000000 to 4fffffff are 1 byte constant ORs.

                            Don't use this. It would be nice to have this sort of control with that code type. RPGs could really use this with many characters with many ORs to turn on statuses and ANDs to remove some. Mayn things have 99 whatever or 999 whatever too.
                            July 7, 2019

                            https://www.4shared.com/s/fLf6qQ66Zee
                            https://www.sendspace.com/file/jvsdbd

                            Comment


                            • #15
                              @kh2k4: Yes, I'm sure because I reverse-engineered most of CodeBreaker's interesting code, and the C type is also used for the same purpose by Xploder V4.

                              @bungholio: This is possible. We could use one of the @n digits to indicate the operation without affecting compatibility. I guess nobody actually sets @n to high value. So the 4 code becomes something like this:

                              4-aaaaaaa xnnnssss
                              vvvvvvvv iiiiiiii

                              Values for x:
                              0 - 32-bit write
                              1 - 32-bit OR
                              2 - 32-bit AND
                              3 - 32-bit XOR
                              4 - 16-bit write
                              5 - 16-bit OR
                              6 - 16-bit AND
                              7 - 16-bit XOR
                              8 - 8-bit write
                              9 - 8-bit OR
                              a - 8-bit AND
                              b - 8-bit XOR
                              What do you say?

                              Comment

                              Working...
                              X