Romhacking.net

Romhacking => Personal Projects => Topic started by: TimeSpaceMage on July 18, 2017, 07:44:56 pm

Title: Arcana - Seal of Rimsala! (SNES)
Post by: TimeSpaceMage on July 18, 2017, 07:44:56 pm
(Please PM me at Sarah Shinespark (http://www.romhacking.net/forum/index.php?action=profile;u=76501) for feedback!)

Hello, everyone! This is my improvement project for Arcana, aka Card Master in Japan. It's one of my first and favorite RPGs growing up. Arcana is an early 90's dungeon crawler with maps that draw themselves as you progress, catchy woodwind music, and a charmingly quaint 4-element battle system: Wind beats Earth beats Water beats Fire beats Wind.

On the other hand: there's a very high encounter rate, the script is Engrishy and full of unneeded capitalization, and (as is typical of early 90's Nintendo games) it's full of religious censorship. Well hey, I can fix that! And so this started as just a script fix, until I learned to edit even more and make the game more interesting. This mod showcases edits to most of the following, because I can!
-Equipment, monster and spell statistics
-Music and sfx used
-Treasure chest contents
-Spell animations
-Character level-up stats and spell lists
-Stage Select starting inventory
-Inventory limits (max # of items)
-Various formatted text

Thanks to rainponcho for the following:
-Decreased encounter rate (Fog Cards are still cheaper for speedrunners.)
-FastROM conversion and 37-47% faster walk speed (Most noticeable in Bintel Castle)
-Multi-levelup patch that supports carrying over leftover EXP towards the next level

Patches:
FastROM v0.4 (https://drive.google.com/open?id=1scgehyU9EoBLVKTkiDHxXR0JOkKJPCn2)
Levelup v0.3 (https://drive.google.com/file/d/0B8HyspHa_gHaQjc4Z2wxaFVGa00/view?usp=drivesdk)
(If you'd like to try out the multi-levelup, enemy EXP is loaded to $136B-7A in battle)  ;)

Future content I'd like to add:
-Fix armor in damage calculation. Armor does jack diddly to lower damage, and can be skipped.
-Fix a text issue where some items and spells are written with a trailing space ("learned Change Attribute to Wind .")
-Work out the damage formula and other mechanics.

Finally, here are some before-and-after pics of Vanilla compared with Seal of Rimsala v0.93. Enjoy!
(http://i.imgur.com/jMjXlan.png)(http://i.imgur.com/78aJDbJ.png)
(http://i.imgur.com/mmjMMID.png)(http://i.imgur.com/mNk1NnK.png)
(http://i.imgur.com/0TGDled.png)(http://i.imgur.com/I2NPw9k.png)
(http://i.imgur.com/NJYwUz4.png)(http://i.imgur.com/39jYR79.png)(http://i.imgur.com/FXqZA3m.png)
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: SunGodPortal on July 18, 2017, 07:59:01 pm
Cool. It's nice to see someone working on this game. I only played it a little bit but I def thought it was neat. Most SNES games I've played from this era that were similar had artwork that was far less charming if not downright ugly.
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: KirkyMonster on July 18, 2017, 08:12:20 pm
I've never heard of this game but it looks really cool and reading your description of the game and the changes you are making sound intriguing.
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: Zoinkity on July 19, 2017, 09:42:55 am
Always thought I was crazy going into dungeons naked but wow, armor really doesn't do anything after all!
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: Time/SpaceMage on July 19, 2017, 11:37:50 am
The only things I've found that decrease physical damage are the Endurance stat, Wall All/Attack Impair, elemental advantage, and armor with a race bonus (like Mithril vs undead).

Incidentally, buffs and debuffs cancel each other, like Haste and Slow in FF6. They're flags for each character, so one cast is enough for the whole battle.
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: goldenband on July 19, 2017, 01:23:02 pm
Looking good! This should be a nice spruce-up for a deserving game. :)
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: rainponcho on July 19, 2017, 11:12:10 pm
If you know asm, this is where the random encounter logic is:

Code: [Select]
$18/802E AD F5 16    LDA $16F5  [$00:16F5]   A:FFFF X:0012 Y:0074 D:1E00 DB:00 S:1FF3 P:eNvmxdIzC HC:0890 VC:008 FC:47 I:00
$18/8031 C9 10 00    CMP #$0010              A:0010 X:0012 Y:0074 D:1E00 DB:00 S:1FF3 P:envmxdIzC HC:0938 VC:008 FC:47 I:00
$18/8034 90 0A       BCC $0A    [$8040]      A:0010 X:0012 Y:0074 D:1E00 DB:00 S:1FF3 P:envmxdIZC HC:0970 VC:008 FC:47 I:00
$18/8036 C9 20 00    CMP #$0020              A:0010 X:0012 Y:0074 D:1E00 DB:00 S:1FF3 P:envmxdIZC HC:0994 VC:008 FC:47 I:00
$18/8039 90 09       BCC $09    [$8044]      A:0010 X:0012 Y:0074 D:1E00 DB:00 S:1FF3 P:eNvmxdIzc HC:1026 VC:008 FC:47 I:00
$18/8044 A2 0C 00    LDX #$000C              A:0010 X:0012 Y:0074 D:1E00 DB:00 S:1FF3 P:eNvmxdIzc HC:1056 VC:008 FC:47 I:00
$18/8047 80 03       BRA $03    [$804C]      A:0010 X:000C Y:0074 D:1E00 DB:00 S:1FF3 P:envmxdIzc HC:1088 VC:008 FC:47 I:00
..


throw rng dice
$18/804C 48          PHA                     A:0010 X:000C Y:0074 D:1E00 DB:00 S:1FF3 P:envmxdIzc HC:1152 VC:008 FC:47 I:00
$18/804D 8A          TXA                     A:0010 X:000C Y:0074 D:1E00 DB:00 S:1FF1 P:envmxdIzc HC:1190 VC:008 FC:47 I:00
$18/804E 22 F1 89 00 JSL $0089F1[$00:89F1]   A:000C X:000C Y:0074 D:1E00 DB:00 S:1FF1 P:envmxdIzc HC:1212 VC:008 FC:47 I:00


==============>

$00/89F1 48          PHA                     A:00FA X:0012 Y:0002 D:1E00 DB:00 S:1FF3 P:envmxdIzc HC:1004 VC:251 FC:29 I:00
$00/89F2 DA          PHX                     A:00FA X:0012 Y:0002 D:1E00 DB:00 S:1FF1 P:envmxdIzc HC:1042 VC:251 FC:29 I:00
$00/89F3 A2 0B 00    LDX #$000B              A:00FA X:0012 Y:0002 D:1E00 DB:00 S:1FEF P:envmxdIzc HC:1080 VC:251 FC:29 I:00
$00/89F6 0E 0A 00    ASL $000A  [$00:000A]   A:00FA X:000B Y:0002 D:1E00 DB:00 S:1FEF P:envmxdIzc HC:1112 VC:251 FC:29 I:00
$00/89F9 E2 20       SEP #$20                A:00FA X:000B Y:0002 D:1E00 DB:00 S:1FEF P:envmxdIzc HC:1182 VC:251 FC:29 I:00
$00/89FB 2A          ROL A                   A:00FA X:000B Y:0002 D:1E00 DB:00 S:1FEF P:envMxdIzc HC:1212 VC:251 FC:29 I:00
$00/89FC 2A          ROL A                   A:00F4 X:000B Y:0002 D:1E00 DB:00 S:1FEF P:eNvMxdIzC HC:1234 VC:251 FC:29 I:00
$00/89FD 4D 0A 00    EOR $000A  [$00:000A]   A:00E9 X:000B Y:0002 D:1E00 DB:00 S:1FEF P:eNvMxdIzC HC:1256 VC:251 FC:29 I:00
$00/8A00 2A          ROL A                   A:00CD X:000B Y:0002 D:1E00 DB:00 S:1FEF P:eNvMxdIzC HC:1296 VC:251 FC:29 I:00
$00/8A01 4D 0A 00    EOR $000A  [$00:000A]   A:009B X:000B Y:0002 D:1E00 DB:00 S:1FEF P:eNvMxdIzC HC:1318 VC:251 FC:29 I:00
$00/8A04 4A          LSR A                   A:00BF X:000B Y:0002 D:1E00 DB:00 S:1FEF P:eNvMxdIzC HC:1358 VC:251 FC:29 I:00
$00/8A05 4A          LSR A                   A:005F X:000B Y:0002 D:1E00 DB:00 S:1FEF P:envMxdIzC HC:0016 VC:252 FC:29 I:00
$00/8A06 49 FF       EOR #$FF                A:002F X:000B Y:0002 D:1E00 DB:00 S:1FEF P:envMxdIzC HC:0038 VC:252 FC:29 I:00
$00/8A08 29 01       AND #$01                A:00D0 X:000B Y:0002 D:1E00 DB:00 S:1FEF P:eNvMxdIzC HC:0062 VC:252 FC:29 I:00
$00/8A0A 0D 0A 00    ORA $000A  [$00:000A]   A:0000 X:000B Y:0002 D:1E00 DB:00 S:1FEF P:envMxdIZC HC:0086 VC:252 FC:29 I:00
$00/8A0D 8D 0A 00    STA $000A  [$00:000A]   A:0024 X:000B Y:0002 D:1E00 DB:00 S:1FEF P:envMxdIzC HC:0126 VC:252 FC:29 I:00
$00/8A10 C2 20       REP #$20                A:0024 X:000B Y:0002 D:1E00 DB:00 S:1FEF P:envMxdIzC HC:0166 VC:252 FC:29 I:00
$00/8A12 CA          DEX                     A:0024 X:000B Y:0002 D:1E00 DB:00 S:1FEF P:envmxdIzC HC:0196 VC:252 FC:29 I:00
$00/8A13 D0 E1       BNE $E1    [$89F6]      A:0024 X:000A Y:0002 D:1E00 DB:00 S:1FEF P:envmxdIzC HC:0218 VC:252 FC:29 I:00
$00/8A15 FA          PLX                     A:00C2 X:0000 Y:0002 D:1E00 DB:00 S:1FEF P:envmxdIZC HC:1310 VC:255 FC:29 I:00
$00/8A16 68          PLA                     A:00C2 X:0012 Y:0002 D:1E00 DB:00 S:1FF1 P:envmxdIzC HC:1354 VC:255 FC:29 I:00
$00/8A17 F0 19       BEQ $19    [$8A32]      A:00FA X:0012 Y:0002 D:1E00 DB:00 S:1FF3 P:envmxdIzC HC:0034 VC:256 FC:29 I:00
$00/8A19 E2 20       SEP #$20                A:00FA X:0012 Y:0002 D:1E00 DB:00 S:1FF3 P:envmxdIzC HC:0058 VC:256 FC:29 I:00
$00/8A1B 8F 02 42 00 STA $004202[$00:4202]   A:00FA X:0012 Y:0002 D:1E00 DB:00 S:1FF3 P:envMxdIzC HC:0088 VC:256 FC:29 I:00
$00/8A1F AD 0A 00    LDA $000A  [$00:000A]   A:00FA X:0012 Y:0002 D:1E00 DB:00 S:1FF3 P:envMxdIzC HC:0134 VC:256 FC:29 I:00
$00/8A22 8F 03 42 00 STA $004203[$00:4203]   A:00C2 X:0012 Y:0002 D:1E00 DB:00 S:1FF3 P:eNvMxdIzC HC:0174 VC:256 FC:29 I:00
$00/8A26 EA          NOP                     A:00C2 X:0012 Y:0002 D:1E00 DB:00 S:1FF3 P:eNvMxdIzC HC:0220 VC:256 FC:29 I:00
$00/8A27 C2 20       REP #$20                A:00C2 X:0012 Y:0002 D:1E00 DB:00 S:1FF3 P:eNvMxdIzC HC:0242 VC:256 FC:29 I:00
$00/8A29 AF 16 42 00 LDA $004216[$00:4216]   A:00C2 X:0012 Y:0002 D:1E00 DB:00 S:1FF3 P:eNvmxdIzC HC:0272 VC:256 FC:29 I:00
$00/8A2D 29 00 FF    AND #$FF00              A:BD74 X:0012 Y:0002 D:1E00 DB:00 S:1FF3 P:eNvmxdIzC HC:0324 VC:256 FC:29 I:00
$00/8A30 EB          XBA                     A:BD00 X:0012 Y:0002 D:1E00 DB:00 S:1FF3 P:eNvmxdIzC HC:0356 VC:256 FC:29 I:00
$00/8A31 6B          RTL                     A:00BD X:0012 Y:0002 D:1E00 DB:00 S:1FF3 P:eNvmxdIzC HC:0384 VC:256 FC:29 I:00


$18/8052 7A          PLY                     A:0007 X:000C Y:0074 D:1E00 DB:00 S:1FF1 P:envmxdIzC HC:0884 VC:013 FC:47 I:00
$18/8053 AA          TAX                     A:0007 X:000C Y:0010 D:1E00 DB:00 S:1FF3 P:envmxdIzC HC:0928 VC:013 FC:47 I:00
$18/8054 D0 EA       BNE $EA    [$8040]      A:0007 X:0007 Y:0010 D:1E00 DB:00 S:1FF3 P:envmxdIzC HC:0950 VC:013 FC:47 I:00



random encounter
$18/8056 AD CD 18    LDA $18CD  [$00:18CD]   A:0000 X:0000 Y:0010 D:1E00 DB:00 S:1FF3 P:envmxdIZC HC:1050 VC:013 FC:15 I:00
$18/8059 3A          DEC A                   A:0001 X:0000 Y:0010 D:1E00 DB:00 S:1FF3 P:envmxdIzC HC:1098 VC:013 FC:15 I:00
$18/805A 0A          ASL A                   A:0000 X:0000 Y:0010 D:1E00 DB:00 S:1FF3 P:envmxdIZC HC:1154 VC:013 FC:15 I:00
$18/805B AA          TAX                     A:0000 X:0000 Y:0010 D:1E00 DB:00 S:1FF3 P:envmxdIZc HC:1176 VC:013 FC:15 I:00
$18/805C BF 3D 91 18 LDA $18913D,x[$18:913D] A:0000 X:0000 Y:0010 D:1E00 DB:00 S:1FF3 P:envmxdIZc HC:1198 VC:013 FC:15 I:00
$18/8060 85 18       STA $18    [$00:1E18]   A:9147 X:0000 Y:0010 D:1E00 DB:00 S:1FF3 P:eNvmxdIzc HC:1254 VC:013 FC:15 I:00
$18/8062 A9 18 00    LDA #$0018              A:9147 X:0000 Y:0010 D:1E00 DB:00 S:1FF3 P:eNvmxdIzc HC:1294 VC:013 FC:15 I:00
$18/8065 85 1A       STA $1A    [$00:1E1A]   A:0018 X:0000 Y:0010 D:1E00 DB:00 S:1FF3 P:envmxdIzc HC:1326 VC:013 FC:15 I:00
$18/8067 98          TYA                     A:0018 X:0000 Y:0010 D:1E00 DB:00 S:1FF3 P:envmxdIzc HC:1366 VC:013 FC:15 I:00
$18/8068 29 0F 00    AND #$000F              A:0010 X:0000 Y:0010 D:1E00 DB:00 S:1FF3 P:envmxdIzc HC:0024 VC:014 FC:15 I:00
$18/806B F0 10       BEQ $10    [$807D]      A:0000 X:0000 Y:0010 D:1E00 DB:00 S:1FF3 P:envmxdIZc HC:0056 VC:014 FC:15 I:00

Now check this value:
$18/8044 A2 0C 00    LDX #$000C

That's your standard rng seeder. Higher for less encounters. Lower for quick grinding.


Pretty nice changes so far.
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: Reiska on July 20, 2017, 03:05:09 am
Oh man, so looking forward to this.  I loooooove Arcana.

Incidentally, do you have a complete list of all the armors that do have a race bonus and are thus worth buying?
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: TimeSpaceMage on July 20, 2017, 07:33:39 pm
Oh wow rainponcho, how did you find that data so quickly? You're a lifesaver! And yes I'm learning ASM, so I can read that (albeit slowly; that looks complicated!). Nice to see more known data for bank $18; so far I only found treasure chest contents there.

Speaking of treasure chests, their value is in 4 bytes but only GP uses all 4. The 1st byte is the type (00=cards, 01=items, 02=equipment, 03=gold) while the 2nd byte is value or ID. For instance, "02 01" would be a Dagger while "01 06" is Intelligence Honey. Fun thing is, there's an unused type in the game  ;)
Spoiler:
If you change the type to "04", Rooks says "Oh no!" and a battle starts! So there's Monsters-in-a-box, although they don't leave an item and it seems to be just a random encounter. Neat surprise, though.


Oh man, so looking forward to this.  I loooooove Arcana.

Incidentally, do you have a complete list of all the armors that do have a race bonus and are thus worth buying?
Why yes, I do  :)
I made some tables on Data Crystal (http://datacrystal.romhacking.net/wiki/Arcana) awhile back. Just pick the Equipment Listing. (Also if you feel like messing around, the RAM map has your X/Y position so you can jump around the map. Just move to refresh the display afterwards.)
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: rainponcho on July 20, 2017, 08:16:34 pm
Geiger snes9x debugger. Used trace logs and toggle on/off until I triggered the encounter. Then kept breakpoint testing from last written log until I got what I wanted. It's nice when the method works quickly.

I thought the game was written confusing enough and just picked out details that resemble other games. Admittedly I didn't bother to read most of the code like that rng :)
(kinda reminds me of some noise feedback generators)


You really know this game inside-out. :mrgreen:
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: TimeSpaceMage on July 20, 2017, 08:45:14 pm
Geiger snes9x debugger. Used trace logs and toggle on/off until I triggered the encounter. Then kept breakpoint testing from last written log until I got what I wanted. It's nice when the method works quickly.

I thought the game was written confusing enough and just picked out details that resemble other games. Admittedly I didn't bother to read most of the code like that rng :)
(kinda reminds me of some noise feedback generators)


You really know this game inside-out. :mrgreen:
I'm using the debugger too, but it sounds like you know a lot more about tracing! So by toggle on/off you mean the * key? I'll use a frame advance to only log 1 frame and I still get 900 lines to parse through. How do you decide what to break on?

So looking through that, looks like it loops 0B times at 89F6, doing a bunch of shift and EOR operations to the random seed, then multiplies the result by the seed. And then... oh, if the result is 0 you get an encounter, otherwise it loads 0 in A and RTLs. Huh. I still don't see WHY a higher seed leads to fewer encounters, but it sure works.

And thanks; I've been researching this game on and off for 2 years. It helps that I'm really good at reading raw hex lol. I'd like to get better at using tools though. (I wrote a Python program to edit the game, but then I found out about Nightmare and made some editors in that.)
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: rainponcho on July 20, 2017, 09:47:59 pm
This is my debug setting.
https://ibb.co/e6Zu4k

So I load up the dungeon. Choose a spot. Savestate.

First time:
Turn on logging - cpu. Wait maybe 10 seconds.

Repeat:
Load state. Turn on logging - cpu. Take a step. No encounter. Turn off logging.


I didn't get an encounter after awhile. So took 2 steps. And repeat.
Took 5 steps looping before I got a hit.


Today's last log throws me here. Bingo!
$18/8056 AD CD 18    LDA $18CD  [$00:18CD]
(yesterday it was elsewhere)


As for rng
$00/8A1B 8F 02 42 00 STA $004202[$00:4202]
==> this is our seed value

$00/8A22 8F 03 42 00 STA $004203
==> this is our randomly generated value from earlier shifting math

It multiplies the 2 8-bit #s together and gets 16-bits out. Or a 8.8 fixed-fractional value.


So our seed is 0C. It basically chooses a value between 00-0B. If we get 00, fight round. 1/12 = 8.333%

If our seed is 01. 1/1 = 100%
If our seed is 7F. 1/127 = 0.78%


Further math analysis. Seed = 0C.
- rng = 40h. 40 * 0C = 3[00] == 3
- rng = C0h. C0 * 0C = 9[00] == 9
- rng = FFh. BF4
- rng = 00h. 000. (*)
- rng = 15h. 0FC. (*)
- rng = 16h. 108. Fail.

00-15 = get ready!
16-FF = just you wait. My seed is low enough to catch you.


edit: My usage of 'seed' might be wrong here. But the idea works. :)
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: TimeSpaceMage on July 20, 2017, 10:08:42 pm
I'll turn off Squelch, though I'm not sure what the extra flags are besides SP=stack pointer.

Had to play around with the calculator a bit, but ohhhhh okay, I get it! So if their product's high byte is 00, it's an encounter. That explains why a higher seed means fewer values that would still yield a product less than 0100f.

I halved the encounter rate for now, so it's 1/24 (4%) now. Also I found the sprite order for FINIS, and changed it to DEATH  :laugh: *smack* (https://upontheshelfreviews.files.wordpress.com/2016/03/mabel_death.jpg)

Now if I could find a way to increase the walk speed. It takes 2f holding forward and up to 21f each to move half a step! I'm poring over trace logs of 1f walking, but the most I've gathered is that it's looping through 846F0f-849DFf (the graphics for the half step, I believe) until it hits an FF. After that it spends an unreasonable amount of time looping around bank $03, followed by about 2850 lines of stalling.
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: rainponcho on July 20, 2017, 10:42:17 pm
Summary of flags

A,X,Y = cpu registers
P = cpu flags
SP = stack
HC = horizontal line counter
VC = vertical line counter (useful for noting VBlank)
FC = frame counter ?


DB = bank
D = direct page
ex. DB:03, D:0100, lda $04 ==> read from 03:0100

It's D + DB that's more useful with squelch off. I got punished several times when you mvn/mvp or game uses dma and tosses banks around without you noticing. Lots of debugging time with crash burns.
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: Time/SpaceMage on July 20, 2017, 11:26:21 pm
DB = bank
D = direct page
ex. DB:03, D:0100, lda $04 ==> read from 03:0100

It's D + DB that's more useful with squelch off. I got punished several times when you mvn/mvp or game uses dma and tosses banks around without you noticing. Lots of debugging time with crash burns.
Ohhhhh so that's why I couldn't find those darn registers half the time! I'd be staring at the [ ] like "where the heck did it get that from?"

What's that about VC and HC? Could you give an example?

Oh, and I edited that last post right when you posted yours.
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: rainponcho on July 21, 2017, 12:31:02 pm
Looking at full trace log, I can't understand HC well enough either. For VC, screen has like 224 visisble lines. Then comes overscan to 239. Then the (something) period which stops at 262. Okay. I don't understand this enough to explain it to someone else. :)

Just ~224-225 onward is usually safe period when you can send/copy stuff to vram (when screen is on).



Unholy moley! Really slow drawing routine. :o
jsr 038F41 = eats up like 5 full nmi frames.

1st idea is to turn on FastRom. Set $30 flag in rom header and asm write $01 to 420d at bootup. Change some 00 code calls to 80 bank to get small appreciable boost.
(or I think you did this already?)


This loop here eats up a lot of cycles in a full trace log.

Code: [Select]
$00/8870 B9 00 00    LDA $0000,y[$7E:E335]   A:E3C0 X:E34B Y:E335 D:1DF8 DB:7E S:1FE6 P:envMxdIZC HC:0314 VC:149 FC:59 I:00
$00/8873 9D 00 00    STA $0000,x[$7E:E34B]   A:E301 X:E34B Y:E335 D:1DF8 DB:7E S:1FE6 P:envMxdIzC HC:0360 VC:149 FC:59 I:00
$00/8876 88          DEY                     A:E301 X:E34B Y:E335 D:1DF8 DB:7E S:1FE6 P:envMxdIzC HC:0406 VC:149 FC:59 I:00
$00/8877 E8          INX                     A:E301 X:E34B Y:E334 D:1DF8 DB:7E S:1FE6 P:eNvMxdIzC HC:0428 VC:149 FC:59 I:00
$00/8878 C2 20       REP #$20                A:E301 X:E34C Y:E334 D:1DF8 DB:7E S:1FE6 P:eNvMxdIzC HC:0450 VC:149 FC:59 I:00
$00/887A C6 03       DEC $03    [$00:1DFB]   A:E301 X:E34C Y:E334 D:1DF8 DB:7E S:1FE6 P:eNvmxdIzC HC:0480 VC:149 FC:59 I:00
$00/887C E2 20       SEP #$20                A:E301 X:E34C Y:E334 D:1DF8 DB:7E S:1FE6 P:envmxdIzC HC:0588 VC:149 FC:59 I:00
$00/887E D0 F0       BNE $F0    [$8870]      A:E301 X:E34C Y:E334 D:1DF8 DB:7E S:1FE6 P:envMxdIzC HC:0618 VC:149 FC:59 I:00

Code: [Select]
$00/87C4 B7 00       LDA [$00],y[$10:C58E]   A:0000 X:E000 Y:0001 D:1DF8 DB:7E S:1FE8 P:eNvMxdIzc HC:0442 VC:196 FC:58 I:00
$00/87C6 C8          INY                     A:0062 X:E000 Y:0001 D:1DF8 DB:7E S:1FE8 P:envMxdIzc HC:0504 VC:196 FC:58 I:00
$00/87C7 9D 00 00    STA $0000,x[$7E:E000]   A:0062 X:E000 Y:0002 D:1DF8 DB:7E S:1FE8 P:envMxdIzc HC:0526 VC:196 FC:58 I:00
$00/87CA E8          INX                     A:0062 X:E000 Y:0002 D:1DF8 DB:7E S:1FE8 P:envMxdIzc HC:0612 VC:196 FC:58 I:00
$00/87CB C2 20       REP #$20                A:0062 X:E001 Y:0002 D:1DF8 DB:7E S:1FE8 P:eNvMxdIzc HC:0634 VC:196 FC:58 I:00
$00/87CD C6 03       DEC $03    [$00:1DFB]   A:0062 X:E001 Y:0002 D:1DF8 DB:7E S:1FE8 P:eNvmxdIzc HC:0664 VC:196 FC:58 I:00
$00/87CF E2 20       SEP #$20                A:0062 X:E001 Y:0002 D:1DF8 DB:7E S:1FE8 P:envmxdIzc HC:0732 VC:196 FC:58 I:00
$00/87D1 D0 F1       BNE $F1    [$87C4]      A:0062 X:E001 Y:0002 D:1DF8 DB:7E S:1FE8 P:envMxdIzc HC:0762 VC:196 FC:58 I:00

Otherwise not sure yet how else to drop time. It runs lots of animation scripting language for what purpose? This could take some time to get it down. ^^
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: Time/SpaceMage on July 21, 2017, 02:00:22 pm
Yeah I had a feeling this wasn't very optimal code. Haven't turned on FastROM before nor changed 00 calls to 80; could you explain the latter? I'll see about the former later tonight.

The kicker to trying to optimize this is that I have no idea what it's doing, or when it's branching over to something unrelated. Any tips on bank disassembly? I literally used the Disassemble option on a full bank and pasted to a file, then wrote a Python program to remove the flags and put a newline after each JSL/JSR. But going through, it can misread data as strings of BRK or get off by a byte.
 
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: KingMike on July 21, 2017, 05:57:40 pm
Disassembling the full ROM isn't likely to get it right.
In addition to the 6502 problems in that it can mix code and data, and also indirect JMP (codes that read pointers from a table and then jump to the pointer. That's a problem since disassemblers won't be smart enough to know the table size and thus how many functions they should attempt to disassemble) , but also they may not be smart enough to account for the SEP/REP instructions.
(SEP and REP set certain processor flags. In particular to how they can mess up opcodes is that they can change A and X/Y to be 8-bit or 16-bit registers, which also affects the size of instructions that read them.)
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: magictrufflez on July 21, 2017, 06:25:47 pm
No help to offer as far as hacking, but plenty of moral support from this corner!  I haven't played Arcana in a long time, bu it was one of those games I was very proud to have finally conquered when I finished it as a kid.  I do, however, suddenly feel silly for backtracking with Darwin to get him dressed properly after you first get him when the armor I bought did literally nothing....
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: rainponcho on July 21, 2017, 07:10:01 pm
What I'd do is get a decent sized tracelog of all the important gameplay areas - dungeon, battle, menu, loading. Then parse it for any JSL / JML. Replace with HiRom banks.

We only get the slightly faster memory speed if we read/write/execute from $80-FF region. $00-7F will be default SlowRom.



So if we see any of these:
Code: [Select]
$03/8F2F 22 62 87 00 JSL $008762[$00:8762]   A:0010 X:C58D Y:E000 D:1E00 DB:7E S:1FF0 P:eNvmxdIzc HC:0536 VC:195 FC:57 I:00
==> 22 62 87 80  JSL $808762


$03/A2FA BF 79 A4 03 LDA $03A479,x[$03:A47F] A:0000 X:0006 Y:0001 D:1E00 DB:00 S:1FF1 P:envmxdIzC HC:0050 VC:001 FC:56 I:00
==> BF 79 A4 83  LDA $83A479,x


$03/A31C DF AF A3 03 CMP $03A3AF,x[$03:A3D7] A:0010 X:0028 Y:0001 D:1E00 DB:00 S:1FF1 P:envmxdIzc HC:1014 VC:001 FC:56 I:00
==> DF AF A3 83


$00/A2ED A9 00       LDA #$00                A:000A X:000A Y:0100 D:0000 DB:00 S:1E35 P:envMxdizc HC:0022 VC:015 FC:24 I:00
$00/A2EF 48          PHA                     A:0000 X:000A Y:0100 D:0000 DB:00 S:1E35 P:envMxdiZc HC:0046 VC:015 FC:24 I:00
$00/A2F0 AB          PLB                     A:0000 X:000A Y:0100 D:0000 DB:00 S:1E34 P:envMxdiZc HC:0076 VC:015 FC:24 I:00
==> A9 80 48 AB


$03/8F0B 9F 78 A6 7E STA $7EA678,x[$7E:A69E] A:0000 X:0026 Y:0026 D:1E00 DB:00 S:1FF1 P:envmxdIzc HC:0760 VC:005 FC:56 I:00
==> do not touch me (7E,7F,sram banks)


$00/9761 A7 10       LDA [$10]  [$01:8B29]   A:002C X:002C Y:8B28 D:1E00 DB:00 S:1FF6 P:eNvmxdIzc HC:0550 VC:006 FC:55 I:00
==> these are harder to track since they're ptrs somewhere in rom


$03/8F1E F4 7E 00    PEA $007E               A:0000 X:0000 Y:CCE1 D:1E00 DB:00 S:1FF1 P:envmxdIZc HC:0164 VC:195 FC:58 I:00
$03/8F21 AB          PLB                     A:0000 X:0000 Y:CCE1 D:1E00 DB:00 S:1FEF P:envmxdIZc HC:0212 VC:195 FC:58 I:00
==> have to be careful, 7E doesn't count

It's not important to get every single value. Just enough that runs in critical code areas. And wherever that original DB:00 value comes from. ^^


I did this only for decompression routine in Super Ghouls 'n Ghosts restoration (+ changed to vram dma loading) and average ~0.5 seconds shorter level load times. Which isn't alot (~30 NMI frames) but it might give a few more frames easy way through automation. Had I actually did a thorough changeover, I don't know whether I'd get another 0.5 second or more off.

You'll also want to edit the nmi, irq vectors from 00xxxx ==> 80xxxx. They should be somewhere around 7ff0 rom. Maybe some other snes hacker could comment more as I didn't experiment much with SlowRom --> FastRom yet.


I wouldn't have the skills to pull off a Nightcrawler speedup achievement (Glory of Heracles IV translation). Basically rewriting the engine and killing waste-of-time ideas.


edit: Someone could even write a "universal" automated tool that takes geiger / bsnes-plus logs and auto-patches loroms. Though I'm not so confident it'd fully fix up games like Gradius III slowdowns. Or Final Fight (Guy). But it's worth a thought?
(I'm not doing it)
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: zombero on July 21, 2017, 09:03:11 pm
What makes you say armor doesn't do anything?  That's pretty contrary to what I've observed.
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: Reiska on July 21, 2017, 09:30:26 pm
Did a bit of testing today with armor - I can confirm it does *something*, although the effect isn't exactly profound (in chapter 3, naked Rooks was taking about 6-8 more damage from attacks with no armor as compared to Breast Plate + Iron Shield).
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: TimeSpaceMage on July 22, 2017, 12:25:32 am
OK, so it's not quite nothing. A more accurate statement would be "stats are wack"... which is why down the line I'd like to work out the damage formula and see if it's just using too little of certain stats. I recently learned about the multiplication registers, so maybe now I can make more sense of it. When I'm not looking into the rest of this, lol.

Disassembling the full ROM isn't likely to get it right.
In addition to the 6502 problems in that it can mix code and data, and also indirect JMP (codes that read pointers from a table and then jump to the pointer. That's a problem since disassemblers won't be smart enough to know the table size and thus how many functions they should attempt to disassemble) , but also they may not be smart enough to account for the SEP/REP instructions.
(SEP and REP set certain processor flags. In particular to how they can mess up opcodes is that they can change A and X/Y to be 8-bit or 16-bit registers, which also affects the size of instructions that read them.)

That makes sense! I'm a little fuzzy on JMP addressing modes, but I've seen SEP and REP plenty of times. Also gotta say, really big fan. Your posts have helped me learn so much ASM already!


What I'd do is get a decent sized tracelog of all the important gameplay areas - dungeon, battle, menu, loading. Then parse it for any JSL / JML. Replace with HiRom banks.

We only get the slightly faster memory speed if we read/write/execute from $80-FF region. $00-7F will be default SlowRom.
..
You'll also want to edit the nmi, irq vectors from 00xxxx ==> 80xxxx. They should be somewhere around 7ff0 rom. Maybe some other snes hacker could comment more as I didn't experiment much with SlowRom --> FastRom yet.


edit: Someone could even write a "universal" automated tool that takes geiger / bsnes-plus logs and auto-patches loroms. Though I'm not so confident it'd fully fix up games like Gradius III slowdowns. Or Final Fight (Guy). But it's worth a thought?
(I'm not doing it)

Parsing tracelogs... yeah, I could write a program to look for certain opcodes in a tracelog. I think it'd be safer if it just wrote those lines to a file rather than edit the ROM directly, since I don't trust addressing modes further than I can throw them. If someone wants to add that capability, I could look into putting it on Github later.

Meanwhile, sounds like I need to go research SlowROM->FastROM some more.
EDIT: Okay, I changed the flag in the internal header to $30. So the next step is to write my first ASM jump (*squeeing internally*) to set $420d. Going out on a limb here and presuming the huge block of FF's at 6020h-7FB0h is free.

Code: [Select]
$00/8001 18          CLC                     A:0000 X:0000 Y:0000 D:0000 DB:00 S:01FF P:EnvMXdIZc HC:0190 VC:000 FC:00 I:00
$00/8002 FB          XCE                     A:0000 X:0000 Y:0000 D:0000 DB:00 S:01FF P:EnvMXdIZc HC:0220 VC:000 FC:00 I:00
$00/8003 C2 10       REP #$10                A:0000 X:0000 Y:0000 D:0000 DB:00 S:01FF P:envMXdIZC HC:0250 VC:000 FC:00 I:00
$00/8005 E2 20       SEP #$20                A:0000 X:0000 Y:0000 D:0000 DB:00 S:01FF P:envMxdIZC HC:0288 VC:000 FC:00 I:00
$00/8007 A2 00 01    LDX #$0100              A:0000 X:0000 Y:0000 D:0000 DB:00 S:01FF P:envMxdIZC HC:0326 VC:000 FC:00 I:00
$00/800A 9A          TXS                     A:0000 X:0100 Y:0000 D:0000 DB:00 S:01FF P:envMxdIzC HC:0366 VC:000 FC:00 I:00
$00/800B A9 00       LDA #$00                A:0000 X:0100 Y:0000 D:0000 DB:00 S:0100 P:envMxdIzC HC:0396 VC:000 FC:00 I:00
$00/800D 48          PHA                     A:0000 X:0100 Y:0000 D:0000 DB:00 S:0100 P:envMxdIZC HC:0428 VC:000 FC:00 I:00
$00/800E AB          PLB                     A:0000 X:0100 Y:0000 D:0000 DB:00 S:00FF P:envMxdIZC HC:0466 VC:000 FC:00 I:00
$00/800F A9 8F       LDA #$8F                A:0000 X:0100 Y:0000 D:0000 DB:00 S:0100 P:envMxdIZC HC:0510 VC:000 FC:00 I:00
$00/8011 8D 00 21    STA $2100  [$00:2100]   A:008F X:0100 Y:0000 D:0000 DB:00 S:0100 P:eNvMxdIzC HC:0542 VC:000 FC:00 I:00
$00/8014 A9 00       LDA #$00                A:008F X:0100 Y:0000 D:0000 DB:00 S:0100 P:eNvMxdIzC HC:0628 VC:000 FC:00 I:00
$00/8016 8D 00 42    STA $4200  [$00:4200]   A:0000 X:0100 Y:0000 D:0000 DB:00 S:0100 P:envMxdIZC HC:0660 VC:000 FC:00 I:00

Looks like as good a place as any. So the code I want is...

Code: [Select]
$00/8019 22 30 60 80 JSL $806030
...
$80/6030 A9 01       LDA #$01
$80/6032 8D 0D 42    STA $420D
$80/6035 C2 10       REP #$10 (The 2 lines I'm replacing with the JSL)
$80/6037 E2 20       SEP #$20
$80/6039 6B          RTL

Oh, can I set DB to 80 here? Is there an instruction for that?
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: Reiska on July 22, 2017, 01:46:21 am
I don't have any real insight on the damage formula mathematically, but some empirical observations of mine:
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: Time/SpaceMage on July 22, 2017, 03:21:18 am
Yeah, that matches what I've observed in battle. The thing about finding hidden equipment/monster stats is that the tables are all 1 stat at a time for all items rather than all stats for 1 item at a time. It's hard to tell what's a table and what's not. For instance, monsters have Int values as I've found them in RAM (and given 999 Int to a monster to watch them wipe everyone with spells lol).

Attack power and battle damage are loaded into $16DB, and defense power into $16DD. But, they're shared by other stuff in battle too.

Oh, Alertness comes up a bunch in battle. According to my notes:
-Is read 3x per fighter at the end of the round (probably to determine turn order)   
-Read when an enemy whiffs   
-Read, then Endurance read when an enemy hits   
-Read when attacking   
-When attacking: Alertness/8 + 1, JSR C88B (isn't that the damage formula?)   
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: rainponcho on July 22, 2017, 08:13:26 am
db starts here.
Code: [Select]
$00/800B A9 00       LDA #$00                A:0000 X:0100 Y:0000 D:0000 DB:00 S:0100 P:envMxdIzC HC:0356 VC:000 FC:00 I:00
$00/800D 48          PHA                     A:0000 X:0100 Y:0000 D:0000 DB:00 S:0100 P:envMxdIZC HC:0380 VC:000 FC:00 I:00
$00/800E AB          PLB                     A:0000 X:0100 Y:0000 D:0000 DB:00 S:00FF P:envMxdIZC HC:0410 VC:000 FC:00 I:00



I think you're choice of free area is probably safe.

Code: [Select]
$00/8019 22 30 E0 80 JSL $80E030
==> JML $80E030


$80/E030 A9 01       LDA #$01
$80/E032 8D 0D 42    STA $420D

$80/E035 C2 10       REP #$10 (The 2 lines I'm replacing with the JSL)
$80/E037 E2 20       SEP #$20
$80/E039 6B          RTL
==> JMP $801D

Your detour works but it'll RTL back to SlowRom area (00). We want to stay in FastRom. So JMP over ($80 -> $80). Then rest of init will go faster.


You might want to hijink the other vectors listed here:
http://www.smwiki.net/wiki/Vector_Info


I might give writing a small fastrom tool a try also, just to see how much it works.

(edit: I'm helping out on some snes projects that run into lorom slowdowns. So I guess I need it too. :))


edit2:
Another db here
Code: [Select]
$00/811A F4 00 00    PEA $0000               A:1E00 X:1FFF Y:0000 D:1E00 DB:00 S:1FFF P:envmxdIzC HC:1290 VC:002 FC:01 I:00
$00/811D AB          PLB                     A:1E00 X:1FFF Y:0000 D:1E00 DB:00 S:1FFD P:envmxdIzC HC:1338 VC:002 FC:01 I:00
$00/811E AB          PLB                     A:1E00 X:1FFF Y:0000 D:1E00 DB:00 S:1FFE P:envmxdIZC HC:0010 VC:003 FC:01 I:00


edit3:
Easier detour idea.

Reset vector is @ rom 7ffc. Change that to E030. Write 420d there. Then JML $808001 to finish it off.

Same for NMI, IRQ vectors. Except you just JML to $80xxxx. No hassle. :)

Use Lunar Address to convert rom  snes address.


edit4:
Tested fastrom. Same 20 frames to walk forward. No difference. Hmm. Stupid me.

Something else.


edit5:
Forgot to turn on Fastrom header. 23 clean -> 20 fastrom to take a step forward. Still slow. :|
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: zombero on July 22, 2017, 09:11:29 am
Here are some things I remember from my brief time hacking this game:
-The difference between 1 Strength and 255 Strength is something to the tune of 1.5x to 2x damage.  So yeah, VERY minor.  It was definitely multiplicative, though.
-Endurance was in a similar boat, but I think it was even worse.  Compared to Endurance, Defense is actually pretty effective.  When I removed all my equipment in Stavery I started taking ~double damage from enemies.  The difference in Defense stat is the primary reason why humans take less damage than elementals.
-Intelligence reducing magic damage, as Reiska said, sounds right, though I don't really remember for certain.
-Buffs/Debuffs seem to have a rather meager impact, to the tune of maybe ~1/8 increase/decrease for the more observable stats.  The main exception to this is Dodge All which has a much more noticeable result.
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: KingMike on July 22, 2017, 01:55:36 pm

EDIT: Okay, I changed the flag in the internal header to $30. So the next step is to write my first ASM jump (*squeeing internally*) to set $420d. Going out on a limb here and presuming the huge block of FF's at 6020h-7FB0h is free.

Code: [Select]
$00/8001 18          CLC                     A:0000 X:0000 Y:0000 D:0000 DB:00 S:01FF P:EnvMXdIZc HC:0190 VC:000 FC:00 I:00
$00/8002 FB          XCE                     A:0000 X:0000 Y:0000 D:0000 DB:00 S:01FF P:EnvMXdIZc HC:0220 VC:000 FC:00 I:00
$00/8003 C2 10       REP #$10                A:0000 X:0000 Y:0000 D:0000 DB:00 S:01FF P:envMXdIZC HC:0250 VC:000 FC:00 I:00
$00/8005 E2 20       SEP #$20                A:0000 X:0000 Y:0000 D:0000 DB:00 S:01FF P:envMxdIZC HC:0288 VC:000 FC:00 I:00
$00/8007 A2 00 01    LDX #$0100              A:0000 X:0000 Y:0000 D:0000 DB:00 S:01FF P:envMxdIZC HC:0326 VC:000 FC:00 I:00
$00/800A 9A          TXS                     A:0000 X:0100 Y:0000 D:0000 DB:00 S:01FF P:envMxdIzC HC:0366 VC:000 FC:00 I:00
$00/800B A9 00       LDA #$00                A:0000 X:0100 Y:0000 D:0000 DB:00 S:0100 P:envMxdIzC HC:0396 VC:000 FC:00 I:00
$00/800D 48          PHA                     A:0000 X:0100 Y:0000 D:0000 DB:00 S:0100 P:envMxdIZC HC:0428 VC:000 FC:00 I:00
$00/800E AB          PLB                     A:0000 X:0100 Y:0000 D:0000 DB:00 S:00FF P:envMxdIZC HC:0466 VC:000 FC:00 I:00
$00/800F A9 8F       LDA #$8F                A:0000 X:0100 Y:0000 D:0000 DB:00 S:0100 P:envMxdIZC HC:0510 VC:000 FC:00 I:00
$00/8011 8D 00 21    STA $2100  [$00:2100]   A:008F X:0100 Y:0000 D:0000 DB:00 S:0100 P:eNvMxdIzC HC:0542 VC:000 FC:00 I:00
$00/8014 A9 00       LDA #$00                A:008F X:0100 Y:0000 D:0000 DB:00 S:0100 P:eNvMxdIzC HC:0628 VC:000 FC:00 I:00
$00/8016 8D 00 42    STA $4200  [$00:4200]   A:0000 X:0100 Y:0000 D:0000 DB:00 S:0100 P:envMxdIZC HC:0660 VC:000 FC:00 I:00

Looks like as good a place as any. So the code I want is...

Code: [Select]
$00/8019 22 30 60 80 JSL $806030
...
$80/6030 A9 01       LDA #$01
$80/6032 8D 0D 42    STA $420D
$80/6035 C2 10       REP #$10 (The 2 lines I'm replacing with the JSL)
$80/6037 E2 20       SEP #$20
$80/6039 6B          RTL

Oh, can I set DB to 80 here? Is there an instruction for that?

Is this HiROM or LoROM? (Although it can still technically vary between PCBs, it is usually enough to distinguish Hi or Lo ROM?)
Generally in "LoROM" games (SNES9x or ZSNES will tell you when the game loads), ROM is only mapped to address $8000-FFFF (the second part of the address). $6000-7FFF can vary between PCBs but is possibly SRAM.
(bank 00/80:8000 would map to the first 32KB of ROM, bank 01/81:8000 map to the second 32KB, etc.)
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: TimeSpaceMage on July 23, 2017, 12:49:17 am
Not sure why my posts only have to wait on mod approval when I post on mobile, but I'll just repost this on PC now that I'm home.

Yes, it's LoROM. Oh I see, so those addresses are out of range. Phooey... that's a good lesson though. So I would need free space in one of the banks in the 8000+ range. There's another section of FFs from F990-FFFF.
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: rainponcho on July 23, 2017, 08:04:27 am
LoROM can be a little funny to understand at first. FuSoYa's tool Lunar Address makes it easier to convert between raw file and snes addresses.

tool
http://fusoya.eludevisibility.org/la/index.html


ex.
Free space located at $6020 rom (file). Lunar Address shows us it's SNES LoROM address 00:E020. Or 80:E020 for FastROM.

Free space F990 (file) = 01:F990 (SNES, SlowRom, LoRom)  81:F990 (SNES, FastRom, LoRom)


Or here's a snippet from FastRom tester
Code: [Select]
arch snes.cpu; lorom


// lorom, fastrom
org $ffd5
db $30


// snes bootup
org $fffc
dw fastrom_start


// todo: snes irq, nmi remap



//$00/9532 A7 10       LDA [$10]  [$01:8CDE]   A:8761 X:000E Y:0001 D:1E00 DB:00 S:1FF6 P:eNvmxdIzc HC:0264 VC:259 FC:59 I:00
//
//$00/9534 29 FF 00    AND #$00FF              A:1103 X:000E Y:0001 D:1E00 DB:00 S:1FF6 P:envmxdIzc HC:0352 VC:259 FC:59 I:00

// snes $9534 = file $1532
org $9534
jsr fastrom_code1



// snes 80e020 = snes 00e020 = file 6020
org $80e020

fastrom_start:
// snes native mode
clc
xce

sep #$20
lda.b #$01
sta $420d

// 00xxxx ==> 808001
jml $808001



fastrom_code1:
and.w #$00ff

cmp.w #$0040
bcs fastrom_code1_done

// 24-bit ptr table code jumps  (00-3F ==> 80-BF)
ora.w #$0080

fastrom_code1_done:
rts


And patch to convert FastRom banks (code analysis).
https://www.sendspace.com/file/60krtf

Although I found a bug with how toll handles plb codes but there weren't many in this game. So I think it was okay - have to recheck.
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: TimeSpaceMage on July 23, 2017, 12:15:23 pm
LoROM can be a little funny to understand at first. FuSoYa's tool Lunar Address makes it easier to convert between raw file and snes addresses.

tool
http://fusoya.eludevisibility.org/la/index.html


ex.
Free space located at $6020 rom (file). Lunar Address shows us it's SNES LoROM address 00:E020. Or 80:E020 for FastROM.

Free space F990 (file) = 01:F990 (SNES, SlowRom, LoRom)  81:F990 (SNES, FastRom, LoRom)


Or here's a snippet from FastRom tester
Code: [Select]
arch snes.cpu; lorom


// lorom, fastrom
org $ffd5
db $30


// snes bootup
org $fffc
dw fastrom_start


// todo: snes irq, nmi remap



//$00/9532 A7 10       LDA [$10]  [$01:8CDE]   A:8761 X:000E Y:0001 D:1E00 DB:00 S:1FF6 P:eNvmxdIzc HC:0264 VC:259 FC:59 I:00
//
//$00/9534 29 FF 00    AND #$00FF              A:1103 X:000E Y:0001 D:1E00 DB:00 S:1FF6 P:envmxdIzc HC:0352 VC:259 FC:59 I:00

// snes $9534 = file $1532
org $9534
jsr fastrom_code1



// snes 80e020 = snes 00e020 = file 6020
org $80e020

fastrom_start:
// snes native mode
clc
xce

sep #$20
lda.b #$01
sta $420d

// 00xxxx ==> 808001
jml $808001



fastrom_code1:
and.w #$00ff

cmp.w #$0040
bcs fastrom_code1_done

// 24-bit ptr table code jumps  (00-3F ==> 80-BF)
ora.w #$0080

fastrom_code1_done:
rts


And patch to convert FastRom banks (code analysis).
https://www.sendspace.com/file/60krtf

Although I found a bug with how toll handles plb codes but there weren't many in this game. So I think it was okay - have to recheck.

Turns out I had Lunar Address; I just forgot about it  :D
So I've got a few questions. First, which program are you editing that in? (Admittedly I've been going by hand, but most of my changes up til now have just been data tweaks.) Second, what does that patch do? I'm a little confused as to if I still need to write those redirects. IPS files don't really explain what they're changing.

Third, let me see if I got this right.
Code: [Select]
Initial detour for FastROM:
7ffc (Reset vector): 01 80 -> 90 F9

At F990:
A9 01
8D 0D 42
5C 01 80 80

And then I have to redirect these 4 too?
7fea (Native mode NMI): 35 83
7fee (Native mode IRQ): 4E 81
7ffa (Emulation mode NMI): FF FF
7ffe (Emulation mode IRQ): 00 00
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: rainponcho on July 23, 2017, 12:49:11 pm
xkas-plus
https://github.com/devinacker/xkas-plus/releases


Ips patch changes game's 24-bit JSL, JML, LDA, ORA, STA, (lala) opcodes to fastrom banks. And some PEA / PLB ones. You still need redirects, fastrom 420d, etc.

bonus asm code: game hides some 24-bit ptrs as data. So I found the routine and fastrom edit on-the-fly.


These 2 need remapping to $80 fastrom.
7fea (Native mode NMI): 35 83
7fee (Native mode IRQ): 4E 81

A simple JML $808335, JML $80814E redirect will work.


At F990... I guess technically we have no idea (?) what startup snes settings are. So we need to
1. enter native snes mode: clc - xce
(we could be in native or emulation mode??)

2. set 8-bit accumulator mode: sep #$20
(could be 16-bit A register)

3. write $01 to $420d
(slowrom -> fastrom)

4. jml to normal start code but in $80 bank
(slow bank -> fast bank)


I only got ~3 frames faster per walking step. But it's "free" and easy. :)

You'd have to optimize down the slow loops to get more frames.
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: TimeSpaceMage on July 23, 2017, 02:07:59 pm
Okay, so that's:
Code: [Select]
F990:
18 (clc)
FB (xce)
E2 20 (sep #$20)
A9 01
8D 0D 42
5C 01 80 80

7fea: A0 F9
f9a0: 5C 35 83 80

7FEE: A4 F9
f9a4: 5C 4E 81 80

Wait, am I missing something with xkas? I see where I can use it on the command line to convert .asm to .ips, but I was expecting some sort of editor. Do I just write the .asm file in a text editor?

EDIT: Okay I put the code in, and the reset vector took it to 00/F990... which is still FF's, so it was actually sent to file position $7990. I thought that was part of SRAM? :huh: No, I think I get it; the snes address $7990 would be SRAM or w/e, but the file positions $0000-$7FFF are bank $00 and snes addresses $8001-$FFFF.

EDIT2: Okay it doesn't crash Snes9x any more  :laugh: The startup stats say Mode: 20 though. Hang on...
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: KingMike on July 23, 2017, 02:53:19 pm
You write the code as a text file but did you format it correctly?

First line you need lorom/hirom to tell it the format.

Then you would format the address as something like

Code: [Select]
org $80F990
NewBootCode:
and then your code. To fix the reset vector.

Code: [Select]
org $80FFEC
 .dw NewBootCode
At least, I think $FFEC is the Native Mode Reset vector (the start point of the code) and this should write the address of your new start code.
(.dw is the started instruction to insert a "word", a 2-byte value. I can't recall if xkas support that but it should. Maybe it was "dw")

If you didn't correctly define the address to insert your code in your ASM file, it might have defaulted to address 0 in the ROM, possibly corrupting it. You should probably double-check that.
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: TimeSpaceMage on July 23, 2017, 03:29:51 pm
Code: [Select]
This one's a pretty big offender.
$80/9B0E DC 49 10    JML [$1049][$00:A105]

And this is where the bank for $1049 is stored, so I guess the trick is getting it to store 80's instead?  o.0
$80/9537 8D 4B 10    STA $104B  [$00:104B]   A:0007
$80/9000 8D 4B 10    STA $104B  [$00:104B]   A:0405

Also found this one.
$03/A363 22 47 9C 00 JSL $009C47[$00:9C47]
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: rainponcho on July 23, 2017, 04:56:16 pm
I'd say it depends how much time game spends running those routines. If it hits it a lot, then yeah.. you'll want to manually "run-time" optimize them (00:9532) -- it'd take a long time to dissect each bank ptr correctly through disassembly (data storage).

You'll probably find lots of 24-bit ptrs that I missed, because I never came close to triggering them.
[Bwa ha ha!]



If you keep trace logging, you can run it in this tool:
https://www.sendspace.com/file/9z7g4g

Make sure to backup your rom first. Rename it to 'rom'. Rename your geiger tracelog to 'log'. Run exe. It'll parse it and turn things into fastrom banks.

Be careful about it corrupting your own asm hacks if you keep making (changing) them lots of times. Have to be organized. So I'm not officially releasing it or anything. And turned off PEA - PLB detection since there's situations that mess up.



I'll locate some loop offenders and optimize them first. See what I can get before mentioning them here -- have some ideas to test on them. :)

But I'm going to back off with explanations (since clearly I did a lousy job at it) and let KingMike help you understanding technical problems.


edit: Doesn't look like FastRom will help much. So maybe no point in continuing further this way. I guess there's just too much raster math which is taking the brunt of the slowdown.

Which maybe is why FastRom conversions aren't that popular to fix slow games.

You could always work on your other todo items. Sorry, guess another game that's defeated me again.


edit2:
Out of curiosity, tried some more. There's a routine that inits the drawing data. Although it uses mvn, dma speeds it up another 2 frames. So 23 -> 20 (fastrom) -> 18 (dma init).

I'll keep poking at it then and upload optimized asm file w/ full ips patch if I can get some more time cut.
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: Time/SpaceMage on July 23, 2017, 07:03:52 pm
(Yeah I'm just not gonna post on mobile any more)
Phantom edit to see if it's still doing that.
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: TimeSpaceMage on July 24, 2017, 12:03:24 am
I'd say it depends how much time game spends running those routines. If it hits it a lot, then yeah.. you'll want to manually "run-time" optimize them (00:9532) -- it'd take a long time to dissect each bank ptr correctly through disassembly (data storage).

What do you mean by 00:9532 and data storage?

Quote
You'll probably find lots of 24-bit ptrs that I missed, because I never came close to triggering them.
[Bwa ha ha!]
I just walked around hitting Step Into to see if the current instruction was in a SlowROM bank :3 Those instructions were from leaving town/Balnea Temple.


Quote
If you keep trace logging, you can run it in this tool:
https://www.sendspace.com/file/9z7g4g

Make sure to backup your rom first. Rename it to 'rom'. Rename your geiger tracelog to 'log'. Run exe. It'll parse it and turn things into fastrom banks.

Be careful about it corrupting your own asm hacks if you keep making (changing) them lots of times. Have to be organized. So I'm not officially releasing it or anything. And turned off PEA - PLB detection since there's situations that mess up.

I'm pretty good at keeping track of them. ;) Every version gets backed up in my Backup folder, and my data edits have the byte changes written to a change log for reference. My work, references and tools are all on my Google Drive too in case of hard drive failure. I've been around long enough to know better than to take chances with my projects!
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: rainponcho on July 24, 2017, 09:17:06 pm
This is nearly most I could torture engine. If you generic optimized every single possible thing, maybe you could squeeze another frame.
https://www.sendspace.com/file/kstnbk


Full fastrom ips tester can be applied to vanilla rom. It should give some walking boost (~7-8 frames or ~33%).



The rest of the slowdown comes from running this all the time:
JSR $99FE  [$83:99FE]

That's hard to figure out how to get it better. But that spot would kick it down another 2-3 frames possibly.
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: TimeSpaceMage on July 25, 2017, 12:36:05 am
Oh wow, that looks like it was a lot of work!
...

Quote
// average walking stats
//
// balnia   23 ==> 15
// stavery  23 ==> 15
// bintel   19 ==> 12
Holy f- that's plenty fast! Good job  :o

Code: [Select]
org $188044

// random encounter cheat
ldx.w #$00ff
I see that! (http://24.media.tumblr.com/aeb6abc922bfe2e3a78ad7e9c2c31a1e/tumblr_mfyijb0fJ81rkffv3o1_500.gif)  :P I'm using $18 for now, unless the faster speed needs something lower.


Oh, I revisited my old mod discussion on GameFAQs and zombero had this to say:
Quote
zombero    2 years ago   #31
Yeah, I did my own tests back in the day.

From my memory, Str's effect on your damage is basically (1 + (strength/400))*weapon_based_damage. Though it also seems to have some sort of minimum damage that it must add, apparently something like strength/40. Not sure exactly how the implementation works.

I think the weapon-based portion was a subtractive formula with enemy defense, but I don't recall for certain. But weapon is the main driving force in your damage in general.
...I'm starting to wonder if the Defend command does anything at all, though. Maybe I should rename it to "Wait"  ::)
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: rainponcho on July 25, 2017, 08:22:42 am
Forgot to remove that cheat - good for exploration though. :)


And I goofed this line:

(ffec ==> ffee)
org $ffee
dw fastrom_irq


And I'm told you don't need this part either:

// lorom, fastrom
org $ffd5
db $30


Otherwise good luck with it!
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: zombero on July 25, 2017, 10:34:45 am
Quote
...I'm starting to wonder if the Defend command does anything at all, though. Maybe I should rename it to "Wait"
That I have no idea about.  Defend isn't worth bothering with in most RPGs, and this game was certainly no exception.  :)

Oh, and I'm having the same issue with waiting for replies to be moderated.  Presumably it's probationary period for new posters.
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: TimeSpaceMage on July 29, 2017, 06:34:04 pm
rainponcho: You should finalize that patch and submit it! I'd still like to use it in my mod, but there should be a version history to keep track of it better. I'm sure lots of users would like a standalone speed optimization.

zombero: Yeah, I don't get it since neither of us are new users.

So there's a few things I've got in the queue to look at.
-How map progress is stored. (I figure this can lead to understanding how the maps are stored, and therefore editing maps.) So far I've compared 2 SRAMs, with 1 tile difference on the map exploration. I got the following changes:
1376: 0F->01 (-14d)
1378: 1D->15 (-8)
137A: 04->06 (+2)
13F4: 03->01 (-2)
1500: 73->53
By any chance, does this look like a familiar compression to anyone?
Oh, and a bunch of bytes after 1500 were changed into consecutive numbers like the rest of the region, but I'm betting that's something else like a difference in initialization. (My next step is to try a Cheat Search for these values upon taking that step.)

Save files are split up distinctly, btw.
Slot 1: 0100-05FF, 1100-15FF
Slot 2: 0600-0AFF, 1600-1AFF
Slot 3: 0B00-10FF, 1B00-1FFF

So, 2 sets of 500 bytes each. The pairs aren't exact copies, but they're really similar.


-Locating pointer tables. I haven't had luck finding pointers to the dialogue strings, but it's been awhile since I checked and I understand more about banks now.
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: KingMike on July 29, 2017, 10:02:35 pm
1 or 2 changes is probably the map data, and the other checksums.
I'd make a couple more test changes to look for patterns.
Does the game keep track of any other variables, such as time played, that could possibly vary uncontrollably?
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: Time/SpaceMage on July 29, 2017, 11:57:49 pm
Wow, that's actually what I expected it to be! There is no (known) in-game timer, though there are plenty of variables that advance every frame.
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: TimeSpaceMage on July 30, 2017, 07:18:09 pm
OK, I played around with the SRAM viewer in Geiger's Snes9x. Turns out SRAM 0376/0378/037A are where the game saves the last position and compass direction you were at in the dungeon. I was getting $0F/1D/04 from leaving the dungeon normally, but figured this out after a few Return Rings. Side note, the game literally saves your last dungeon position so if we ever work out how Return Rings work, there could be a reverse Return Ring to take you back to where you were. That would be awesome.

(Hid the old research since it's not as relevant now.)
Spoiler:
So this leaves:
3F4: 01->03
500: 5D->73
502: A3->8D
504: E7->E1
512: A1->B7
514: 5F->49
516: 87->81

Filled out 3 spaces instead of 1:
3EC: 01->03
3F0: 00->02

3F4: 01->03 (same)
500: 5D->77
502: A3->89
504: E7->E1 (same)
512: A1->BB
514: 5F->45
516: 87->81 (same)
Maybe 3EC-3F4 have to do with the map tile?

Filled out a lot more:
(Changes from 3 spaces)
3C0: 0000->0300
3C3: 0000->8002
3C7: 0000->8003
3CB: 0000->8001
3D0: 0000->0100
3D3: 00E0->00E3
3D7: 00A0->80A2
3DB: 00B6->80B6
3E3: 0001->8001
500: 77 53 89 AC E1 -> 06 57 FA A8 62
510: 6F 00 BB 07 45 F8 81 -> 6F 00 4A 0B B6 F4 02

...OK I have no idea what the 500's are doing, but they aren't map progress. I walked to the end of the (explored) room and used a Return Ring, and the new save file had completely different 500's. I even got ten changed values from buying another Return Ring, not counting the GP change!


EDIT: Well I worked out the rest of the known data, enough to make a reference page (http://datacrystal.romhacking.net/wiki/Arcana:SRAM_map) on Data Crystal. Dungeon progress seems to be stored in 380-3FF, so that at least narrows things down. It could be in 400-4FF too, but I'd need to fill out a larger area such as the Ice Mine Ice Maze.

EDIT2: Well hello there! I found a pointer table in the ROM for which addresses get an MVN to SRAM. They're in groups of 3 bytes, the "from" address and the # of consecutive bytes to copy. The RAM addresses are now on the SRAM reference page btw.

If anyone would like to help trace the map data, it starts around $1700 in RAM.


August 01, 2017, 05:44:29 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
Gentlemen... BEHOLD!
CORN!!

(http://i.imgur.com/P4wrJnM.png)

Yep, that's Balnea Temple 1F in RAM ;D  Turns out the map isn't compressed... in RAM. Bastard was all the way at the end. Here's the code I followed, tracing the changes to the Dungeon X/Y position (which I call Xpos and Ypos for short):

Code: [Select]
$83/A2FA BF 79 A4 83 LDA $83A479,x[$83:A47B] *Load offset to Xpos (i.e. 01 if you moved east)
$83/A2FE 18          CLC
$83/A2FF 6D F7 16    ADC $16F7  [$80:16F7] *Add A to Xpos
$83/A302 85 22       STA $22    [$00:1E22]
$83/A304 BF 81 A4 83 LDA $83A481,x[$83:A483] *Load offset to Ypos (i.e. 01 if you moved south)
$83/A308 18          CLC                   
$83/A309 6D F9 16    ADC $16F9  [$80:16F9] *Add A to Ypos
$83/A30C 85 24       STA $24    [$00:1E24] 
$83/A30E A6 22       LDX $22    [$00:1E22] 
$83/A310 20 57 A4    JSR $A457  [$83:A457] 

$83/A457 C9 20 00    CMP #$0020             
$83/A45A B0 19       BCS $19    [$A475]     *Verify Xpos < $20
$83/A45C 09 00 20    ORA #$2000             <-This threw me at first, but it's storing #$20 to $4203
$83/A45F 8D 02 42    STA $4202  [$80:4202]  <-and so multiplying Ypos * $20.
$83/A462 E0 20 00    CPX #$0020             
$83/A465 B0 0E       BCS $0E    [$A475]     *Verify Ypos < $20
$83/A467 8A          TXA                    *Move Xpos to A
$83/A468 18          CLC                   
$83/A469 6D 16 42    ADC $4216  [$80:4216]  *Add: Xpos + Ypos*$20
$83/A46C AA          TAX                    *Make this an offset
$83/A46D BF 00 FC 7F LDA $7FFC00,x[$7F:FFB0]*Load from a table with $20 bytes per line
$83/A471 29 FF 00    AND #$00FF             
$83/A474 60          RTS                   

So seeing that LDA and staring at the table, I typed out 2 rows per line and it was as plain as day!
80 = chest
90 = exit
40 = stairs up
70 = boss
I presume 30 are no-encounter tiles, and the difference of 10-12 is unclear. More research is needed  :D
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: Time/SpaceMage on August 01, 2017, 09:10:58 pm
Ok, I found Balnea 1F in ROM; it starts at x9EBF7 ($93/EBF7). The maps are compressed with Run Length Encoding. Here's the format as I have observed so far:

00 40 = Repeat 40 once
24 30 = Repeat 30 five times
23 12 = Repeat 12 four times
2E 00 = Repeat 00 F (E+1) times
41 80 00 = Repeat "80 00" twice
(There's a 60 code too, but I haven't seen an example yet.)
05 = WYSIWYG

If the control code is negative (80+) it's a MVN.
83 00 52 = MVN 4 bytes from $xx52.
9F 00 57 = MVN 20 bytes from $xx57.

Code: [Select]
You can follow along with the above image; here's the first line.
2E 00
00 40
36 00
41 80 00
24 30
23 12
00 00
22 10

So... anyone know a good tool for de/recompressing RLE?  :angel: (I mean, I could write one but if there's already one, great!)
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: rainponcho on August 02, 2017, 12:33:34 pm
Haven't forgotten about uploading a standalone fastrom patch for vanilla. After optimizing Super Ghouls 'n Ghosts to playable levels, learned some new tricks.


Moving through Stavery is a little faster now. To me, almost bearable walking speed now when holding motion button down.
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: TimeSpaceMage on August 03, 2017, 08:09:30 pm
Bug report! So something in that FastROM patch is breaking the event at the end of Chapter 1. The character graphics are corrupted, and after the Paralyze spell the game crashes.
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: rainponcho on August 03, 2017, 10:47:17 pm
Yeah, happens in the new FastROM patch too (one in queue). I'll try sorting it out. Anyone I've worked with can tell you how buggy my stuff can be. :)
(Wish I had more time to actually play these games instead of just panic speedrun testing all these hacks I make)



Meantime, made a patch that will multi-level up and rollover exp gains.
https://www.sendspace.com/file/nqij5l
(this was not trivial at all so I pitched in here)


Game uses a scripting language that made this more difficult than imagined.

$80/902B = where it reads scripting code
07 = run asm code (24-bit addr)
0c = jump if false (16-bit addr)
1b = jsr (16-bit addr)
1c = ret


ex.
01:90aa = 07  07b234  ==> check exp asm
01:90ae = 0b  9129    ==> no gain level (jmp)

Eventually found where it does the level up routine and extended it via scripting.


edit: HAL actually uses the DMA for that cutscene. Which collides with some speedup tricks. Have to rework it then. :|



edit2: New fastrom patch in queue. Do not use hdma 2,3,4,7.
https://www.sendspace.com/file/5a63vs

Played up to Chapter 3 ending okay.



edit3:
Some info about how battle damage works.

Code: [Select]
battle


$80/C0B9 C5 00       CMP $00    [$00:1E00]   A:0067 X:0094 Y:0008 D:1E00 DB:80 S:1FF0 P:envmxdIzC HC:0278 VC:093 FC:26 I:00
$80/C0BB 90 04       BCC $04    [$C0C1]      A:0067 X:0094 Y:0008 D:1E00 DB:80 S:1FF0 P:eNvmxdIzc HC:0312 VC:093 FC:26 I:00
$80/C0C1 9C 25 11    STZ $1125  [$80:1125]   A:0067 X:0094 Y:0008 D:1E00 DB:80 S:1FF0 P:eNvmxdIzc HC:0336 VC:093 FC:26 I:00
$80/C0C4 C5 02       CMP $02    [$00:1E02]   A:0067 X:0094 Y:0008 D:1E00 DB:80 S:1FF0 P:eNvmxdIzc HC:0376 VC:093 FC:26 I:00
$80/C0C6 B0 03       BCS $03    [$C0CB]      A:0067 X:0094 Y:0008 D:1E00 DB:80 S:1FF0 P:envmxdIzC HC:0410 VC:093 FC:26 I:00



get max damage
$80/C0CB AE 21 11    LDX $1121  [$80:1121]   A:0067 X:0094 Y:0008 D:1E00 DB:80 S:1FF0 P:envmxdIzC HC:0434 VC:093 FC:26 I:00
$80/C0CE 22 CA C4 80 JSL $80C4CA[$80:C4CA]   A:0067 X:0008 Y:0008 D:1E00 DB:80 S:1FF0 P:envmxdIzC HC:0474 VC:093 FC:26 I:00
$80/C0D2 85 00       STA $00    [$00:1E00]   A:0041 X:0000 Y:0008 D:1E00 DB:80 S:1FF0 P:envmxdIzc HC:0698 VC:097 FC:26 I:00




player defense value
$80/C0D4 AE 23 11    LDX $1123  [$80:1123]   A:0041 X:0000 Y:0008 D:1E00 DB:80 S:1FF0 P:envmxdIzc HC:0732 VC:097 FC:26 I:00
$80/C0D7 22 26 C5 80 JSL $80C526[$80:C526]   A:0041 X:0000 Y:0008 D:1E00 DB:80 S:1FF0 P:envmxdIZc HC:0772 VC:097 FC:26 I:00
$80/C0DB 85 02       STA $02    [$00:1E02]   A:0041 X:0033 Y:0000 D:1E00 DB:80 S:1FF0 P:envmxdIzc HC:0704 VC:100 FC:39 I:00


======================================


$80/C526 86 06       STX $06    [$00:1E06]   A:0041 X:0000 Y:0008 D:1E00 DB:80 S:1FED P:envmxdIZc HC:0836 VC:097 FC:39 I:00
$80/C528 A4 06       LDY $06    [$00:1E06]   A:0041 X:0000 Y:0008 D:1E00 DB:80 S:1FED P:envmxdIZc HC:0876 VC:097 FC:39 I:00
$80/C52A A2 00 00    LDX #$0000              A:0041 X:0000 Y:0000 D:1E00 DB:80 S:1FED P:envmxdIZc HC:0916 VC:097 FC:39 I:00
$80/C52D 20 81 C7    JSR $C781  [$80:C781]   A:0041 X:0000 Y:0000 D:1E00 DB:80 S:1FED P:envmxdIZc HC:0946 VC:097 FC:39 I:00
$80/C530 A2 66 00    LDX #$0066              A:0028 X:0056 Y:0000 D:1E00 DB:80 S:1FED P:envmxdIzc HC:0124 VC:098 FC:39 I:00
$80/C533 20 8B C8    JSR $C88B  [$80:C88B]   A:0028 X:0066 Y:0000 D:1E00 DB:80 S:1FED P:envmxdIzc HC:0160 VC:098 FC:39 I:00
$80/C536 29 00 FF    AND #$FF00              A:0FF0 X:0066 Y:0000 D:1E00 DB:80 S:1FED P:envmxdIzc HC:0588 VC:098 FC:39 I:00
$80/C539 EB          XBA                     A:0F00 X:0066 Y:0000 D:1E00 DB:80 S:1FED P:envmxdIzc HC:0624 VC:098 FC:39 I:00
$80/C53A 85 08       STA $08    [$00:1E08]   A:000F X:0066 Y:0000 D:1E00 DB:80 S:1FED P:envmxdIzc HC:0660 VC:098 FC:39 I:00
$80/C53C A4 06       LDY $06    [$00:1E06]   A:000F X:0066 Y:0000 D:1E00 DB:80 S:1FED P:envmxdIzc HC:0706 VC:098 FC:39 I:00
$80/C53E A2 00 00    LDX #$0000              A:000F X:0066 Y:0000 D:1E00 DB:80 S:1FED P:envmxdIZc HC:0752 VC:098 FC:39 I:00
$80/C541 20 D1 C7    JSR $C7D1  [$80:C7D1]   A:000F X:0000 Y:0000 D:1E00 DB:80 S:1FED P:envmxdIZc HC:0788 VC:098 FC:39 I:00
$80/C544 A2 33 00    LDX #$0033              A:0028 X:00A4 Y:0000 D:1E00 DB:80 S:1FED P:envmxdIzc HC:1330 VC:098 FC:39 I:00
$80/C547 20 8B C8    JSR $C88B  [$80:C88B]   A:0028 X:0033 Y:0000 D:1E00 DB:80 S:1FED P:envmxdIzc HC:1366 VC:098 FC:39 I:00
$80/C54A 29 00 FF    AND #$FF00              A:07F8 X:0033 Y:0000 D:1E00 DB:80 S:1FED P:envmxdIzc HC:0390 VC:099 FC:39 I:00
$80/C54D EB          XBA                     A:0700 X:0033 Y:0000 D:1E00 DB:80 S:1FED P:envmxdIzc HC:0426 VC:099 FC:39 I:00
$80/C54E 18          CLC                     A:0007 X:0033 Y:0000 D:1E00 DB:80 S:1FED P:envmxdIzc HC:0462 VC:099 FC:39 I:00
$80/C54F 65 08       ADC $08    [$00:1E08]   A:0007 X:0033 Y:0000 D:1E00 DB:80 S:1FED P:envmxdIzc HC:0492 VC:099 FC:39 I:00
$80/C551 85 08       STA $08    [$00:1E08]   A:0016 X:0033 Y:0000 D:1E00 DB:80 S:1FED P:envmxdIzc HC:0538 VC:099 FC:39 I:00
$80/C553 A6 06       LDX $06    [$00:1E06]   A:0016 X:0033 Y:0000 D:1E00 DB:80 S:1FED P:envmxdIzc HC:0624 VC:099 FC:39 I:00
$80/C555 20 6A C6    JSR $C66A  [$80:C66A]   A:0016 X:0000 Y:0000 D:1E00 DB:80 S:1FED P:envmxdIZc HC:0682 VC:099 FC:39 I:00
$80/C558 A2 33 00    LDX #$0033              A:00DC X:00DF Y:0000 D:1E00 DB:80 S:1FED P:envmxdIzc HC:0032 VC:100 FC:39 I:00
$80/C55B 20 8B C8    JSR $C88B  [$80:C88B]   A:00DC X:0033 Y:0000 D:1E00 DB:80 S:1FED P:envmxdIzc HC:0068 VC:100 FC:39 I:00
$80/C55E 29 00 FF    AND #$FF00              A:2BD4 X:0033 Y:0000 D:1E00 DB:80 S:1FED P:envmxdIzc HC:0456 VC:100 FC:39 I:00
$80/C561 EB          XBA                     A:2B00 X:0033 Y:0000 D:1E00 DB:80 S:1FED P:envmxdIzc HC:0492 VC:100 FC:39 I:00
$80/C562 18          CLC                     A:002B X:0033 Y:0000 D:1E00 DB:80 S:1FED P:envmxdIzc HC:0528 VC:100 FC:39 I:00
$80/C563 65 08       ADC $08    [$00:1E08]   A:002B X:0033 Y:0000 D:1E00 DB:80 S:1FED P:envmxdIzc HC:0598 VC:100 FC:39 I:00
$80/C565 6B          RTL                     A:0041 X:0033 Y:0000 D:1E00 DB:80 S:1FED P:envmxdIzc HC:0644 VC:100 FC:39 I:00


=========================================



$80/C0DD AE 23 11    LDX $1123  [$80:1123]   A:0041 X:0033 Y:0000 D:1E00 DB:80 S:1FF0 P:envmxdIzc HC:0750 VC:100 FC:39 I:00
$80/C0E0 A0 0C 00    LDY #$000C              A:0041 X:0000 Y:0000 D:1E00 DB:80 S:1FF0 P:envmxdIZc HC:0802 VC:100 FC:39 I:00
$80/C0E3 22 85 C5 80 JSL $80C585[$80:C585]   A:0041 X:0000 Y:000C D:1E00 DB:80 S:1FF0 P:envmxdIzc HC:0838 VC:100 FC:39 I:00


base defense -- rooks = $19
$80/C0E7 BF 4F C0 80 LDA $80C04F,x[$80:C04F] A:0000 X:0000 Y:000C D:1E00 DB:80 S:1FF0 P:envmxdIZc HC:0024 VC:101 FC:39 I:00
$80/C0EB A2 33 00    LDX #$0033              A:0080 X:0000 Y:000C D:1E00 DB:80 S:1FF0 P:envmxdIzc HC:0078 VC:101 FC:39 I:00
$80/C0EE 20 8B C8    JSR $C88B  [$80:C88B]   A:0080 X:0033 Y:000C D:1E00 DB:80 S:1FF0 P:envmxdIzc HC:0114 VC:101 FC:39 I:00
$80/C0F1 29 00 FF    AND #$FF00              A:1980 X:0033 Y:000C D:1E00 DB:80 S:1FF0 P:envmxdIzc HC:0502 VC:101 FC:39 I:00
$80/C0F4 EB          XBA                     A:1900 X:0033 Y:000C D:1E00 DB:80 S:1FF0 P:envmxdIzc HC:0102 VC:101 FC:26 I:00


+ armor bonus + level bonus
$80/C0F5 18          CLC                     A:0019 X:0033 Y:000C D:1E00 DB:80 S:1FF0 P:envmxdIzc HC:0126 VC:101 FC:26 I:00
$80/C0F6 65 02       ADC $02    [$00:1E02]   A:0019 X:0033 Y:000C D:1E00 DB:80 S:1FF0 P:envmxdIzc HC:0144 VC:101 FC:26 I:00
$80/C0F8 85 02       STA $02    [$00:1E02]   A:005A X:0033 Y:000C D:1E00 DB:80 S:1FF0 P:envmxdIzc HC:0178 VC:101 FC:26 I:00


$80/C0FA A9 FF 00    LDA #$00FF              A:005A X:0033 Y:000C D:1E00 DB:80 S:1FF0 P:envmxdIzc HC:0212 VC:101 FC:26 I:00
$80/C0FD 38          SEC                     A:00FF X:0033 Y:000C D:1E00 DB:80 S:1FF0 P:envmxdIzc HC:0236 VC:101 FC:26 I:00
$80/C0FE E5 02       SBC $02    [$00:1E02]   A:00FF X:0033 Y:000C D:1E00 DB:80 S:1FF0 P:envmxdIzC HC:0254 VC:101 FC:26 I:00


~~ damage % amount -- $a5 = 0.64453125 x full damage
$80/C100 AA          TAX                     A:00A5 X:0033 Y:000C D:1E00 DB:80 S:1FF0 P:envmxdIzC HC:0288 VC:101 FC:26 I:00


get full damage amount??
$80/C101 A5 00       LDA $00    [$00:1E00]   A:00A5 X:00A5 Y:000C D:1E00 DB:80 S:1FF0 P:envmxdIzC HC:0306 VC:101 FC:26 I:00
$80/C103 20 A1 C8    JSR $C8A1  [$80:C8A1]   A:0041 X:00A5 Y:000C D:1E00 DB:80 S:1FF0 P:envmxdIzC HC:0340 VC:101 FC:26 I:00



======================================================

$80/C8A1 85 22       STA $22    [$00:1E22]   A:0050 X:00D1 Y:0008 D:1E00 DB:80 S:1FEB P:envmxdIzC HC:0616 VC:096 FC:26 I:00
$80/C8A3 20 8B C8    JSR $C88B  [$80:C88B]   A:0050 X:00D1 Y:0008 D:1E00 DB:80 S:1FEB P:envmxdIzC HC:0650 VC:096 FC:26 I:00


$80/C8A6 85 24       STA $24    [$00:1E24]   A:4150 X:00D1 Y:0008 D:1E00 DB:80 S:1FEB P:envmxdIzC HC:1026 VC:096 FC:26 I:00
$80/C8A8 A5 22       LDA $22    [$00:1E22]   A:4150 X:00D1 Y:0008 D:1E00 DB:80 S:1FEB P:envmxdIzC HC:1060 VC:096 FC:26 I:00
$80/C8AA EB          XBA                     A:0050 X:00D1 Y:0008 D:1E00 DB:80 S:1FEB P:envmxdIzC HC:1094 VC:096 FC:26 I:00
$80/C8AB 20 8B C8    JSR $C88B  [$80:C88B]   A:5000 X:00D1 Y:0008 D:1E00 DB:80 S:1FEB P:envmxdIZC HC:1160 VC:096 FC:26 I:00


$80/C8AE 85 22       STA $22    [$00:1E22]   A:0000 X:00D1 Y:0008 D:1E00 DB:80 S:1FEB P:envmxdIZC HC:0172 VC:097 FC:26 I:00
$80/C8B0 29 00 FF    AND #$FF00              A:0000 X:00D1 Y:0008 D:1E00 DB:80 S:1FEB P:envmxdIZC HC:0206 VC:097 FC:26 I:00
$80/C8B3 EB          XBA                     A:0000 X:00D1 Y:0008 D:1E00 DB:80 S:1FEB P:envmxdIZC HC:0230 VC:097 FC:26 I:00
$80/C8B4 AA          TAX                     A:0000 X:00D1 Y:0008 D:1E00 DB:80 S:1FEB P:envmxdIZC HC:0254 VC:097 FC:26 I:00
$80/C8B5 A5 22       LDA $22    [$00:1E22]   A:0000 X:0000 Y:0008 D:1E00 DB:80 S:1FEB P:envmxdIZC HC:0272 VC:097 FC:26 I:00
$80/C8B7 29 FF 00    AND #$00FF              A:0000 X:0000 Y:0008 D:1E00 DB:80 S:1FEB P:envmxdIZC HC:0306 VC:097 FC:26 I:00
$80/C8BA EB          XBA                     A:0000 X:0000 Y:0008 D:1E00 DB:80 S:1FEB P:envmxdIZC HC:0330 VC:097 FC:26 I:00
$80/C8BB 18          CLC                     A:0000 X:0000 Y:0008 D:1E00 DB:80 S:1FEB P:envmxdIZC HC:0354 VC:097 FC:26 I:00
$80/C8BC 65 24       ADC $24    [$00:1E24]   A:0000 X:0000 Y:0008 D:1E00 DB:80 S:1FEB P:envmxdIZc HC:0372 VC:097 FC:26 I:00
$80/C8BE 90 01       BCC $01    [$C8C1]      A:4150 X:0000 Y:0008 D:1E00 DB:80 S:1FEB P:envmxdIzc HC:0406 VC:097 FC:26 I:00
$80/C8C1 60          RTS                     A:4150 X:0000 Y:0008 D:1E00 DB:80 S:1FEB P:envmxdIzc HC:0430 VC:097 FC:26 I:00

======================================================


final damage
$80/C106 29 00 FF    AND #$FF00              A:29E5 X:0000 Y:000C D:1E00 DB:80 S:1FF0 P:envmxdIzc HC:0286 VC:102 FC:26 I:00
$80/C109 85 00       STA $00    [$00:1E00]   A:2900 X:0000 Y:000C D:1E00 DB:80 S:1FF0 P:envmxdIzc HC:0310 VC:102 FC:26 I:00



$80/C10B 8A          TXA                     A:2900 X:0000 Y:000C D:1E00 DB:80 S:1FF0 P:envmxdIzc HC:0344 VC:102 FC:26 I:00
$80/C10C 05 00       ORA $00    [$00:1E00]   A:0000 X:0000 Y:000C D:1E00 DB:80 S:1FF0 P:envmxdIZc HC:0362 VC:102 FC:26 I:00
$80/C10E EB          XBA                     A:2900 X:0000 Y:000C D:1E00 DB:80 S:1FF0 P:envmxdIzc HC:0396 VC:102 FC:26 I:00
$80/C10F 85 00       STA $00    [$00:1E00]   A:0029 X:0000 Y:000C D:1E00 DB:80 S:1FF0 P:envmxdIzc HC:0420 VC:102 FC:26 I:00





$80/C111 AE 21 11    LDX $1121  [$80:1121]   A:0029 X:0000 Y:000C D:1E00 DB:80 S:1FF0 P:envmxdIzc HC:0454 VC:102 FC:26 I:00
$80/C114 AC 23 11    LDY $1123  [$80:1123]   A:0029 X:0008 Y:000C D:1E00 DB:80 S:1FF0 P:envmxdIzc HC:0494 VC:102 FC:26 I:00
$80/C117 20 B1 C5    JSR $C5B1  [$80:C5B1]   A:0029 X:0008 Y:0000 D:1E00 DB:80 S:1FF0 P:envmxdIZc HC:0534 VC:102 FC:26 I:00


$80/C11A AA          TAX                     A:0002 X:0005 Y:0003 D:1E00 DB:80 S:1FF0 P:envmxdIzc HC:0538 VC:113 FC:26 I:00
$80/C11B BF 76 C1 80 LDA $80C176,x[$80:C178] A:0002 X:0002 Y:0003 D:1E00 DB:80 S:1FF0 P:envmxdIzc HC:0596 VC:113 FC:26 I:00
$80/C11F A6 00       LDX $00    [$00:1E00]   A:0100 X:0002 Y:0003 D:1E00 DB:80 S:1FF0 P:envmxdIzc HC:0638 VC:113 FC:26 I:00
$80/C121 22 39 8A 80 JSL $808A39[$80:8A39]   A:0100 X:0029 Y:0003 D:1E00 DB:80 S:1FF0 P:envmxdIzc HC:0672 VC:113 FC:26 I:00


$80/C125 A5 01       LDA $01    [$00:1E01]   A:0000 X:0000 Y:0003 D:1E00 DB:80 S:1FF0 P:envmxdIZc HC:0616 VC:114 FC:26 I:00
$80/C127 85 00       STA $00    [$00:1E00]   A:0029 X:0000 Y:0003 D:1E00 DB:80 S:1FF0 P:envmxdIzc HC:0650 VC:114 FC:26 I:00
$80/C129 AE 21 11    LDX $1121  [$80:1121]   A:0029 X:0000 Y:0003 D:1E00 DB:80 S:1FF0 P:envmxdIzc HC:0684 VC:114 FC:26 I:00
$80/C12C AC 23 11    LDY $1123  [$80:1123]   A:0029 X:0008 Y:0003 D:1E00 DB:80 S:1FF0 P:envmxdIzc HC:0724 VC:114 FC:26 I:00
$80/C12F 20 0C C3    JSR $C30C  [$80:C30C]   A:0029 X:0008 Y:0000 D:1E00 DB:80 S:1FF0 P:envmxdIZc HC:0764 VC:114 FC:26 I:00

From what I get so far, Rooks has a base armor value @ 80C04F,x table. Add level buffs + armor. Gives us full defense.

255 - full_defense = % attack.


Admittedly it does more math down the line around $80/C156 with that $29 value * $00C0 ==> $1E (30 points). It then adds another 4 points @ $80/C2CB = final 34 damage Rooks receives.




Efrite hits Rooks

$80/C0DB values ==> final damage

$00 ==> 44 points
$41 ==> 34 points
$7f ==> 21 points
$80 ==> 20 points
$c0 ==>  6 points
$e0 ==>  1 points
$e6 ==>  1 points

$e7 ==> 52 points
$f0 ==> 47 points
$ff ==> 41 points


Notes are messy but this is what I've got. You have to play around with all the values at various spots to see how final damage gets tweaked around. Then it's a bit more clear how this thing works. ^^
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: TimeSpaceMage on August 06, 2017, 01:31:21 pm
Meantime, made a patch that will multi-level up and rollover exp gains.
https://www.sendspace.com/file/nqij5l
(this was not trivial at all so I pitched in here)


Game uses a scripting language that made this more difficult than imagined.

$80/902B = where it reads scripting code
07 = run asm code (24-bit addr)
0c = jump if false (16-bit addr)
1b = jsr (16-bit addr)
1c = ret


ex.
01:90aa = 07  07b234  ==> check exp asm
01:90ae = 0b  9129    ==> no gain level (jmp)

Eventually found where it does the level up routine and extended it via scripting.

Omigosh I can't wait to try that out  8)
..So that's what those bytes do! How in the world did you figure them out? (Still not sure I understand that second example, though.)

I figured out some codes too, from playing with the text display. Here's most of my notes:
Code: [Select]
00 Text delimiter (End of text/Stop reading)
08 XX Tabs to a position XX
0D Newline
7F Wait for A press

Exploring
98 15 Card used (98 is the byte offset, so using 99 15 would use 1 of "ind Card")
AF 15 Object name ("Dagger" acquired, Rooks has mastered "Unpetrify")
DB 16 Number amount ("300" GP acquired, "200" HP restored)
01 6B 33 MP cost (in spell descriptions)

Battles
06 0E 11 06 deals with text formatting. This should change the font color.
10 81 15 Character name (All of Rooks's power has been increased)
01 E7 16 Level up HP bonus
01 EB 16 Level up MP bonus
01 DD 16 Level up Str bonus
01 DF 16 Level up End bonus
01 E1 16 Level up Int bonus
01 E3 16 Level up Agi bonus

Dialogue
10 A5 FA 0C Pause then clear text; clear face (character finished talking)
10 1E FA 0C Pause then clear text; keep face (character still talking)
10 1B FA 0C Pause then newline; keep face (character still talking; same page)

10 (F5 F7) 0C Ariel speaking
10 (E3 F7) 0C Rooks speaking (no pic)
10 (0D F8) 0C Teefa speaking

For instance, starting a dialogue with one of these 3 codes will show their face and precede the text with
their name automatically. Some characters seem to have multiple commands available, such as to say their line
without their face appearing. However, calling a character whose graphics aren't in memory will cause graphics
glitches. There also seem to be codes for calling special events (such as a character appearing or moving on
the screen, the flash when Rooks gets stunned etc). This needs more research, but I'm thinking the actual event
is elsewhere in the code. It would be neat if we could control these for custom events or different character appearances.

A lot of text formatting starts with 06 or 10, and there's codes for text speed and vertical/horizontal spacing between letters too.
(For text speed, notice how sometimes text will display one line at a time or a page at a time.)

Quote
Some info about how battle damage works.
<cut for message length>

Efrite hits Rooks

$80/C0DB values ==> final damage

$00 ==> 44 points
$41 ==> 34 points
$7f ==> 21 points
$80 ==> 20 points
$c0 ==>  6 points
$e0 ==>  1 points
$e6 ==>  1 points

$e7 ==> 52 points
$f0 ==> 47 points
$ff ==> 41 points


Notes are messy but this is what I've got. You have to play around with all the values at various spots to see how final damage gets tweaked around. Then it's a bit more clear how this thing works. ^^

Wow, this is gonna take me a long time to analyze  :o
So your defense bonuses lower your damage by a percentage? That could make balancing efforts easier, considering monster attack power is harder to change. (According to zombero, monster attack power is a pointer including the damage animation, so swapping values would give monsters each others' animations as well. Giving a Slime Rimsala's attack gives it double swords.)

Maybe raising armor defense bonuses would make armor more useful. Come to think of it, figuring out those monster attack pointers could help raise their damage without taking it to his extremes of doubling their damage.

Wait, where did this $80/C0DB come from? I didn't see that mentioned elsewhere in your snippets. So many questions! (Going out today for my wife's birthday, but I'll have some time this week to work on things.)
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: rainponcho on August 06, 2017, 04:15:22 pm
Tracked back where exp check came from and wondered why it looked like 16-bit, 24-bit data ptrs. Check tracking the script loop and mapped out stuff I wanted.


Code: [Select]
01:9028 = run code 1b. jsr to 907f and continue.

I edited this to run my own code at 81:ff00
-- jsr $907f
-- asm level_loop (rewinds ptr if exp overflow)
-- rts


===>

level up routine
01:907f = ...
...

01:90aa = run code 07. asm code 07:b234. This checks our exp and returns
-- 0 = no level
-- 1 = level up.

01:90ae = run code 0b. If our flag is 0, then jump to (01:)9129.

-- (no jump) 01:90b1 = start elemental upgrade logic
-- (jump) 01:9129 = run code 1c. Exit routine.


Code: [Select]
get max damage??
$80/C0CB AE 21 11    LDX $1121  [$80:1121]   A:0067 X:0094 Y:0008 D:1E00 DB:80 S:1FF0 P:envmxdIzC HC:0434 VC:093 FC:26 I:00
$80/C0CE 22 CA C4 80 JSL $80C4CA[$80:C4CA]   A:0067 X:0008 Y:0008 D:1E00 DB:80 S:1FF0 P:envmxdIzC HC:0474 VC:093 FC:26 I:00
$80/C0D2 85 00       STA $00    [$00:1E00]   A:0041 X:0000 Y:0008 D:1E00 DB:80 S:1FF0 P:envmxdIzc HC:0698 VC:097 FC:26 I:00



player defense bonus
$80/C0D4 AE 23 11    LDX $1123  [$80:1123]   A:0041 X:0000 Y:0008 D:1E00 DB:80 S:1FF0 P:envmxdIzc HC:0732 VC:097 FC:26 I:00
$80/C0D7 22 26 C5 80 JSL $80C526[$80:C526]   A:0041 X:0000 Y:0008 D:1E00 DB:80 S:1FF0 P:envmxdIZc HC:0772 VC:097 FC:26 I:00
$80/C0DB 85 02       STA $02    [$00:1E02]   A:0041 X:0033 Y:0000 D:1E00 DB:80 S:1FF0 P:envmxdIzc HC:0704 VC:100 FC:39 I:00

1 armor = 1/255 less damage. Or maybe 1/256 less damage.

My damage formula notes are fuzzy because I don't quite understand it either. :)
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: TimeSpaceMage on August 07, 2017, 10:27:31 pm
I just figured out that JSR $C88B multiplies A*X! Man, this code makes SO much more sense now. Looks like you already knew that, though.

OK, let me see if I'm following so far. I like to have all of my offsets in one place.

Quote
Code: [Select]
battle


$80/C0B9 C5 00       CMP $00    [$00:1E00]   A:0067 X:0094 Y:0008 D:1E00 DB:80 S:1FF0 P:envmxdIzC HC:0278 VC:093 FC:26 I:00
$80/C0BB 90 04       BCC $04    [$C0C1]      A:0067 X:0094 Y:0008 D:1E00 DB:80 S:1FF0 P:eNvmxdIzc HC:0312 VC:093 FC:26 I:00
$80/C0C1 9C 25 11    STZ $1125  [$80:1125]   A:0067 X:0094 Y:0008 D:1E00 DB:80 S:1FF0 P:eNvmxdIzc HC:0336 VC:093 FC:26 I:00
$80/C0C4 C5 02       CMP $02    [$00:1E02]   A:0067 X:0094 Y:0008 D:1E00 DB:80 S:1FF0 P:eNvmxdIzc HC:0376 VC:093 FC:26 I:00
$80/C0C6 B0 03       BCS $03    [$C0CB]      A:0067 X:0094 Y:0008 D:1E00 DB:80 S:1FF0 P:envmxdIzC HC:0410 VC:093 FC:26 I:00



get max damage
$80/C0CB AE 21 11    LDX $1121  [$80:1121]   A:0067 X:0094 Y:0008 D:1E00 DB:80 S:1FF0 P:envmxdIzC HC:0434 VC:093 FC:26 I:00
$80/C0CE 22 CA C4 80 JSL $80C4CA[$80:C4CA]   A:0067 X:0008 Y:0008 D:1E00 DB:80 S:1FF0 P:envmxdIzC HC:0474 VC:093 FC:26 I:00
$80/C0D2 85 00       STA $00    [$00:1E00]   A:0041 X:0000 Y:0008 D:1E00 DB:80 S:1FF0 P:envmxdIzc HC:0698 VC:097 FC:26 I:00




player defense value
$80/C0D4 AE 23 11    LDX $1123  [$80:1123]   A:0041 X:0000 Y:0008 D:1E00 DB:80 S:1FF0 P:envmxdIzc HC:0732 VC:097 FC:26 I:00
$80/C0D7 22 26 C5 80 JSL $80C526[$80:C526]   A:0041 X:0000 Y:0008 D:1E00 DB:80 S:1FF0 P:envmxdIZc HC:0772 VC:097 FC:26 I:00
$80/C0DB 85 02       STA $02    [$00:1E02]   A:0041 X:0033 Y:0000 D:1E00 DB:80 S:1FF0 P:envmxdIzc HC:0704 VC:100 FC:39 I:00


======================================


$80/C526 86 06       STX $06    [$00:1E06]   A:0041 X:0000 Y:0008 D:1E00 DB:80 S:1FED P:envmxdIZc HC:0836 VC:097 FC:39 I:00
$80/C528 A4 06       LDY $06    [$00:1E06]   A:0041 X:0000 Y:0008 D:1E00 DB:80 S:1FED P:envmxdIZc HC:0876 VC:097 FC:39 I:00
$80/C52A A2 00 00    LDX #$0000              A:0041 X:0000 Y:0000 D:1E00 DB:80 S:1FED P:envmxdIZc HC:0916 VC:097 FC:39 I:00
$80/C52D 20 81 C7    JSR $C781  [$80:C781]   A:0041 X:0000 Y:0000 D:1E00 DB:80 S:1FED P:envmxdIZc HC:0946 VC:097 FC:39 I:00
$80/C530 A2 66 00    LDX #$0066              A:0028 X:0056 Y:0000 D:1E00 DB:80 S:1FED P:envmxdIzc HC:0124 VC:098 FC:39 I:00
$80/C533 20 8B C8    JSR $C88B  [$80:C88B]   A:0028 X:0066 Y:0000 D:1E00 DB:80 S:1FED P:envmxdIzc HC:0160 VC:098 FC:39 I:00
$80/C536 29 00 FF    AND #$FF00              A:0FF0 X:0066 Y:0000 D:1E00 DB:80 S:1FED P:envmxdIzc HC:0588 VC:098 FC:39 I:00
$80/C539 EB          XBA                     A:0F00 X:0066 Y:0000 D:1E00 DB:80 S:1FED P:envmxdIzc HC:0624 VC:098 FC:39 I:00
$80/C53A 85 08       STA $08    [$00:1E08]   A:000F X:0066 Y:0000 D:1E00 DB:80 S:1FED P:envmxdIzc HC:0660 VC:098 FC:39 I:00
$80/C53C A4 06       LDY $06    [$00:1E06]   A:000F X:0066 Y:0000 D:1E00 DB:80 S:1FED P:envmxdIzc HC:0706 VC:098 FC:39 I:00
$80/C53E A2 00 00    LDX #$0000              A:000F X:0066 Y:0000 D:1E00 DB:80 S:1FED P:envmxdIZc HC:0752 VC:098 FC:39 I:00
$80/C541 20 D1 C7    JSR $C7D1  [$80:C7D1]   A:000F X:0000 Y:0000 D:1E00 DB:80 S:1FED P:envmxdIZc HC:0788 VC:098 FC:39 I:00
$80/C544 A2 33 00    LDX #$0033              A:0028 X:00A4 Y:0000 D:1E00 DB:80 S:1FED P:envmxdIzc HC:1330 VC:098 FC:39 I:00
$80/C547 20 8B C8    JSR $C88B  [$80:C88B]   A:0028 X:0033 Y:0000 D:1E00 DB:80 S:1FED P:envmxdIzc HC:1366 VC:098 FC:39 I:00
$80/C54A 29 00 FF    AND #$FF00              A:07F8 X:0033 Y:0000 D:1E00 DB:80 S:1FED P:envmxdIzc HC:0390 VC:099 FC:39 I:00
$80/C54D EB          XBA                     A:0700 X:0033 Y:0000 D:1E00 DB:80 S:1FED P:envmxdIzc HC:0426 VC:099 FC:39 I:00
$80/C54E 18          CLC                     A:0007 X:0033 Y:0000 D:1E00 DB:80 S:1FED P:envmxdIzc HC:0462 VC:099 FC:39 I:00
$80/C54F 65 08       ADC $08    [$00:1E08]   A:0007 X:0033 Y:0000 D:1E00 DB:80 S:1FED P:envmxdIzc HC:0492 VC:099 FC:39 I:00
$80/C551 85 08       STA $08    [$00:1E08]   A:0016 X:0033 Y:0000 D:1E00 DB:80 S:1FED P:envmxdIzc HC:0538 VC:099 FC:39 I:00
$80/C553 A6 06       LDX $06    [$00:1E06]   A:0016 X:0033 Y:0000 D:1E00 DB:80 S:1FED P:envmxdIzc HC:0624 VC:099 FC:39 I:00
$80/C555 20 6A C6    JSR $C66A  [$80:C66A]   A:0016 X:0000 Y:0000 D:1E00 DB:80 S:1FED P:envmxdIZc HC:0682 VC:099 FC:39 I:00
$80/C558 A2 33 00    LDX #$0033              A:00DC X:00DF Y:0000 D:1E00 DB:80 S:1FED P:envmxdIzc HC:0032 VC:100 FC:39 I:00
$80/C55B 20 8B C8    JSR $C88B  [$80:C88B]   A:00DC X:0033 Y:0000 D:1E00 DB:80 S:1FED P:envmxdIzc HC:0068 VC:100 FC:39 I:00
$80/C55E 29 00 FF    AND #$FF00              A:2BD4 X:0033 Y:0000 D:1E00 DB:80 S:1FED P:envmxdIzc HC:0456 VC:100 FC:39 I:00
$80/C561 EB          XBA                     A:2B00 X:0033 Y:0000 D:1E00 DB:80 S:1FED P:envmxdIzc HC:0492 VC:100 FC:39 I:00
$80/C562 18          CLC                     A:002B X:0033 Y:0000 D:1E00 DB:80 S:1FED P:envmxdIzc HC:0528 VC:100 FC:39 I:00
$80/C563 65 08       ADC $08    [$00:1E08]   A:002B X:0033 Y:0000 D:1E00 DB:80 S:1FED P:envmxdIzc HC:0598 VC:100 FC:39 I:00
$80/C565 6B          RTL                     A:0041 X:0033 Y:0000 D:1E00 DB:80 S:1FED P:envmxdIzc HC:0644 VC:100 FC:39 I:00


=========================================



$80/C0DD AE 23 11    LDX $1123  [$80:1123]   A:0041 X:0033 Y:0000 D:1E00 DB:80 S:1FF0 P:envmxdIzc HC:0750 VC:100 FC:39 I:00
$80/C0E0 A0 0C 00    LDY #$000C              A:0041 X:0000 Y:0000 D:1E00 DB:80 S:1FF0 P:envmxdIZc HC:0802 VC:100 FC:39 I:00
$80/C0E3 22 85 C5 80 JSL $80C585[$80:C585]   A:0041 X:0000 Y:000C D:1E00 DB:80 S:1FF0 P:envmxdIzc HC:0838 VC:100 FC:39 I:00


base defense -- rooks = $19
$80/C0E7 BF 4F C0 80 LDA $80C04F,x[$80:C04F] A:0000 X:0000 Y:000C D:1E00 DB:80 S:1FF0 P:envmxdIZc HC:0024 VC:101 FC:39 I:00
$80/C0EB A2 33 00    LDX #$0033              A:0080 X:0000 Y:000C D:1E00 DB:80 S:1FF0 P:envmxdIzc HC:0078 VC:101 FC:39 I:00
$80/C0EE 20 8B C8    JSR $C88B  [$80:C88B]   A:0080 X:0033 Y:000C D:1E00 DB:80 S:1FF0 P:envmxdIzc HC:0114 VC:101 FC:39 I:00
$80/C0F1 29 00 FF    AND #$FF00              A:1980 X:0033 Y:000C D:1E00 DB:80 S:1FF0 P:envmxdIzc HC:0502 VC:101 FC:39 I:00
$80/C0F4 EB          XBA                     A:1900 X:0033 Y:000C D:1E00 DB:80 S:1FF0 P:envmxdIzc HC:0102 VC:101 FC:26 I:00


+ armor bonus + level bonus
$80/C0F5 18          CLC                     A:0019 X:0033 Y:000C D:1E00 DB:80 S:1FF0 P:envmxdIzc HC:0126 VC:101 FC:26 I:00
$80/C0F6 65 02       ADC $02    [$00:1E02]   A:0019 X:0033 Y:000C D:1E00 DB:80 S:1FF0 P:envmxdIzc HC:0144 VC:101 FC:26 I:00
$80/C0F8 85 02       STA $02    [$00:1E02]   A:005A X:0033 Y:000C D:1E00 DB:80 S:1FF0 P:envmxdIzc HC:0178 VC:101 FC:26 I:00


$80/C0FA A9 FF 00    LDA #$00FF              A:005A X:0033 Y:000C D:1E00 DB:80 S:1FF0 P:envmxdIzc HC:0212 VC:101 FC:26 I:00
$80/C0FD 38          SEC                     A:00FF X:0033 Y:000C D:1E00 DB:80 S:1FF0 P:envmxdIzc HC:0236 VC:101 FC:26 I:00
$80/C0FE E5 02       SBC $02    [$00:1E02]   A:00FF X:0033 Y:000C D:1E00 DB:80 S:1FF0 P:envmxdIzC HC:0254 VC:101 FC:26 I:00


~~ damage % amount -- $a5 = 0.64453125 x full damage
$80/C100 AA          TAX                     A:00A5 X:0033 Y:000C D:1E00 DB:80 S:1FF0 P:envmxdIzC HC:0288 VC:101 FC:26 I:00


get full damage amount??
$80/C101 A5 00       LDA $00    [$00:1E00]   A:00A5 X:00A5 Y:000C D:1E00 DB:80 S:1FF0 P:envmxdIzC HC:0306 VC:101 FC:26 I:00
$80/C103 20 A1 C8    JSR $C8A1  [$80:C8A1]   A:0041 X:00A5 Y:000C D:1E00 DB:80 S:1FF0 P:envmxdIzC HC:0340 VC:101 FC:26 I:00



======================================================

$80/C8A1 85 22       STA $22    [$00:1E22]   A:0050 X:00D1 Y:0008 D:1E00 DB:80 S:1FEB P:envmxdIzC HC:0616 VC:096 FC:26 I:00
$80/C8A3 20 8B C8    JSR $C88B  [$80:C88B]   A:0050 X:00D1 Y:0008 D:1E00 DB:80 S:1FEB P:envmxdIzC HC:0650 VC:096 FC:26 I:00


$80/C8A6 85 24       STA $24    [$00:1E24]   A:4150 X:00D1 Y:0008 D:1E00 DB:80 S:1FEB P:envmxdIzC HC:1026 VC:096 FC:26 I:00
$80/C8A8 A5 22       LDA $22    [$00:1E22]   A:4150 X:00D1 Y:0008 D:1E00 DB:80 S:1FEB P:envmxdIzC HC:1060 VC:096 FC:26 I:00
$80/C8AA EB          XBA                     A:0050 X:00D1 Y:0008 D:1E00 DB:80 S:1FEB P:envmxdIzC HC:1094 VC:096 FC:26 I:00
$80/C8AB 20 8B C8    JSR $C88B  [$80:C88B]   A:5000 X:00D1 Y:0008 D:1E00 DB:80 S:1FEB P:envmxdIZC HC:1160 VC:096 FC:26 I:00


$80/C8AE 85 22       STA $22    [$00:1E22]   A:0000 X:00D1 Y:0008 D:1E00 DB:80 S:1FEB P:envmxdIZC HC:0172 VC:097 FC:26 I:00
$80/C8B0 29 00 FF    AND #$FF00              A:0000 X:00D1 Y:0008 D:1E00 DB:80 S:1FEB P:envmxdIZC HC:0206 VC:097 FC:26 I:00
$80/C8B3 EB          XBA                     A:0000 X:00D1 Y:0008 D:1E00 DB:80 S:1FEB P:envmxdIZC HC:0230 VC:097 FC:26 I:00
$80/C8B4 AA          TAX                     A:0000 X:00D1 Y:0008 D:1E00 DB:80 S:1FEB P:envmxdIZC HC:0254 VC:097 FC:26 I:00
$80/C8B5 A5 22       LDA $22    [$00:1E22]   A:0000 X:0000 Y:0008 D:1E00 DB:80 S:1FEB P:envmxdIZC HC:0272 VC:097 FC:26 I:00
$80/C8B7 29 FF 00    AND #$00FF              A:0000 X:0000 Y:0008 D:1E00 DB:80 S:1FEB P:envmxdIZC HC:0306 VC:097 FC:26 I:00
$80/C8BA EB          XBA                     A:0000 X:0000 Y:0008 D:1E00 DB:80 S:1FEB P:envmxdIZC HC:0330 VC:097 FC:26 I:00
$80/C8BB 18          CLC                     A:0000 X:0000 Y:0008 D:1E00 DB:80 S:1FEB P:envmxdIZC HC:0354 VC:097 FC:26 I:00
$80/C8BC 65 24       ADC $24    [$00:1E24]   A:0000 X:0000 Y:0008 D:1E00 DB:80 S:1FEB P:envmxdIZc HC:0372 VC:097 FC:26 I:00
$80/C8BE 90 01       BCC $01    [$C8C1]      A:4150 X:0000 Y:0008 D:1E00 DB:80 S:1FEB P:envmxdIzc HC:0406 VC:097 FC:26 I:00
$80/C8C1 60          RTS                     A:4150 X:0000 Y:0008 D:1E00 DB:80 S:1FEB P:envmxdIzc HC:0430 VC:097 FC:26 I:00

======================================================


final damage
$80/C106 29 00 FF    AND #$FF00              A:29E5 X:0000 Y:000C D:1E00 DB:80 S:1FF0 P:envmxdIzc HC:0286 VC:102 FC:26 I:00
$80/C109 85 00       STA $00    [$00:1E00]   A:2900 X:0000 Y:000C D:1E00 DB:80 S:1FF0 P:envmxdIzc HC:0310 VC:102 FC:26 I:00



$80/C10B 8A          TXA                     A:2900 X:0000 Y:000C D:1E00 DB:80 S:1FF0 P:envmxdIzc HC:0344 VC:102 FC:26 I:00
$80/C10C 05 00       ORA $00    [$00:1E00]   A:0000 X:0000 Y:000C D:1E00 DB:80 S:1FF0 P:envmxdIZc HC:0362 VC:102 FC:26 I:00
$80/C10E EB          XBA                     A:2900 X:0000 Y:000C D:1E00 DB:80 S:1FF0 P:envmxdIzc HC:0396 VC:102 FC:26 I:00
$80/C10F 85 00       STA $00    [$00:1E00]   A:0029 X:0000 Y:000C D:1E00 DB:80 S:1FF0 P:envmxdIzc HC:0420 VC:102 FC:26 I:00





$80/C111 AE 21 11    LDX $1121  [$80:1121]   A:0029 X:0000 Y:000C D:1E00 DB:80 S:1FF0 P:envmxdIzc HC:0454 VC:102 FC:26 I:00
$80/C114 AC 23 11    LDY $1123  [$80:1123]   A:0029 X:0008 Y:000C D:1E00 DB:80 S:1FF0 P:envmxdIzc HC:0494 VC:102 FC:26 I:00
$80/C117 20 B1 C5    JSR $C5B1  [$80:C5B1]   A:0029 X:0008 Y:0000 D:1E00 DB:80 S:1FF0 P:envmxdIZc HC:0534 VC:102 FC:26 I:00


$80/C11A AA          TAX                     A:0002 X:0005 Y:0003 D:1E00 DB:80 S:1FF0 P:envmxdIzc HC:0538 VC:113 FC:26 I:00
$80/C11B BF 76 C1 80 LDA $80C176,x[$80:C178] A:0002 X:0002 Y:0003 D:1E00 DB:80 S:1FF0 P:envmxdIzc HC:0596 VC:113 FC:26 I:00
$80/C11F A6 00       LDX $00    [$00:1E00]   A:0100 X:0002 Y:0003 D:1E00 DB:80 S:1FF0 P:envmxdIzc HC:0638 VC:113 FC:26 I:00
$80/C121 22 39 8A 80 JSL $808A39[$80:8A39]   A:0100 X:0029 Y:0003 D:1E00 DB:80 S:1FF0 P:envmxdIzc HC:0672 VC:113 FC:26 I:00


$80/C125 A5 01       LDA $01    [$00:1E01]   A:0000 X:0000 Y:0003 D:1E00 DB:80 S:1FF0 P:envmxdIZc HC:0616 VC:114 FC:26 I:00
$80/C127 85 00       STA $00    [$00:1E00]   A:0029 X:0000 Y:0003 D:1E00 DB:80 S:1FF0 P:envmxdIzc HC:0650 VC:114 FC:26 I:00
$80/C129 AE 21 11    LDX $1121  [$80:1121]   A:0029 X:0000 Y:0003 D:1E00 DB:80 S:1FF0 P:envmxdIzc HC:0684 VC:114 FC:26 I:00
$80/C12C AC 23 11    LDY $1123  [$80:1123]   A:0029 X:0008 Y:0003 D:1E00 DB:80 S:1FF0 P:envmxdIzc HC:0724 VC:114 FC:26 I:00
$80/C12F 20 0C C3    JSR $C30C  [$80:C30C]   A:0029 X:0008 Y:0000 D:1E00 DB:80 S:1FF0 P:envmxdIZc HC:0764 VC:114 FC:26 I:00

So first it makes sure A is between the values at $00 and $02. (BCC/BCS are tricky to remember). Then it looks like $1121 and $1123 are player offsets to load their stats.

-$C4CA loads max damage into $(1E)00.
-$C526 loads the player defense value through several subs.
-->$C781's value is multiplied by #$0066 and divided by 256 (the top byte is taken).
-->$C7D1's value * #$0033 / 256, then added to the total.
-->$C66A's value * #$0033 / 256, then added to the total... which is stored in $02.
(These constants are probably where I could modify how effective the stats are, once I figure out which stat is which.)

Next... I guess we're skipping $C585.
-$C04F,x loads the player's base defense, then * #$0033 / 256.
-This is added into the "player defense value" in $02.
-This modified defense (mDef) is subtracted from FF to get their damage reduction % (DR%).
-Then at $C8A1 it... multiplies the full damage (D) by DR% and stores in $1E24.
-Then it byte-swaps D, multiplies by DR%/256 (stores in X), multiplies by 256, and adds it to the total in $1E24.
...I don't really get what it's doing there, and it looks like some of these traces don't match, but D * DR%/256 should give the reduced damage. After that point I get lost, but I see it going back to referencing the character offsets $1121/1123.

So this is disregarding race/element/buff bonuses (which I expect are multipliers), but it helps to know that damage reduction is largely percentage-based.
EDIT: $C3E1 checks the target's element.

EDIT2:
rainponcho! Your multi-levelup works TOO WELL! This is from killing a Slime in a new game.
(http://i.imgur.com/QdJrGIk.png)
(The game soft-locked after this)  :laugh: :laugh:
For some reason Rooks started with $555F EXP to the next level.
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: Time/SpaceMage on August 08, 2017, 01:48:51 pm
By the way, $33/$FF is 51/256 or 0.199 (nearly 1/5). $66/$FF is 102/256 or 0.398 (about 2/5). So it's like those values are being divided by 5. Except, y'know, floating-point math.

So if I called those 3 sub-functions' stats D1-D3, the defense value Def would be:
Def = 2*D1/5 + D2/5 + D3/5.

Base Defense "bDef" would be added to make the modified Defense "mDef":
mDef = Def + bDef/5
DR% = $FF - mDef
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: TimeSpaceMage on August 09, 2017, 04:05:11 am
Quote
For some reason Rooks started with $555F EXP to the next level.

So when the game first initializes Rooks' EXP to next level, it uses $07/B29F to store $0A to $1363. Problem is, hijacking it there calls an ADC with the current value, which before initialization is $5555. So, you may need to STZ $1363 (and STZ $1365 for the Spirit) on startup, or add it with another STZ like $81/821F (STZ $1393). That's max HP values, so I doubt it would get called more than once.

To test out the multi-levelup, enemy EXP is loaded to $136B-7A.
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: KingMike on August 09, 2017, 10:47:21 am
If you're talking about uninitialized RAM, technically it is random values.
But emulators may default to filling RAM (and I assume SRAM) with certain values (such as the 0x55 and 0xAA, or alternating bits, pattern SNES9x has used).
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: rainponcho on August 09, 2017, 12:28:53 pm
Quote
So when the game first initializes Rooks' EXP to next level, it uses $07/B29F to store $0A to $1363. Problem is, hijacking it there calls an ADC with the current value, which before initialization is $5555. So, you may need to STZ $1363 (and STZ $1365 for the Spirit) on startup, or add it with another STZ like $81/821F (STZ $1393). That's max HP values, so I doubt it would get called more than once.

Yup, thanks (!) I get the problem(s) now. Didn't think about when new characters join party ==> mega bug!

Can't believe you figured out damage formula so quickly. I stared at that for awhile and thought meh; have other things to do. Starting to think you're better at asm than I am. :)

Will try to get something working for levelup. ^^


edit:
new levelup idea
https://www.sendspace.com/file/8vw1l5


Moved exp gain up to 87:B29B. And following up on KingMike's expert observation about uninit ram (thanks for this!), cleared out that area of memory on bootup (~$30 bytes worth to be safe). It should work properly now.

Vanilla game writes to current exp first, before writing to max hp.


edit2:
Gave fight with 1 Goblin 65535 exp. Rooks + Teefa (Tifa?) = LV36 and stopped. Also used a cheat code to force Rooks exp = 0 always. LV60 and stopped.


edit3:
Bad news. Thought of how it could break - game over screen. So either reset data on new game, load game. Or maybe when a new person enters party, it flips that active member switch from 0 -> 1 somewhere around there.
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: SCO on August 12, 2017, 09:25:32 am
Haven't forgotten about uploading a standalone fastrom patch for vanilla. After optimizing Super Ghouls 'n Ghosts to playable levels, learned some new tricks.

Speaking of that, i just submitted a critical review on that hack because i noticed that the intro was broken. At first i thought it was because of confusion between the base game (no-intro vs. goodset or similar) as i've seen other games break, but now i'm not so sure. Can you tell me if it happens to you and what game should be used as base?

I suppose it might be a confusion with the graphical part having a different origin rom and the hacking part having the no-intro rom and and the combination going wonky.
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: TimeSpaceMage on September 08, 2017, 05:17:55 pm
Well that was a fun hiatus! Let's see what I can get done before my class starts at the end of the month.

new levelup idea
https://www.sendspace.com/file/8vw1l5


Moved exp gain up to 87:B29B. And following up on KingMike's expert observation about uninit ram (thanks for this!), cleared out that area of memory on bootup (~$30 bytes worth to be safe). It should work properly now.

So, turns out this has a major bug too. 87:B29B is also called when switching spirits with Call, so switching between 2 spirits will ADC their "EXP" each time. This causes a softlock after battle. (You can avoid this bug by only switching from the Empty slot to a spirit, but after getting Marid this means you'd have to end all battles with Sylph or Efrite active!)

For the record, here's the vanilla code:
Code: [Select]
Load the character offset (2=Active Spirit)
$07/B292 7A          PLY                     A:0000 X:0000 Y:0004 D:1E00 DB:00 S:1FF1 P:envmxdIZc HC:0400 VC:047 FC:38 I:00

Load their LV and left shift.
$07/B293 B9 7B 13    LDA $137B,y[$00:137D]   A:0000 X:0000 Y:0002 D:1E00 DB:00 S:1FF3 P:envmxdIzc HC:0452 VC:047 FC:38 I:00
$07/B296 0A          ASL A                   A:0028 X:0000 Y:0002 D:1E00 DB:00 S:1FF3 P:envmxdIzc HC:0514 VC:047 FC:38 I:00

Add their LV*2 to a byte offset $00 ($78 * ID#)
$07/B297 18          CLC                     A:0050 X:0000 Y:0002 D:1E00 DB:00 S:1FF3 P:envmxdIzc HC:0584 VC:047 FC:38 I:00
$07/B298 65 00       ADC $00    [$00:1E00]   A:0050 X:0000 Y:0002 D:1E00 DB:00 S:1FF3 P:envmxdIzc HC:0614 VC:047 FC:38 I:00
$07/B29A AA          TAX                     A:0230 X:0000 Y:0002 D:1E00 DB:00 S:1FF3 P:envmxdIzc HC:0662 VC:047 FC:38 I:00

Use the offset to get the Spirit's new "EXP" value and store it.
$07/B29B BF 1A A9 05 LDA $05A91A,x[$05:AB4A] A:0230 X:0230 Y:0002 D:1E00 DB:00 S:1FF3 P:envmxdIzc HC:0692 VC:047 FC:38 I:00
$07/B29F 99 63 13    STA $1363,y[$00:1365]   A:1B58 X:0230 Y:0002 D:1E00 DB:00 S:1FF3 P:envmxdIzc HC:0756 VC:047 FC:38 I:00

And here's where rainponcho's code comes in.
Code: [Select]
$87/B292 7A          PLY                     A:0000 X:0000 Y:0004 D:1E00 DB:80 S:1FF1 P:envmxdIZc HC:1048 VC:041 FC:55 I:00
$87/B293 B9 7B 13    LDA $137B,y[$80:137D]   A:0000 X:0000 Y:0002 D:1E00 DB:80 S:1FF3 P:envmxdIzc HC:1094 VC:041 FC:55 I:00
$87/B296 0A          ASL A                   A:001E X:0000 Y:0002 D:1E00 DB:80 S:1FF3 P:envmxdIzc HC:1188 VC:041 FC:55 I:00
$87/B297 18          CLC                     A:003C X:0000 Y:0002 D:1E00 DB:80 S:1FF3 P:envmxdIzc HC:1212 VC:041 FC:55 I:00
$87/B298 65 00       ADC $00    [$00:1E00]   A:003C X:0000 Y:0002 D:1E00 DB:80 S:1FF3 P:envmxdIzc HC:1236 VC:041 FC:55 I:00
$87/B29A AA          TAX                     A:00B4 X:0000 Y:0002 D:1E00 DB:80 S:1FF3 P:envmxdIzc HC:1276 VC:041 FC:55 I:00

ADC's the current EXP ($1363) before storing it.
$87/B29B 5C A1 FF 87 JMP $87FFA1[$87:FFA1]   A:00B4 X:00B4 Y:0002 D:1E00 DB:80 S:1FF3 P:envmxdIzc HC:1300 VC:041 FC:55 I:00
$87/FFA1 BF 1A A9 85 LDA $85A91A,x[$85:A9CE] A:00B4 X:00B4 Y:0002 D:1E00 DB:80 S:1FF3 P:envmxdIzc HC:1336 VC:041 FC:55 I:00
$87/FFA5 18          CLC                     A:07D0 X:00B4 Y:0002 D:1E00 DB:80 S:1FF3 P:envmxdIzc HC:0020 VC:042 FC:55 I:00
$87/FFA6 79 63 13    ADC $1363,y[$80:1365]   A:07D0 X:00B4 Y:0002 D:1E00 DB:80 S:1FF3 P:envmxdIzc HC:0044 VC:042 FC:55 I:00
$87/FFA9 99 63 13    STA $1363,y[$80:1365]   A:1770 X:00B4 Y:0002 D:1E00 DB:80 S:1FF3 P:envmxdIzc HC:0096 VC:042 FC:55 I:00

So it's a pretty simple (useful) edit, but the kicker is that it's always run. I'm going to look for a variable to check if a battle has been won, and skip the ADC if it's not. After that I'll take a look at what he meant about the game over screen >.>

EDIT: I decided to make the code check the current music ($1064) for the Battle Win theme ($55). I'm pretty sure that is foolproof  :D


Code: [Select]
ADC's the current EXP ($1363) before storing it.
$87/B29B 5C A1 FF 87 JMP $87FFA1
$87/FFA1 BF 1A A9 85 LDA $85A91A,x

Added these lines; skips to the STA if Battle Win isn't playing.
$87/FFA5 AE 64 10    LDX $1064
$87/FFA8 E0 55 00    CPX #$0055
$87/FFAB D0 04       BNE $04

$87/FFAD 18          CLC
$87/FFAE 79 63 13    ADC $1363,y
$87/FFB1 99 63 13    STA $1363,y
$87/FFB4 6B          RTL

Also, I repointed the zeroing code:
$80/8112 22 AD FF 87 JSL $87FFAD
$80/8112 22 B5 FF 87 JSL $87FFB5

Here's the updated version! (https://www.sendspace.com/file/m2jjo8)

Annnnd now Level Select has graphics glitches in the dungeons until finishing a battle. But, only for Chapter 2. Um, what?  :o
...Wait, that bug shows up before my bugfix too. It's caused by the FastROM patch v2.

EDIT2: Confirmed Game Over no longer breaks the game under levelup v0.3.
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: TimeSpaceMage on September 21, 2017, 12:10:16 am
So I'm going to leave fixing the FastROM patch to rainponcho. It's gonna take me awhile to figure out what his code changed, and there's emulator-dependent graphics glitches too. At first I thought it was just Ch2 stage select, but in no$sns it glitches in Balnea Temple as well. Finishing a battle clears the glitches, but returning from the map brings it back again.

Here's the latest progress!
-All treasure chest contents through Ch3 have been located in ROM, and can be freely edited. I'll finish documenting the rest in another 2 hours' work or so.

-Added a Broad Sword to the Ch2 stage select inventory so Darwin has something to swing when he joins.
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: TimeSpaceMage on October 27, 2017, 12:15:26 am
Hey everyone! So I just identified some more spell data, their SFX. There's also SFX for the effects taking place (say for "Rooks' attribute has changed to Fire" or "Rooks' Attack Power has been increased"), which is stored 2 banks away from the spell data for some reason. So, now buff spells use what I call the "Lufia Buff" SFX. It's cool and adds a bit more variety to battles.  :)

Yeah, idk what happened to rainponcho. I sure hope he's all right...

EDIT:
Major update! I fixed the graphical issues with fastrom v0.2! I'm thrilled enough that I'd release the game right now, except now the game hangs after finishing the intro  :( So once I find what's causing that, I'm willing to release.

EDIT2:
GOT IT! Turns out it was a bad patch job. Confirmed FastROM v3 and Levelup v3 work with both vanilla and Seal of Rimsala v0.941, so I added 0.942's changes and we're at v0.95! The game's ready to release pending some playtesting ^___^ It's been over 2 years, but it's finally coming out!
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ FastROM bug fixed!
Post by: juef on January 31, 2018, 03:25:13 pm
Hey TimeSpaceMage! :) Any update regarding the hack?
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ FastROM bug fixed!
Post by: Time/SpaceMage on February 01, 2018, 08:17:02 am
Thanks for the interest! No updates yet, but I will have time to work on it after I take my A+ certification tests in two weeks. This will help me get into IT, so it's very important to me!

There's still a major graphics bug with the FastROM patch when played in no$sns, and I want to finish going through the dialogue (and fitting it in between the unmovable event opcodes) before release. I can't wait to share it with you, though :)
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ FastROM bug fixed!
Post by: Zeemis on February 01, 2018, 08:04:16 pm
This looks really amazing! I loved playing this back in the day on my SNES! :D
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ FastROM bug fixed!
Post by: PersianImm0rtal on February 02, 2018, 02:11:21 am
I just wanted to say thank you for the hard work you put into this. I am going to test itt out on my super ufo! Thank thanks thanks!

Edit: Wait, Is this hack not on the site yet?
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ FastROM bug fixed!
Post by: Time/SpaceMage on February 02, 2018, 07:50:57 am
No public release yet, unfortunately. I'm rather selective about its quality, since this is my first big project.

Don't worry, I'll release a news article for it so you won't miss it. It won't be in February, though. Although... having some beta testers could be handy :3 Shoot me a PM if you want a prerelease.
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ FastROM bug fixed!
Post by: PersianImm0rtal on February 05, 2018, 05:28:18 pm
I think you have a hit on your hands based on this beta version.  :thumbsup:

I love hacks like this that take games that had great attributes and just modernizes them so that we can enjoy them without getting frustrated. The best change is the rate of random encounters.
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ FastROM bug fixed!
Post by: Time/SpaceMage on February 06, 2018, 09:35:34 pm
Thanks! I'm more fired up about this now  :)
Since I had some free time after studying, I finished the script for Chapter 3 and the intro to Chapter 4. The story should make more sense now. Before it was like, "Oh, she's been hit with a sleep spell!" "Is she okay?" "Yes, she just needs to rest."
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ FastROM bug fixed!
Post by: PersianImm0rtal on February 07, 2018, 12:46:31 am
So in chapter 1, when I enter the Temple I get glitched graphics, and then it goes away if I finish a battle, but if I look at the map, it comes back until I finish another combat.
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ FastROM bug fixed!
Post by: sluffy on February 07, 2018, 09:46:47 am
Quote
and I want to finish going through the dialogue (and fitting it in between the unmovable event opcodes)

Would it be possible to invent your own scripting "jump" code that prints text from other 24-bit location and then "return" back to continue normal scripting routine?


Quote
So in chapter 1, when I enter the Temple I get glitched graphics, and then it goes away if I finish a battle, but if I look at the map, it comes back until I finish another combat.

rainponcho's FastROM patch doesn't work on real hardware (see review). I've had this exact problem and other strange graphic stuff just using that hack. Tried contacting rainponcho but no response for awhile now. :(


Can't help but think all the different (emulator graphic) glitches are because of "unstable" dma hacks constantly used to give quick boosts at bad times; irq and nmi timing conflicts would be my guess.

Just a thought though.
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ FastROM bug fixed!
Post by: Time/SpaceMage on February 07, 2018, 10:16:07 am
Would it be possible to invent your own scripting "jump" code that prints text from other 24-bit location and then "return" back to continue normal scripting routine?


rainponcho's FastROM patch doesn't work on real hardware (see review). I've had this exact problem and other strange graphic stuff just using that hack. Tried contacting rainponcho but no response for awhile now. :(


Can't help but think all the different (emulator graphic) glitches are because of "unstable" dma hacks constantly used to give quick boosts at bad times; irq and nmi timing conflicts would be my guess.

Just a thought though.
There might be a code for that, like when rainponcho listed codes for the scripting language. If so then I could expand the text used in games. Most of the time I just need to be clever with my words to fit it in, which is fun in its own right. But, I'll see if I can't figure out a jump routine.

So his patch has that bug on all real hardware? That's a real bummer! Also hard to test, since I don't really understand what he did. I'm literally reversing groups of byte changes until I find the offender.

And yeah, rainponcho dropped off the face of the earth :x Hope he's ok, but I don't think he's coming back.
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ FastROM bug fixed!
Post by: PersianImm0rtal on February 07, 2018, 10:56:29 pm
In chapter 2 the graphics get glitched when you open the map, and then it goes away after a battle.    :(
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ FastROM bug fixed!
Post by: TimeSpaceMage on February 09, 2018, 12:55:10 am
That was the problem before too, but it went away on Snes9x.  :(

So, here are the byte changes his FastROM patch made to the original. To shorten the list, I'll remove the entries that just change the bank (00 -> 80).

Code: [Select]
Comparing files Arcana_base+fastrom.smc and Arcana_base.smc:
00000770: 22 E2
00000771: 9D 20
00000772: FB 85
00000773: 9F 02

000007C4: 5C B7
000007C5: A8 00
000007C6: FB C8
000007C7: 9F 9D

000007D6: 5C B7
000007D7: EC 00
000007D8: FB C8
000007D9: 9F 5A

0000082E: 5C B9
0000082F: 2C 00
00000830: FC 00
00000831: 9F 9D

00000870: 5C B9
00000871: 4F 00
00000872: FC 00
00000873: 9F 9D

0000089D: 5C A9
0000089E: 28 E0
0000089F: FD 95
000008A0: 9F 01

00001532: 22 A7
00001533: 30 10
00001534: FB 29
00001535: 9F FF
00001536: EA 00

00001B0E: 4C DC
00001B0F: 9E 49
00001B10: FF 10

00007F90: 78 FF
00007F91: 18 FF
00007F92: FB FF
00007F93: E2 FF
00007F94: 20 FF
00007F95: A9 FF
00007F96: 01 FF
00007F97: 8D FF
00007F98: 0D FF
00007F99: 42 FF
00007F9A: 5C FF
00007F9B: 01 FF
00007F9C: 80 FF
00007F9D: 80 FF
00007F9E: 08 FF
00007F9F: E2 FF
00007FA0: 20 FF
00007FA1: 48 FF
00007FA2: AD FF
00007FA3: 4B FF
00007FA4: 10 FF
00007FA5: C9 FF
00007FA6: 40 FF
00007FA7: B0 FF
00007FA8: 05 FF
00007FA9: 09 FF
00007FAA: 80 FF
00007FAB: 8D FF
00007FAC: 4B FF
00007FAD: 10 FF
00007FAE: 68 FF
00007FAF: 28 FF
00007FB0: DC FF
00007FB1: 49 FF
00007FB2: 10 FF
00007FFC: 90 01
00007FFD: FF 80

000199B1: 22 8B
000199B2: 42 A9
000199B3: FB FF
000199B4: 9F FF
000199B5: 60 8F

000FFB30: A7 FF
000FFB31: 10 FF
000FFB32: 29 FF
000FFB34: 00 FF
000FFB35: C9 FF
000FFB36: 40 FF
000FFB37: 00 FF
000FFB38: B0 FF
000FFB39: 03 FF
000FFB3A: 09 FF
000FFB3B: 80 FF
000FFB3C: 00 FF
000FFB3D: 6B FF
000FFB3E: 00 FF
000FFB3F: 00 FF
000FFB42: 08 FF
000FFB43: A9 FF
000FFB44: 20 FF
000FFB45: 13 FF
000FFB46: 8D FF
000FFB47: 65 FF
000FFB48: 43 FF
000FFB49: A9 FF
000FFB4A: 40 FF
000FFB4B: FB FF
000FFB4C: 8D FF
000FFB4D: 62 FF
000FFB4E: 43 FF
000FFB4F: A9 FF
000FFB50: FB FF
000FFB51: 9F FF
000FFB52: 8D FF
000FFB53: 63 FF
000FFB54: 43 FF
000FFB55: A9 FF
000FFB56: E0 FF
000FFB57: CC FF
000FFB58: 8D FF
000FFB59: 81 FF
000FFB5A: 21 FF
000FFB5B: A9 FF
000FFB5C: CC FF
000FFB5D: 7E FF
000FFB5E: 8D FF
000FFB5F: 82 FF
000FFB60: 21 FF
000FFB61: A9 FF
000FFB62: 08 FF
000FFB63: 80 FF
000FFB64: 8D FF
000FFB65: 60 FF
000FFB66: 43 FF
000FFB67: E2 FF
000FFB68: 20 FF
000FFB69: A9 FF
000FFB6A: 40 FF
000FFB6B: 8D FF
000FFB6C: 0B FF
000FFB6D: 42 FF
000FFB6E: C2 FF
000FFB6F: 20 FF
000FFB70: A9 FF
000FFB71: 40 FF
000FFB72: 26 FF
000FFB73: 8D FF
000FFB74: 65 FF
000FFB75: 43 FF
000FFB76: A9 FF
000FFB77: 3E FF
000FFB78: FB FF
000FFB79: 8D FF
000FFB7A: 62 FF
000FFB7B: 43 FF
000FFB7C: A9 FF
000FFB7D: FB FF
000FFB7E: 9F FF
000FFB7F: 8D FF
000FFB80: 63 FF
000FFB81: 43 FF
000FFB82: A9 FF
000FFB83: A0 FF
000FFB84: A6 FF
000FFB85: 8D FF
000FFB86: 81 FF
000FFB87: 21 FF
000FFB88: A9 FF
000FFB89: A6 FF
000FFB8A: 7E FF
000FFB8B: 8D FF
000FFB8C: 82 FF
000FFB8D: 21 FF
000FFB8E: A9 FF
000FFB8F: 08 FF
000FFB90: 80 FF
000FFB91: 8D FF
000FFB92: 60 FF
000FFB93: 43 FF
000FFB94: E2 FF
000FFB95: 20 FF
000FFB96: A9 FF
000FFB97: 40 FF
000FFB98: 8D FF
000FFB99: 0B FF
000FFB9A: 42 FF
000FFB9B: 28 FF
000FFB9C: 6B FF
000FFB9D: E2 FF
000FFB9E: 20 FF
000FFB9F: C9 FF
000FFBA0: 40 FF
000FFBA1: B0 FF
000FFBA2: 02 FF
000FFBA3: 09 FF
000FFBA4: 80 FF
000FFBA5: 85 FF
000FFBA6: 02 FF
000FFBA7: 6B FF
000FFBA8: C2 FF
000FFBA9: 20 FF
000FFBAA: A5 FF
000FFBAB: 03 FF
000FFBAC: 8F FF
000FFBAD: 65 FF
000FFBAE: 43 FF
000FFBAF: 80 FF
000FFBB0: 98 FF
000FFBB1: 18 FF
000FFBB2: 65 FF
000FFBB3: 00 FF
000FFBB4: 8F FF
000FFBB5: 62 FF
000FFBB6: 43 FF
000FFBB7: 80 FF
000FFBB8: 8A FF
000FFBB9: 8F FF
000FFBBA: 81 FF
000FFBBB: 21 FF
000FFBBC: 80 FF
000FFBBD: A9 FF
000FFBBE: 00 FF
000FFBBF: 80 FF
000FFBC0: 8F FF
000FFBC1: 60 FF
000FFBC2: 43 FF
000FFBC3: 80 FF
000FFBC4: E2 FF
000FFBC5: 20 FF
000FFBC6: A5 FF
000FFBC7: 02 FF
000FFBC8: 09 FF
000FFBC9: 80 FF
000FFBCA: 8F FF
000FFBCB: 64 FF
000FFBCC: 43 FF
000FFBCD: 80 FF
000FFBCE: 8B FF
000FFBCF: 68 FF
000FFBD0: 8F FF
000FFBD1: 83 FF
000FFBD2: 21 FF
000FFBD3: 80 FF
000FFBD4: A9 FF
000FFBD5: 40 FF
000FFBD6: 8F FF
000FFBD7: 0B FF
000FFBD8: 42 FF
000FFBD9: 80 FF
000FFBDA: C2 FF
000FFBDB: 20 FF
000FFBDC: 8A FF
000FFBDD: 18 FF
000FFBDE: 65 FF
000FFBDF: 03 FF
000FFBE0: AA FF
000FFBE1: 98 FF
000FFBE2: 18 FF
000FFBE3: 65 FF
000FFBE4: 03 FF
000FFBE5: A8 FF
000FFBE6: E2 FF
000FFBE7: 20 FF
000FFBE8: 5C FF
000FFBE9: 7C FF
000FFBEA: 87 FF
000FFBEB: 80 FF
000FFBEC: C2 FF
000FFBED: 20 FF
000FFBEE: A5 FF
000FFBEF: 03 FF
000FFBF0: 8F FF
000FFBF1: 65 FF
000FFBF2: 43 FF
000FFBF3: 80 FF
000FFBF4: 98 FF
000FFBF5: 18 FF
000FFBF6: 65 FF
000FFBF7: 00 FF
000FFBF8: 8F FF
000FFBF9: 62 FF
000FFBFA: 43 FF
000FFBFB: 80 FF
000FFBFC: 8A FF
000FFBFD: 8F FF
000FFBFE: 81 FF
000FFBFF: 21 FF
000FFC00: 80 FF
000FFC01: A9 FF
000FFC02: 08 FF
000FFC03: 80 FF
000FFC04: 8F FF
000FFC05: 60 FF
000FFC06: 43 FF
000FFC07: 80 FF
000FFC08: E2 FF
000FFC09: 20 FF
000FFC0A: A5 FF
000FFC0B: 02 FF
000FFC0C: 09 FF
000FFC0D: 80 FF
000FFC0E: 8F FF
000FFC0F: 64 FF
000FFC10: 43 FF
000FFC11: 80 FF
000FFC12: 8B FF
000FFC13: 68 FF
000FFC14: 8F FF
000FFC15: 83 FF
000FFC16: 21 FF
000FFC17: 80 FF
000FFC18: A9 FF
000FFC19: 40 FF
000FFC1A: 8F FF
000FFC1B: 0B FF
000FFC1C: 42 FF
000FFC1D: 80 FF
000FFC1E: C2 FF
000FFC1F: 20 FF
000FFC20: 8A FF
000FFC21: 18 FF
000FFC22: 65 FF
000FFC23: 03 FF
000FFC24: AA FF
000FFC25: C8 FF
000FFC26: E2 FF
000FFC27: 20 FF
000FFC28: 5C FF
000FFC29: 7C FF
000FFC2A: 87 FF
000FFC2B: 80 FF
000FFC2C: C2 FF
000FFC2D: 20 FF
000FFC2E: 8A FF
000FFC2F: BB FF
000FFC30: A8 FF
000FFC31: 8B FF
000FFC32: 8B FF
000FFC33: 68 FF
000FFC34: C9 FF
000FFC35: 7F FF
000FFC36: 7F FF
000FFC37: F0 FF
000FFC38: 08 FF
000FFC39: A5 FF
000FFC3A: 03 FF
000FFC3B: 3A FF
000FFC3C: 54 FF
000FFC3D: 7E FF
000FFC3E: 7E FF
000FFC3F: 80 FF
000FFC40: 06 FF
000FFC41: A5 FF
000FFC42: 03 FF
000FFC43: 3A FF
000FFC44: 54 FF
000FFC45: 7F FF
000FFC46: 7F FF
000FFC47: BB FF
000FFC48: E2 FF
000FFC49: 20 FF
000FFC4A: 7A FF
000FFC4B: 5C FF
000FFC4C: 7C FF
000FFC4D: 87 FF
000FFC4E: 80 FF
000FFC4F: C2 FF
000FFC50: 20 FF
000FFC51: A5 FF
000FFC52: 03 FF
000FFC53: C9 FF
000FFC54: 10 FF
000FFC55: 00 FF
000FFC56: 90 FF
000FFC57: 4E FF
000FFC58: 98 FF
000FFC59: 38 FF
000FFC5A: E9 FF
000FFC5B: 10 FF
000FFC5C: 00 FF
000FFC5D: A8 FF
000FFC5E: B9 FF
000FFC5F: 0F FF
000FFC60: 00 FF
000FFC61: EB FF
000FFC62: 9D FF
000FFC63: 00 FF
000FFC64: 00 FF
000FFC65: B9 FF
000FFC66: 0D FF
000FFC67: 00 FF
000FFC68: EB FF
000FFC69: 9D FF
000FFC6A: 02 FF
000FFC6B: 00 FF
000FFC6C: B9 FF
000FFC6D: 0B FF
000FFC6E: 00 FF
000FFC6F: EB FF
000FFC70: 9D FF
000FFC71: 04 FF
000FFC72: 00 FF
000FFC73: B9 FF
000FFC74: 09 FF
000FFC75: 00 FF
000FFC76: EB FF
000FFC77: 9D FF
000FFC78: 06 FF
000FFC79: 00 FF
000FFC7A: B9 FF
000FFC7B: 07 FF
000FFC7C: 00 FF
000FFC7D: EB FF
000FFC7E: 9D FF
000FFC7F: 08 FF
000FFC80: 00 FF
000FFC81: B9 FF
000FFC82: 05 FF
000FFC83: 00 FF
000FFC84: EB FF
000FFC85: 9D FF
000FFC86: 0A FF
000FFC87: 00 FF
000FFC88: B9 FF
000FFC89: 03 FF
000FFC8A: 00 FF
000FFC8B: EB FF
000FFC8C: 9D FF
000FFC8D: 0C FF
000FFC8E: 00 FF
000FFC8F: B9 FF
000FFC90: 01 FF
000FFC91: 00 FF
000FFC92: EB FF
000FFC93: 9D FF
000FFC94: 0E FF
000FFC95: 00 FF
000FFC96: 8A FF
000FFC97: 18 FF
000FFC98: 69 FF
000FFC99: 10 FF
000FFC9A: 00 FF
000FFC9B: AA FF
000FFC9C: A5 FF
000FFC9D: 03 FF
000FFC9E: 38 FF
000FFC9F: E9 FF
000FFCA0: 10 FF
000FFCA1: 00 FF
000FFCA2: 85 FF
000FFCA3: 03 FF
000FFCA4: 80 FF
000FFCA5: AB FF
000FFCA6: C9 FF
000FFCA7: 08 FF
000FFCA8: 00 FF
000FFCA9: 90 FF
000FFCAA: 30 FF
000FFCAB: 98 FF
000FFCAC: 38 FF
000FFCAD: E9 FF
000FFCAE: 08 FF
000FFCAF: 00 FF
000FFCB0: A8 FF
000FFCB1: B9 FF
000FFCB2: 07 FF
000FFCB3: 00 FF
000FFCB4: EB FF
000FFCB5: 9D FF
000FFCB6: 00 FF
000FFCB7: 00 FF
000FFCB8: B9 FF
000FFCB9: 05 FF
000FFCBA: 00 FF
000FFCBB: EB FF
000FFCBC: 9D FF
000FFCBD: 02 FF
000FFCBE: 00 FF
000FFCBF: B9 FF
000FFCC0: 03 FF
000FFCC1: 00 FF
000FFCC2: EB FF
000FFCC3: 9D FF
000FFCC4: 04 FF
000FFCC5: 00 FF
000FFCC6: B9 FF
000FFCC7: 01 FF
000FFCC8: 00 FF
000FFCC9: EB FF
000FFCCA: 9D FF
000FFCCB: 06 FF
000FFCCC: 00 FF
000FFCCD: 8A FF
000FFCCE: 18 FF
000FFCCF: 69 FF
000FFCD0: 08 FF
000FFCD1: 00 FF
000FFCD2: AA FF
000FFCD3: A5 FF
000FFCD4: 03 FF
000FFCD5: 38 FF
000FFCD6: E9 FF
000FFCD7: 08 FF
000FFCD8: 00 FF
000FFCD9: 85 FF
000FFCDA: 03 FF
000FFCDB: C9 FF
000FFCDC: 04 FF
000FFCDD: 00 FF
000FFCDE: 90 FF
000FFCDF: 1E FF
000FFCE0: 88 FF
000FFCE1: 88 FF
000FFCE2: 88 FF
000FFCE3: 88 FF
000FFCE4: B9 FF
000FFCE5: 03 FF
000FFCE6: 00 FF
000FFCE7: EB FF
000FFCE8: 9D FF
000FFCE9: 00 FF
000FFCEA: 00 FF
000FFCEB: B9 FF
000FFCEC: 01 FF
000FFCED: 00 FF
000FFCEE: EB FF
000FFCEF: 9D FF
000FFCF0: 02 FF
000FFCF1: 00 FF
000FFCF2: E8 FF
000FFCF3: E8 FF
000FFCF4: E8 FF
000FFCF5: E8 FF
000FFCF6: A5 FF
000FFCF7: 03 FF
000FFCF8: 38 FF
000FFCF9: E9 FF
000FFCFA: 04 FF
000FFCFB: 00 FF
000FFCFC: 85 FF
000FFCFD: 03 FF
000FFCFE: C9 FF
000FFCFF: 02 FF
000FFD00: 00 FF
000FFD01: 90 FF
000FFD02: 13 FF
000FFD03: 88 FF
000FFD04: 88 FF
000FFD05: B9 FF
000FFD06: 01 FF
000FFD07: 00 FF
000FFD08: EB FF
000FFD09: 9D FF
000FFD0A: 00 FF
000FFD0B: 00 FF
000FFD0C: E8 FF
000FFD0D: E8 FF
000FFD0E: A5 FF
000FFD0F: 03 FF
000FFD10: 38 FF
000FFD11: E9 FF
000FFD12: 02 FF
000FFD13: 00 FF
000FFD14: 85 FF
000FFD15: 03 FF
000FFD16: E2 FF
000FFD17: 20 FF
000FFD18: 3A FF
000FFD19: D0 FF
000FFD1A: 08 FF
000FFD1B: B9 FF
000FFD1C: 00 FF
000FFD1D: 00 FF
000FFD1E: 9D FF
000FFD1F: 00 FF
000FFD20: 00 FF
000FFD21: 88 FF
000FFD22: E8 FF
000FFD23: 7A FF
000FFD24: 5C FF
000FFD25: 7C FF
000FFD26: 87 FF
000FFD27: 80 FF
000FFD28: E2 FF
000FFD29: 20 FF
000FFD2A: A9 FF
000FFD2B: E0 FF
000FFD2C: E0 FF
000FFD2D: 81 FF
000FFD2E: 03 FF
000FFD2F: B0 FF
000FFD30: 4A FF
000FFD31: 95 FF
000FFD32: 01 FF
000FFD33: 95 FF
000FFD34: 05 FF
000FFD35: 95 FF
000FFD36: 09 FF
000FFD37: 95 FF
000FFD38: 0D FF
000FFD39: 95 FF
000FFD3A: 11 FF
000FFD3B: 95 FF
000FFD3C: 15 FF
000FFD3D: 95 FF
000FFD3E: 19 FF
000FFD3F: 95 FF
000FFD40: 1D FF
000FFD41: 95 FF
000FFD42: 21 FF
000FFD43: 95 FF
000FFD44: 25 FF
000FFD45: 95 FF
000FFD46: 29 FF
000FFD47: 95 FF
000FFD48: 2D FF
000FFD49: 95 FF
000FFD4A: 31 FF
000FFD4B: 95 FF
000FFD4C: 35 FF
000FFD4D: 95 FF
000FFD4E: 39 FF
000FFD4F: 95 FF
000FFD50: 3D FF
000FFD51: 95 FF
000FFD52: 41 FF
000FFD53: 95 FF
000FFD54: 45 FF
000FFD55: 95 FF
000FFD56: 49 FF
000FFD57: 95 FF
000FFD58: 4D FF
000FFD59: 95 FF
000FFD5A: 51 FF
000FFD5B: 95 FF
000FFD5C: 55 FF
000FFD5D: 95 FF
000FFD5E: 59 FF
000FFD5F: 95 FF
000FFD60: 5D FF
000FFD61: 95 FF
000FFD62: 61 FF
000FFD63: 95 FF
000FFD64: 65 FF
000FFD65: 95 FF
000FFD66: 69 FF
000FFD67: 95 FF
000FFD68: 6D FF
000FFD69: 95 FF
000FFD6A: 71 FF
000FFD6B: 95 FF
000FFD6C: 75 FF
000FFD6D: 95 FF
000FFD6E: 79 FF
000FFD6F: 95 FF
000FFD70: 7D FF
000FFD71: C2 FF
000FFD72: 20 FF
000FFD73: 8A FF
000FFD74: 18 FF
000FFD75: 69 FF
000FFD76: 80 FF
000FFD77: 00 FF
000FFD78: AA FF
000FFD79: 80 FF
000FFD7A: AD FF
000FFD7B: E0 FF
000FFD7C: C1 FF
000FFD7D: 03 FF
000FFD7E: B0 FF
000FFD7F: 2C FF
000FFD80: 95 FF
000FFD81: 01 FF
000FFD82: 95 FF
000FFD83: 05 FF
000FFD84: 95 FF
000FFD85: 09 FF
000FFD86: 95 FF
000FFD87: 0D FF
000FFD88: 95 FF
000FFD89: 11 FF
000FFD8A: 95 FF
000FFD8B: 15 FF
000FFD8C: 95 FF
000FFD8D: 19 FF
000FFD8E: 95 FF
000FFD8F: 1D FF
000FFD90: 95 FF
000FFD91: 21 FF
000FFD92: 95 FF
000FFD93: 25 FF
000FFD94: 95 FF
000FFD95: 29 FF
000FFD96: 95 FF
000FFD97: 2D FF
000FFD98: 95 FF
000FFD99: 31 FF
000FFD9A: 95 FF
000FFD9B: 35 FF
000FFD9C: 95 FF
000FFD9D: 39 FF
000FFD9E: 95 FF
000FFD9F: 3D FF
000FFDA0: C2 FF
000FFDA1: 20 FF
000FFDA2: 8A FF
000FFDA3: 18 FF
000FFDA4: 69 FF
000FFDA5: 40 FF
000FFDA6: 00 FF
000FFDA7: AA FF
000FFDA8: E2 FF
000FFDA9: 20 FF
000FFDAA: A9 FF
000FFDAB: E1 FF
000FFDAC: E0 FF
000FFDAD: E1 FF
000FFDAE: 03 FF
000FFDAF: B0 FF
000FFDB0: 1C FF
000FFDB1: 95 FF
000FFDB2: 01 FF
000FFDB3: 95 FF
000FFDB4: 05 FF
000FFDB5: 95 FF
000FFDB6: 09 FF
000FFDB7: 95 FF
000FFDB8: 0D FF
000FFDB9: 95 FF
000FFDBA: 11 FF
000FFDBB: 95 FF
000FFDBC: 15 FF
000FFDBD: 95 FF
000FFDBE: 19 FF
000FFDBF: 95 FF
000FFDC0: 1D FF
000FFDC1: C2 FF
000FFDC2: 20 FF
000FFDC3: 8A FF
000FFDC4: 18 FF
000FFDC5: 69 FF
000FFDC6: 20 FF
000FFDC7: 00 FF
000FFDC8: AA FF
000FFDC9: E2 FF
000FFDCA: 20 FF
000FFDCB: A9 FF
000FFDCC: E1 FF
000FFDCD: E0 FF
000FFDCE: F1 FF
000FFDCF: 03 FF
000FFDD0: B0 FF
000FFDD1: 14 FF
000FFDD2: 95 FF
000FFDD3: 01 FF
000FFDD4: 95 FF
000FFDD5: 05 FF
000FFDD6: 95 FF
000FFDD7: 09 FF
000FFDD8: 95 FF
000FFDD9: 0D FF
000FFDDA: C2 FF
000FFDDB: 20 FF
000FFDDC: 8A FF
000FFDDD: 18 FF
000FFDDE: 69 FF
000FFDDF: 10 FF
000FFDE0: 00 FF
000FFDE1: AA FF
000FFDE2: E2 FF
000FFDE3: 20 FF
000FFDE4: A9 FF
000FFDE5: E1 FF
000FFDE6: E0 FF
000FFDE7: F9 FF
000FFDE8: 03 FF
000FFDE9: B0 FF
000FFDEA: 10 FF
000FFDEB: 95 FF
000FFDEC: 01 FF
000FFDED: 95 FF
000FFDEE: 05 FF
000FFDEF: C2 FF
000FFDF0: 20 FF
000FFDF1: 8A FF
000FFDF2: 18 FF
000FFDF3: 69 FF
000FFDF4: 08 FF
000FFDF5: 00 FF
000FFDF6: AA FF
000FFDF7: E2 FF
000FFDF8: 20 FF
000FFDF9: A9 FF
000FFDFA: E1 FF
000FFDFB: E0 FF
000FFDFC: 00 FF
000FFDFD: 04 FF
000FFDFE: B0 FF
000FFDFF: 06 FF
000FFE00: 95 FF
000FFE01: 01 FF
000FFE02: E8 FF
000FFE03: E8 FF
000FFE04: E8 FF
000FFE05: E8 FF
000FFE06: 5C FF
000FFE07: AA FF
000FFE08: 88 FF
000FFE09: 80 FF
So for my fix, I reverted 8 bytes (0x770-773 and 0x7C4-7C7) that were causing gfx junk to appear. It looks like the bulk of his code is FFB30-FFE09. Wow, I can't believe he wrote almost $200 bytes of assembly... Well my next step will be trying to revert the other small groups, and if that doesn't work I'll have to disassemble that monster.  :-X Wish me luck guys! If anyone can give some input on FastROM conversion I'd really appreciate it.

February 09, 2018, 12:55:30 am - (Auto Merged - Double Posts are not allowed before 7 days.)
Also I documented more of the script opcodes. They still don't really make sense  :laugh: Tracing the opcodes hasn't led anywhere yet. $80/209B bounces all over the place, and when I trace the opcodes I can see where they're being read all at once, but not so much where they're being followed. For instance at 0x62256, the first 4 bytes "10 A5 FA 0C" mean to pause, then newline.  Next is "10 E3 F7 0C", which has Rooks speak without his picture showing. All the dialogue-related codes start with 10 and end with 0C, but I'm not sure HOW it works.

Code: [Select]
rainponcho's notes
$80/902B = where it reads scripting code
07 = run asm code (24-bit addr)
0c = jump if false (16-bit addr)
1b = jsr (16-bit addr)
1c = ret
And this just confuses me even more  :P
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ FastROM bug fixed!
Post by: sluffy on February 09, 2018, 09:49:25 am
Lots of weird crap so I just take guesses. :p

770 just.. flips [rd] bank to 80+ if between 00-3F. And that causes junk to appear??
7c4/7d6 dma rom ==> ram
82e mvn ram copy
870 loop unrolls?
89d oam loop unroll (invalid sprite maybe)
1532/1b0e looks like 770 again (fastbank)
7f90 boot fastrom switch
199b1 appears to .. init ram via dma ..

That's what I could make out. Ugh.



I'm interested enough in trying out an independent faster rom conversion, to cross-check for problems. Not going to use rainponcho as a base since I have learned own ideas on what to do. This takes me (lots of) months though.

Faster rom means.. flipping the banks. And optimizing code - using look-up tables, removing loops, restructuring blocks, writing own spc transfer routines, disabling interrupts during lengthy "no update" screens, cycle counting, register cache, misc.



Did basic fastrom treatment. Ohohh. Ow. This game is buggy.
- dma $1800 size during active vblank. Fails. Already getting graphical glitches due to incomplete vram transfers.

- writes to 420c/420d every nmi. 420d is written using uninitialized ram. 50/50 chance you get fastrom or slowrom.

- reads 4216/4217 after 2 nop cycles. This sounds like a bad idea but game works so maybe .. still sounds awful. Need to check this harder


Does anyone know of other snes quirks to watch for? It'd be nice if there's a bgb-like debugger that catches illegal or "questionable" stuff and prints it out somewhere / auto-break. ^^
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ FastROM bug fixed! ...kinda.
Post by: TimeSpaceMage on February 10, 2018, 10:06:04 pm
Yeah I'm not surprised this game is buggy. When reverting the level-up text to match the Japanese version (1 button press instead of 7), I found the English version has a hard-coded counter to tell it how many times to pause for input on that one screen. Along with the opcode to pause for input (7F), I literally had to track down a 07 and change it to a 01.

I'll try reverting 89d and see what happens. In the meantime, I'll rebuild my beta keeping the FastROM patch separate and just soft patch it. Thanks for the guesses :D
EDIT: 89d didn't fix the Heal crash in no$sns. I made a "minus fastrom" patch but soft patching it makes the game softlock after the Chapter 1 screen. Looks like I'll have to add my changes by hand again :x
EDIT2: Also no dice with 7D6, 82E, 870 reverted all at once, nor with 1532/1B0E reverted. So that leaves the last 3 groups... I'm guessing it's an issue with 199b1 since you said it was initializing RAM.

An emulator that catches stupid code sounds amazing. I can do some searching, but I haven't heard of one before.
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ FastROM bug fixed! ...kinda.
Post by: sluffy on February 20, 2018, 10:31:55 pm
I really should get back on the ball with this. Game likes to over-transfer data and it tends to drop sometimes.

Code: [Select]
max transfer size
$80/BFF3 C9 01 18    CMP #$1801              A:1B90 X:10C3 Y:0000 D:1DE1 DB:80 S:1FEF P:envmxdIzC HC:0934 VC:202 FC:06 I:00
$80/BFF6 B0 0B       BCS $0B    [$C003]      A:1B90 X:10C3 Y:0000 D:1DE1 DB:80 S:1FEF P:envmxdIzC HC:0958 VC:202 FC:06 I:00


1-time transfer
$00/BFF8 A9 FF FF    LDA #$FFFF              A:0000 X:0000 Y:0000 D:0000 DB:00 S:01FF P:EnvmxdIzc HC:0238 VC:000 FC:00 I:00
$00/BFFB 8D 1D 11    STA $111D  [$00:111D]   A:0000 X:0000 Y:0000 D:0000 DB:00 S:01FF P:EnvmxdIzc HC:0254 VC:000 FC:00 I:00
$00/BFFE 9C 1F 11    STZ $111F  [$00:111F]   A:0000 X:0000 Y:0000 D:0000 DB:00 S:01FF P:EnvmxdIzc HC:0270 VC:000 FC:00 I:00
$00/C001 80 0C       BRA $0C    [$C00F]      A:0000 X:0000 Y:0000 D:0000 DB:00 S:01FF P:EnvmxdIzc HC:0286 VC:000 FC:00 I:00


split transfers
$80/C003 A9 00 18    LDA #$1800              A:1B90 X:10C3 Y:0000 D:1DE1 DB:80 S:1FEF P:envmxdIzC HC:0982 VC:202 FC:06 I:00
$80/C006 85 04       STA $04    [$00:1DE5]   A:1800 X:10C3 Y:0000 D:1DE1 DB:80 S:1FEF P:envmxdIzC HC:1006 VC:202 FC:06 I:00

$80/C008 18          CLC                     A:1800 X:10C3 Y:0000 D:1DE1 DB:80 S:1FEF P:envmxdIzC HC:1046 VC:202 FC:06 I:00
$80/C009 6D 1D 11    ADC $111D  [$80:111D]   A:1800 X:10C3 Y:0000 D:1DE1 DB:80 S:1FEF P:envmxdIzc HC:1064 VC:202 FC:06 I:00
$80/C00C 8D 1D 11    STA $111D  [$80:111D]   A:1810 X:10C3 Y:0000 D:1DE1 DB:80 S:1FEF P:envmxdIzc HC:1104 VC:202 FC:06 I:00


$1801/$1800 = way too much. Set mine at $1401/$1400, which cuts it close. Could lower another $100 on safe side maybe..

DMA[0]: CPU->PPU Mode:1 0x7E4010->0x2118 Bytes:1400 (inc) V:229 VRAM: 5008 (1,0) word
$80/84AC 8C 0B 42    STY $420B  [$80:420B]   A:5008 X:0060 Y:0001 D:0000 DB:80 S:1FDF P:envmXdIzc HC:1214 VC:229 FC:19 I:00
$80/84AF 4C 69 84    JMP $8469  [$80:8469]   A:5008 X:0060 Y:0001 D:0000 DB:80 S:1FDF P:envmXdIzc HC:1196 VC:260 FC:19 I:00


Random graphic glitches disappear for me with generic fastrom build. Have to see if I can trigger heal bug on no$sns. Does it happen with vanilla too or just rainponcho's fast or seal of rimsala edition?
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ FastROM bug fixed! ...kinda.
Post by: Time/SpaceMage on February 21, 2018, 07:58:46 am
The bug is with rainponcho's FastROM patch. The rest of SoR just changes data and doesnt touch the code.
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ FastROM bug fixed! ...kinda.
Post by: sluffy on February 23, 2018, 09:27:38 pm
no$sns -- tried Heal with just FastROM patch on-site but no hangs, crashes. Maybe I'm doing it wrong.
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ FastROM bug fixed! ...kinda.
Post by: PersianImm0rtal on April 08, 2018, 12:18:46 am
When is the final release?
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ FastROM bug fixed! ...kinda.
Post by: Time/SpaceMage on April 08, 2018, 03:32:43 pm
No release date yet, until this bug is narrowed down so it can be played on real hardware! At this point I think it's in the level up patch. I should have some time to take a look tonight.

If you're impatient and want a pre-release build to beta, shoot me a PM!
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ FastROM bug fixed! ...kinda.
Post by: TimeSpaceMage on April 10, 2018, 05:05:09 pm
Well, I found the source of the Heal crash! This one's my bad  :-X
Turns out two of the spell animations I used make the game crash in no$sns, the white swirl for Heal spells and the white-blue swirl for Sleep.
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ FastROM bug fixed! ...kinda.
Post by: sluffy on April 10, 2018, 07:22:43 pm
no$sns is buggy in its own ways, that doesn't happen elsewhere. That's from enough Canoe emu patch testing.


rainponcho did an amazing enough job fastrom'ing this game. I can't come close to the same optimizations. The actual renderer seems too rigid to make any faster. Without cheating using sa-1 which would kill most hardware enthusiasts.
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ FastROM bug fixed! ...kinda.
Post by: PersianImm0rtal on April 12, 2018, 01:10:34 am
Just wanted to let you know I tried the latest beta you sent me, and it froze on a black screen after a few minutes after a few battles.


Tried starting a new game, and it freezes right after the beginning cutscene on a black screen, right after it says "Chapter One".

However, my save seems to work fine when I go back to the unhacked Arcana.
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ FastROM bug fixed! ...kinda.
Post by: Time/SpaceMage on April 15, 2018, 10:02:03 am
Whoa, really? Maybe I did a bad patch job. I'll run it myself when I get off work but I swear I double checked it before sending.
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ FastROM bug fixed! ...kinda.
Post by: SCO on April 18, 2018, 05:34:33 am
He didn't say in what emulator was this.
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ FastROM bug fixed! ...kinda.
Post by: Time/SpaceMage on April 18, 2018, 07:38:59 am
Persian isn't using an emulator; he has a flash cart (Super UFO Pro 8 ).
And I patched it right, so one of those changes broke things. It softlocks for me too. Why spell animations would affect the first loading screen is beyond me... I'll fiddle around with it.
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ FastROM bug fixed! ...kinda.
Post by: firedropdl on April 22, 2018, 10:34:01 am
This one is pretty exciting man.  Looking forward to playing it someday whenever I get around to fiddling with SNES stuff.  Me and my bros got this cart from Funcoland back in the day and loved it.  Thanks for your effort.  :)
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ FastROM bug fixed! ...kinda.
Post by: PersianImm0rtal on May 13, 2018, 09:45:43 pm
Let me know when you need me to test the next beta version  ;D ;)
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ FastROM bug fixed! ...kinda.
Post by: TimeSpaceMage on July 04, 2018, 04:56:57 pm
I'm back, bitches!  :laugh:
Thanks to LSA's IPS Patch Checker (http://www.romhacking.net/utilities/1080/), I found an incompatible byte between Levelup v0.3 and FastROM v0.3. After editing the IPS files, it turns out FastROM was wrong again  :crazy:
Here's the updated version, works on vanilla: FastROM v0.4 patch (unheadered) (https://drive.google.com/open?id=1scgehyU9EoBLVKTkiDHxXR0JOkKJPCn2)

So this means... we're back in business again! Seal of Rimsala is on v0.96 and in testing. I'll have time this month to work on the script, and barring anything happening I'd like to release by the end of the month! It's been a long and crazy ride  :beer:
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ FastROM bug fixed! For realsies!
Post by: TheSiege on July 13, 2018, 06:41:27 pm
Can anyone provide a link for the level up patch? The links no longer work.
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ FastROM bug fixed! For realsies!
Post by: Time/SpaceMage on July 19, 2018, 07:30:33 am
Can anyone provide a link for the level up patch? The links no longer work.
So sorry for the delay! I must have missed the topic reply notification. Persian if you're reading this, could you post your test results here?

Levelup v0.3 (https://drive.google.com/file/d/0B8HyspHa_gHaQjc4Z2wxaFVGa00/view?usp=drivesdk)

Almost finished Ch.4s script! There are still a couple lines that sound way too vague and I'm deciding what to do with them.
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ Fixing gfx bug, then release
Post by: TimeSpaceMage on July 29, 2018, 12:11:01 am
Okay, so the dungeon graphics glitch is still alive and well in Snes9x 1.51, 1.55 and 1.56. I was hoping for a July release, but it's better if it's postponed until this gets hit on the head.

So it's the FastROM patch again  :huh: I'll have to use trial and error to narrow it down, but at least my script and levelup v0.3 aren't affecting anything.
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ Fixing gfx bug, then release
Post by: PersianImm0rtal on August 05, 2018, 03:40:38 pm
Okay, so I finally got around to playing the latest beta version sent to me, and it seems to be working pretty good.

When I first loaded my save from my Super UFO Pro 8 flashcart and got into the dungeon (Forest of Doubt in Chapter 2) I got a slight graphics glitch, but as soon as I got into a fight it went away permanently. Man this game is fun, and I really enjoy the low encounter rate! It's just enough where it doesn't get too annoying and make you want to quit, because you want to know what's just around the next corner and down the hall. All of the boss battles are tough, and close fights, but not impossible... don't really need to grind much, but there is still strategy. Makes the game VERY enjoyable!! Plus the music is really really good.

BTW, did you change Zerel's name to Zero? I just got to Chapter 3! Not sure if I should keep playing... or wait for the next version. Let me know.

Man... we need more easy patches on old 90s RPGs like this.
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ Fixing gfx bug, then release
Post by: Time/SpaceMage on August 05, 2018, 05:47:26 pm
Awesome, so 0.96 works on flashcart?! Could you start a new game and check from there in case SRAM is affecting anything?

The dialogue should be good for all of Ch 3. TheSiege and I were brainstorming ideas for the rest, but we were having trouble with graphics bugs in other versions of Snes9x and in BizHawk. I really want to get to the bottom of this bc this project has been waiting on release for way too long!
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ Fixing gfx bug, then release
Post by: PersianImm0rtal on August 05, 2018, 10:46:08 pm
Ok I'll check starting from a new game. If I go on to chapter 4 does the encounter rate stay low or does it change because you haven't gotten that far yet?
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ Fixing gfx bug, then release
Post by: Time/SpaceMage on August 06, 2018, 01:03:29 am
Encounter rate is global afaik. Since 0.96 I made more script changes and it's nice to have someone check them for displaying properly (you have to insert the line breaks manually). TheSiege gave me feedback there so you can go on and beat the game, but I'd like it if you could hold off on beating Ch 3. I'm planning on making some interesting treasure changes, and I made a forgettable boss a bit challenging (who casts Smash 1 in Chapter 4?!)

Btw, this feature was in the original: some equipment can be used in battle to cast spells.
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ Fixing gfx bug, then release
Post by: TheSiege on August 07, 2018, 10:24:11 pm
(who casts Smash 1 in Chapter 4?!)


The kind of boss that lets me pass by at level 14
Spoiler:
especially when he shows up later alongside his even stronger counterpart
:thumbsup:

Spoiler:
Seeing as Darah now casts Lightning 2 in the latest patch as opposed to Smash 1, I've decided to amend what I wrote about the battle previously. The battle against Darah alone seems more reasonable now, especially when you compare it to the infinitely harder Hydra battle from the previous chapter. Darah also now has 500 HP and Barah has 750 HP. Both of these changes are very welcome in creating a balance in both battles that simply didn't exist before.

Here's a bit of a pro-tip. The elements go in a cycle of weakness: Wind < Fire < Water < Earth < Wind. From what I understand, if you don't have an element, then you have a 25% resistance against all elements. Normally you'll want to change the team's attribute to make you both attack harder and take less damage. However, in a case that an enemy is attacking with a spell using an element that is on the opposite end of the spectrum, it's better to do nothing and retain that 25% resistance.

Edit: Made the entire comment a spoiler alert as opposed to just the suggestion and corrected a few mistakes.
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ Fixing gfx bug, then release
Post by: TheSiege on August 30, 2018, 07:56:46 pm
So I've been playing the Japanese version of this recently, and I've noticed a lot of translation errors in the game. I figured I'd post my translations here.

Equipment:
The Desiree is actually the Ragnarok
The Flying Axe = Francisca
The Giant Sword = Strongest (Best) Sword
Grand = The Strongest (Good change)
Demon = Devil (Not sure why you changed it to Medusa Axe when it's weak against Medusa)
Battle Hammer = Warhammer
Blackthorne Whip = Thorn Whip
Wish Wand = Soul Wand
Memory Wand = Wand (It's just a wand)
Scimitar = Buster Sword (This is a translation that I actually agree with, but consistency is fine too)
Seam Mail = Splint Mail
Mithril = Silver (I'm guessing the translator was at least somewhat familiar with Tolkien's work, but decided to keep the Robe as Silver)
Rococo Armor = Gorgeous Mail (rococo is a very fancy word for "Antique")
Robe of Valor = Mage Robe
Shaman Robe = Sacred Robe
Caeser Shield = Kaiser Shield
Gauntlet = Bracelet (Armlet)

Monsters (by area):
Barnia Temple = Barniba Temple
Gurgeon = Chimera
Hound = Dog
Lupus = Wolf
Jell = Pudding
Saurian = Valium/Barium (I 100% agree with the change)

Draven Pass = Dwarven Pass
Forest of Doubt = Lost Woods
Crimson Valley = Red Valley
Trunk Man = Dryad
Flytrap = Cloud (Funny thing to note is that means that Cloud and the Buster Sword are both in this game)
Huetree = Tree with a Face
Wolfsbane = Aconite (both mean the same thing)Zerel = Zero (which I believe you caught already)

Jeru = Gel (pretty obvious one)
Manteco = Manticore
Raiton = Lute
Bajis = Basilisk
Undead = Zombie
Sauza = Sauzer/Salza/Souther (common Japanese antagonist name, also featured in Dragon Ball Z as "Salza" and Fist of the North Star as "Souther", both with the same Japanese Romanji spelling)

Stavery Tower = Endless/Topless Tower
Jara = Wight
Fult = Ghoul
Reach = Lich
Aurane = Alraune
Rilus - Lilith
Merlini = Sorcerer
Nostrus = Knight
Darah = Durham
Barah = Balam
Ariel = Alan

Bintel Castle = Byzantine Castle
Shaman = Bishop
Karul = Karura (Carla)
A Tunnel = Underpass
Desurin = Death Lich
Minotaurus = Minotaur (just minotaur)
Rimsala = Rimsalia

Magic:
Most of the translations for spells are serviceable, so I'll just do the more noteworthy ones.
Restore All (Marid) = Mist of Purification
HP Restore All (Marid) = Sparkling Water Therapy
HP Restore (Ifrite) = Flame of Life
Destroy (Ifrite) = Death
Change to x Attribute = Whirlwand Wall, Stone Wall, Flame Wall, and Water Wall
Restoration of Spirit = Elemental Prayer
Home = Interdimensional Portal

And now the moment you've been waiting for: Attribute spells
Sky Blast
Flame Windmill
Ice Vacuum
Hellfire Lava
Soil Dragon
Ice Flame Slash
Ice Crushing Storm
Lava Storm
Ice Flame Tornado
Thermonuclear Explosion
Explosion of Heaven and Earth
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ Fixing gfx bug, then release
Post by: Time/SpaceMage on August 31, 2018, 09:21:18 pm
Spoiler:
Seeing as Darah now casts Lightning 2 in the latest patch as opposed to Smash 1, I've decided to amend what I wrote about the battle previously. The battle against Darah alone seems more reasonable now, especially when you compare it to the infinitely harder Hydra battle from the previous chapter. Darah also now has 500 HP and Barah has 750 HP. Both of these changes are very welcome in creating a balance in both battles that simply didn't exist before.

Here's a bit of a pro-tip. The elements go in a cycle of weakness: Wind < Fire < Water < Earth < Wind. From what I understand, if you don't have an element, then you have a 25% resistance against all elements. Normally you'll want to change the team's attribute to make you both attack harder and take less damage. However, in a case that an enemy is attacking with a spell using an element that is on the opposite end of the spectrum, it's better to do nothing and retain that 25% resistance.

Edit: Made the entire comment a spoiler alert as opposed to just the suggestion and corrected a few mistakes.
Just noticed your edit >.>
Really good to hear the balance worked out well. Yeah Hydra is crazy hard with Level Select. I pretty much have to come loaded with Water Cards. I didn't have a figure for element-less resistance, so that's really good to know. Btw if I ever figure out how to copy and edit spells, I'd LOVE to give Rooks a "Change Attr. to None" spell. Of course it still wouldn't affect the spirits nor elemental equipment, but I bet it would make battles more dynamic. If enemies got a simple AI for say, multiple spells, it would make battles more interesting! There really aren't enough enemies throwing debuffs around like lowering your defense.

It bugs me that some of the Mithril equipment resists undead but not all of it; there's gonna be more consistency when I get done with it!
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ Fixing gfx bug, then release
Post by: TheSiege on September 01, 2018, 01:47:56 pm
Actually, it turns out that the information about 25% resistance could very well be incorrect. I just saw another guide here that I've been testing and finding to be more accurate here: http://mikesrpgcenter.com/arcana/attributes.html

No attribute takes 100% from all. Same attributes are 80%, advantages are 160%/40%, and opposite attributes are 120%

Opposite attributes are Wind/Water and Fire/Earth, so for example
Spoiler:
Changing Attribute to Wind against Darah will have you doing 120% damage to him, but only take 80% from his newly found Lightning 2 spell (or only 40% from his Smash 1 spell if you're playing the original), but you wouldn't want to do that before defeating Barah as he can get a lucky critical and potentially end your game.

I first noticed this when I was able to one shot a Gurgeon/Chimera as a none attribute, but could no longer do so after matching its attribute.
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ Fixing gfx bug, then release
Post by: Time/SpaceMage on September 02, 2018, 11:19:14 am
Actually, it turns out that the information about 25% resistance could very well be incorrect. I just saw another guide here that I've been testing and finding to be more accurate here: http://mikesrpgcenter.com/arcana/attributes.html

No attribute takes 100% from all. Same attributes are 80%, advantages are 160%/40%, and opposite attributes are 120%

Opposite attributes are Wind/Water and Fire/Earth, so for example
Spoiler:
Changing Attribute to Wind against Darah will have you doing 120% damage to him, but only take 80% from his newly found Lightning 2 spell (or only 40% from his Smash 1 spell if you're playing the original), but you wouldn't want to do that before defeating Barah as he can get a lucky critical and potentially end your game.

I first noticed this when I was able to one shot a Gurgeon/Chimera as a none attribute, but could no longer do so after matching its attribute.

That's a really interesting find. So if 80% damage is "normal" to spirits, resistance is 0.5x, opposites are 1.5x and weaknesses are 2x. I wonder how these multipliers are implemented bitwise? Oh, and any idea how damage is done when multiple elements are involved? I get the feeling damage is lower than it should be. Also, he lists Rimsala as having all elements but her data says she's elementless. Maybe the fight would be more interesting if she was 0F instead of 00... Just realized nobody actually learns Revitalize (heals Paralysis) either. I thought Sylph would have it?

If I ever make a second quest, it is totally going to go full-on parody for misread Japanese and so on  :laugh: Join Looks and his rare blue Sylph on their adventure to stop Gallon from reviving the evil Rimless in the tower of Rim-seala  :D

Title: Re: Arcana - Seal of Rimsala! (SNES) ~ Fixing gfx bug, then release
Post by: TheSiege on September 05, 2018, 11:14:23 pm
From what I understand, Rimsalia herself has a special attribute that has her take extra damage from the sword you're using.

I don't think anyone in your group ever gets paralyzed. Petrify seems to exist for story purposes only. The only thing left is sleep. This means that tents don't do everything they're advertised to do.
One funny side effect of this is that it's possible to get the unpetrify spell for rooks after he's already cast it.

Join Luke and Sarah as they slay a cloud with his trusty buster sword.
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ Fixing gfx bug, then release
Post by: PersianImm0rtal on February 05, 2019, 02:51:59 pm
Any new developmentts lately?
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ Fixing gfx bug, then release
Post by: Sarah Shinespark on February 06, 2019, 10:06:36 am
Yep! Last night I found where the dungeon music IDs are stored. There's a separate byte for each floor of every dungeon, and on a side note I also found the code that checks whether Darwin is in your party so it plays his theme instead :3

...Oh I forgot I was gonna start with the same av. This is Time/SpaceMage on my new account~☆
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ Fixing gfx bug, then release
Post by: Sarah Shinespark on March 17, 2019, 03:07:57 pm
Okay, so the big graphics issue is not on Geiger's Debugger, but IS on Snes9x 1.51 (which it's based on) :huh:, and the bug is exactly the same on multiple later versions including 1.59.2. Also, no$sns has a similar bug but in a different area. I read through the changelog for the Debugger and didn't see anything jump out at me, but looking deeper into that is probably going to involve comparing 9yo source code. I usually stop to reevaluate my options before doing a depth-first search, so I'll go over it here.

Here's what the bug looks like (1) after entering the Chapter 2 area and (2) halfway through turning.
(https://i.ibb.co/GthPgh6/Arcana-Seal-of-Rimsala-v0-98a-fr4s-lv3000.png)(https://i.ibb.co/7X5r5K1/Arcana-Seal-of-Rimsala-v0-98a-fr4s-lv3002.png)

Opening and closing the map redraws the center area, but leaves a line at the bottom. I tried switching characters and the corruption is on a different BG layer (BG2), so Rooks' face is just covered up and definitely not eight eaten by Missingno.
(https://i.ibb.co/GdK7gfR/Arcana-Seal-of-Rimsala-v0-98a-fr4s-lv3001.png)

Finishing a battle fully redraws the screen, but then opening and closing the map again leaves a line at the bottom! Other than that, the bug is gone until you leave and re-enter the start of the area again.
(https://i.ibb.co/Mn8XHvG/Arcana-Seal-of-Rimsala-v0-98a-fr4s-lv3003.png)(https://i.ibb.co/RjHHqj2/Arcana-Seal-of-Rimsala-v0-98a-fr4s-lv3004.png)

Also for comparison, here's what it looks like in no$sns:
(https://i.ibb.co/zZTdzFB/Arcana-Seal-of-Rimsala-v0-98a-fr4s-lv3005.png)


Annnd the issues in nocash are coming from the FastROM patch. Well isn't that nice? The code written by rainponcho who isn't here any more is still haunting me... any ideas where I should look?


Also on a separate topic, I'm going through the code for loading an item's health value. Now finding it was no issue, but I've been seeing an awful lot of the sub $C88B and I want to figure out wth it's doing!

Code: [Select]
**Load 2-byte health of Silver Flask (15) from ROM
$00/9B09 A7 10       LDA [$10]  [$05:F234]   A:0001 X:0022 Y:F230 D:1E00 DB:80 S:1FF0 P:eNvmxdIzc HC:1304 VC:256 FC:56 I:00
$00/9B0B E6 10       INC $10    [$00:1E10]   A:000F X:0022 Y:F230 D:1E00 DB:80 S:1FF0 P:envmxdIzc HC:1368 VC:256 FC:56 I:00
$00/9B0D 6B          RTL                     A:000F X:0022 Y:F230 D:1E00 DB:80 S:1FF0 P:eNvmxdIzc HC:0066 VC:257 FC:56 I:00


**Save our value in $00
$87/BC46 85 00       STA $00    [$00:1E00]   A:000F X:0022 Y:F230 D:1E00 DB:80 S:1FF3 P:eNvmxdIzc HC:0116 VC:257 FC:56 I:00
$87/BC48 22 F8 9A 00 JSL $009AF8[$00:9AF8]   A:000F X:0022 Y:F230 D:1E00 DB:80 S:1FF3 P:eNvmxdIzc HC:0150 VC:257 FC:56 I:00

**Load whatever's the next byte after that
$00/9AF8 E6 10       INC $10    [$00:1E10]   A:000F X:0022 Y:F230 D:1E00 DB:80 S:1FF0 P:eNvmxdIzc HC:0206 VC:257 FC:56 I:00
$00/9AFA A7 10       LDA [$10]  [$05:F236]   A:000F X:0022 Y:F230 D:1E00 DB:80 S:1FF0 P:eNvmxdIzc HC:0292 VC:257 FC:56 I:00
$00/9AFC 29 FF 00    AND #$00FF              A:070C X:0022 Y:F230 D:1E00 DB:80 S:1FF0 P:envmxdIzc HC:0356 VC:257 FC:56 I:00
$00/9AFF 6B          RTL                     A:000C X:0022 Y:F230 D:1E00 DB:80 S:1FF0 P:envmxdIzc HC:0388 VC:257 FC:56 I:00

**Put my bytes "000F" in A and the next 1 byte in X
$87/BC4C AA          TAX                     A:000C X:0022 Y:F230 D:1E00 DB:80 S:1FF3 P:envmxdIzc HC:0438 VC:257 FC:56 I:00
$87/BC4D 5C AE C2 00 JMP $00C2AE[$00:C2AE]   A:000C X:000C Y:F230 D:1E00 DB:80 S:1FF3 P:envmxdIzc HC:0456 VC:257 FC:56 I:00
$00/C2AE A5 00       LDA $00    [$00:1E00]   A:000C X:000C Y:F230 D:1E00 DB:80 S:1FF3 P:envmxdIzc HC:0488 VC:257 FC:56 I:00
$00/C2B0 20 A1 C8    JSR $C8A1  [$00:C8A1]   A:000F X:000C Y:F230 D:1E00 DB:80 S:1FF3 P:envmxdIzc HC:0528 VC:257 FC:56 I:00


$00/C8A1 85 22       STA $22    [$00:1E22]   A:000F X:000C Y:F230 D:1E00 DB:80 S:1FF1 P:envmxdIzc HC:0622 VC:257 FC:56 I:00
$00/C8A3 20 8B C8    JSR $C88B  [$00:C88B]   A:000F X:000C Y:F230 D:1E00 DB:80 S:1FF1 P:envmxdIzc HC:0662 VC:257 FC:56 I:00


**Okay so here $C88B puts A&X in one byte then multiplies by X... and returns the low byte.
**(256*A + X) * X mod 256
**Does this look like a familiar function to anyone, maybe floating point math?
$00/C88B 29 FF 00    AND #$00FF              A:000F X:000C Y:F230 D:1E00 DB:80 S:1FEF P:envmxdIzc HC:0716 VC:257 FC:56 I:00
$00/C88E EB          XBA                     A:000F X:000C Y:F230 D:1E00 DB:80 S:1FEF P:envmxdIzc HC:0748 VC:257 FC:56 I:00
$00/C88F 85 20       STA $20    [$00:1E20]   A:0F00 X:000C Y:F230 D:1E00 DB:80 S:1FEF P:envmxdIZc HC:0776 VC:257 FC:56 I:00
$00/C891 8A          TXA                     A:0F00 X:000C Y:F230 D:1E00 DB:80 S:1FEF P:envmxdIZc HC:0816 VC:257 FC:56 I:00
$00/C892 29 FF 00    AND #$00FF              A:000C X:000C Y:F230 D:1E00 DB:80 S:1FEF P:envmxdIzc HC:0838 VC:257 FC:56 I:00
$00/C895 05 20       ORA $20    [$00:1E20]   A:000C X:000C Y:F230 D:1E00 DB:80 S:1FEF P:envmxdIzc HC:0870 VC:257 FC:56 I:00
$00/C897 8D 02 42    STA $4202  [$80:4202]   A:0F0C X:000C Y:F230 D:1E00 DB:80 S:1FEF P:envmxdIzc HC:0910 VC:257 FC:56 I:00
$00/C89A EA          NOP                     A:0F0C X:000C Y:F230 D:1E00 DB:80 S:1FEF P:envmxdIzc HC:0954 VC:257 FC:56 I:00
$00/C89B EA          NOP                     A:0F0C X:000C Y:F230 D:1E00 DB:80 S:1FEF P:envmxdIzc HC:0976 VC:257 FC:56 I:00
$00/C89C EA          NOP                     A:0F0C X:000C Y:F230 D:1E00 DB:80 S:1FEF P:envmxdIzc HC:0998 VC:257 FC:56 I:00
$00/C89D AD 16 42    LDA $4216  [$80:4216]   A:0F0C X:000C Y:F230 D:1E00 DB:80 S:1FEF P:envmxdIzc HC:1020 VC:257 FC:56 I:00
$00/C8A0 60          RTS                     A:00B4 X:000C Y:F230 D:1E00 DB:80 S:1FEF P:envmxdIzc HC:1064 VC:257 FC:56 I:00

** Ok so it saves that result (the low byte of the multiplication) in $24 and then switches to the 2nd byte (00) and repeats C88B...
$00/C8A6 85 24       STA $24    [$00:1E24]   A:00B4 X:000C Y:F230 D:1E00 DB:80 S:1FF1 P:envmxdIzc HC:1114 VC:257 FC:56 I:00
$00/C8A8 A5 22       LDA $22    [$00:1E22]   A:00B4 X:000C Y:F230 D:1E00 DB:80 S:1FF1 P:envmxdIzc HC:1154 VC:257 FC:56 I:00
$00/C8AA EB          XBA                     A:000F X:000C Y:F230 D:1E00 DB:80 S:1FF1 P:envmxdIzc HC:1194 VC:257 FC:56 I:00
$00/C8AB 20 8B C8    JSR $C88B  [$00:C88B]   A:0F00 X:000C Y:F230 D:1E00 DB:80 S:1FF1 P:envmxdIZc HC:1222 VC:257 FC:56 I:00


$00/C88B 29 FF 00    AND #$00FF              A:0F00 X:000C Y:F230 D:1E00 DB:80 S:1FEF P:envmxdIZc HC:1276 VC:257 FC:56 I:00
$00/C88E EB          XBA                     A:0000 X:000C Y:F230 D:1E00 DB:80 S:1FEF P:envmxdIZc HC:1308 VC:257 FC:56 I:00
$00/C88F 85 20       STA $20    [$00:1E20]   A:0000 X:000C Y:F230 D:1E00 DB:80 S:1FEF P:envmxdIZc HC:1336 VC:257 FC:56 I:00
$00/C891 8A          TXA                     A:0000 X:000C Y:F230 D:1E00 DB:80 S:1FEF P:envmxdIZc HC:0012 VC:258 FC:56 I:00
$00/C892 29 FF 00    AND #$00FF              A:000C X:000C Y:F230 D:1E00 DB:80 S:1FEF P:envmxdIzc HC:0034 VC:258 FC:56 I:00
$00/C895 05 20       ORA $20    [$00:1E20]   A:000C X:000C Y:F230 D:1E00 DB:80 S:1FEF P:envmxdIzc HC:0066 VC:258 FC:56 I:00
$00/C897 8D 02 42    STA $4202  [$80:4202]   A:000C X:000C Y:F230 D:1E00 DB:80 S:1FEF P:envmxdIzc HC:0106 VC:258 FC:56 I:00
$00/C89A EA          NOP                     A:000C X:000C Y:F230 D:1E00 DB:80 S:1FEF P:envmxdIzc HC:0150 VC:258 FC:56 I:00
$00/C89B EA          NOP                     A:000C X:000C Y:F230 D:1E00 DB:80 S:1FEF P:envmxdIzc HC:0172 VC:258 FC:56 I:00
$00/C89C EA          NOP                     A:000C X:000C Y:F230 D:1E00 DB:80 S:1FEF P:envmxdIzc HC:0194 VC:258 FC:56 I:00
$00/C89D AD 16 42    LDA $4216  [$80:4216]   A:000C X:000C Y:F230 D:1E00 DB:80 S:1FEF P:envmxdIzc HC:0216 VC:258 FC:56 I:00
$00/C8A0 60          RTS                     A:0000 X:000C Y:F230 D:1E00 DB:80 S:1FEF P:envmxdIZc HC:0260 VC:258 FC:56 I:00

** And then it adds those two together. At first I thought it was finding the low byte and the high byte in 2 separate calls,
but no it's just throwing out the high byte in both. What?
$00/C8AE 85 22       STA $22    [$00:1E22]   A:0000 X:000C Y:F230 D:1E00 DB:80 S:1FF1 P:envmxdIZc HC:0310 VC:258 FC:56 I:00
$00/C8B0 29 00 FF    AND #$FF00              A:0000 X:000C Y:F230 D:1E00 DB:80 S:1FF1 P:envmxdIZc HC:0350 VC:258 FC:56 I:00
$00/C8B3 EB          XBA                     A:0000 X:000C Y:F230 D:1E00 DB:80 S:1FF1 P:envmxdIZc HC:0382 VC:258 FC:56 I:00
$00/C8B4 AA          TAX                     A:0000 X:000C Y:F230 D:1E00 DB:80 S:1FF1 P:envmxdIZc HC:0410 VC:258 FC:56 I:00
$00/C8B5 A5 22       LDA $22    [$00:1E22]   A:0000 X:0000 Y:F230 D:1E00 DB:80 S:1FF1 P:envmxdIZc HC:0432 VC:258 FC:56 I:00
$00/C8B7 29 FF 00    AND #$00FF              A:0000 X:0000 Y:F230 D:1E00 DB:80 S:1FF1 P:envmxdIZc HC:0472 VC:258 FC:56 I:00
$00/C8BA EB          XBA                     A:0000 X:0000 Y:F230 D:1E00 DB:80 S:1FF1 P:envmxdIZc HC:0504 VC:258 FC:56 I:00
$00/C8BB 18          CLC                     A:0000 X:0000 Y:F230 D:1E00 DB:80 S:1FF1 P:envmxdIZc HC:0532 VC:258 FC:56 I:00
$00/C8BC 65 24       ADC $24    [$00:1E24]   A:0000 X:0000 Y:F230 D:1E00 DB:80 S:1FF1 P:envmxdIZc HC:0594 VC:258 FC:56 I:00
$00/C8BE 90 01       BCC $01    [$C8C1]      A:00B4 X:0000 Y:F230 D:1E00 DB:80 S:1FF1 P:envmxdIzc HC:0634 VC:258 FC:56 I:00
$00/C8C1 60          RTS                     A:00B4 X:0000 Y:F230 D:1E00 DB:80 S:1FF1 P:envmxdIzc HC:0664 VC:258 FC:56 I:00

And after this it... does something with A and X, then loops eleven times doing a bunch of shift operations and EORs to make
a very large number that it doesn't seem to use.
What??

Oh, and sometimes healing items will be 1 off what their value states.
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ Fixing gfx bug, then release
Post by: justin3009 on March 17, 2019, 08:58:46 pm
I'm slightly confused by the code here.

I assume the FastROM patch is on that already, but why is it jumping back to $00 instead of $80 like it normally would for FastROM? Seems like it missed some JMPs/JSL's and stuff along the way.

I would assume the healing being 1 digit off is due to a CLC missing somewhere but I'm not sure. Seems like some very strange oddities.
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ Fixing gfx bug, then release
Post by: Sarah Shinespark on March 17, 2019, 11:21:53 pm
I assume the FastROM patch is on that already, but why is it jumping back to $00 instead of $80 like it normally would for FastROM? Seems like it missed some JMPs/JSL's and stuff along the way.

I would assume the healing being 1 digit off is due to a CLC missing somewhere but I'm not sure. Seems like some very strange oddities.
Yeah, it didn't catch everything. I'll see about manually fixing some of them while I'm going through trace logs. Not sure I should be touching this, but the PLB is what's changing the bank for awhile. I'd NOP it but I assume I'd have to find a corresponding PHB to avoid a potential stack overflow. Thoughts?
Code: [Select]
$80/88ED AD 20 00    LDA $0020  [$80:0020]   A:FF00 X:0028 Y:0009 D:1E00 DB:80 S:1FED P:envMxdIZC HC:1308 VC:224 FC:15 I:00
$80/88F0 F0 FB       BEQ $FB    [$88ED]      A:FF00 X:0028 Y:0009 D:1E00 DB:80 S:1FED P:envMxdIZC HC:1340 VC:224 FC:15 I:00
$80/88ED AD 20 00    LDA $0020  [$80:0020]   A:FF00 X:0028 Y:0009 D:1E00 DB:80 S:1FED P:envMxdIZC HC:1364 VC:224 FC:15 I:00
$00/8335 C2 30       REP #$30                A:FF00 X:0028 Y:0009 D:1E00 DB:80 S:1FE9 P:envMxdIZC HC:0094 VC:225 FC:15 I:00
$00/8337 48          PHA                     A:FF00 X:0028 Y:0009 D:1E00 DB:80 S:1FE9 P:envmxdIZC HC:0124 VC:225 FC:15 I:00
$00/8338 DA          PHX                     A:FF00 X:0028 Y:0009 D:1E00 DB:80 S:1FE7 P:envmxdIZC HC:0162 VC:225 FC:15 I:00
$00/8339 5A          PHY                     A:FF00 X:0028 Y:0009 D:1E00 DB:80 S:1FE5 P:envmxdIZC HC:0200 VC:225 FC:15 I:00
$00/833A 0B          PHD                     A:FF00 X:0028 Y:0009 D:1E00 DB:80 S:1FE3 P:envmxdIZC HC:0238 VC:225 FC:15 I:00
$00/833B F4 00 00    PEA $0000               A:FF00 X:0028 Y:0009 D:1E00 DB:80 S:1FE1 P:envmxdIZC HC:0276 VC:225 FC:15 I:00
$00/833E 2B          PLD                     A:FF00 X:0028 Y:0009 D:1E00 DB:80 S:1FDF P:envmxdIZC HC:0324 VC:225 FC:15 I:00
$00/833F 8B          PHB                     A:FF00 X:0028 Y:0009 D:0000 DB:80 S:1FE1 P:envmxdIZC HC:0368 VC:225 FC:15 I:00
$00/8340 4B          PHK                     A:FF00 X:0028 Y:0009 D:0000 DB:80 S:1FE0 P:envmxdIZC HC:0398 VC:225 FC:15 I:00
$00/8341 AB          PLB                     A:FF00 X:0028 Y:0009 D:0000 DB:80 S:1FDF P:envmxdIZC HC:0428 VC:225 FC:15 I:00
$00/8342 E2 20       SEP #$20                A:FF00 X:0028 Y:0009 D:0000 DB:00 S:1FE0 P:envmxdIZC HC:0464 VC:225 FC:15 I:00
$00/8344 AD 10 42    LDA $4210  [$00:4210]   A:FF00 X:0028 Y:0009 D:0000 DB:00 S:1FE0 P:envMxdIZC HC:0494 VC:225 FC:15 I:00
$00/8347 E6 20       INC $20    [$00:0020]   A:FFC2 X:0028 Y:0009 D:0000 DB:00 S:1FE0 P:eNvMxdIzC HC:0532 VC:225 FC:15 I:00
$00/8349 C2 20       REP #$20                A:FFC2 X:0028 Y:0009 D:0000 DB:00 S:1FE0 P:envMxdIzC HC:0618 VC:225 FC:15 I:00
$00/834B AD 55 10    LDA $1055  [$00:1055]   A:FFC2 X:0028 Y:0009 D:0000 DB:00 S:1FE0 P:envmxdIzC HC:0648 VC:225 FC:15 I:00
$00/834E D0 03       BNE $03    [$8353]      A:0000 X:0028 Y:0009 D:0000 DB:00 S:1FE0 P:envmxdIZC HC:0696 VC:225 FC:15 I:00
$00/8350 20 79 83    JSR $8379  [$00:8379]   A:0000 X:0028 Y:0009 D:0000 DB:00 S:1FE0 P:envmxdIZC HC:0720 VC:225 FC:15 I:00


There wouldn't be an Add Without Carry, would there... did a quick search through the instruction set but could've missed it if it didn't mention adding.

Oh, and look at this wonderful shit I found! Every battle stat being loaded into RAM  :woot!:
Also, I can edit: item heal amounts, honey stat boosts, bartender food heal amounts, and soon thanks to this code I'll have more comprehensive monster stats available! #ADHDforlife
Code: [Select]
$82/9147 BF 2D C9 85 LDA $85C92D,x[$85:C969] A:0008 X:003C Y:0008 D:1E00 DB:80 S:1FF3 P:envmxdIzc HC:0814 VC:089 FC:27 I:00
$82/914B 99 0B 12    STA $120B,y[$80:1213]   A:0000 X:003C Y:0008 D:1E00 DB:80 S:1FF3 P:envmxdIZc HC:0856 VC:089 FC:27 I:00
$82/914E BF CD C9 85 LDA $85C9CD,x[$85:CA09] A:0000 X:003C Y:0008 D:1E00 DB:80 S:1FF3 P:envmxdIZc HC:0902 VC:089 FC:27 I:00
$82/9152 99 23 12    STA $1223,y[$80:122B]   A:0060 X:003C Y:0008 D:1E00 DB:80 S:1FF3 P:envmxdIzc HC:0944 VC:089 FC:27 I:00
$82/9155 BF 95 CA 85 LDA $85CA95,x[$85:CAD1] A:0060 X:003C Y:0008 D:1E00 DB:80 S:1FF3 P:envmxdIzc HC:0990 VC:089 FC:27 I:00
$82/9159 99 3B 12    STA $123B,y[$80:1243]   A:0050 X:003C Y:0008 D:1E00 DB:80 S:1FF3 P:envmxdIzc HC:1032 VC:089 FC:27 I:00
$82/915C BF 35 CB 85 LDA $85CB35,x[$85:CB71] A:0050 X:003C Y:0008 D:1E00 DB:80 S:1FF3 P:envmxdIzc HC:1078 VC:089 FC:27 I:00
$82/9160 99 53 12    STA $1253,y[$80:125B]   A:0096 X:003C Y:0008 D:1E00 DB:80 S:1FF3 P:envmxdIzc HC:1154 VC:089 FC:27 I:00
$82/9163 BF D5 CB 85 LDA $85CBD5,x[$85:CC11] A:0096 X:003C Y:0008 D:1E00 DB:80 S:1FF3 P:envmxdIzc HC:1200 VC:089 FC:27 I:00
$82/9167 99 6B 12    STA $126B,y[$80:1273]   A:0006 X:003C Y:0008 D:1E00 DB:80 S:1FF3 P:envmxdIzc HC:1242 VC:089 FC:27 I:00
$82/916A BF 75 CC 85 LDA $85CC75,x[$85:CCB1] A:0006 X:003C Y:0008 D:1E00 DB:80 S:1FF3 P:envmxdIzc HC:1288 VC:089 FC:27 I:00
$82/916E 99 83 12    STA $1283,y[$80:128B]   A:00A6 X:003C Y:0008 D:1E00 DB:80 S:1FF3 P:envmxdIzc HC:1330 VC:089 FC:27 I:00
$82/9171 BF 15 CD 85 LDA $85CD15,x[$85:CD51] A:00A6 X:003C Y:0008 D:1E00 DB:80 S:1FF3 P:envmxdIzc HC:0012 VC:090 FC:27 I:00
$82/9175 99 9B 12    STA $129B,y[$80:12A3]   A:0002 X:003C Y:0008 D:1E00 DB:80 S:1FF3 P:envmxdIzc HC:0054 VC:090 FC:27 I:00
$82/9178 BF B5 CD 85 LDA $85CDB5,x[$85:CDF1] A:0002 X:003C Y:0008 D:1E00 DB:80 S:1FF3 P:envmxdIzc HC:0100 VC:090 FC:27 I:00
$82/917C 99 B3 12    STA $12B3,y[$80:12BB]   A:0009 X:003C Y:0008 D:1E00 DB:80 S:1FF3 P:envmxdIzc HC:0142 VC:090 FC:27 I:00
$82/917F BF 35 D0 85 LDA $85D035,x[$85:D071] A:0009 X:003C Y:0008 D:1E00 DB:80 S:1FF3 P:envmxdIzc HC:0188 VC:090 FC:27 I:00
$82/9183 99 7B 13    STA $137B,y[$80:1383]   A:0004 X:003C Y:0008 D:1E00 DB:80 S:1FF3 P:envmxdIzc HC:0230 VC:090 FC:27 I:00
$82/9186 BF F5 CE 85 LDA $85CEF5,x[$85:CF31] A:0004 X:003C Y:0008 D:1E00 DB:80 S:1FF3 P:envmxdIzc HC:0276 VC:090 FC:27 I:00
$82/918A 99 63 13    STA $1363,y[$80:136B]   A:000F X:003C Y:0008 D:1E00 DB:80 S:1FF3 P:envmxdIzc HC:0318 VC:090 FC:27 I:00
$82/918D BF 55 CE 85 LDA $85CE55,x[$85:CE91] A:000F X:003C Y:0008 D:1E00 DB:80 S:1FF3 P:envmxdIzc HC:0364 VC:090 FC:27 I:00
$82/9191 99 F3 12    STA $12F3,y[$80:12FB]   A:001C X:003C Y:0008 D:1E00 DB:80 S:1FF3 P:envmxdIzc HC:0412 VC:090 FC:27 I:00
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ Fixing gfx bug, then release
Post by: rookwield on March 20, 2019, 12:54:22 pm
I think you're doing an above-remarkable job, giving this game some fan service! Waiting for a release.


Checked the rainponcho fastrom patch on rhdn and encountered the garbage bug when leaving map view. A lot of guessing later, I found this one:
Code: [Select]
$80/882E 5C 2C FC 9F JMP $9FFC2C[$9F:FC2C]   A:8080 X:80E7 Y:80A7 D:1DF8 DB:7E S:1FE5 P:envMxdIZC HC:0996 VC:003 FC:25 I:00


$9F/FC2C C2 20       REP #$20                A:8080 X:80E7 Y:80A7 D:1DF8 DB:7E S:1FE5 P:envMxdIZC HC:1032 VC:003 FC:25 I:00
$9F/FC2E 8A          TXA                     A:8080 X:80E7 Y:80A7 D:1DF8 DB:7E S:1FE5 P:envmxdIZC HC:1062 VC:003 FC:25 I:00
$9F/FC2F BB          TYX                     A:80E7 X:80E7 Y:80A7 D:1DF8 DB:7E S:1FE5 P:eNvmxdIzC HC:1086 VC:003 FC:25 I:00
$9F/FC30 A8          TAY                     A:80E7 X:80A7 Y:80A7 D:1DF8 DB:7E S:1FE5 P:eNvmxdIzC HC:1110 VC:003 FC:25 I:00
$9F/FC31 8B          PHB                     A:80E7 X:80A7 Y:80E7 D:1DF8 DB:7E S:1FE5 P:eNvmxdIzC HC:1168 VC:003 FC:25 I:00
$9F/FC32 8B          PHB                     A:80E7 X:80A7 Y:80E7 D:1DF8 DB:7E S:1FE4 P:eNvmxdIzC HC:1200 VC:003 FC:25 I:00
$9F/FC33 68          PLA                     A:80E7 X:80A7 Y:80E7 D:1DF8 DB:7E S:1FE3 P:eNvmxdIzC HC:1232 VC:003 FC:25 I:00
$9F/FC34 C9 7F 7F    CMP #$7F7F              A:7E7E X:80A7 Y:80E7 D:1DF8 DB:7E S:1FE5 P:envmxdIzC HC:1278 VC:003 FC:25 I:00
$9F/FC37 F0 08       BEQ $08    [$FC41]      A:7E7E X:80A7 Y:80E7 D:1DF8 DB:7E S:1FE5 P:eNvmxdIzc HC:1308 VC:003 FC:25 I:00
$9F/FC39 A5 03       LDA $03    [$00:1DFB]   A:7E7E X:80A7 Y:80E7 D:1DF8 DB:7E S:1FE5 P:eNvmxdIzc HC:1332 VC:003 FC:25 I:00
$9F/FC3B 3A          DEC A                   A:0007 X:80A7 Y:80E7 D:1DF8 DB:7E S:1FE5 P:envmxdIzc HC:0014 VC:004 FC:25 I:00
$9F/FC3C 54 7E 7E    MVN 7E 7E               A:0006 X:80A7 Y:80E7 D:1DF8 DB:7E S:1FE5 P:envmxdIzc HC:0038 VC:004 FC:25 I:00
$9F/FC3C 54 7E 7E    MVN 7E 7E               A:0005 X:80A8 Y:80E8 D:1DF8 DB:7E S:1FE5 P:envmxdIzc HC:0096 VC:004 FC:25 I:00
$9F/FC3C 54 7E 7E    MVN 7E 7E               A:0004 X:80A9 Y:80E9 D:1DF8 DB:7E S:1FE5 P:envmxdIzc HC:0154 VC:004 FC:25 I:00
$9F/FC3C 54 7E 7E    MVN 7E 7E               A:0003 X:80AA Y:80EA D:1DF8 DB:7E S:1FE5 P:envmxdIzc HC:0212 VC:004 FC:25 I:00
$9F/FC3C 54 7E 7E    MVN 7E 7E               A:0002 X:80AB Y:80EB D:1DF8 DB:7E S:1FE5 P:envmxdIzc HC:0270 VC:004 FC:25 I:00
$9F/FC3C 54 7E 7E    MVN 7E 7E               A:0001 X:80AC Y:80EC D:1DF8 DB:7E S:1FE5 P:envmxdIzc HC:0328 VC:004 FC:25 I:00
$9F/FC3C 54 7E 7E    MVN 7E 7E               A:0000 X:80AD Y:80ED D:1DF8 DB:7E S:1FE5 P:envmxdIzc HC:0386 VC:004 FC:25 I:00
$9F/FC3F 80 06       BRA $06    [$FC47]      A:FFFF X:80AE Y:80EE D:1DF8 DB:7E S:1FE5 P:envmxdIzc HC:0444 VC:004 FC:25 I:00
$9F/FC47 BB          TYX                     A:FFFF X:80AE Y:80EE D:1DF8 DB:7E S:1FE5 P:envmxdIzc HC:0474 VC:004 FC:25 I:00
$9F/FC48 E2 20       SEP #$20                A:FFFF X:80EE Y:80EE D:1DF8 DB:7E S:1FE5 P:eNvmxdIzc HC:0498 VC:004 FC:25 I:00
$9F/FC4A 7A          PLY                     A:FFFF X:80EE Y:80EE D:1DF8 DB:7E S:1FE5 P:eNvMxdIzc HC:0528 VC:004 FC:25 I:00
$9F/FC4B 5C 7C 87 80 JMP $80877C[$80:877C]   A:FFFF X:80EE Y:006B D:1DF8 DB:7E S:1FE7 P:envMxdIzc HC:0614 VC:004 FC:25 I:00

which put back old code becomes this

Code: [Select]
$80/882E B9 00 00    LDA $0000,y[$7E:80A7]   A:8080 X:80E7 Y:80A7 D:1DF8 DB:7E S:1FE5 P:envMxdIZC HC:0986 VC:003 FC:44 I:00
$80/8831 9D 00 00    STA $0000,x[$7E:80E7]   A:804A X:80E7 Y:80A7 D:1DF8 DB:7E S:1FE5 P:envMxdIzC HC:1030 VC:003 FC:44 I:00


$80/882E B9 00 00    LDA $0000,y[$7E:80A7]   A:8080 X:80E7 Y:80A7 D:1DF8 DB:7E S:1FE5 P:envMxdIZC HC:0972 VC:003 FC:59 I:00
$80/8831 9D 00 00    STA $0000,x[$7E:80E7]   A:804A X:80E7 Y:80A7 D:1DF8 DB:7E S:1FE5 P:envMxdIzC HC:1016 VC:003 FC:59 I:00
$80/8834 C8          INY                     A:804A X:80E7 Y:80A7 D:1DF8 DB:7E S:1FE5 P:envMxdIzC HC:1060 VC:003 FC:59 I:00
$80/8835 E8          INX                     A:804A X:80E7 Y:80A8 D:1DF8 DB:7E S:1FE5 P:eNvMxdIzC HC:1084 VC:003 FC:59 I:00
$80/8836 C2 20       REP #$20                A:804A X:80E8 Y:80A8 D:1DF8 DB:7E S:1FE5 P:eNvMxdIzC HC:1108 VC:003 FC:59 I:00
$80/8838 C6 03       DEC $03    [$00:1DFB]   A:804A X:80E8 Y:80A8 D:1DF8 DB:7E S:1FE5 P:eNvmxdIzC HC:1172 VC:003 FC:59 I:00
$80/883A E2 20       SEP #$20                A:804A X:80E8 Y:80A8 D:1DF8 DB:7E S:1FE5 P:envmxdIzC HC:1240 VC:003 FC:59 I:00
$80/883C D0 F0       BNE $F0    [$882E]      A:804A X:80E8 Y:80A8 D:1DF8 DB:7E S:1FE5 P:envMxdIzC HC:1270 VC:003 FC:59 I:00
$80/882E B9 00 00    LDA $0000,y[$7E:80A8]   A:804A X:80E8 Y:80A8 D:1DF8 DB:7E S:1FE5 P:envMxdIzC HC:1300 VC:003 FC:59 I:00
$80/8831 9D 00 00    STA $0000,x[$7E:80E8]   A:80FF X:80E8 Y:80A8 D:1DF8 DB:7E S:1FE5 P:eNvMxdIzC HC:1344 VC:003 FC:59 I:00
$80/8834 C8          INY                     A:80FF X:80E8 Y:80A8 D:1DF8 DB:7E S:1FE5 P:eNvMxdIzC HC:0024 VC:004 FC:59 I:00
$80/8835 E8          INX                     A:80FF X:80E8 Y:80A9 D:1DF8 DB:7E S:1FE5 P:eNvMxdIzC HC:0048 VC:004 FC:59 I:00
$80/8836 C2 20       REP #$20                A:80FF X:80E9 Y:80A9 D:1DF8 DB:7E S:1FE5 P:eNvMxdIzC HC:0072 VC:004 FC:59 I:00
$80/8838 C6 03       DEC $03    [$00:1DFB]   A:80FF X:80E9 Y:80A9 D:1DF8 DB:7E S:1FE5 P:eNvmxdIzC HC:0102 VC:004 FC:59 I:00
$80/883A E2 20       SEP #$20                A:80FF X:80E9 Y:80A9 D:1DF8 DB:7E S:1FE5 P:envmxdIzC HC:0170 VC:004 FC:59 I:00
$80/883C D0 F0       BNE $F0    [$882E]      A:80FF X:80E9 Y:80A9 D:1DF8 DB:7E S:1FE5 P:envMxdIzC HC:0200 VC:004 FC:59 I:00
$80/882E B9 00 00    LDA $0000,y[$7E:80A9]   A:80FF X:80E9 Y:80A9 D:1DF8 DB:7E S:1FE5 P:envMxdIzC HC:0230 VC:004 FC:59 I:00
$80/8831 9D 00 00    STA $0000,x[$7E:80E9]   A:8008 X:80E9 Y:80A9 D:1DF8 DB:7E S:1FE5 P:envMxdIzC HC:0274 VC:004 FC:59 I:00
$80/8834 C8          INY                     A:8008 X:80E9 Y:80A9 D:1DF8 DB:7E S:1FE5 P:envMxdIzC HC:0318 VC:004 FC:59 I:00
$80/8835 E8          INX                     A:8008 X:80E9 Y:80AA D:1DF8 DB:7E S:1FE5 P:eNvMxdIzC HC:0342 VC:004 FC:59 I:00
$80/8836 C2 20       REP #$20                A:8008 X:80EA Y:80AA D:1DF8 DB:7E S:1FE5 P:eNvMxdIzC HC:0366 VC:004 FC:59 I:00
$80/8838 C6 03       DEC $03    [$00:1DFB]   A:8008 X:80EA Y:80AA D:1DF8 DB:7E S:1FE5 P:eNvmxdIzC HC:0396 VC:004 FC:59 I:00
$80/883A E2 20       SEP #$20                A:8008 X:80EA Y:80AA D:1DF8 DB:7E S:1FE5 P:envmxdIzC HC:0464 VC:004 FC:59 I:00
$80/883C D0 F0       BNE $F0    [$882E]      A:8008 X:80EA Y:80AA D:1DF8 DB:7E S:1FE5 P:envMxdIzC HC:0494 VC:004 FC:59 I:00
$80/882E B9 00 00    LDA $0000,y[$7E:80AA]   A:8008 X:80EA Y:80AA D:1DF8 DB:7E S:1FE5 P:envMxdIzC HC:0524 VC:004 FC:59 I:00
$80/8831 9D 00 00    STA $0000,x[$7E:80EA]   A:80FF X:80EA Y:80AA D:1DF8 DB:7E S:1FE5 P:eNvMxdIzC HC:0608 VC:004 FC:59 I:00
$80/8834 C8          INY                     A:80FF X:80EA Y:80AA D:1DF8 DB:7E S:1FE5 P:eNvMxdIzC HC:0652 VC:004 FC:59 I:00
$80/8835 E8          INX                     A:80FF X:80EA Y:80AB D:1DF8 DB:7E S:1FE5 P:eNvMxdIzC HC:0676 VC:004 FC:59 I:00
$80/8836 C2 20       REP #$20                A:80FF X:80EB Y:80AB D:1DF8 DB:7E S:1FE5 P:eNvMxdIzC HC:0700 VC:004 FC:59 I:00
$80/8838 C6 03       DEC $03    [$00:1DFB]   A:80FF X:80EB Y:80AB D:1DF8 DB:7E S:1FE5 P:eNvmxdIzC HC:0730 VC:004 FC:59 I:00
$80/883A E2 20       SEP #$20                A:80FF X:80EB Y:80AB D:1DF8 DB:7E S:1FE5 P:envmxdIzC HC:0798 VC:004 FC:59 I:00
$80/883C D0 F0       BNE $F0    [$882E]      A:80FF X:80EB Y:80AB D:1DF8 DB:7E S:1FE5 P:envMxdIzC HC:0828 VC:004 FC:59 I:00
$80/882E B9 00 00    LDA $0000,y[$7E:80AB]   A:80FF X:80EB Y:80AB D:1DF8 DB:7E S:1FE5 P:envMxdIzC HC:0858 VC:004 FC:59 I:00
$80/8831 9D 00 00    STA $0000,x[$7E:80EB]   A:8008 X:80EB Y:80AB D:1DF8 DB:7E S:1FE5 P:envMxdIzC HC:0902 VC:004 FC:59 I:00
$80/8834 C8          INY                     A:8008 X:80EB Y:80AB D:1DF8 DB:7E S:1FE5 P:envMxdIzC HC:0946 VC:004 FC:59 I:00
$80/8835 E8          INX                     A:8008 X:80EB Y:80AC D:1DF8 DB:7E S:1FE5 P:eNvMxdIzC HC:0970 VC:004 FC:59 I:00
$80/8836 C2 20       REP #$20                A:8008 X:80EC Y:80AC D:1DF8 DB:7E S:1FE5 P:eNvMxdIzC HC:0994 VC:004 FC:59 I:00
$80/8838 C6 03       DEC $03    [$00:1DFB]   A:8008 X:80EC Y:80AC D:1DF8 DB:7E S:1FE5 P:eNvmxdIzC HC:1024 VC:004 FC:59 I:00
$80/883A E2 20       SEP #$20                A:8008 X:80EC Y:80AC D:1DF8 DB:7E S:1FE5 P:envmxdIzC HC:1092 VC:004 FC:59 I:00
$80/883C D0 F0       BNE $F0    [$882E]      A:8008 X:80EC Y:80AC D:1DF8 DB:7E S:1FE5 P:envMxdIzC HC:1156 VC:004 FC:59 I:00
$80/882E B9 00 00    LDA $0000,y[$7E:80AC]   A:8008 X:80EC Y:80AC D:1DF8 DB:7E S:1FE5 P:envMxdIzC HC:1186 VC:004 FC:59 I:00
$80/8831 9D 00 00    STA $0000,x[$7E:80EC]   A:80FF X:80EC Y:80AC D:1DF8 DB:7E S:1FE5 P:eNvMxdIzC HC:1230 VC:004 FC:59 I:00
$80/8834 C8          INY                     A:80FF X:80EC Y:80AC D:1DF8 DB:7E S:1FE5 P:eNvMxdIzC HC:1274 VC:004 FC:59 I:00
$80/8835 E8          INX                     A:80FF X:80EC Y:80AD D:1DF8 DB:7E S:1FE5 P:eNvMxdIzC HC:1298 VC:004 FC:59 I:00
$80/8836 C2 20       REP #$20                A:80FF X:80ED Y:80AD D:1DF8 DB:7E S:1FE5 P:eNvMxdIzC HC:1322 VC:004 FC:59 I:00
$80/8838 C6 03       DEC $03    [$00:1DFB]   A:80FF X:80ED Y:80AD D:1DF8 DB:7E S:1FE5 P:eNvmxdIzC HC:1352 VC:004 FC:59 I:00
$80/883A E2 20       SEP #$20                A:80FF X:80ED Y:80AD D:1DF8 DB:7E S:1FE5 P:envmxdIzC HC:0056 VC:005 FC:59 I:00
$80/883C D0 F0       BNE $F0    [$882E]      A:80FF X:80ED Y:80AD D:1DF8 DB:7E S:1FE5 P:envMxdIzC HC:0086 VC:005 FC:59 I:00
$80/882E B9 00 00    LDA $0000,y[$7E:80AD]   A:80FF X:80ED Y:80AD D:1DF8 DB:7E S:1FE5 P:envMxdIzC HC:0116 VC:005 FC:59 I:00
$80/8831 9D 00 00    STA $0000,x[$7E:80ED]   A:8008 X:80ED Y:80AD D:1DF8 DB:7E S:1FE5 P:envMxdIzC HC:0160 VC:005 FC:59 I:00
$80/8834 C8          INY                     A:8008 X:80ED Y:80AD D:1DF8 DB:7E S:1FE5 P:envMxdIzC HC:0204 VC:005 FC:59 I:00
$80/8835 E8          INX                     A:8008 X:80ED Y:80AE D:1DF8 DB:7E S:1FE5 P:eNvMxdIzC HC:0228 VC:005 FC:59 I:00
$80/8836 C2 20       REP #$20                A:8008 X:80EE Y:80AE D:1DF8 DB:7E S:1FE5 P:eNvMxdIzC HC:0252 VC:005 FC:59 I:00
$80/8838 C6 03       DEC $03    [$00:1DFB]   A:8008 X:80EE Y:80AE D:1DF8 DB:7E S:1FE5 P:eNvmxdIzC HC:0282 VC:005 FC:59 I:00
$80/883A E2 20       SEP #$20                A:8008 X:80EE Y:80AE D:1DF8 DB:7E S:1FE5 P:envmxdIZC HC:0350 VC:005 FC:59 I:00
$80/883C D0 F0       BNE $F0    [$882E]      A:8008 X:80EE Y:80AE D:1DF8 DB:7E S:1FE5 P:envMxdIZC HC:0380 VC:005 FC:59 I:00
$80/883E 7A          PLY                     A:8008 X:80EE Y:80AE D:1DF8 DB:7E S:1FE5 P:envMxdIZC HC:0404 VC:005 FC:59 I:00
$80/883F 4C 7C 87    JMP $877C  [$80:877C]   A:8008 X:80EE Y:006B D:1DF8 DB:7E S:1FE7 P:envMxdIzC HC:0450 VC:005 FC:59 I:00
$80/877C B7 00       LDA [$00],y[$90:D361]   A:8008 X:80EE Y:006B D:1DF8 DB:7E S:1FE7 P:envMxdIzC HC:0504 VC:005 FC:59 I:00

and my dungeon view is cured of whatever sickness was blinding the player. Haven't seen anything in Chapter 1/2 yet.

I guess someone tried to be too clever with asm tweak and botched something?
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ Fixing gfx bug, then release
Post by: Sarah Shinespark on March 21, 2019, 06:57:16 pm
What the... he added a DMA transfer? Yeah that would probably do it. I'm not entirely sure what that code does, but I'm guessing it was initializing RAM. Well if the fix works, that's a wrap! I'll edit the IPS and upload the fix later tonight during one of my class breaks. You're awesome! That was the one part of the patch I hadn't tried getting rid of  :laugh:

EDIT: Which emulator are you using? This cleared up in no$sns, but it's still there in Snes9x 1.59.2. However, it's completely cleared after opening the map now, which is much more acceptable!
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ Fixing gfx bug, then release
Post by: rookwield on March 21, 2019, 07:27:06 pm
Yeah, he played around with dma transfers during active -hdma transfers-. That could be a murderous hazard for your family. Otherwise I saw some loop unrolls. But to his credit, he did pull off some decent speed.

That above code looks like a plain memory copy. Pretty harmless I thought. Except the upper 8-bits of A register gets trashed. That could be a big oops! if the game was hoarding onto that value for later.

I hope that's the only one, because that was a pitb to locate! :)


edit: Using Geiger debugger 1.51. I'll try to track down the others.
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ Fixing gfx bug, then release
Post by: Sarah Shinespark on March 23, 2019, 02:21:17 am
Oh, right! I've been using an unreleased update to the Fastrom patch. Can't seem to add anyone else as a contributor, but I finally got the nerve to submit these two.

FastROM v0.5 (https://www.romhacking.net/hacks/3608/)
Multi Level-up v1 (https://www.romhacking.net/hacks/4425/)

Btw, how can you tell he did DMA during HDMA? Still learning what I can about that.
I mean, is there a way I can tell it to not use a certain channel if it's busy? He said awhile back "Do not use hdma 2,3,4,7." Or do I just need to make sure DMA is during V-blank? *eyes cross*
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ Fixing gfx bug, then release
Post by: rookwield on March 24, 2019, 09:07:17 am
Look for 'Special Tracing': 'DMA' and 'HDMA' checkbox. Click those and it'll spam the box when it's being used. During Chapter 1 ending cutscene,

Code: [Select]
H-DMA[3] write (0) 0x01B7D7->0x2131 ind, Count:   1, Rep: yes, V-LINE: 151 01B7CC
H-DMA[4] write (0) 0x01B7D8->0x212C ind, Count:   1, Rep: yes, V-LINE: 151 01B7D6

It looks that fastrom DMA is used during loading data like graphics and initializing ram.
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ Fixing gfx bug, then release
Post by: Sarah Shinespark on March 29, 2019, 06:08:42 pm
Wait, so how can you tell they're being used simultaneously? I see both of them pop up in town, dungeons and battle, the latter looking like this:
Code: [Select]
H-DMA[3] write (0) 0x01B7D7->0x2131 ind, Count:   1, Rep: yes, V-LINE: 151 01B7CC
H-DMA[4] write (0) 0x01B7D8->0x212C ind, Count:   1, Rep: yes, V-LINE: 151 01B7D6
DMA[0]: CPU->PPU Mode:0 0x000200->0x2104 Bytes:220 (inc) V:225 OBJADDR: 0000
DMA[0]: CPU->PPU Mode:0 0x000420->0x2122 Bytes:200 (inc) V:229 CGRAM: 00 (0)
H-DMA[2] write (2) 0x030FEF->0x2111 ind, Count:   1, Rep: yes, V-LINE:   0 038963
H-DMA[3] write (0) 0x011893->0x2131 ind, Count: 100, Rep: yes, V-LINE:   0 01B7C6
I take it the [# ] is the channel in use, the range is ROM->RAM, and HDMA only writes a byte or two at a time. So what am I looking for?
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ Fixing gfx bug, then release
Post by: rookwield on April 04, 2019, 08:40:10 pm
Sorry for the late reply. Checking more carefully, sometimes I saw a DMA[6] popup in the logs that didn't happen with vanilla. But I've only seen H-DMA[2,3,4,7] so far. Maybe that's not the problem.

edit: Found the well-hidden gremlin. My previous fix only masked the problem, but it still happened much less often.

Normally fastrom hack behaves something like this:
Code: [Select]
** nmi handler @ 225
DMA[0]: CPU->PPU Mode:0 0x000200->0x2104 Bytes:220 (inc) V:225 OBJADDR: 0000
DMA[0]: CPU->PPU Mode:1 0x7E8000->0x2118 Bytes:1000 (inc) V:229 VRAM: 0400 (1,0) word
** note how game copies everything into vram right now, it takes up to 30 v-lines. 263 is our death line. anything past here will not be written to vram.
DMA[6]: CPU->PPU Mode:0 0x9FFB40->0x2180 Bytes:1320 (fixed) V:259
DMA[6]: CPU->PPU Mode:0 0x9FFB3E->0x2180 Bytes:2640 (fixed) V:027

And when timing runs too fast, it does this
Code: [Select]
DMA[6]: CPU->PPU Mode:0 0x9FFB40->0x2180 Bytes:1320 (fixed) V:222
** nmi handler @ 253
DMA[0]: CPU->PPU Mode:0 0x000200->0x2104 Bytes:220 (inc) V:253 OBJADDR: 0000
DMA[0]: CPU->PPU Mode:1 0x7E8000->0x2118 Bytes:1000 (inc) V:257 VRAM: 0400 (1,0) word
** error: 257+30 exceeds 263. most of transfer is dumped to wasteland and we gets lots of visual garbage instead.
DMA[6]: CPU->PPU Mode:0 0x9FFB3E->0x2180 Bytes:2640 (fixed) V:024

It looks like rainponcho zeros out memory via dma, which is fast but fatal when done around nmi. I'll see about patching this up next chance, since I get it now.

edit:
http://s000.tinyupload.com/index.php?file_id=97991706921447959755

Apply this on top of fastrom v5. It will now check the scanline before deciding when to dma. It's a kludge fix since we could sometimes squeeze in 1 extra dma pre-nmi but idc enough since it doesn't add enough time savings.
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ Fixing gfx bug, then release
Post by: Sarah Shinespark on April 06, 2019, 09:01:00 am
Fine by me; I fixed Multi Levelup by checking that the current music was "Battle Won" so it wouldn't ADC the spirits' exp each time you switched them out :P

Code: [Select]
DMA[6]: CPU->PPU Mode:0 0x9FFB40->0x2180 Bytes:1320 (fixed) V:259Ok so in your first example there's this; so this is part of it working properly? I don't get how it's different than the garbage in the second example. I'm probably overthinking this and you weren't pointing out that part.
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ Fixing gfx bug, then release
Post by: rookwield on April 06, 2019, 02:25:23 pm
It's okay since we copied all the data to vram first, which is critical. Main ram has no timing restrictions.


So log1 says:
V:225 = nmi, vram open for editing
V:225-229 = copy obj to vram
V:229-259 = copy tiles to vram
--- both these must be finished between 225-262.

V:259-027 = memset ram data
--- we don't care. do anytime


Log2 says:
V:222-253 = memset ram data

V:253 = nmi handler
V:253-257 = copy obj to vram
V:257-262 = (partial) copy tiles to vram
--- V:000 = warning: vram is closed for business
V:000-024 = (partial) copy tiles to vram
--- error, invalid, not written, goofed

That's what kills the tiles. There's not enough time to write everything in.
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ Fixing gfx bug, then release
Post by: SCO on May 04, 2019, 11:26:34 am
So... has the main patch been updated yet? Why not if there is a fix?
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ Fixing gfx bug, then release
Post by: Sarah Shinespark on May 04, 2019, 07:50:41 pm
So... has the main patch been updated yet? Why not if there is a fix?
Right, communication! So the fix still doesn't fix it on BizHawk, and we're looking into why so it will work on actual hardware.
UPDATE: Think this might do it; it's in testing now  :) I also submitted an updated Fastrom patch that works on its own; I guess nobody noticed that bug  :angel:

If anyone else wants to test on real hardware, hit me up  :beer:
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ Fixing gfx bug, then release
Post by: Sarah Shinespark on May 12, 2019, 11:22:21 am
Well... it's submitted  ;D
When it gets accepted I'll make an updated topic and news entry. Thanks for the help everyone!!
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ Fixing gfx bug, then release
Post by: Zoinkity on May 13, 2019, 11:26:09 pm
Sorry this comes a bit late, but had a chance to play the game through the Icicle Cave on hardware with no ill effects or torn textures.  (Well, nothing obvious at least ;*))
So far the only noticeable bug was the aforementioned "of" on the title screen borrowing the highlight color from "new game".

Can't understate how excellent your work is.
Editing the script improved the story remarkably, but new dialogs are languid in a useful way.  It's remarkable how much of a difference well-presented common dialog makes.  After all, you're going to see battle text and level up dialog hundreds of times.
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ Fixing gfx bug, then release
Post by: Sarah Shinespark on May 14, 2019, 12:14:13 am
Sorry this comes a bit late, but had a chance to play the game through the Icicle Cave on hardware with no ill effects or torn textures.  (Well, nothing obvious at least ;*))
So far the only noticeable bug was the aforementioned "of" on the title screen borrowing the highlight color from "new game".

Can't understate how excellent your work is.
Editing the script improved the story remarkably, but new dialogs are languid in a useful way.  It's remarkable how much of a difference well-presented common dialog makes.  After all, you're going to see battle text and level up dialog hundreds of times.
Ahh, I'm so excited to hear that! When I graduate I planned on rewarding myself with a SNESC, and really hoped it would work on there.

Thanks so much! I really try to get everything just right. Still hard to believe they had separate lines for everyone's dodge and critical hits but they went with the same text 9 times.
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ Fixing gfx bug, then release
Post by: Shade Aurion on May 14, 2019, 12:18:01 am
Oh nice! This sounds like a vastly better experience than the original. Well done!  :beer:
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ Fixing gfx bug, then release
Post by: Vanya on May 14, 2019, 08:10:48 am
Can't wait to try this out!
Arcana is one of those games I never got a chance to play much of.
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ Fixing gfx bug, then release
Post by: Cureless on May 16, 2019, 08:16:54 pm
I made an account just to thank you for all the work you did on Arcana. This game holds such a special place in my heart as I actually used to rent it from a local video store when I was a kid, so it’s nice to be able to play it in a fashion that’s as close to the original as possible.

I’m almost finished with Balnia Temple, so I’m not that far, but all the changes I’ve seen so far have been awesome!

Thanks again for doing this. :)
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ Fixing gfx bug, then release
Post by: Zoinkity on May 17, 2019, 12:20:48 am
Can't speak for a SNESC, but runs splendidly on an archaic Super UFO ;*)
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ Fixing gfx bug, then release
Post by: Dzumeister on July 27, 2019, 04:07:40 pm
Can't speak for a SNESC, but runs splendidly on an archaic Super UFO ;*)

So far it works great on my SNES Classic!  :laugh: Thanks for all of the QOL updates you included; they make this game much more tolerable to play in 2019.  :woot!:

I made a quick boxart for anyone who wants to use this on their own SNESC or other emulator.

(https://i.imgur.com/f0MyTle.jpg)
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ Fixing gfx bug, then release
Post by: Sarah Shinespark on July 29, 2019, 11:47:01 am
Nice! I grabbed one with the Japanese art using the box art search; think it was this one by WarlockTank.

(https://i.redd.it/bhlpmyjoqns11.png)

I should do my own version with the recolored title splash and subtitle.
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ Fixing gfx bug, then release
Post by: PersianImm0rtal on September 26, 2019, 11:49:25 pm
Love reading all the comments and hearing all the love for this game. It really is a gem of a game! And the improvement makes it a top 20 or 30 snes game in my opinion! Right up there with all the heavy hitter mustt plays on the SNES  ;D
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ Fixing gfx bug, then release
Post by: Sarah Shinespark on October 15, 2019, 12:49:08 am
Aw, that really warms my heart  :)

I've been debating making a parody "second quest" mod of this, but I probably won't make a serious attempt until the map format can be de/recompressed. I would love to mess with the game on a level-editor tier, but I'd need some help. I *think* exhal is supposed to work with Arcana, but after returning the recompressed data I have no idea how to update whatever pointers are involved so the game will... load at all  :huh: So far unsure if the maps just look like RLE or if I'm not using exhal correctly. Been awhile since I touched anything >.>
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ Fixing gfx bug, then release
Post by: Sarah Shinespark on November 08, 2019, 08:03:54 am
So last night I made some *super cute* Windows icons <3 I'm bundling them in the next release. Dropping Flee's MP cost and revamping some treasure chests. It'll be after I add a new feature to the healer's shop  :thumbsup:
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ Fixing gfx bug, then release
Post by: travel27 on November 08, 2019, 12:16:36 pm
"make this game much more tolerable to play in 2019."
Since when was the game "intolerable" to play?

Oh nice! This sounds like a vastly better experience than the original. Well done!  :beer:
The original was fine.
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ Fixing gfx bug, then release
Post by: Special on November 08, 2019, 12:36:39 pm
I like how you cherry pick a line and leave out the context. Very cool.
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ Fixing gfx bug, then release
Post by: Sarah Shinespark on November 08, 2019, 01:02:25 pm
This mod *exists* because I found fault with the original game. Defending it here is...

...well it's not forbidden, but it's out of place. You're wondering when the game was intolerable, but you haven't read anything about players getting fed up with the slow movement speed and high encounter rate that this mod addresses. If they quit on account of those issues then they found the game intolerable.
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ Fixing gfx bug, then release
Post by: Special on November 08, 2019, 02:32:03 pm
He doesn't even say "intolerable", but says that the added QOL featrues make the game much more tolerable to play in 2019, which they do.
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ Fixing gfx bug, then release
Post by: Red Soul on November 08, 2019, 04:01:28 pm
I'm thankful this mod exists, because it consistently addressed every annoyance I have/had with it.
If only every RPG got such a nice QoL treatment.
Title: Re: Arcana - Seal of Rimsala! (SNES) ~ Fixing gfx bug, then release
Post by: Sarah Shinespark on November 08, 2019, 05:05:40 pm
I'm thankful this mod exists, because it consistently addressed every annoyance I have/had with it.
If only every RPG got such a nice QoL treatment.
Well it's the only one I've put my hands in  :laugh: Thanks for the kind words! Got at least one more QoL change coming, once I finish researching how to do it.
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: Sarah Shinespark on November 26, 2019, 04:58:32 pm
So I made some research breakthroughs today :)
While tracking down the code turning out-of-battle spells gray, I identified 3 more fields for spells: Out-of-battle use, single/multi-target, and accuracy. For WHATEVER REASON, of the 4 elements Smash 1/2/3 has almost perfect accuracy. Guess it's harder to dodge rocks than lightning... someone should tell Tidus.  :beer:
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: Sarah Shinespark on April 12, 2020, 11:18:57 am
Back from hiatus  :angel:
Got a balance patch almost ready, mostly normalizing spell accuracy.

New discoveries:
-Weapons have their own critical hit rates
-Hit/Crit section of damage formula decyphered
-Monsters have all stats and even "equipment" stats, although these are sometimes just values for a lookup table
-Shields have a 2nd stat for magic defense.
-Mapped out a ton of subroutines, like multiplication and division
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: torha on April 19, 2020, 12:14:26 am
Hi, there!

Read about your work on the news and wandered in here (and saw the other thread about the graphics stuff).

Really want to find time to replay this classic game from ways back then, but I did sample up to Dungeon 1 and the changes are well. Amazing! Checked the vanilla game and that is a far difference.


I do have some experience with asm but not much time. Even less so now with the crummy virus. :grumble:


But I do have a few observations coding wise.

1. Graphics decompression runs through here
Code: [Select]
808766 phd                    A:0010 X:c9e0 Y:e000 S:1feb D:1e00 DB:7e NvmxdIzc V: 91 H:1034 F:27
808767 pha                    A:0010 X:c9e0 Y:e000 S:1fe9 D:1e00 DB:7e NvmxdIzc V: 91 H:1064 F:27
808768 tdc                    A:0010 X:c9e0 Y:e000 S:1fe7 D:1e00 DB:7e NvmxdIzc V: 91 H:1094 F:27
808769 sec                    A:1e00 X:c9e0 Y:e000 S:1fe7 D:1e00 DB:7e nvmxdIzc V: 91 H:1108 F:27
80876a sbc #$0008             A:1e00 X:c9e0 Y:e000 S:1fe7 D:1e00 DB:7e nvmxdIzC V: 91 H:1152 F:27
80876d tcd                    A:1df8 X:c9e0 Y:e000 S:1fe7 D:1e00 DB:7e nvmxdIzC V: 91 H:1176 F:27
80876e pla                    A:1df8 X:c9e0 Y:e000 S:1fe7 D:1df8 DB:7e nvmxdIzC V: 91 H:1190 F:27
80876f php                    A:0010 X:c9e0 Y:e000 S:1fe9 D:1df8 DB:7e nvmxdIzC V: 91 H:1226 F:27
808770 sep #$20               A:0010 X:c9e0 Y:e000 S:1fe8 D:1df8 DB:7e nvmxdIzC V: 91 H:1248 F:27
808772 sta $02       [001dfa] A:0010 X:c9e0 Y:e000 S:1fe8 D:1df8 DB:7e nvMxdIzC V: 91 H:1270 F:27
808774 stx $00       [001df8] A:0010 X:c9e0 Y:e000 S:1fe8 D:1df8 DB:7e nvMxdIzC V: 91 H:1300 F:27
808776 sty $05       [001dfd] A:0010 X:c9e0 Y:e000 S:1fe8 D:1df8 DB:7e nvMxdIzC V: 91 H:1338 F:27
808778 tyx                    A:0010 X:c9e0 Y:e000 S:1fe8 D:1df8 DB:7e nvMxdIzC V: 92 H:  12 F:27

Tip 1: 00-02 = 24-bit rom pointer. It's using SlowROM banks! That could be a modest gain.


Tip 2: I've read the decruncher math. It's ugly. The fastrom replacement code to speed it up is.. hard to understand also! :lol:


To summarize, something like this from what I'm reading:

rom to ram:
00-1f = 8-bit copy
20-3f = 8-bit rle
40-5f = 16-bit rle
60-7f = 8-bit rle+1

ram to ram:
80-9f = 8-bit copy forward
a0-bf = 8-bit reverse flip
c0-df = 8-bit copy reverse

special flag:
e0-ff = 16-bit run lengths

Writing a cruncher program would seem less fun to do.


edit: And then I read the comments. A genius already did the master work. That's a lot of HAL games covered!
https://github.com/devinacker/exhal/blob/master/compress.c


Tip 3: I was watching the vram in dungeon walking mode. It runs slow because it decompresses the dungeon tiles every frame. It'd be much faster if you expanded LoROM to 2MB and threw the raw tiles in there. Maybe battle monster sprites too.

I also have to wonder if the decrunch routine could be sped up further. Not all paths have been reworked to use dma helpers.


Well good fortune to you and your project!

(The new script is great so far. Would it help to expand the ROM and put in a "re-translation" of some type? For full unleashed creativity of what could have been? You definitely have the Midas touch for this game)
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: cospefogo on April 19, 2020, 07:10:40 am
Question:

Is there a way (or a alternative side patch) to change the game regular text font? Perhaps replacing with some font with better readability?

Thanks!
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: Sarah Shinespark on April 19, 2020, 01:21:57 pm
cospefogo: You may want to ask RetGal about that; their topic (http://www.romhacking.net/forum/index.php?topic=30381.0) is working fonts for a translation.

torha:
Oh wow, welcome! I've got plenty of time, but lots of dead ends I can use advice with  :D
Code: [Select]
Tip 1: 00-02 = 24-bit rom pointer. It's using SlowROM banks! That could be a modest gain.
Ah, you mean $00 and $02 right? The code itself is on $80, but you mean it's slower for doing LDA [$00],y to $17:xxxx than $97:xxxx? That doesn't seem easy to change thanks to that PHA/PLA... Also pretty sure the whole game loads values that way  :-X

Yeah I knew about exhal, I just haven't gotten it to work because I'm having trouble finding the end of compressed blocks. Would be amazing if I could edit the maps, I've seen where they're uncompressed into the end of RAM. Keeping them uncompressed would be a godsend. (I just tied in map values to encounter formations, but I've been busy trying to get Mimics working, and Monster-in-a-Box skips most of the code loading encounter data so it's been a royal pita)

Didn't have much reason to expand the rom (and I was worried it would stop working on hakchi2/Super UFO), but having that data would be enough reason. This memory map (https://en.wikibooks.org/wiki/Super_NES_Programming/SNES_memory_map) has an example of LoROM + FastROM using 1.5 MB, so that should be fine. As for the text, moving the banks would give me more space to talk, but it hasn't been a major issue. Maybe if I had a full game translation it would be different.
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: torha on April 19, 2020, 04:09:32 pm
Tokimeki Memorial is a 4MB LoROM (FastROM) game that works on hakchi and Super UFO. :)


Quote
Ah, you mean $00 and $02 right? The code itself is on $80, but you mean it's slower for doing LDA [$00],y to $17:xxxx than $97:xxxx? That doesn't seem easy to change thanks to that PHA/PLA... Also pretty sure the whole game loads values that way 

Loading rom data from $00-3f is a bit slower. Maybe not that slow but anything might help.

Code: [Select]
808770 sep #$20
===> ora #$80
808772 sta $02
808774 stx $00
808776 sty $05

808779 ldy #$0000
80877c lda [$00],y

You could hijink the code and add that fastrom bank flag. Or if possible, rewrite the code and optimize it.


I'll try playing with exhal and see what I can do with it.


Quote
Maybe if I had a full game translation it would be different.

Haven't seen anyone do a text comparison yet with Card Master.


I'll try helping out where I can. Also look into the font and report in that other thread if I see something. I have some ideas but have to look harder.


edit:
808770 can be repurposed to add fastrom and load uncompressed data. More on that later when I get some stuff moving forward.


edit2:
Sadly this FAQ wasn't really updated much. I didn't know that much changed from JP to US.
https://gamefaqs.gamespot.com/snes/563513-arcana/faqs/17456


It's been 5+ years for you now on this mod?
https://gamefaqs.gamespot.com/boards/563513-arcana/71596251


This is kinda interesting.
http://www.angelfire.com/rpg2/teefa85/Arcana/Arcana.html
http://www.angelfire.com/rpg2/teefa85/Arcana/Facts.html


And the unused stuff
https://tcrf.net/Arcana


===============================================


April 19, 2020:
https://github.com/torha/files/raw/arcana/dungeon%20maps/dungeon%20map%20v1.ips
- Apply this on top of SOR v1.0d
- Expands ROM to 2MB
- Reads raw dungeon maps from A0:8000


https://github.com/torha/files/raw/arcana/dungeon%20maps
- source code


Quote
-Fix a text issue where some items and spells are written with a trailing space ("learned Change Attribute to Wind .")

Easy fix. Open SOR ROM to x2E902.
Code: [Select]
Change Attr. to Wind[x20][x00]
==>
Change Attr. to Wind[x00][x00]

Same for "Change Attr. to Fire[x00]".

I suppose there's likely some coding bug to track down though.
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: Sarah Shinespark on April 21, 2020, 06:11:12 pm
Tokimeki Memorial is a 4MB LoROM (FastROM) game that works on hakchi and Super UFO. :)
No kidding? I've heard of the game, sounds awfully familiar and I swear it was related to DDR somehow.

Quote
Loading rom data from $00-3f is a bit slower. Maybe not that slow but anything might help.

Code: [Select]
808770 sep #$20
===> ora #$80
808772 sta $02
808774 stx $00
808776 sty $05

808779 ldy #$0000
80877c lda [$00],y

You could hijink the code and add that fastrom bank flag. Or if possible, rewrite the code and optimize it.
That's... really clever just using an OR.



Quote
Sadly this FAQ wasn't really updated much. I didn't know that much changed from JP to US.
https://gamefaqs.gamespot.com/snes/563513-arcana/faqs/17456

It's been 5+ years for you now on this mod?
https://gamefaqs.gamespot.com/boards/563513-arcana/71596251

This is kinda interesting.
http://www.angelfire.com/rpg2/teefa85/Arcana/Arcana.html
http://www.angelfire.com/rpg2/teefa85/Arcana/Facts.html

And the unused stuff
https://tcrf.net/Arcana

I think that author is overreacting, there really don't seem to be many differences. No evidence of JP having item drops, spirits aren't any different, and there aren't any more items or spells available afaik. Main menu is slightly rearranged, status screen has the character class (which I used in SOR), and the level up screen was much more condensed. But yea it's been awhile since I started! I've seen those articles, used them for a bit of input like using Blood Cards. Actually Apocalypse612 helped submit my findings to TCRF; I elaborated on the spells and descriptions, and discovered the Mirror Card and Mimic enemy~  :beer:

Quote
Code: [Select]
Change Attr. to Wind[x20][x00]
==>
Change Attr. to Wind[x00][x00]

Same for "Change Attr. to Fire[x00]".

I suppose there's likely some coding bug to track down though.
About that text issue~ Both the 2 spells and their attribute names have a trailing space, but it doesn't seem happy with an unexpected x00.
(https://i.ibb.co/C9xVYZ2/Arcana-Seal-of-Rimsala-v1-0d005.png)


Forward steps reduced 34f -> 28f  :o :o That's a big difference! Odd that I only see this improvement in Balnea Temple though...
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: torha on April 21, 2020, 07:05:09 pm
https://github.com/torha/files/raw/arcana/rimsala%20title/rimsala%20title%20v1.ips
- Fixes title glitch with 'OF' colors
- Use on top of Seal of Rimsala! 1.0d


https://github.com/torha/files/tree/arcana/rimsala%20title
- source code here


Short explanation:
- exhal to get tiles
- Add 'F' in palette 1 color (**)
- inhal to get packed
- make adjustments to rom
  https://github.com/torha/files/blob/arcana/rimsala%20title/title_seal.asar.txt
- try me!


~~~~~~~~~~~~~~~~~~~~


https://github.com/torha/files/raw/arcana/fastrom/fastrom%20v1.ips
- Minor speed up when creating dungeon tiles
- Apply on top of SOR 1.0d


https://github.com/torha/files/tree/arcana/fastrom
- Source code here


Short explain:
Code: [Select]
839d59 lda $7f0000,x [7f0040]

839d5d pha
839d5e sep #$30             
839d60 plx                   
839d61 lda $83b251,x [83b350]
839d65 xba                   
839d66 plx                   
839d67 lda $83b251,x [83b251]
839d6b xba                   
839d6c rep #$30

Notice how it uses the stack (pha, plx, plx). A small gain by avoiding the r/w to ram.

Code: [Select]
  tay ; two 8-bit tile data
  xba
  tax
  sep #$30

  lda $83b251,x ; tile1
  xba
  tyx ; tile2
  lda $83b251,x
  rep #$30

Which fits perfectly.
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: Sarah Shinespark on April 21, 2020, 07:33:35 pm
Holy crap that's amazing.
(I really gotta learn how to use xkas)  :cookie:

EDIT: Saw the 2nd part, lemme test that too.
Wow, I just realized walking is really uneven speed in Dwarven Pass. Sometimes steps are 14/12, 15/12, 15/11. It's gotta be those "moving clouds".
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: torha on April 21, 2020, 07:39:23 pm
I use asar which is like xkas but improved.
https://github.com/RPGHacker/asar


Lets you do dirty stuff like this quickly.
https://raw.githubusercontent.com/torha/files/arcana/fastrom/fast1.asar.txt
https://raw.githubusercontent.com/torha/files/arcana/dungeon%20maps/dungeon_raw.asar.txt


EDIT:
I should mention that you could modify the title.bin from here
https://github.com/torha/files/tree/arcana/rimsala%20title

Add a "!" font tile
Run inhal script
Copy packed back to same spot (it's smaller for sure)

Then write the full hack subtitle "SEAL OF RIMSALA!"


EDIT:
For the uneven walking speed, all I can think would be to add a minimum frame limiter depending on dungeon map maybe. Compared to how slow it was in vanilla game, would be kinda ironic actually.

With some luck, maybe I can help smash out some of the other annoying bugs on the master list.
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: Sarah Shinespark on April 21, 2020, 08:11:09 pm
I don't think a ! is necessary, but that's still pretty cool.
Guessing the uneven speed in Dwarven Pass is from the clouds overhead, probably doing more graphics handling for those.

...Wait, did you say the maps were uncompressed now? Like just the graphics, or the tiles?
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: torha on April 21, 2020, 08:24:44 pm
The dungeon layouts 32x32 are uncompressed now. You can see the whole list here.
https://github.com/torha/files/tree/arcana/dungeon%20maps


ex.
Balnia 1F  https://github.com/torha/files/blob/arcana/dungeon%20maps/00.bin
Balnia 2F  https://github.com/torha/files/blob/arcana/dungeon%20maps/01.bin


Whole list is in here
https://raw.githubusercontent.com/torha/files/arcana/dungeon%20maps/dungeon_raw.asar.txt


Using the ips patch will load the raw data from A0:8000 onward.
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: Sarah Shinespark on April 21, 2020, 08:40:07 pm
Awww yiss (https://www.youtube.com/watch?v=0NdmreSfAgE).
Probably tomorrow when I'm not in night class, I'll mess around with it and see if I can move tiles/chests/bosses. If so this is gonna break the game wide open.

Kinda wish I had the know-how to write a GUI editor, but I could do something command-line if I can decide how to take in input.


Oh snap, I can edit the map  8)
Made a shortcut from the start of Balnia 1F, now you can walk straight from the entrance. Reworked Ice Maze is gonna be fun.
(https://i.ibb.co/RTxGfJq/Arcana-SOR-v1-0d-mapv1-title-fr000.png)
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: torha on April 21, 2020, 09:52:02 pm
Here's your next appreciation gift!


https://github.com/torha/files/raw/arcana/spell%20reader/spell%20reader%20v1.ips
- Fixes the dummy space in printed text
- Apply on top of SOR 1.0d


As usual source is here
https://github.com/torha/files/tree/arcana/spell%20reader
https://raw.githubusercontent.com/torha/files/arcana/spell%20reader/spell_reader.asar.txt


Notes:
Rewrote the spell, item printing code because it was big and had that error.

00 = EOS
20 20 = EOS
20 00 = EOS but doesn't catch this before


EDIT:
Also noticed that it uses SlowROM bank $05.
Code: [Select]
878168 lda #$e340
87816b clc
87816c adc $00
87816e sta $00

878170 lda #$0005
878173 sta $02
878175 rts

I didn't change this and almost forgot to point it out.


Turns out spells are fixed-width table at 05:E340. Of x16 bytes each entry. I don't think it needs expanding but wanted to notate it also.

Code: [Select]
878161 ldx #$0016
878164 jsl $808a39
808a39 jsr $8a3d

That's the text width value.


EDIT:
If someone has a bsnes savestate or sram for Rimsala boss, I can jump on that faster.

There still might be a " ." printing bug but haven't gotten one yet.
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: Sarah Shinespark on April 21, 2020, 10:26:56 pm
Here's your next appreciation gift!


https://github.com/torha/files/raw/arcana/spell%20reader/spell%20reader%20v1.ips
- Fixes the dummy space in printed text
- Apply on top of SOR 1.0d


As usual source is here
https://github.com/torha/files/tree/arcana/spell%20reader
https://raw.githubusercontent.com/torha/files/arcana/spell%20reader/spell_reader.asar.txt


Notes:
Rewrote the spell, item printing code because it was big and had that error.

00 = EOS
20 20 = EOS
20 00 = EOS but doesn't catch this before
/falls down
Really it just didn't catch that? That's hilarious. Awesome work!


Quote
Turns out spells are fixed-width table at 05:E340. Of x16 bytes each entry. I don't think it needs expanding but wanted to notate it also.

Code: [Select]
878161 ldx #$0016
878164 jsl $808a39
808a39 jsr $8a3d

That's the text width value.

Oh I have a lot of those tables documented here (http://datacrystal.romhacking.net/wiki/Arcana:ROM_map) hun, hope it's not taking too much time finding values yourself! Interesting seeing the code.

I don't have any bsnes savestates, but if Apocalypse was here he could probably blaze up to the boss quickly. You can teleport by modifying your $16F7/$16F9 (just move to update the screen afterwards) but you still have to fight the event battles if my time screwing with that in Chapter 2 holds fast. Although just set their HP to 1 ($12FB) if you wanna go fast lol. Anyway, (00, 00) is the top left of the map.
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: Apocalypse612 on April 21, 2020, 11:20:49 pm
Here's the requested save state for BSNES. It's for the accuracy build exe (bsnes-plus-05-x64).

https://www.sendspace.com/file/01mbl8
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: torha on April 22, 2020, 11:52:28 pm
Thanks a lot! It was helpful getting there fast. What a bug that turned out. It's like walking up to a "Welcome!" mat and finding a dog laid poop there. :rofl:


So I didn't know what to call this one.
https://github.com/torha/files/raw/arcana/title%20register%20reset/title%20register%20reset%20v1.ips
- Use on SOR 1.0d
- Fixes dirty graphics after failing Rimsala fight (maybe others)


https://github.com/torha/files/tree/arcana/title%20register%20reset
https://raw.githubusercontent.com/torha/files/arcana/title%20register%20reset/title_register_reset.asar.txt
- Source code provided


Explain here:
Rimsala fight uses h-dma7, which is still activated when we die and return to main menu. This causes all sorts of invisible wonky stuff to show.

note: There could be other registers that need zapping also. But maybe it's safe.


$105a is used to cache which h-dma channels to run. Now we find some code that runs only during title.
Code: [Select]
title + hal fade-in
978014 jsl $808c84   [808c84] A:0081 X:00d0 Y:001e S:1ffc D:1e00 DB:80 NvmxdIzC V: 52 H: 926 F:26
978018 lda #$0014             A:0430 X:0400 Y:001e S:1ffc D:1e00 DB:80 nvmxdIzC V: 65 H:1148 F:26
97801b jsl $808d24   [808d24] A:0014 X:0400 Y:001e S:1ffc D:1e00 DB:80 nvmxdIzC V: 65 H:1166 F:26
97801f jsl $8088de   [8088de] A:0000 X:0000 Y:0000 S:1ffc D:1e00 DB:80 nvmxdIZc V: 69 H: 234 F:26
978023 jsl $808e29   [808e29] A:0000 X:0000 Y:0000 S:1ffc D:1e00 DB:80 nvmxdIZc V:232 H:1070 F:26
978027 jsl $80a760   [80a760] A:0400 X:0400 Y:ffff S:1ffc D:1e00 DB:80 nvmxdIzC V:251 H:1036 F:26

Then we reset $105a to zero. And whoop goes the little gremlin. Onward and upward!
=== Special note: vanilla game has this same bug also. Experimentally verified. ===


So Card Master @Sarah Shinespark, anything else that can use a look?



Side-note: found another SlowROM bank to change.
Code: [Select]
809cf1 jsl $00995c   [00995c]

And the SlowROM NMI handler could be sped up methinks. I would expect small gain though. But combining all the measly crumbs could eventually turn into marshmallow dough.
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: Sarah Shinespark on April 23, 2020, 05:06:21 am
These would go really well all added to the FastROM patch so other translations can use them 🤔 Theres a minor patch conflict between it and Multi-Levelup where the order matters. One sets a value to 85, and the other 87.
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: torha on April 23, 2020, 09:37:17 am
I should re-edit my ips patches to remove checksum fixing. :oops: Then I'll recommend which ones should be standalone FastROM inclusion compatible.


For levelup - fastrom conflict:
Code: [Select]
vanilla:
87b29b lda $85a91a,x [85d736]
87b29f sta $1363,y   [811362]
87b2a2 rtl                   


current:
87b29b jml $87ffa1   [87ffa1]
87b29f sta $1363,y   [811362]
87b2a2 rtl                   


87ffa1 lda $85a91a,x [85d736]
87ffa5 ldx $1064     [801064]
87ffa8 cpx #$0055           
87ffab bne $ffb1     [87ffb1]
87ffad clc                   
87ffae adc $1363,y   [811362]
87ffb1 sta $1363,y   [811362]
87ffb4 rtl                   

levelup patch becomes

Code: [Select]
fix:
87b29b lda $85a91a,x [85d736]
87b29f jml $87ffa5
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: Sarah Shinespark on April 23, 2020, 01:44:07 pm
Um, that skips a game breaking bugfix~
The code is also called whenever changing spirits, so I have it check to see if the victory theme is playing so if only activates then. Otherwise switching the spirits will ADC a certain value each time.
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: torha on April 23, 2020, 02:09:09 pm
The forum ate my new code somehow. :/

edit: Check above post again. That should be the correct answer that won't have a bank conflict. Re-organizing github files so will take a bit.
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: Sarah Shinespark on April 26, 2020, 02:05:32 am
I may have to un patch Fastrom and MLU on SOR to be sure the new versions will apply properly... tracking changes separately from those patches is annoying lol.

Anyway, if I'm gonna be editing maps I'm gonna want a program to help visualize it. Got code I can repurpose for that, just thinking out loud about possible scopes.
-Easiest: reads an extended ROM and displays each map.
-Possible features: show ROM addresses near area shown, select a certain map
-Harder: Accept original game as well, automate extracting with exhal for reading data
-Harder: Automate inserting with inhal for non expanded games

Idk, it would be amazing to make a tool anyone can use with vanilla. But at the moment I just need something to draw out the values so I dont have to keep stretching Translhexion to a weird size.


EDIT: Ohh I just got it, you suggested adding a ! to the title because I had it in the topic name. That's really good attention to detail   :cookie:

EDIT2: Got the map viewer working!  :beer: Truncated it for size, but it shows all 14 blocks of 400 bytes!
Legend:
1x: Encounters (1/20 in SOR, 1/12 in vanilla)
2x: Encounters (1/4), only in Stavery 12F in Chapter 4
30: No encounters
40: Stairs up
41: Stairs down
5x: Event x
6x: Fog
70: Boss
80: Treasure chest
90: Door

Code: [Select]
Source file: Arcana - SOR v1.0dx.smc
....
Map 1: 0X100000
                                                                                               
                                             40                                                 
                     80    80    30 30 30 30 30 12 12 12 12    10 10 10                         
                     10    12    30 12                12 12    10    10                         
                     10    12    30 12                12 12    10    10                         
                     10    12    30 30 30 30 30 12 12 12 12    10    10                         
                     10    12                70                10    10                         
                     10    12 12 12    11 11 30    12 12 12 12 12    10                         
                     10    12    12    11          12    12    12    10                         
                     10    12          11          12    12    12    10                         
                     10    11 11 11 11 11 11 11 11 12 12 12 12 12    11                         
                     10                      10                      11                         
                     10    12 12 12 12 12    10 10 10 10 10 10 10    11                         
                     10    12    12    12                      10    11                         
                     10    12 12 12 12 12 11 11 11 11 11 11    10    11                         
                     10    12 12 12 12 12 11 11 11 11 11 11    10    11                         
                     10    12    12    12    11                10    11                         
                     10    12 12 12 12 12    11    80 11 11 11 11    11                         
                     10                      11                11    11                         
                     10 10 10 10 10 10 10 10 11 11 11 11 11    11    11                         
                     10    10                10          11    11    11                         
                     10    10    11 11 11    10    11 11 11    11    12                         
                     10    10    11    80    10    11 11 11    11    12                         
                     10    10    11          10                11    12                         
                     10    10 11 11    11 11 10 11 11 11 11 11 11    12                         
                     10    10    11          10                      12                         
                     10    10    11    80    10 10 10 10 10 10 10    12                         
                     10    10    11 11 11    10 10 10 10 10 10 10    12                         
                     10    10                               10 10    12                         
                     10    10 10 10 10 10 10 10 10 10 10 10 10 10    12                         
                     10    10 10 10 10 10    90    10 10 10 10 10    80                         
                                                                                               


Map 2: 0X100400
                                                                                               
                                 30 30 30 30 30 30 30 30 30                                     
                                 30          30          30                                     
                                 30    30 30 30 30 30    30                                     
                                 30    30          30    30                                     
                                 30    30    54    30    30                                     
                                 30    30 30 30 30 30    30                                     
                                 30                      30                                     
                                 30 30 30 30 30 30 30 30 30                                     
                                             70                                                 
   15 15 15       15 15 15       15 15 15    15    15 13 13 13 13    15    14    15    14       
   15    15 14 14 15    15 14 14 15    15    15    15          13    15    14    15    14       
   15 15 15       15 15 15       15 15 15    15    15    15    13    15    14    15    14       
   15 15 15       15 15 15       15 15 15    15    15    15    13    15    14    15    14       
   15    15 14 14 15    15 14 14 15    15    15    15    15    13    15    14    15    14       
   15 15 15       15 15 15       15 15 15    15 15 15    15 15 13 13 13 13 13 13 13 13 13       
                                       14                                              13       
   14 13 13 13 13 13 13 13 14 14 14 14 14 14 14 15 15 15 15 15 14 14 14 14 13 13 13 13 13       
   14                                              13                                           
   14    15 15 15 13 13 13 13 13 13 13 13 13 13    13 13 13 13 13 13 13 13 13 13 13 13 13       
   14    15    15    14    14    14    14    13    13          15          15          13       
   14    15    15    14    14    14    14    13    13    80    15    80    15    80    13       
   14    15 15 15    14    14    14    14    13    13    14    80    14    80    14    13       
   14                14    14    14    14    13    13    14          14          14    13       
   14 14 14 14 14 14 14    14 14 14    14    13    13 13 13 13 13 13 13 13 13 13 13 13 13       
                                             13                                                 
                                             13                                                 
                                          13 13 13                                             
                                          13    13                                             
                                          13 13 13                                             
                                             41                                                 
                                                                                               


Map 3: 0X100800
                                                                                               
                                                                                               
                                                                                               
                                                                                               
                                                                                               
                                                                                               
                                                                                               
                                                                                               
                                                                                               
                                                                                               
                                                                                               
                                                                                               
                                                                                               
                                                                                               
                                                                                               
   80 10 10 10 10 10 10 10 10 10 10 10 10 10                                                   
                  10                      13                                                   
   10 10 10       10    13 13 13 13 13    13                                                   
   10    10       10    13    13    13    13                                                   
   10 10 10       10    13    13    13    13                                                   
         10       10    13    80    80    13                                                   
   60 30 30       10    13                13                                                   
         10       10    13 13 13 13 13 13 13                                                   
   80    10       10    13                                                                     
   10    10       10    13    13 13 13 13                                                       
   10 10 10       10    13    13       13                                                       
   10 10 10       10    13    13    30 30                                                       
   10    10       10    13    13    30                                                         
   80    10 10 10 10    13 13 13    30 30 61                                                   
                                                                                               
                                                                                               
                                                                                               


Map 4: 0X100C00
                                                                                               
         14 14 14 14 14 14 14 14 14 14 14 80    14 14 14 14 14 80    15 15 15 80    80         
         14                                     14                   15             15         
         14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 80    15 15 15 80    15         
         14                                     14                   15             15         
         14 14 14 14 14 14 14 14 14 14 14 80    14 14 14 14 14 80    15 15 15 80    15         
         14                                     14                   15             15         
         14 14 14 14 14 14 14 14 14 14 14 80    14 14 14 14 14 80    15 15 15 15 15 15         
         14                                     14                   15             15         
         14 14 14 14 14 14 14 14 14 14 14 80    14 14 14 14 14 14 15 15 15 15 80    15         
         14                                     14                   15             15         
         14 14 14 14 14 14 14 14 14 14 14 80    14 14 14 14 14 80    15 15 15 80    15         
   30 30 14                                     14                   15             30 70 30   
   30    14 14 14 14 14 14 14 14 14 14 14 80    14 14 14 14 14 80    15 15 15 80          30   
   66                                                                                     67   
                                                                                               
                                                                                               

Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: stratoform on April 26, 2020, 10:09:30 pm
@torha
The Seal of Rimsala "title register reset" fix has a fastrom bank conflict.

Code: [Select]
$97/800A A9 24 00    LDA #$0024
$97/800D 8D 39 06    STA $0639
$97/8010 22 63 81 80 JSL $808163
$97/8014 22 84 C0 80 JSL $8084C0 --- here $97 vs $80

I suggest changing it to:

Code: [Select]
org $97800a
jsl +
nop #2


org $9cffc0
+
lda #$0024   ; old code
sta $0639

sep #$20     ; reset h-dma
stz $105a
rep #$20
rtl
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: Sarah Shinespark on April 28, 2020, 01:58:03 am
Okay, uncovered a little more!  :)
So Stavery 12F in Ch4 has a unique high encounter rate, 1 in 4. Also I understand the RNG better; given a number (4) it returns (0...3). This changes my understanding of a lot of code, especially the damage formula! Back to the drawing board... So if I understand this correctly,
Encounter rates:
Vanilla: 0C (1 in 12)
SOR: 14 (1 in 20)
Stavery 12F: 04 (1 in 4)

EDIT: Also back attack % seems to be 1/16.

EDIT2: Think I found position/quantity data for enemy formations! It's in a really well-hidden set of tables. Depending on the floor tile, the 2nd byte in the formation data references a pointer table to the hidden table. As it's based on the "2"nd byte in the formation "Header", I decided to call it the H2 Table. An example:
Code: [Select]
H2 Table format
*First byte, #entries
*Each entry's first byte, #words

H2 Table 00
Used by: Balnea 2F (Chapter 1 tiles 13, 14, 15)
Entries @ 9288: 10
00: 9289: 08 0400 0700 0800 2500 2600 4400 4700 4800
01: 929A: 01 0403
02: 929D: 01 0404
03: 92A0: 03 0402 0703 0802
04: 92A7: 03 0502 0602 2404
05: 92AE: 03 0503 0603 2404
06: 92B5: 05 0700 0800 2503 2603 4404
07: 92C0: 05 0403 2501 2601 4700 4800
08: 92CB: 02 0503 0603
09: 92D0: 02 0504 0604
0A: 92D5: 02 0503 0604
0B: 92DA: 05 0500 0600 2401 2700 2800
0C: 92E5: 03 0402 0702 0802
0D: 92EC: 03 0702 2400 4803
0E: 92F3: 05 0502 0602 2400 4704 4804
0F: 92FE: 03 0703 0803 2404

Notice how the first byte in each word always has a similar range. I think the high nybble is vertical position and low nybble is horizontal position. The 2nd byte in the word... hmm, probably refers to the enemy ID position in the formation table!! Yes, so for the first entry "0400 0700 0800 2500 2600 4400 4700 4800", notice how they all end in 00 and are arranged like "3 in front row, 2 in middle, 3 in back row". Balnea 2F has either "00" (Slime) or "0A" (Pudding/Jell) for the first entry! So this is the infamous 8-slime encounter. Oh man, what a find  :woot!:

Positions 00 through 03 are for the characters... THE CHARACTERS! lol
(https://i.ibb.co/gMTcCrs/3.png)
They're saving that spot for Axs, little guy... you'll have to move.
(Mimic secretly wants to be the mascot)


EDIT 3:
OK, I made a nerd document  8)  Think I'll do one for the original game too so I have something to submit. Here's an excerpt!
(https://i.ibb.co/RQN7T1N/Map-showoff.png)
(https://i.ibb.co/18bYR6x/Map-showoff-2.png)

I decided to call the H2 Table the "Battle Lists". Every area has a set of 16 (00-0F) possible battles, and it uses the Enemy List to decide what enemies to use. So a battle with 00 x8 could yield Slime x8 or Pudding x8 depending on what floor tile you're on. :thumbsup: Battle Lists also include enemy positional data, so now I know how to move enemies around too.
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: Apocalypse612 on May 02, 2020, 09:37:31 pm
Sarah's done some absolutely amazing work here with her rom patch(s). If any one you haven't tried out SOR yet, I highly suggest that you do. You will not be disappointed.

Also, the data she has scraped from and compiled from the game I haven't found anywhere else on the internet, so thanks for that too!|

Keep up the fine work.
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: stratoform on May 03, 2020, 09:59:33 pm
Something I've been wondering about. Inhal compresses pretty well compared to standard HAL. When the new dungeon maps are completed, would the ROM have to be expanded? It feels like they could be squished back into the original space with room to spare.
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: Sarah Shinespark on May 04, 2020, 04:39:20 pm
They could be, yes. I think torha suggested leaving them uncompressed because the game runs uncompression on the map like every frame, and the extra space significantly speeds up the game. ...Which is strange bc it uncompresses the map into RAM when you enter the dungeon.

In the meantime while I wait for torha to return and field compression/patch questions, having the maps uncompressed is super useful for testing and map editing. If I get to the point where I inhal the maps and leave the game unexpanded, I'll basically need to write a utility to run exhal/inhal and edit the maps. Right now I just have a tool I wrote to extract the already-uncompressed maps to .txt for editing, but writing one to re-insert the map data is gonna take a lot of error-checking. More importantly it'd be super useful to have a tool to edit the maps rather than tracking my changes in a TXT, but I haven't decided how I want the layout to work. (Will probably work like 1. Pick map number, 2. Pick row number, 3. Pick column number, 4. Input new value) :P

I'm gonna work on other sections while I wait for torha, so there aren't patch issues etc. Hopefully they're ok and come back soon.

Minor updates:
-Changed Rooks' "Card" ability to "Arcana"
-In work: Modifying some enemy formations (arrangements)
-In work: Increasing types of available enemies per area (most have 5 but some have only 4)
-In work: Decreasing backtracking and making areas more interesting

Also...
-Received a patch from RetGal that adds a credits line for me in SOR  :o 8) He's a heck of a fast learner and working on a Spanish translation (http://www.romhacking.net/forum/index.php?topic=30381.0) for vanilla that uses the diacritics and such. Check it out sometime~
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: stratoform on May 06, 2020, 04:03:02 pm
Tried to find some old-school Cartographer drawing program for ye olde RPGs like Wizadry, Pool of Radiance and such but nothing satisfied me. Excel doesn't cut it.


For SOR, I'm wondering if it's possible to modify bsnes-plus:
- https://github.com/devinacker/bsnes-plus
- Expand memory editor to 32 bytes per row
- Color code text based on dungeon floor codes

Then you could just open up custom debugger, edit RAM floor tiles and see the effects in almost real-time without lots of (disgusting) re-loading.

I'll let you know if I can make something like this work..
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: Sarah Shinespark on May 07, 2020, 07:00:33 pm
Thanks! Yeah I can expand the RAM editor in Geiger's, but color coordination would make things SO much easier... especially if I could hide "00".

Just thinking out loud, I heard the instruments and sound engine is similar to other HAL games like Kirby Super Star. It'd be funny if I could swap in music  ::) Really wouldn't fit, but it would be cool to see if it's possible.
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: stratoform on May 08, 2020, 12:17:21 am
New idea.

1) Download Cheat Engine and install
https://cheatengine.org/downloads.php

2) Download this tool and copy to CE install folder
https://github.com/stratoform/archive/raw/Arcana___Seal_of_Rimsala/Maps%20-%20Cheat%20Engine/cheatengine-i386.sor.exe.7z

3) Run snes emulator and play to dungeon floor

4) Run CE.SOR and 'Open Process'
   Select Snes emulator of choice.

   You'll have to find the floor layout using an "array of bytes" search.
   Check with Geiger or Bsnes+ memory debugger to be sure.

5) Now click 'Memory View'
   You will see a variety of colors. Edit what you want.

   If you want custom RGB colors for each range, just give me the #s and I'll change them around. ;)
   Walls (00) are invisible.

6) When done, either use Geiger / Bsnes+ memory save. Or CE 'Save Memory Region' to dump to file.


It's complicated. I'll help you through with each step that needs help.
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: Sarah Shinespark on May 08, 2020, 01:58:35 am
Ah, I have the ROM addresses for the maps (well, where torha put them). The RAM version is just at the end of RAM, can't miss it~

That does a bit involved, will hopefully have time and energy to look at it tomorrow!
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: stratoform on May 08, 2020, 08:38:20 am
I'll try posting some pictures to guide you along. Check this post for edits sometime later~


1) Start Snes9x Geiger

2) Run Cheat Engine SOR
https://github.com/stratoform/archive/raw/Arcana___Seal_of_Rimsala/Maps%20-%20Cheat%20Engine/cheatengine-i386.sor.exe.7z

3) Open process
(https://github.com/stratoform/archive/raw/___notepad___/Arcana%20-%20Seal%20of%20Rimsala/Maps%20-%20Cheat%20Engine/Guide/sor1_help1a.JPG) (https://github.com/stratoform/archive/raw/___notepad___/Arcana%20-%20Seal%20of%20Rimsala/Maps%20-%20Cheat%20Engine/Guide/sor1_help1b.JPG)

4) Edit memory and search
(https://github.com/stratoform/archive/raw/___notepad___/Arcana%20-%20Seal%20of%20Rimsala/Maps%20-%20Cheat%20Engine/Guide/sor1_help2a.JPG) (https://github.com/stratoform/archive/raw/___notepad___/Arcana%20-%20Seal%20of%20Rimsala/Maps%20-%20Cheat%20Engine/Guide/sor1_help2b.JPG) (https://github.com/stratoform/archive/raw/___notepad___/Arcana%20-%20Seal%20of%20Rimsala/Maps%20-%20Cheat%20Engine/Guide/sor1_help2c.JPG)

5) Now freely edit dungeon map
(https://github.com/stratoform/archive/raw/___notepad___/Arcana%20-%20Seal%20of%20Rimsala/Maps%20-%20Cheat%20Engine/Guide/sor1_help3a.JPG) (https://github.com/stratoform/archive/raw/___notepad___/Arcana%20-%20Seal%20of%20Rimsala/Maps%20-%20Cheat%20Engine/Guide/sor1_help3b.JPG) (https://github.com/stratoform/archive/raw/___notepad___/Arcana%20-%20Seal%20of%20Rimsala/Maps%20-%20Cheat%20Engine/Guide/sor1_help3c.JPG)

6) Tell me which tile #s to change to what RGB colors ;)


Side-note: Your new avatar gets a :heart: icon.


EDIT:
I suppose I should later add a mini-tutorial on how I edited Cheat Engine to do this tweak. It's not difficult but the actual steps can be hard to figure out.

Some of the default colors (http://www.romhacking.net/Colors) suck. Wouldn't mind changing it around like Pink, Orange and other vivid useful shades, plus some other code tweaks.


EDIT2:
How to make your own Cheat Engine mod.

1) Install latest version of Lazarus

https://sourceforge.net/projects/lazarus-snapshots/files/Window%2032/
-- ex. lazarus-2.0.8-fpc-3.2.0-beta-44680-win32.exe

https://sourceforge.net/projects/lazarus-snapshots/files/Window%2064/
-- ex. lazarus-2.0.8-fpc-3.2.0-beta-44680-win64.exe


2) Download latest Cheat Engine source code
https://github.com/cheat-engine/cheat-engine/archive/master.zip


3) Run Lazarus.
   Open "Cheat Enginecheatengine.lpi" from src archive.
   Run --> Build.
   Press "Green arrow" to go.


4) Make these changes to "Cheat Engine//hexviewunit.pas"
https://github.com/stratoform/archive/commit/db48c060014eea564e137fab14a0425b5a34cfa7


5) Run --> Build again. Test.
   Standalone release build is in "Cheat Engine//bin"
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: Sarah Shinespark on May 09, 2020, 12:36:21 am
I had to double-take that the maps didn't have a hidden "babe d00d"  ::)
Got sidetracked today tracking down text opcodes after finding a minor display bug in RetGal's translation, didn't figure it out but got some more research from it. Now I can follow subroutine and ram jumps hidden in text. Still a lot more opcodes with spaghetti code that's super hard to read... $A7B5 is complicated  :huh:
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: stratoform on May 09, 2020, 08:01:23 am
I added the lame codeword using Geiger's RAM editor.. bwa ha ha! Then did the CE search.


Special hexcodes makes it easy to find where the maps are stored using Cheat Engine. Then (naturally) you erase it. Would be a very silly, stupid joke to accidentally leave it in the map. ;)


You could also use "baad f00d", "feed c0de". Whatever fancys your creativity. Or you could go the longer way and search for the hexbytes that the floor layout has.
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: Sarah Shinespark on May 09, 2020, 06:01:22 pm
Well that... almost worked. Editing that text in RAM is easy, but in ROM the tile data is compressed (the EN in NINTENDO uses the EN from LICENSED) which makes the data entry an odd number of bytes from saving 1b. I got away with it for the subtitle because the title graphics there use a line for a tiny speck of the bottom graphic, which is easy enough to overwrite  :cookie:
(https://i.ibb.co/9gbW7zy/Arcana-SOR-v1-0dx-003.png)

Most of the tile data makes sense, like
04 8D 04 97 04 98 (tiles 8D, 97, 98)
but then where I'm expecting a 04, it has another high number:
84 06 91 02
...and neither 84, 91 are tiles. That line somehow retrieves the tiles 8E, 9A from LICENSED.

So much more tracing to do to understand this stuff  :(
This is why I get sidetracked so much on this project; I see something small, think "huh, that should be easy", then nope it doesn't work because of hardcoded x. Let's find out why! ...THREE HOURS LATERRR


EDIT1:
Making strides in editing the maps and encounters.
-Confirmed treasure chests can be relocated, if their location is also updated in the contents list.
-Confirmed monsters can be swapped and repositioned.
-Very odd display bug with the Ogre, poor guy may be doomed to obscurity with one minor appearance  :'(
 Other enemies can be substituted fine, but Ogre's graphics don't load and even make other enemies look like Goblins. Doesn't make any sense! For now I'm using Lizardman.

(https://i.ibb.co/YW4FD3s/Swapwin.png)(https://i.ibb.co/1GFD8yQ/Swapwin2.png)(https://i.ibb.co/cwmWG5g/Swapwin3.png)

Upcoming enemy changes:
Balnea 1F: Added 1/16 Lizardman, 1/16 Chimera
Dwarven Pass: Added 1/16 Flytrap, 1/16 Wolfsbane
Crimson Valley: First half now has Lizardman instead of Assassin
Crimson Valley: Added 1/16 Flytrap, 1/16 Wolfsbane
Forest of Doubt: Added 2/16 Thief, 2/16 Assassin
Remorse 1F/2F (Ch4): Switched Knight to Mimic, switched Warlock to Mage

Ch1-3 maps have surprising changes to them as well  8) I think y'all will have a blast exploring these.
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: stratoform on May 13, 2020, 10:16:45 pm
Sometime I'm decently interested in helping out with changing the title screen text and looking into that Ogre bug, if no one else chimes in.
(Currently absorbed with hacking SMAS)


Have you tried swapping Ogre in vanilla USA and Japan ROMs? They suffer the same problem?
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: Sarah Shinespark on May 14, 2020, 04:10:42 pm
Yeah, it's the same issue in vanilla and CM. Really surprised, I assumed Card Master's tables would be relocated since the text is a different length, but so far bank $18 is the same  8) awesome, that means I can eventually have edit support for CM as well.

What's interesting about this bug is that when changing Goblin + Goblin to Goblin + Ogre, they both use the Ogre colors. When switching Pickpocket + Pickpocket to Pickpocket + Ogre, the swapped PP uses a glitched Ogre sprite. Other monsters work just fine, but not Ogre  :huh: The stats seem to load accurately, just that one graphic doesn't play well with others.

If you wanna play around with it, here's my test changes:
-$18/9149: Change 00 03 05 07 09 to 00 03 05 07 04
-$18/9150: Change 00 01 06 07 09 to 00 01 06 07 04
-$18/949C: Change 05 01 06 01 24 02 to 05 01 06 04 24 02

First 2 set the 5th enemy ID to Ogre's, last line changes encounter 7 to use the 5th enemy in the ID lists.

Trace $18/80A2, get in a battle then edit register A to the encounter (7). It'll pull up either the 1st or 2nd depending on where in Balnea 1F you are, 1st is by the front and 2nd is by the C-shape on the left.

Just y'know, if you wanna mess around~


EDIT: Okay, yeah it has something to do with recolors. If 2 enemies with the same sprite are in the same list, the later one is the palette used. So Slime + Jel loads Jel's red palette, but Jel + Slime loads Slime's.

Yeah, for some reason Pilferer (01) shares gfx with Goblin (03) and Ogre (04), if they're together with P last then everyone has P's graphics. Same goes for Assassin (13). Gonna need to playtest the different formations as I add them >_<


EDIT2:
No dice finding enemy graphics, but PC gfx are in bank $0E. Rooks' out of battle sprite is $0E/81A1-8550 (3B0 bytes) for reference. Tracing is a PITA since the decompressor code at $877C is called for like the entire bank and not always contiguously. I'm... gonna leave that alone for now and just keep recolors apart when designing 2.0.


EDIT3:
Map and treasure changes are about done for now, preparing to playtest.
Also this will prooooobably break midgame but I'm tempted to make the Scale Mail water-elemental.


EDIT4:
Found the weapon shop inventory. Proof for shits and giggles:
(https://i.ibb.co/SdnfKLb/Arcana-u-001.png)


v2.0 is looking sharp, PM for beta testing. Gonna look at torha's patch conflicts and work on a release. SORv2.0 will be an expanded ROM, you can use FLIPS to patch and it will auto-expand for you. I can check for SNES Classic compatibility. Reason being, the game is so much faster this way. If there was a way to store them uncompressed in the original space, that'd be fine. But, that's not been done here so I'm favoring speed as entertainment.

Come check it out!  :woot!:
(https://i.ibb.co/5c0p0Q0/Arcana-ring-debut.png)
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: stratoform on May 20, 2020, 05:58:26 pm
Been gone for too long and all this happens! Don't think there's enough space to store uncompressed dungeon maps in original ROM.

Wish I had time to check all this out..
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: Sarah Shinespark on May 29, 2020, 01:12:35 pm
Two utilities are live now! For those of you that like having your ROM's data outputted to a file.
Arcana Monster Reader (http://www.romhacking.net/utilities/1536/)
Arcana Treasure Reader (http://www.romhacking.net/utilities/1526/)

2.0's been tested, just organizing patches to check for conflicts.
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: Sarah Shinespark on June 11, 2020, 11:58:04 am
Uh... neat! I put all the patches together, and once I enter the first dungeon the game crashes.  :crazy:
Ok figured it out, there's a patch conflict between Dungeon Map expansion and FastROM so you have to patch Dungeon Map second or it can't read the expanded maps.

SOR v2.0 is starting playtesting.

EDIT:
Found a bug in the Spell Reader patch, displays the quantity on Cards page 2 to $66 repeating. Page 2 is stored in a really weird way and interlaced with Page 1 selections, so it's hard to tell where entries should end.
(https://i.ibb.co/3BVKvbr/SOR-v1dx-spell-reader-000.png)

And another bug, somehow casting the Call Spirit spells on a Shaman freezes the game.
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: Sarah Shinespark on June 21, 2020, 07:23:12 pm
Almost ready for release! PM me if you'd like to test the awesomeness.
Fixed a bug present in all versions where level-up text could only handle 2 digit numbers.

(https://i.ibb.co/CHStwKC/Arcana-SOR-v2-0f003.png)(https://i.ibb.co/wzkYMDP/Arcana-SOR-v2-0f004.png)
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: Sarah Shinespark on June 29, 2020, 01:43:24 am
Okay, while waiting for the queue to open up I thought I'd share some research I've been doing. This goes to show how confusing the game's code is, having its own scripting language to decypher. So the background on this, I figured out the item handling code is loaded when double-clicking the item (solid red border on Rooks). Trying to see what if anything gets called for different items so maybe I can find leftover code for Water of Life or just know what's going on better. So with this scripting, the first byte is doubled and references a pointer table of different handler functions. The code is iterated with RAM $10, and some subroutines are called with $1049.

Code: [Select]
Double clicking a Medicine out of battle
81:9584: 07 71 A0 07 Run $07:A071 is item useable out of battle
81:9588: 0B 25 97 If false move to 9725
81:958B: 07 DF A0 07 (Else) Run $07:A0DF is item the Enchanted Jewel
81:958F: 0C 25 97 07 If true move to 9725
81:9592: 07 AA A0 07 Run $07:A0AA load selected item
81:9596: 07 C7 A0 07 Run $07:A0C7 is item a Return Ring
81:959A: 0C C2 95 If true move to 95C2
81:959D: 04 37 F1 05 Move to $05:F137
85:F137: 07 2A BB 07 Run $07:BB2A store a bunch of values from nearby RAM into 11A1-11B3
85:F13B: 07 F8 BA 07 Run $07:BAF8 load the item and store in $18C3
85:F13F: 12 11 If item (0C) is less than 11, move to code using the (0C) word in the following pointer table.
85:F214: 1B F5 F2 0C Move to $0C:F2F5
85:F2F5: 0F 01 00 00 Store 0000 in a RAM address (09C9 here) – 01 is the pointer table entry
85:F2F9: 06 02 Return

So looking through the code (rather than summarizing what happened here), there is a ton of code reuse. It loads the selected item in multiple functions and it's like 15 lines each time. Hard to tell how prevalent each function is, if cutting any of them would break code.

July 02, 2020, 03:04:42 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
Update's live! Lmk how you like it  :woot!:
Give it a shot! (http://www.romhacking.net/hacks/4505/)
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: Manamiko on August 02, 2020, 11:15:21 am
So far this has been a very fun and pleasant experience! I am playing SoR on the Snes-Mini and no issues. I have made it all the way to Bintel Castle slightly underleveled at lvl 37 but have decided to stick around smacking dragons and such til I over level XD.

On a side note, I do not know if it was intentional, but when you changed the attack values and what party members are capable of on their status screen for Attack without a weapon equipped, it does get a bit wonky. I noticed that sometimes their own attack value is higher than what a specific weapon is capable of giving them, so instead of it adding to their attack power, it nerfs it! I have never seen that in the game before. I think a great example was when I equipped Darwin with a lower end sword and his Attack dropped, and it was noticeable in battle.

Other than that, I love this hack!
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: Zoinkity on August 03, 2020, 03:39:44 pm
Runs fine on a Super UFO!

After playing through the prior version, can attest that throwing Rooks out there bare-fisted is vastly better than ever equipping him with anything.  Granted, if he ever did need to use his MP for anything you'd be in a fix, but his spell selection is so lame compared to just hitting something in the face.  As a bonus, the MP honey gives a bigger boost to his attack than the actual attack honey.

To be fair, it isn't worthwhile to make any of the other characters pugilists, at least in the last half of the game.  Equipment elements and free spells more than make up for it.  Even then Rooks doesn't get anything cool enough to offset having three times the attack of any other character.


Not sure if it is "fixable", but if you reorganize spells that only sticks until the character is "swapped out".  Switching the spirits throws away any changes made to their spell order.
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: galneon on August 04, 2020, 12:38:44 am
Does the game seem like it was balanced with the intention of the player always using the best weapons available to them? If it does, I can pretend there's no problem and always equip the party properly. If not, I will have to hold off till the next update as I don't want to play as Rooks the unarmed card monk.
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: Sarah Shinespark on August 04, 2020, 11:17:07 pm
Yeah, barefisted also has a good crit rate. The downside is that you don't get a damage bonus for race (like Wightslayer/Dragon Blade), and you have to forego his heals and Call X Spirit spells. His Call spells have no backfire chance, high accuracy and the 2nd highest spell power in the game. I get that it can make the optimal strategy boring, but it also really helps new players that don't know see the hint to bring an extra weapon along. I'm more interested in making the game accessible; I can make a hardtype if there's demand for that. (Keep in mind I have a very evil design in mind for a hardtype)

Runs fine on a Super UFO!
Not sure if it is "fixable", but if you reorganize spells that only sticks until the character is "swapped out".  Switching the spirits throws away any changes made to their spell order.
Great to hear it runs on real hardware! And yeah, the game overwrites the spell lists instead of saving them elsewhere. That would take an ASM fix and testing.
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: galneon on August 05, 2020, 01:30:48 am
I'd be interested in a hardtype if not for the nigh-interminable final dungeon of the vanilla game. :P I imagine you've already made it much more bearable in SoR, though, and since I haven't played regular SoR yet, I should probably do that before potentially creating more work for you. ;)
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: Sarah Shinespark on August 06, 2020, 09:47:19 pm
Yeah vanilla final dungeon is pretty rough without Fog Cards or good shields. (3rd slot equipment have magic defense).
Other thing though is that in vanilla you only get hit with Sleep. There's also Confuse which can interrupt your turn with self-damage. Paralyze and Petrify don't wear off after battle, prevent action, and Petrify also makes you take damage every turn; needs the Revitalize/Unpetrify spell, or Moon Oil/Maiden's Tears, or a Tent to restore the status. So I have the ability to make things much worse  :D

Not to mention making the maps harder to navigate, or removing the Map option so you have to use graph paper on new maps  >:D
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: RetGal on August 13, 2020, 02:43:26 am
Not to mention making the maps harder to navigate, or removing the Map option so you have to use graph paper on new maps  >:D

And do not forget to close every inn, so you need to beat the game in one sitting  :angel:
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: galneon on August 16, 2020, 12:47:18 am
And do not forget to close every inn, so you need to beat the game in one sitting  :angel:

Like myself, and most others, wouldn't abuse savestates to get around that :P
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: Sarah Shinespark on August 19, 2020, 06:57:17 pm
Like myself, and most others, wouldn't abuse savestates to get around that :P

Oh just pretend you're speedrunning on stream, you'll be fine lol.

(https://i.ibb.co/zSHKfKB/FF5-Spoof-v1-1-030.png) (https://www.romhacking.net/hacks/493/)
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: Sarah Shinespark on September 28, 2020, 10:54:58 pm
Short update today but I had fun researching this, I found where boss locations and what enemy is used, is stored. So now I could move any map boss fight in Ch1-3. (Ch4-5 bosses all start with dialogue triggers rather than boss triggers, and are stored elsewhere.) These data tables were added to the ROM map (http://datacrystal.romhacking.net/wiki/Arcana:ROM_map).

I also tidied up the Save data (http://datacrystal.romhacking.net/wiki/Arcana:SRAM_map) page added a few things and corrected some byte ranges.
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: Cureless on October 01, 2020, 07:30:00 pm
That's pretty cool, Sarah! Could be very useful.
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: Sarah Shinespark on October 12, 2020, 01:28:33 pm
Just saw the equip screen for FF4 Ultima, and oh man I'm jealous! I want to redraw the status and equip screens for SOR and show more of the hidden stats. Weapons have crit rate, element, race bonus (extra damage vs Undead, Dragons, Medusas, Giants). Armors have race defense bonuses (take less) and elements, and 3rd slot armors have magic defense. Would need to move some code around to make room I'm sure, but I can't help but wonder how I'd want it arranged. Probably cut the entries in each Equipment page to 6 instead of 8. For the status screen, there should be a function that reads the character element and prints it like with the spirits; I could write a similar copy that reads their equipped weapon's element instead.
(https://www.romhacking.net/hacks/snes/images/4134screenshot4.png)
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: Vanya on October 12, 2020, 07:31:54 pm
That would be a great addition. Anything that can be done to cut down on having to look up information online while I play an RPG is good.
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: Sarah Shinespark on October 12, 2020, 11:37:47 pm
Right? That's why I wanted to help add a bestiary to FF6 Brave New World (https://www.romhacking.net/hacks/2095/), but BTB likes old school printouts.

There's some hangups to adding significantly more data to these screens though. There's limited real estate space, about 140x130 and 147x59 for the two windows.


Original status and equipment screens:
(https://i.ibb.co/qYqwkB5/Arcana-SOR-v2-0g001.png)(https://i.ibb.co/q90L46b/Arcana-SOR-v2-0g002.png)


I can save a few lines by condensing the text. I *may* be able to eke out even more savings if I could make stat symbols (sword, shield) in the font. HP and MP are too long to fit on one line together, so unless I went with an unpopular smaller font change or removed current HP/MP, 3 lines is all I'm gonna be saving on the top panel.

For the bottom panel, I'd like to add the weapon crit rate and magic defense... but I can't think of an elegant way to place them. ALSO there's another weapon byte (looks like a NEGATIVE strength modifier), and ALSO some weapons and armor and accessories cast spells. Might just keep putting "this casts a spell" in the item description.

For the equipment screen (2nd picture), I was thinking it would be AMAZING if it displayed the description of the item you selected. (Normally to read the description, you have to go to sell the item. Not useful deep in a dungeon!) The bottom window is designed for this, so it would have to redraw the equipment if I wanted both the description and the atk/def section. Not sure how well that would work. Another thought is to draw a divider in the 7th row, and use the 8th row to put the character's Atk and Def values.

What are some of y'all thoughts? I'd love to hear input on stuff that could be feasible.
For reference, the status screen text is at $88C96A (4496A pc).


Mockup with grayed text
(https://i.ibb.co/C6175wL/Arcana-SOR-v2-0g003.png)


I added sixteen entries of 12 bytes to the free space at 46C30, for the sixteen combinations of damage flags (since Crystal Sword has all 4). So "Zombie", "Zombie/Dragn", "Zom/Drg/Mdsa" etc. If I can mimic a text-reading subroutine in the free space, all I have to do is call it on the current character's weapon race (which will be multiple steps, $1283,x for equipped weapon, then $85/E0E3,y for the weapon's race, then calling my new table for the text to display.)

Another mockup. I relocated the status screen (after spotting the start and end bytes with read breakpoints) to the end of the bank, so I have enough space to do whatever I want.

(https://i.ibb.co/dpkKhjy/Arcana-SOR-v2-0g-Temp-Status-mockup002.png)(https://i.ibb.co/XFpncZt/Arcana-SOR-v2-0g-Temp-Status-mockup003.png)


Mockup of the Equipment screen:
(https://i.ibb.co/2q4N09T/Arcana-SOR-v2-0g-equip-mockup.png)


EDIT 10/17:
I did it! Crit rate is now displayed for all humans. ASM code splice follows.
Code: [Select]
New code at 80E030 (6030)
Save x/y registers
5A phy
DA phx

Loads character value
AE 3F 10 ldx $103F
BD C7 09 lda $09C7,x
22 60 F4 87 jsl $87F460

New at 87F460: Loads character offset (for getting their equipment)
I had to put this one line in a different section because it was in bank $87 versus bank $80.
20 F5 B0    jsr $B0F5
6B rtl

Call C6DC with x=0, y=character to get character's crit rate
AB tay
A2 00 00 ldx 0000
20 DC C6 jsr c6dc

Store in display buffer and continue with attack code
8D F1 16 sta 16F1
FA plx
7A ply
BD C3 11 lda 11c3,x
29 FF 00 and #$00FF
6B rtl

Here's the latest!
(https://i.ibb.co/sCbwfH4/Arcana-SOR-v2-0g-Temp-Status-Mockup006.png)
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: Sarah Shinespark on October 20, 2020, 09:46:04 pm
Just submitted version 2.1a2 (https://www.romhacking.net/hacks/4505/)!
Forgot to mention in the readme, but:
-Unequipped critical chance/magic defense reduced to 0. (Mdef without a shield is endgame level in vanilla, let's not have that!)
-The stat screen looks like rings influence critical chance, but they don't. (It'd be cool, but the game doesn't check anything for them yet!)

Otherwise, updates are as follows:
-New status screen with icons
-Status now shows magic defense and critical hit chance, that was a fun week of assembly  :beer:
-Bugfix: Spirit defense now scales with level (Ifrit Lv40 went from 90->134 defense so this is big!)
Thanks to RetGal for helping with the icons, and abw for the ASM help!

October 27, 2020, 01:15:53 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
Version v2.1a9 (https://www.romhacking.net/hacks/4505/) is up  8)
I've been on a roll with programming changes!

(https://i.ibb.co/ykNNsBx/Arcana-SOR-v2-1-a5-testing-element001.png)(https://i.ibb.co/k5CPXhr/Arcana-SOR-v2-1-a7002.png)(https://i.ibb.co/KwZpn1n/Arcana-SOR-v2-1-a7001.png)

Coding: Elemental equipment can now be viewed in the Status screen!
Graphics: New elemental icons!
Script: Spell text rewritten for more flavor.
Script: Attribute spells now show their element.
Balance: Reverted barehanded damage to vanilla.

Also, I'm adding some "printme" references to the next release. These will include info like enemy stats, spells, equipment and maps. They are all in PDF format to avoid display errors with viewing in text editors.
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: PersianImm0rtal on October 29, 2020, 11:20:24 pm
Thanks Sarah! I am going to patch this and start a new game  :thumbsup:
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: Reiska on November 02, 2020, 04:29:36 am
Wait, was that shield thing a vanilla bug?  Are shields detrimental in the vanilla game? O_O
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: Sarah Shinespark on November 02, 2020, 09:00:44 am
Yeah, that's right. Unshielded gives $34 mdef (52 mdef) which is slightly better than the Spirit Gauntlet. Small Shield gives you the worst mdef in vanilla... zero. How's that for a challenge? lol

Only shields in vanilla worth getting are Caesar Shield, Grand Shield and Moon Gauntlet... unless you need some extra physical defense at the cost of your magic defense.
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: Dzumeister on November 07, 2020, 09:14:26 pm
for the next patch, could you make it so that you can skip the New Game cut scene by pressing Start or A or something?
Title: Re: Arcana - Seal of Rimsala! (SNES)
Post by: Sarah Shinespark on November 07, 2020, 09:26:32 pm
I'll have to look into how the "traveling" cutscene skip works, but I think I can do that. It'd be amazing and would make testing easier, so I'm down. If I can learn more about keyboard inputs, I'd rather the menu be opened with X rather than A too.