Language…
7 users online: JX444444, kurtistrydiz, Nitrogen, OEO6, playagmes169,  Tahixham, Vuong Van - Guests: 100 - Bots: 101
Users: 57,945 (2,498 active)
Latest user: karls_Corinthia

Asar: Under new management

...Jack, are you trying to create a somewhat-less-broken Asar Anti?

If yes, keep in mind these traps:
- autoclean writes data
- Patches could read3 whether they're inserted already, and if so, skip some steps (or even throw errors)
- Negative distance in skip
But it should be good enough for all plausible patches.

Originally posted by RPG Hacker
Like, if some code or data goes from $01E000 to $01FFFF and some other code or data goes from $020000 to $021FFF

Well, $020000 to $021FFF is RAM, so I think we can safely assume it's not patched. $41E000 to $421FFF would be a better example.

Asar considers it an error to cross banks, so if you want it merged, you'd have to add code to merge it. And that's a waste of time.

Quote
or can other things (like switching architectures) affect the mapping mode as well?

Some of the SPC700 modes make the org command become base and take 16bit addresses. But there's a fairly easily found if statement in there, so you can just put that in the else clause and ignore the org-but-actually-bases.

Quote
Not really all that important, but asar has a bug where it treats forward jumps as +1 byte when calculating the RATS size.

I know Asar miscounts forward references - but only if it's LDA Table,x. I don't think BEQ would be miscounted.

And I thought it set the RATS tag size correctly, it just skips some actually-small-enough holes sometimes (so reinserting an unchanged patch would generally move it).

I don't think you can fix fhat one without adding a fourth pass, and that would be impopular.

Quote
changing the mapping mode multiple times or mid-ROM doesn't make much sense and can safely be treated as an error, right?

How aout if there's some random shit appended to the ROM where you need the full norom 16MB range, but the first megabytes are lorom and you want Asar's native lorom handler? I think smkdan's lunar.sfc does that.

But lunar.sfc is 64MB, so Asar won't help anyways.
<blm> zsnes users are the flatearthers of emulation
I suppose the safest and simplest option here is probably to just write both addresses (PC offset and SNES address) to the struct and then add a "use with caution" note to the SNES address. In 99% of all cases, just using that SNES address should probably be fine, though.
Feel free to visit my website/blog - it's updated rarely, but it looks pretty cool!
THAT REMINDS ME

exhirom/exlorom support please. ive been using macros for the former and its not too fun
What's the main characteristic of those modes? Implementing new mapping modes sounds kinda major... unless all I need to touch in Asar are the address conversion routines, in which case it might actually be quite simple. I'm not familiar with the diferent mapping modes, so can you list all key differences between exhirom/exlorom and other mapping modes?
Feel free to visit my website/blog - it's updated rarely, but it looks pretty cool!
The lorom command itself, of course. And I think there's a PC->SNES converter too, but that should be in the same file as the SNES->PC one; I don't think there's any more than that.

To prove or disprove that theory, grep -r addr_lorom, or whatever I called it.
<blm> zsnes users are the flatearthers of emulation
rough conversions (excluding header)

lorom
SNES 008000 = PC 000000
SNES 018000 = PC 008000
SNES 400000 = not ROM
SNES 408000 = PC 200000
SNES 808000 = PC 000000
SNES C00000 = not ROM
SNES C08000 = PC 200000
SNES FFFFFF = PC 3FFFFF

hirom
SNES 008000 = PC 008000
SNES 018000 = PC 018000
SNES 400000 = PC 000000
SNES 408000 = PC 008000
SNES 808000 = PC 008000
SNES C00000 = PC 000000
SNES C08000 = PC 008000
SNES FFFFFF = PC 3FFFFF

exlorom
SNES 008000 = PC 400000
SNES 018000 = PC 408000
SNES 400000 = not ROM
SNES 408000 = PC 600000
SNES 808000 = PC 000000
SNES C00000 = not ROM
SNES C08000 = PC 200000
SNES FFFFFF = PC 3FFFFF

exhirom
SNES 008000 = PC 408000
SNES 018000 = PC 418000
SNES 400000 = PC 400000
SNES 408000 = PC 408000
SNES 808000 = PC 408000
SNES C00000 = PC 000000
SNES C08000 = PC 008000
SNES FFFFFF = PC 3FFFFF
I think this is a bit of a better explanation.
Anime statistic on MyAnimeList:
400 animes completed ✓
6000 episodes completed ✓
100 Days completed ✓
... what even am I doing with my life?
Does Asar as it currently stands have an option to allow bank crossing? Some dynamic sprites require that.

----------------

I'm working on a hack! Check it out here.
That should be enough material to get me started, thanks!

Originally posted by imamelia
Does Asar as it currently stands have an option to allow bank crossing? Some dynamic sprites require that.


I think there is a version of incbin that allows bank-crossing. Aside from that I'm not sure. What exactly do you need to cross banks?
Feel free to visit my website/blog - it's updated rarely, but it looks pretty cool!
Some dynamic sprites have GFX files that are larger than 32 KiB.

----------------

I'm working on a hack! Check it out here.
That should be possible with incbin then, I think. Look into manual.txt, it mentions bank crossing in a few places.
Feel free to visit my website/blog - it's updated rarely, but it looks pretty cool!
Hm...does that not work with Sprite Tool? I tried both the -> method and the split method (doing incbin blah:0000-7FFF and 8000-FFFF), and I keep getting errors like this:

Code
tmpasm.asm:1221: error: No freespace found [incbin yibncgfx.bin -> GFXAddr]
tmpasm.asm:1058: error: Label GFXAddr not found [LDA.w #GFXAddr]
tmpasm.asm:1064: error: Label GFXAddr not found [LDA.b #GFXAddr/$10000]
tmpasm.asm:1221: warning: This freespace appears to be leaked.


----------------

I'm working on a hack! Check it out here.
Not sure if it works with Sprite Tool. I've never personally used it yet. Can you post your code here to give a rough idea of what you're trying to do? Who knows, maybe incbin has a bug after all, so it might be worth looking into it.
Feel free to visit my website/blog - it's updated rarely, but it looks pretty cool!
I'm trying to insert edit1754's YI Ball 'n' Chain sprite, which uses a 64 KiB .bin file for its graphics. The only relevant code is these three references:

Code
LDA.w #GFXAddr

Code
LDA.b #GFXAddr/$10000

Code
incbin yibncgfx.bin -> GFXAddr


----------------

I'm working on a hack! Check it out here.
Did you try it on a clean, expanded ROM? Maybe there really just isn't any area in the ROM you're currently using that has two consecutive banks of free space. Fixing the first of those errors should automatically make the other errors disappear, I assume.

The sprite does seem to require your graphics to be placed exactly at the start of a bank, though looking at incbin in Asar's manual, it does seem to enforce that kind of alignment for such big data, anyways, so that should technically work. If free space in your ROM isn't the problem, then it might indeed be a bug in Asar. Maybe its freespace detection doesn't work correctly for data that's bigger than a single bank. Will have to take a look at the code.
Feel free to visit my website/blog - it's updated rarely, but it looks pretty cool!
Yeah, there's more than enough free space in the ROM.

----------------

I'm working on a hack! Check it out here.
since I just ran into this "problem", think a pushtable, pulltable command would be worth the effort?
Anime statistic on MyAnimeList:
400 animes completed ✓
6000 episodes completed ✓
100 Days completed ✓
... what even am I doing with my life?
yes
Anime statistic on MyAnimeList:
400 animes completed ✓
6000 episodes completed ✓
100 Days completed ✓
... what even am I doing with my life?