Users browsing this thread: 1 Guest(s)
Learning Magic

#13
Posts: 763
Threads: 83
Thanks Received: 55
Thanks Given: 7
Joined: Apr 2015
Reputation: 22
Status
Obliviscence
Ok, so this is what I have so far... I think I need a little help understanding the accumulator and RAM operations.

Code:
C3/50A2:    85E0        STA $E0
C3/50A4:    20DD4E      JSR $4EDD
C3/50A7:    B90000      LDA $0000,Y
----------this is where my code starts-------------------------
C3/50AA:   8D0442      STA $4204  (Divider A)
C3/50AD:   A90C         LDA #$0C (12)
C3/50AF:   8D0542      STA $4205  (Divider B)
C3/50B2:   AD1642      LDA 4216    (MathValue Math coprocessor's result. Remainder for Divisions)
----------this is where my code ends-------------------------
C3/50XX:    8D0242      STA $4202
C3/50XX:    A936        LDA #$36
C3/50XX:    8D0342      STA $4203
C3/50XX:    7B          TDC
C3/50XX:    A5E0        LDA $E0
C3/50XX:    C220        REP #$20      (16 bit memory/accum.)
C3/50XX:    6D1642      ADC $4216
C3/50XX:    AA          TAX
C3/50XX:    E220        SEP #$20      (8 bit memory/accum.)
C3/50XX:    BD6E1A      LDA $1A6E,X
C3/50XX:    60          RTS

**I am overwriting Gogo's code, its not going to get used anyway.**

So what I am expecting to happen is for it to use the remainder of the actor/12 (#$0C) to determine what spell to look at, not the raw actor number. The result I am actually getting is all of my actors are seeing the same random magic percentages, when I scroll down the list in the menu and come back up, some of the values disappear, while others change value.

I'm still new to assembly code and I think I have some fundamental misunderstanding of the registers, accumulator, and RAM. Since the values change when I move around, does that mean the numbers aren't staying consistent in the accumulator, if so, why would that be? Also, $4216 in the RAM is used for both the product of multipliers and the remainder from division... this code uses both, so if I have values in $4202, $4203, $4204, and $4205; what number would I expect to see in $4216? And finally, what is the difference between "MathValue" and "MathValue!" ?
  Find
Quote  



Messages In This Thread
Learning Magic - by B-Run - 06-28-2012, 12:34 PM
RE: Learning Magic - by madsiur - 06-28-2012, 07:01 PM
RE: Learning Magic - by B-Run - 06-28-2012, 08:19 PM
RE: Learning Magic - by madsiur - 06-28-2012, 10:24 PM
RE: Learning Magic - by B-Run - 06-29-2012, 09:07 AM
RE: Learning Magic - by B-Run - 06-30-2012, 10:49 PM
RE: Learning Magic - by madsiur - 07-01-2012, 08:24 AM
RE: Learning Magic - by B-Run - 07-01-2012, 10:09 PM
RE: Learning Magic - by Angelo26 - 07-01-2012, 11:26 PM
RE: Learning Magic - by madsiur - 07-01-2012, 11:42 PM
RE: Learning Magic - by B-Run - 07-01-2012, 11:47 PM
RE: Learning Magic - by madsiur - 07-02-2012, 12:00 AM
RE: Learning Magic - by B-Run - 07-05-2012, 07:38 PM
RE: Learning Magic - by Synchysi - 07-05-2012, 09:05 PM
RE: Learning Magic - by B-Run - 07-05-2012, 09:32 PM
RE: Learning Magic - by Synchysi - 07-05-2012, 10:33 PM
RE: Learning Magic - by B-Run - 07-06-2012, 07:40 AM
RE: Learning Magic - by B-Run - 07-07-2012, 02:32 PM
RE: Learning Magic - by B-Run - 07-13-2012, 05:59 PM
RE: Learning Magic - by SSJ Rick - 07-13-2012, 06:06 PM
RE: Learning Magic - by B-Run - 07-13-2012, 07:16 PM
RE: Learning Magic - by SSJ Rick - 07-13-2012, 07:23 PM
RE: Learning Magic - by B-Run - 07-13-2012, 08:26 PM
RE: Learning Magic - by Angelo26 - 07-13-2012, 08:56 PM
RE: Learning Magic - by B-Run - 07-14-2012, 07:25 AM

Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite