Page 1 of 1

Free camera control code for DKL?

PostPosted: February 7th, 2009, 8:58 am
by TheUltimateKoopa
Is it possible to make a code (GameShark or Game Genie) that allows you to freely move the camera around, or one that allows you to fix the camera in a certain position where you can change values to move the camera vertically or horizontally? E.g. ??xx??yy (where xx and yy are the values you'd change and ?? is just whatever the other digits are).

Re: Free camera control code for DKL?

PostPosted: February 7th, 2009, 11:17 am
by Blaziken257
If there is, I don't know about it. It would be convenient for ripping maps though.

Re: Free camera control code for DKL?

PostPosted: February 7th, 2009, 11:54 am
by TheUltimateKoopa
Exactly why I asked :D by the way, how did you do the 2 DKL3 maps? Did you do the old "take screenshots of every possible location and paste them together, using terrain tiles to fill in any gaps" method, either actually PrintScreening, or via VisualBoy Advances "Map Viewer", or was there another way you did it?

Re: Free camera control code for DKL?

PostPosted: February 7th, 2009, 3:47 pm
by Blaziken257
Yeah, I used the map viewer and kept using Alt+Print Screen. I also hacked the level starting points in the ROM to be able to get to those inaccessible places (like lots of solid space).

Re: Free camera control code for DKL?

PostPosted: February 7th, 2009, 10:57 pm
by Raccoon Sam
Blaziken257 wrote:Yeah, I used the map viewer and kept using Alt+Print Screen. I also hacked the level starting points in the ROM to be able to get to those inaccessible places (like lots of solid space).

Maybe the header format is the same for DKL2..?
I can't relative search, but you should give DKL2 a go and search for common bytes from DKL3.

Re: Free camera control code for DKL?

PostPosted: February 9th, 2009, 11:37 pm
by TheUltimateKoopa
Well firstly it seems the original question was slightly misread. The question was asking whether it was possible to make a code to freely move the camera, OR fix it in a certain position by changing 2 values for the x and y co-ordinates, however it was read as "Is there a code..." rather than "Is it possible to make a code..."

Re: Free camera control code for DKL?

PostPosted: July 23rd, 2012, 8:19 am
by TheUltimateKoopa
So in the 3 and a half years since the last post...

Why has no one made a kind of 'camera' code? Or even a kind of move any where code, which also means you don't get hit by enemies, and can go through walls?

Re: Free camera control code for DKL?

PostPosted: July 29th, 2012, 1:41 am
by Raccoon Sam
It isn't as easy as you might think.

But I'm sure that DKL1-3 could be mapped easily if someone programmed a tool that save states and spits out maps. The format isn't difficult.

Re: Free camera control code for DKL?

PostPosted: August 2nd, 2012, 3:54 pm
by Blaziken257
I suppose it would help if I used bgb's disassembler to try to find something...

Re: Free camera control code for DKL?

PostPosted: August 3rd, 2012, 7:26 am
by TheUltimateKoopa
http://www.youtube.com/watch?v=AZD-R6xVk3w

:P

Generally any code that allows you to 'travel' anywhere (obviously, including through walls).

A simple camera code might not work, since, like with a certain Wario Land 2 code, I'm assuming, if you were to put the camera high enough that DK is below the screen, it'd treat it as you having fallen down a pit, and you'll lose a life.

Essentially, the kind of code that would work would be one in which all enemies, items and basically anything animated (including the track of Track Attack, and the background of the Blimp Stages, and indeed... yourself) are frozen in their "initial" positions, AND that moves the camera, AND... moves you at the same time, so that you are always in the same position (relative to the screen), e.g. always in the center, and thus no "outside screen = death" stuff.

It's like 500 codes in one :P, but that's the only thing I can think of. The important things are frozen animation, move anywhere, oh and obviously go through objects?

Re: Free camera control code for DKL?

PostPosted: August 3rd, 2012, 2:28 pm
by Blaziken257
I did find RAM addresses that control the camera's X and Y positions in DKL, but unfortunately, they're in the FFxx range in RAM, so there's no GameShark code that I know of, since GameShark codes, as far as I know, can only access A000-DFFF in RAM. However, it's still possible to edit any RAM address with the bgb emulator, so I suggest you use that. Hopefully, you have Windows so that you can use it.

In DKL, FFA8-FFA9 controls the camera's X position (left is 0), and FFAB-FFAC controls the camera's Y position (top is 0). These values are 16-bit values and are little endian.
So for example, if you want the camera to be 256 pixels from the left, this is 0100 in hexadecimal. You have to reverse the 01 and the 00 to get 00 01. So, FFA8 would be 00, and FFA9 would be 01 in this case.

To control the RAM addresses, do the following:

  1. Open bgb.
  2. Open a ROM by right-clicking the window, and clicking Load rom...
  3. Once the ROM is loaded, right-click the window again, go to Other, then debugger.
  4. A new window will open up.
  5. In the bottom-left area of the debugger, you can see the entire RAM. You will want to scroll down all the way to the bottom so that the HRAM:FFA0 row shows up.
  6. Find the RAM address you want to change (either FFA8, FFA9, FFAB, or FFAC as described above). Right-click the byte. Then, click "Freeze ram address".
  7. Change it to the value that you want. Just be aware of a few things:
    • Do not cause the change the value too much from whatever it is currently, or else the camera will shift faster than the tiles can properly load. In general, try to keep Donkey/Diddy on the screen.
    • Locking the X position will cause Donkey/Diddy unable to move past the screen, so you will have to unfreeze the value and re-freeze it to something else. Also, they can get stuck on the left side of the screen unless you roll/cartwheel to the right.
    • Locking the Y position will cause Donkey/Diddy to die if he falls below the screen! Getting Donkey/Diddy above the screen doesn't seem to have serious consequences.
    • The camera will shake a bit whenever you move, because it is trying to get Donkey/Diddy in the center of the screen, but freezing the value overrides this.
I hope this makes sense. Also, in DKL2, DE80-DE81 controls the camera's X position, and DE82-DE83 controls the camera's Y position. Again, try not to shift the camera too much, although Diddy/Dixie can walk past the screen this time. I haven't tried DKL3 yet, but I wouldn't be surprised if it had the same RAM addresses. (Also, since they happen to be in the proper address range in this game, you can use GameShark codes 01xx80DE, 01xx81DE, 01xx82DE, and 01xx83DE.)

Re: Free camera control code for DKL?

PostPosted: August 4th, 2012, 2:25 am
by TheUltimateKoopa
Blaziken257 wrote:Hopefully, you have Windows so that you can use it.


We got double-glazing put in last year... is BGB compatible with these kinds of windows? :P

It's OK, but it does have serious problems. Whenever I try and move the camera's X position, instead of the camera moving, DK just disappears.

Re: Free camera control code for DKL?

PostPosted: August 4th, 2012, 4:05 am
by Blaziken257
What were the values of FFA8 and FFA9 before you changed them, and what were they after?

Re: Free camera control code for DKL?

PostPosted: August 4th, 2012, 4:12 am
by TheUltimateKoopa
I forget. But normally, every level seems to start with 20 00 (which I'm assuming means you can't go less than 20 pixels from the left of the stage)

If I'm to change the 00 to 10, so that the X position is 20 10 (or 1020 in hex), the screen remains the same position, but the character disappears.

So, is there no way of making it so that all of these happen, at the same time?:
*All animations are frozen in their initial frames
*All objects that move, are frozen at their initial position, i.e. enemies and stuff
*Swim in any level
*No contact with anything, i.e. go through walls?

If not, is there some kind of thing where you can "do something" and the entire of that particular 'area' that you're in, is mapped out automatically? (inb4lazymapping)

The basic (as in basic to explain) thing I want to do is to be able to go everywhere, so that I can get every part of a stage, and then make maps :P

Re: Free camera control code for DKL?

PostPosted: August 4th, 2012, 5:37 am
by Blaziken257
Yeah, every level does seem to start at 20 00. That translates to 0x0020 in raw hexadecimal, or 32 in decimal, so it seems you can't go 32 pixels to the left of the stage.

You seem to have confused the endianness when editing the value, as you're increasing the X position by a multiple of 256 if you're editing address FFA9. Don't forget that the values are little endian (this happens a lot in Game Boy games). Changing it to 20 10 translates to 0x1020 in hex, which is 4128 in decimal. That means you're shifting the camera 4096 pixels to the right from where it was originally. Oops! Try changing address FFA8 instead, since that shifts the camera by multiples of 1 instead of 256.

I also haven't figured how to do the other things you mentioned, but I'll see if they're possible... it's rather difficult though.

Re: Free camera control code for DKL?

PostPosted: August 4th, 2012, 6:21 am
by TheUltimateKoopa
Just out of interest, when you did your Seabed Shanty map, did you simply take "a very long time" just swimming around the level, and making sure you never missed a single area, and took thousands (maybe not exactly thousands) of screenshots, and then took a long long long time pasting them together? If not, how did you do it?

Re: Free camera control code for DKL?

PostPosted: August 5th, 2012, 1:58 am
by Blaziken257
Yeah, that's how I did it (plus I hacked the starting point so that I could get inside the walls). I don't know of any better method, so needless to say, it was very time consuming and that's why I've ripped so few maps.