News:

11 March 2016 - Forum Rules

Main Menu

SimCity+ SNES question

Started by FireBrandWhip, May 20, 2022, 01:21:17 PM

Previous topic - Next topic

FireBrandWhip

Hello & greetings all,

I have recently come back to ROM hacking. I'm a bit Rusty however I started the thread SimCity plus here:

https://www.romhacking.net/forum/index.php?topic=34930.msg430042#msg430042

I am having trouble decoding the conditions for requiring 300 parks for the large Park to generate the gift.

What I would like to do is change the amount of parks required from 300 to 100 and change the amount of large Parks awarded from 3 to 12.

7E0E23 clock timer update this variable loops through a series of variables in a table 7EOC97 is one of them.

7EOC97 counter for 300 parks. Gets weird after 250 or so to 300 but still counts towards the next large park at 600.

$03/83DC 8D 97 0C STA $OC97 [$03:0C97] A:011C X:5DC0 Y: 0000 P:envmxdizc

Of course accumulator 11C is 284 which is how many small Parks I had built at the time.

7EOB4D how many large Parks the player has acquired thus far (up to 3)

When about to get the large Park:
$00/94FD AC 4D 0B LDY $OB4D [$00:0B4D] A:0000 X:0200 Y: 0020 P:envMxdiZC

I set a breakpoint.
When about to highlight the gift menu:
$03/809D CD 4D 0B CMP $OB4D [$00:0B4D] A:0000 X:0000 Y: 0003 P:envMxdiZC

$03/80A2 8D 4D 0B STA $OB4D [$03:0B4D] A:0000 X:0000 Y: 0003 P:envMxdiZC

I presume the compare and store accumulator is shifting the data to another pointer I'm still a bit Rusty on this (so if somebody can help explain that a bit better.)

After placing one large park:
$03/B06F 86 16 STX $16 [$00:1EFD] A:0001 X:1D0A Y: 0000 P:envMxdiZC

Some frames after adjusting breakpoints:
$03/809D CD 4D 0B CMP $04BD [$03:04BD] A:0002 X:0000 Y: 0009 P:envMxdiZC

Some frames after adjusting breakpoints:
$03/80A2 8D 4D 0B STA $04BD [$03:04BD] A:0002 X:0000 Y: 0009 P:envMxdiZC

030B4D with accumulator value to this *might be* the total allowed parks...

Anyway my head is still fuzzy on this if someone could explain this a little bit better... Constructive criticism only please don't "Google is your friend" lol. Or whatever. xD

Please and thank you any input is appreciated. :-)

FAST6191

"Gets weird after 250 or so"
So presumably 255 or 256? Would that mean it is an 8 bit value (2^8/FF/1111 1111) possibly with a flag to note it ticked over (might be able to scrounge a single bit from somewhere rather than using extra bytes), possibly then meaning it did a double check to make sure the extra bit/flag and the requisite smaller part are accounted for. Somewhat odd for a 16 bit console but seen enough I suppose.

Anyway not sure what to add here without playing around myself. Most times I want to change conditions on a game it usually is fairly easy to spot the immediate value that is loaded, or loaded in the prior instructions. Only tricky aspects tend to be if the value is in fact a variable that different difficulties might change and sounds like you approached it from both ways (presumably break on write for the large parks and break on read for the small parks, though break on write might also do something if the totals are counted after each one built rather than vblank or you say upon loading/highlighting the bonus menu).

