What's an offset? What's an IO register?

gukingofheart

Well-Known Member
OP
Member
Joined
Feb 2, 2022
Messages
235
Trophies
0
Age
124
XP
444
Country
United States
42304300 00000002
Writes 2 to the offset(&offset) of the address located in 0x3004300.

What does this mean? This was a test code, so not sure how to use this yet.

C6304300 00000002
Writes 2 to 0x4004300 in the IO Register.

What's an IO register?
 

metroid maniac

An idiot with an opinion
Member
Joined
May 16, 2009
Messages
2,092
Trophies
2
XP
2,704
Country
42304300 00000002
Writes 2 to the offset(&offset) of the address located in 0x3004300.

What does this mean? This was a test code, so not sure how to use this yet.
This description is a little poorly written. It just means that the address stored at 0x3004300 is the location of the write.
C6304300 00000002
Writes 2 to 0x4004300 in the IO Register.

What's an IO register?
The CPU interacts with I/O devices by reading or writing to special memory addresses which trigger behaviour. For example, if the byte 0 is written to 0x4000208 then interrupts are disabled, and if the byte 1 is written then interrupts are enabled.
You can check GBATEK for a listing of all the known I/O registers.
 

FAST6191

Techromancer
Editorial Team
Joined
Nov 21, 2005
Messages
36,798
Trophies
3
XP
28,405
Country
United Kingdom
While I can discern this is supposed to be gameshark v3 codes it is best to specify.

Offsets. In this context sometimes you will want data to appear at a different location to the value in the cheat itself.
This can be because it is a pointer driven value (the GBA can use C coding which means the memory does not have to be all known locations from when the devs made it as it would be for assembly*) or because the same data structure may be repeated a few times and you don't want to fiddle with slide codes. For instance if you had say 4 party members each with their own stats you might be interested in only editing say member 3 for this and could adjust the offset accordingly.

*theoretically you could dynamically allocate in assembly, or do it as an anti cheat but nobody does the former. Seen it as an anti cheat enough though.

https://doc.kodewerx.org/hacking_gba.html#ardescribe has a cleaner description
42a0aaaa xxxxyyyy 16-bit Pointer RAM Write
Writes yyyy to the address located in 0a00aaaa + xxxx * 2.

gbatek's version
42aaaaaa xxxxyyyy [ [a0aaaaa] + xxxx*2 ]=yyyy (Indirect)
The multiply by two (or indeed shifting the data as it will likely be considered by people playing in ARM code or indeed how it is likely achieved -- I believe I mentioned best to learn about shifts, rotates and such in addition to the boolean logic in a previous thread. The short version being much like the quick way of multiplying by 10 in decimal is to move the decimal place then in binary multiplying by 2 means you shift all the numbers along, dividing by 2 going the other way and reason most experience multiplier cheats in games run 2x, 4x,8x,16x,32x... ) losing a small amount of precision over not that but at the same time allowing a far larger range to be applicable.

I/O registers are how the system communicates with its peripherals -- the CPU is sitting there in space as it were (ARM don't care what it is used for, some alarm system, mobile phone, air conditioning controller, SD card.... or game console) with no particular notion of what surrounds it. Easy enough to then attach all the devices** to memory and have that be the means by which the system works.

https://problemkaputt.de/gbatek.htm#gbaiomap for a list.
Granted
Code:
  04000000-040003FE   I/O Registers
  04000400-04FFFFFF   Not used
To that end I am not sure what 04004300 is being used for -- sometimes flash carts and cheat devices colour outside the lines and do their own thing. There are also mirrors of some things but not sure if this is one (some cheat makers might use a mirror as a kind of copy protection -- you copied my cheat as nobody would do that otherwise) and sometimes there are reasons for using a mirror (the GBA cartridge itself appears in several locations in memory, while the same data will come out of it there are different wait states such that something less important won't take priority even if very little uses such things).

**in some systems the CPU or memory bus might not see everything and in fact have other methods of speaking to things like passing commands to things that are accessible, or only certain CPUs seeing things if there are multiple (the megadrive/genesis for instance having a CPU for its sound chips that only sees a fraction of the memory the main CPU sees but in turn is far more primed to deal with those sound chips than the main CPU, and we will ignore the nightmare of the Saturn. If you move up to the DS then the 3d system is kind of isolated from the main CPU with only write only commands that speak to it, and also the DS cart itself only able to be spoken to via commands rather than read from like normal memory in the case of the 99.99% of the GBA library).
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
  • Sicklyboy @ Sicklyboy:
    Thanks ken
  • BigOnYa @ BigOnYa:
    Great game. But I'd buy it straight up before paying for prime. Unless you order something everyday from amazon, not worth it imo
  • Sicklyboy @ Sicklyboy:
    I'm one of those people that Amazon loses money on the Prime subscription with
  • Sicklyboy @ Sicklyboy:
    I abuse the fuck out of it
  • K3Nv2 @ K3Nv2:
    Prime says I've already saved $400 this year lol
  • Sicklyboy @ Sicklyboy:
    Where do you see how much you've saved?
  • K3Nv2 @ K3Nv2:
    Under orders
  • BigOnYa @ BigOnYa:
    See maybe good for you guys, but I don't hardly ever order from amazon, maybe only couple times a month
  • K3Nv2 @ K3Nv2:
    Primes great because I stopped getting into arguments with the door greeter at Walmart
  • Sicklyboy @ Sicklyboy:
    hahahahaha
  • K3Nv2 @ K3Nv2:
    They see me so much in there they don't even ask for me receipt anymore tbh
  • Sicklyboy @ Sicklyboy:
    Pain in the ass, don't see it anywhere on the desktop site, had to pull it up on my phone
  • K3Nv2 @ K3Nv2:
    Think they gave up on the website and mainly focus on the app
  • Sicklyboy @ Sicklyboy:
    Desktop site > mobile site > mobile app
  • Sicklyboy @ Sicklyboy:
    Mobile app is such absolute dogshit, I haven't used it in SO long
  • K3Nv2 @ K3Nv2:
    Yeah mobile versions better people don't think about how apps are just shrunken down websites
  • K3Nv2 @ K3Nv2:
    Could be the phone connection etc I've mostly been fine with the app
  • K3Nv2 @ K3Nv2:
    Regardless fuck bezos
    +1
  • Sicklyboy @ Sicklyboy:
    Agreed. Crazy how both seeking a job at Amazon, and subsequently quitting Amazon, are both some of the best decisions I've ever made
  • K3Nv2 @ K3Nv2:
    Did someone loose a leg? You're fired
  • K3Nv2 @ K3Nv2:
    Ffs 55gb patch for hogwarts legacy
  • SylverReZ @ SylverReZ:
    @K3Nv2, Teslas are prob running Windows XP to this day.
    SylverReZ @ SylverReZ: @K3Nv2, Teslas are prob running Windows XP to this day.