11 March 2016 - Forum Rules
Started by 8.bit.fan, July 19, 2017, 02:54:39 PM
Quote"Hear the word of the gods. Don't forget it."
Quote"Hear the word of the gods. Game Saved."
Quote from: nesrocks on July 19, 2017, 03:26:55 PMNever hacked the game, but to eliminate the losing half olives when dying you can try this:First you locate the RAM adress for the olive counter.Then you set fceux's debugger to stop on writes to that counter.When you die you should get to a routine that writes to that address after manipulating it's value to be halved. Simply change the write to EA EA (or EA EA EA).
Quote from: KingMike on July 19, 2017, 04:40:26 PMThere are cheat-maker tutorials that will tell you how to find the RAM address.But the simple thing is:(I think FCEUX has a "Cheat Finder", so I'll describe it.)Load up the cheat finder once. Click Start or something.Play the game until your olive count changes.Then open up the Cheat Finder and click the button for new value being higher/lower than it was the first time.Repeat the last two until you get just one or a few results.
Quote from: KingMike on July 19, 2017, 04:40:26 PMopen up the Cheat Finder and click the button for new value being higher/lower than it was the first time.Repeat the last two until you get just one or a few results.
Quote from: Psyklax on July 19, 2017, 05:02:38 PMNot to mention that something like olive count will probably be obvious - it'll probably be the same number but in hexadecimal rather than decimal, so 25 would be 19 for example (I've never played the game, just making an educated guess).As for what nesrocks said, in case it's not clear, he's saying you need to find an instruction that halves the olive count (so breakpoint on a write to that olive count address) and replace it with NOP instructions (No OPeration), which is EA. Therefore the game will ignore the halving instruction. It'll be quite simple, really. Well, probably.
Quote from: nesrocks on July 19, 2017, 06:03:48 PMYour other options:[...]3 - change the price of things. This could be easier to do, but requires going through everything that costs olives and rebalancing.
Quote from: nesrocks on July 19, 2017, 06:03:48 PMThat was fast, congrats There probably won't be enough bytes to replace a halving instruction with a 1/10 instruction. Halving is a 1 byte instruction called LSR. Since there is no 1 byte long instruction to 1/5 or 1/10 it is easy to see why it would be a problem to do anything else to the value. The thing about hacking the assembly like this is that you need to write over bytes, you can't insert them. And in this case you want to write over bytes that are no longer useful to you, meaning just the LSR one.So if you really want to do 1/5 or 1/10 you'd need to point it to an empty space in the ROM (using a JSR instruction), do the new math there and send the code back to continue the original routine (using an RTS instruction), which is a bit more advanced.Your other options:1 - make it so the olives drop more often, as you said earlier2 - collecting an olive give more than 1 olive (two). This could maybe make it too easy too, but not as easy as losing nothing on death.3 - change the price of things. This could be easier to do, but requires going through everything that costs olives and rebalancing.
Quote from: nesrocks on July 19, 2017, 06:16:53 PMThis page is a gold mine for you:http://tasvideos.org/GameResources/NES/BattleOfOlympus.htmlI did a TAS of this game 10 years ago, and it has been updated by Arc recently (he credited me on his new TAS, which was nice). Anyway, someone wrote the details of some of the game's inner mechanics in that page, including exactly how the item drop RNG works, so bingo
Quote from: Psyklax on July 19, 2017, 06:06:24 PMJust a quick update from me. I just spent the last ten minutes doing what was suggested already (and in that time I've seen that you've already done something on this! ). I found that the olive count is stored in $E0 and $E1 - for some reason it uses a byte for each digit, perhaps it's easier to print on-screen or something, but if you change $E0 to something in hex and leave $E1 at 0, it'll change to that number when you pause/unpause (it goes through a routine of printing the numbers correctly.So I gave myself olives then killed myself, and because I'd set a breakpoint (FCEUX's debugger, Add Breakpoint, read or write $E0-E1), I saw the operations that halve the olive count (FYI, the key operation is LSR or Logical Shift Right, meaning the eight bits in a byte shift one position to the right, effectively halving the number). So when the time came to write the two new numbers to memory, I just changed the operations to EA EA, instead of 85 E0 and 85 E1. Voila, you no longer lose any olives at all. Of course, your suggestion of only losing 10% would require more hacking, as you'll have to modify the mathematical operation. And that'll take a little longer than the last ten minutes I've spent on this. Still, I hope I've given you a start on this. Assembly language on the NES is relatively simple, and FCEUX makes hacking sooo much easier.EDIT: crikey, I just read all of your post, you did figure it out pretty fast. Well, never mind then.
Quote from: abw on July 19, 2017, 06:45:19 PMAs it happens, Battle of Olympus hardcoded the prices of items into its script, so this would also involve updating the sections of the script where NPCs tell you how much things cost (e.g. Hephaestos says "I'll give you my Sword for 70 olives."), and if you have to start by figuring out how the game's text engine works, successfully making dialogue changes is going to require some very non-trivial effort. The good news in this case is that if all you want to do is make in-place edits to a couple of numbers, you only need to modify a couple of bytes; I'd be willing to help with that if you end up going this route.
07:C269:20 6A D7 JSR $D76A
07:C274:20 85 D7 JSR $D785
07:C265:A5 E1 LDA $00E1 = #$08 07:C267:A2 0A LDX #$0A 07:C269:20 6A D7 JSR multiply 07:C26C:A5 03 LDA $0003 = #$00 07:C26E:18 CLC 07:C26F:65 E0 ADC $00E0 = #$06 07:C271:4A LSR 07:C272:A2 0A LDX #$0A 07:C274:20 85 D7 JSR divide 07:C277:85 E0 STA $00E0 = #$06 07:C279:A5 02 LDA $0002 = #$00 07:C27B:85 E1 STA $00E1 = #$08
07:C265: A9 09 LDA #$09 07:C267: 85 E0 STA $00E0 07:C269: 85 E0 STA $00E1(fill the rest with EA up to C27C)
Quote from: nesrocks on July 19, 2017, 08:57:56 PMCode Select Expand07:C269:20 6A D7 JSR $D76AThis sub routine ($D76A) is fed the accumulator value and returns that decimal number * 10 converted to hex. So if you have 80 + olives, this will return a number of #50 which is 80 in hex. Then it adds to the ones digit (which don't need to be converted to hex because 0-9 are directly equal to their hex equivalents) and does the LSR to the result, halving it. So now you have the total number of olives, in hex, halved.Code Select Expand07:C274:20 85 D7 JSR $D785Then this one does the opposite and returns the ones digit on the accumulator and the tens digit on address $2, and then passes those to $E0 and $E1 respectively.What this means is that this whole area can be replaced with new math:Code Select Expand 07:C265:A5 E1 LDA $00E1 = #$08 07:C267:A2 0A LDX #$0A 07:C269:20 6A D7 JSR dec to hex 07:C26C:A5 03 LDA $0003 = #$00 07:C26E:18 CLC 07:C26F:65 E0 ADC $00E0 = #$06 07:C271:4A LSR 07:C272:A2 0A LDX #$0A 07:C274:20 85 D7 JSR hex to dec 07:C277:85 E0 STA $00E0 = #$06 07:C279:A5 02 LDA $0002 = #$00 07:C27B:85 E1 STA $00E1 = #$08That's 24 bytes!So what I usually do here is change all of those to EA and then start writing. Just so you get the feel of "I can do anything!" try this:Code Select Expand 07:C265: A9 09 LDA #09 07:C267: 85 E0 STA $E0 07:C269: 85 E0 STA $E1(fill the rest with EA up to C27C)One important thing to notice is that if you were writing assembly code the correct way, you'd write LDA #09 and the compiler would transform that to A9 09 for you, because you're using LDA in immediate mode (you're feeding it a direct value, indicated by #). If you wrote LDA $09 you'd be telling it to load the value stored on address $9 and copy it to the accumulator which would compile A5 09 instead of A9 09. But we're doing things backwards here, so you need to pay attention to which type of LDA you want (A5, A9 or others). http://www.6502.org/tutorials/6502opcodes.html
07:C265:A5 E1 LDA $00E1 = #$08 07:C267:A2 0A LDX #$0A 07:C269:20 6A D7 JSR dec to hex 07:C26C:A5 03 LDA $0003 = #$00 07:C26E:18 CLC 07:C26F:65 E0 ADC $00E0 = #$06 07:C271:4A LSR 07:C272:A2 0A LDX #$0A 07:C274:20 85 D7 JSR hex to dec 07:C277:85 E0 STA $00E0 = #$06 07:C279:A5 02 LDA $0002 = #$00 07:C27B:85 E1 STA $00E1 = #$08
07:C265: A9 09 LDA #09 07:C267: 85 E0 STA $E0 07:C269: 85 E0 STA $E1(fill the rest with EA up to C27C)
Quote from: nesrocks on July 19, 2017, 09:15:18 PMAlright, good luck, but in general you can ignore those unofficial opcodes and stick to the official ones
Quote from: Psyklax on July 20, 2017, 02:41:24 AMQuick side note: at ROM location $1FC80 there's a whole heap of FFs, which means it's probably empty. This would be a good place to Jump to a Sub Routine (JSR) where you can do your extra maths. The JSR command requires 3 bytes, which wouldn't be difficult to do. If I were you, I'd suggest you to replace one or two other commands with 20 70 FC (or 'JSR $FC70', which is the address in ROM) and then use 60 (RTS, ReTurn from Subroutine) to get back again.As for the maths, I don't really know how to reduce by 10% with the operations available, though I'm sure I could figure it out if I looked hard enough. Taking 5 away would be very straightforward, however, and nesrocks already mentioned that. However, as he also said, if you, say take away 5 from 4 it goes below zero, looping back to 255, which means you'd need to do something about that. Again, needs some working out. However, everything's possible! You just need to persevere enough.
QuoteA5 E1 18 C9 01 B0 E9 01 90 EA 85 E1
Page created in 0.106 seconds with 19 queries.