Points of Required Attention™
Please chime in on a proposed restructuring of the ROM hacking sections.
Views: 88,432,215
Main | FAQ | Uploader | IRC chat | Radio | Memberlist | Active users | Latest posts | Calendar | Stats | Online users | Search 04-18-24 10:35 AM
Guest: Register | Login

0 users currently in ROM Hacking | 1 guest

Main - ROM Hacking - Searching for Free Bytes New thread | New reply


Trax
Posted on 02-04-09 01:18 AM Link | Quote | ID: 100053


Yellow Stalfos
Level: 71

Posts: 714/1145
EXP: 3033814
Next: 133300

Since: 07-06-07
From: Québec

Last post: 3619 days
Last view: 2871 days
Okay, I'm currently working on some serious ASM hacking, and I need a few bytes to store extra variables. Are there any tricks to make sure a memory spot is never used?

Matrixz
Posted on 02-04-09 04:45 AM Link | Quote | ID: 100060


Ninji
Level: 35

Posts: 36/225
EXP: 266203
Next: 13733

Since: 04-07-07
From: Norway

Last post: 3098 days
Last view: 1775 days
If we are talking NES..
You could try searching the rom like this:

for zero-page memory ($00-$FF):
A5 D0 <- search for "LDA $D0"
85 D0 <- search for "STA $D0"

for other memory ($100-$FFFF):
AD 34 12 <- search for "LDA $1234"
8D 34 12 <- search for "STA $1234"

It's not completely reliable.
These 4 examples only covers the A register..
And this will not give result when the memory is accessed using other addressing modes.
But it could give results, very fast.

never-obsolete
Posted on 02-04-09 03:51 PM Link | Quote | ID: 100078


Rat
Level: 24

Posts: 41/96
EXP: 74448
Next: 3677

Since: 02-22-07
From: Phoenix, AZ

Last post: 2588 days
Last view: 2588 days
assuming the nes:

-set a r/w breakpoint on a location that seems unused and play the game.

-some games don't go too deep in the stack and you may be able to use locations in the lower part of the page.

-if the mapper supports on-cart ram and the game doesn't already have it, add it.

-if the game uses chr-ram, you could store it there as well. though you'd have to do all r/w durring vblank or disable rendering.

koala_knight
Posted on 02-04-09 04:42 PM Link | Quote | ID: 100082


Buzzy Beetle
Level: 44

Posts: 273/384
EXP: 590855
Next: 20430

Since: 06-01-07
From: Miami

Last post: 4118 days
Last view: 4105 days
Posted by never-obsolete

-if the mapper supports on-cart ram and the game doesn't already have it, add it.


Is that difficult to do or is it as simple as changing a value in the header?

never-obsolete
Posted on 02-04-09 08:28 PM (rev. 2 of 02-04-09 08:28 PM) Link | Quote | ID: 100088


Rat
Level: 24

Posts: 42/96
EXP: 74448
Next: 3677

Since: 02-22-07
From: Phoenix, AZ

Last post: 2588 days
Last view: 2588 days
change byte 6 of the header (from http://nesdevwiki.org/wiki/INES):



Flags 6
76543210
||||||||
||||+||+- 0xx0: horizontal mirroring; 0xx1: vertical mirroring; 1xxx: four-screen mirroring
|||| |+-- 1: SRAM in CPU $6000-$7FFF, if present, is battery backed
|||| +--- 1: 512-byte trainer at $7000-$71FF (stored before PRG data)
++++----- Lower nybble of mapper number


koala_knight
Posted on 02-04-09 09:39 PM Link | Quote | ID: 100095


Buzzy Beetle
Level: 44

Posts: 275/384
EXP: 590855
Next: 20430

Since: 06-01-07
From: Miami

Last post: 4118 days
Last view: 4105 days
Thanks!

Main - ROM Hacking - Searching for Free Bytes New thread | New reply

Acmlmboard 2.1+4δ (2023-01-15)
© 2005-2023 Acmlm, blackhole89, Xkeeper et al.

Page rendered in 0.021 seconds. (341KB of memory used)
MySQL - queries: 62, rows: 87/88, time: 0.016 seconds.