Do also do a basic cheat to pump up the large parks location (sounds like you have it already) and see if the game accepts it -- not so bad for a game like this where it is presumably tile location and type (maybe direction or something similar but for something that might be more hard locked into fun like only one capital city in various other city building mechanics then yeah.

FireBrandWhip

#2
Right.
As for the 250 or so... One time it didn't do the reset for the counter until it was past 300...(so perhaps this gets the 256 and points to another counter) I don't want to give false information so I want to double check before I say for sure...

Also I found this resource the SimCity SNES map editor which has its source code very valuable I'll have to pick through that as well to get some more variables to work with. :-)

https://github.com/usrshare/snescityeditor

I'll post more as developments continue.

May 22, 2022, 07:19:09 PM - (Auto Merged - Double Posts are not allowed before 7 days.)

I've updated the project page list and organized it a bit.

As for the actual drawing of the large Park Sprite or graphic, I am hoping somebody can explain a bit better how would that actually draws on the screen I would like to make a mirror image version of the park render sometimes randomly so that they don't all look the same...

(Theoretically the steps involved are??)
Run a break point when the drawing occurs...

Try to find in the hex code which variables are the command to draw the tiles and where they are loading from.

Figure out how to disassemble/assemble mirror this in a separate piece of code (I'm not sure the steps for this)
As mentioned before I've done hexadecimal and break points but not assembly very much yet.

Insert the code and voila have parks that can sometimes be mirrored the other way.

It would be helpful to have additional resources I read as much as I can if anyone can point me in the right direction... I would be most appreciative.

May 23, 2022, 03:39:32 AM - (Auto Merged - Double Posts are not allowed before 7 days.)

7E0C97 part of the problem is this is a 2 byte variable not one.

Not sure where it's actually comparing the 300 though in the ROM so I can change 12C to 63.

:(

Update stepping through the code I'm still looking for the right variables ... I'll try to figure it out on my own because at this point because I hate asking for help unless I get stuck.

May 24, 2022, 03:58:19 AM - (Auto Merged - Double Posts are not allowed before 7 days.)

Still looking into this can't figure it out but not giving up...

Well, f*ck.
I'm trying to figure this out but my brain is melting... I was hoping somebody could help me on this by now... But I will soldier on.



I don't mean to be "that guy"... But I am confuzzled... Using no$snes... Highlighting a portion of the stadium and in tile layer pro highlighting the same thing how do I correlate the address?

I'm actually trying to find the regular City Park tile but the tile array is a mess and for some reason the pallets don't line up. I am almost convinced that some of the tiles are compressed graphics.


FAST6191

Compression is a possibility, though I would include the chance for the game to double up tiles (the black ringed thing from the image in the bottom has two identical tower blocks for each side so you only need the one in RAM and then double that up to save a nice bit of memory and ROM space).

Anyway on screen to ROM location.

Two main choices.

1) Grab the hex from the relevant part of VRAM for that tile, or snippet thereof, and search the ROM for that. Compression does get in the way of such things though if it is present but otherwise very quick and easy.

2) Tracing. Something will have written it into VRAM at some point (might even be possible if you scroll around the map to where it is not readily visible and then scroll back, otherwise start from the main menu or something and load the save) and thus we have breakpoints to find them. Break on write to that area of VRAM (hopefully it is predictable at some level, savestates before it is loaded might help ensure this). You hope it goes directly from ROM (not the page/bank/whatever if that is relevant to your system/chosen game) to VRAM but if there is any compression then most things on most systems will take a trip through the normal work RAM beforehand (at which point you reload the earlier save or scroll off and set a new breakpoint on normal RAM and repeat until you land on a ROM read), and you will have the code it uses to do it so you can then implement your own (de)compression if necessary.

There is usually enough general ROM reading happening at any given point that noting a list of locations read down and checking all those is harder than just opening in a tile editor and pressing page down a lot. For PC games (see stuff like ofview https://www.nirsoft.net/utils/opened_files_view.html ) and some later devices this can be a more viable method. Could use it to direct some corruption efforts I guess though.

I don't know if we are suggesting no$sns these days for debugging purposes either. If it works even half as well as his GBA/DS and GB/GBC efforts then great but most generally noted it as a bit of a WIP emulator.

FireBrandWhip

Still tried looking through this and doing breakpoints with these addresses yet to no avail... :banghead:






However it gets (better) or worse (?)
As the pallet share of tiles allows for different graphics embedded within the graphics...



The fire animation graphic literally shares a tile with the power out graphic. Is this symbolic? LOL.



Still trying to figure out where and how in the debugger the tiles actually written...

Basically trying to put a hilly_park graphic in also... Or even just make one chance same as the park_tree... Where I use the rubble graphic so we can have cooler maps.


Sigh.
If somebody could explain this a little teeny bit better that would be awesome.

On a positive note I found that the fabled night graphic/pallet does exist:



Nonetheless I will keep sifting through various pallet shifts for now perhaps I've been staring at the tile this entire time.