Skeetendo

’Cause all games were better on the GBC

You are not logged in.

#1 2017-09-23 02:08:59

KeiTaRo
Member
Registered: 2015-12-05
Post 45/56
Website

[pokered] wTileMapBackup vs wTileMapBackup2 ?

Hi. I've been desperately trying to carve out a chunk of wram equating to roughly the exact size occupied by both wTileMapBackup and wTileMapBackup2. I've looked in to what these are used for, and they seem to be used for seemingly identical purposes, albeit at different times. The main thing I don't understand is why one would be used over the other---would there ever be a situation where wTileMapBackup would be occupied by other data, necessitating the need for wTileMapBackup2? The only situation that comes to mind is during link play, as some data involved in that is also stored at the same location as wTileMapBackup....however, wTileMapBackup2 is not instantiated at all during link play, so that seems irrelevant.

If it was maybe just used once I'd say it was just a lazy programming quirk, but wTileMapBackup2 seems to be used in quite a number of places (or rather, I should say, the function SaveScreenTilesToBuffer2, which writes data to this ram address, as opposed to SaveScreenTilesToBuffer1 which uses the other) ... what I really want to know is why the game needs two ram addresses which do essentially the same thing when they're so large .... would I be able to do away with the second one (essentially replacing all instances of SaveScreenTilesToBuffer2 with SaveScreenTilesToBuffer1) and not have any ill-effects in my game? is there something I'm grossly overlooking or misunderstanding here? I'd really appreciate any light that can be shed on to this subject, thanks a billion.


EDIT: well, getting rid of wTileMapBackup2 seems to, at the very least, cause the title screen not to work correctly anymore (specifically, the Pokemon don't scroll away properly anymore) ... so then I am clearly missing the point of having both of these? :|

Last edited by KeiTaRo (2017-09-23 08:28:56)

Offline

#2 2017-10-03 05:05:11

KeiTaRo
Member
Registered: 2015-12-05
Post 46/56
Website

Re: [pokered] wTileMapBackup vs wTileMapBackup2 ?

Just an update, since no one really seemed to have an answer: I still do not know what the difference is for these two locations, but I was able to solve my issue--I was able to move the thing I needed to take the place of it to another WRAM bank (as I would only be calling upon it while on CGB hardware anyway), so I actually have no reason to replace this now. I am still curious about what the purpose of the two separate WRAM locations are, but I care significantly less now that I don't have to actually modify them any longer :P

Last edited by KeiTaRo (2017-10-03 05:05:39)

Offline

#3 2017-10-04 14:24:34

Crystal_
Member
From: Spain
Registered: 2012-09-16
Post 433/450
Website

Re: [pokered] wTileMapBackup vs wTileMapBackup2 ?

Well, if you need to back up X tilemaps at the same time then you need X tilemap buffers. Like, when you access the stats screen, the game backs up the map screen and party screen without overwritting each other. That's not to say that you can't just reload the screens when you go back, but sometimes it's convenient to have them backed up for a quick refresh.

Offline

Board footer

Powered by FluxBB