Author Topic: Byte Math question.  (Read 2977 times)

Shinrin

  • Chrono Trigger Threads of Time
  • Squaretable Knight (+400)
  • *
  • Posts: 487
  • Chrono Trigger Fan # 100
    • View Profile
    • Shinrin Cole
Byte Math question.
« on: May 01, 2008, 05:07:02 pm »
I've seem to have hit a roadblock in one of my small projects. I'm trying to raise the ammount of Silver Points you can have from 250 to 65000, every thing works find. But...

While you can subtract two bytes from Byte Math, you can't add two bytes from it... Also, I tried to fix it by selecting the next memory location, but instead it skips the one i need and goes to the past it.

Example 7F0166 insted of going to 167 it goes to 168.

Is it a bug with the editor, or what?

I really wish I could add using two bytes with Byte Math.

BROJ

  • CC:DBT Dream Team
  • Errare Explorer (+1500)
  • *
  • Posts: 1567
    • View Profile
Re: Byte Math question.
« Reply #1 on: May 01, 2008, 10:56:38 pm »
A question and a suggestion:

  • What is Byte Math?
(searched google and found *nothing* on it.)

  • Why don't you use the Windows Calc for Dec<-->Hex conversions/arithmetic?

Shinrin

  • Chrono Trigger Threads of Time
  • Squaretable Knight (+400)
  • *
  • Posts: 487
  • Chrono Trigger Fan # 100
    • View Profile
    • Shinrin Cole
Re: Byte Math question.
« Reply #2 on: May 01, 2008, 11:20:41 pm »
A question and a suggestion:

  • What is Byte Math?
(searched google and found *nothing* on it.)

  • Why don't you use the Windows Calc for Dec<-->Hex conversions/arithmetic?

What is Byte Math, It simple addition and subtraction, in hex. Let's say a certain memory location is 0F, and you want something to be added to it, let's say you want it to equal to 15 in hex, but don't want to do it by assigning it, maybe it's used in a mini game or something. you do a byte math, to the memory location then you put 6 as the integer to add.

I have done this, the problem doesn't lie in windows calc, it lies in the editor, as i said, you can only add up FF, but you can subtract FFFF. I've tried every mode and combination, and even tried to add something like 100, but it still won't let you go past FF.

BROJ

  • CC:DBT Dream Team
  • Errare Explorer (+1500)
  • *
  • Posts: 1567
    • View Profile
Re: Byte Math question.
« Reply #3 on: May 01, 2008, 11:29:39 pm »
What is Byte Math, It simple addition and subtraction, in hex.
Oh... the capitals threw me off. As for how hex works, I already know about that, as I have some experience with tracking/modifying or fixing values.

I have done this, the problem doesn't lie in windows calc, it lies in the editor, as i said, you can only add up FF, but you can subtract FFFF. I've tried every mode and combination, and even tried to add something like 100, but it still won't let you go past FF.
As for determining the problem in the editor, I haven't much experience in software engineering... yet.

Zakyrus

  • Entity
  • Magical Dreamer (+1250)
  • *
  • Posts: 1358
  • "Bouncy, bouncy, bouncy... --!!"
    • View Profile
Re: Byte Math question.
« Reply #4 on: May 01, 2008, 11:54:25 pm »
I've seem to have hit a roadblock in one of my small projects. I'm trying to raise the ammount of Silver Points you can have from 250 to 65000, every thing works find. But...

While you can subtract two bytes from Byte Math, you can't add two bytes from it... Also, I tried to fix it by selecting the next memory location, but instead it skips the one i need and goes to the past it.

Example 7F0166 insted of going to 167 it goes to 168.

Is it a bug with the editor, or what?

I really wish I could add using two bytes with Byte Math.

I wish I had more time to answer this fully as I too had this problem.

Try assigning the integer to a blank memory value, then adding it using Byte Math, after adding set the assigned value back to 0. If that makes no sense, then look at the Gato's Exhibit code in my CT+ hack.

Geiger

  • Guru of Life Emeritus
  • Chronopolitan (+300)
  • *
  • Posts: 315
    • View Profile
    • Geiger's Crypt
Re: Byte Math question.
« Reply #5 on: May 02, 2008, 09:41:00 am »
The only two-byte add command available in the commercial release is memory address based.  Both values (the total amount and the amount added) will have to be assigned to addresses in the 7F0200-7F03FF range.

There was a value-to-mem addition command in the BETA, but it was removed (presumably for space considerations).

syntax error

  • Iokan (+1)
  • *
  • Posts: 5
    • View Profile
Re: Byte Math question.
« Reply #6 on: May 02, 2008, 03:27:06 pm »
how about making a comparative disassembly of the two CT builds?

Agent 12

  • Zurvan Surfer (+2500)
  • *
  • Posts: 2572
    • View Profile
Re: Byte Math question.
« Reply #7 on: May 02, 2008, 05:11:52 pm »
It really wouldn't be worth doing that at all....

Just store the value in memory and then add them....

7F00XX = Silver points
7F0200 = 256

Add(7F00XX, 7F0200).



--JP