Homebrew Emulation Forked MSXAdvance to add auto ROM mapper detection

patters

Well-Known Member
OP
Member
Joined
Jan 28, 2006
Messages
174
Trophies
1
XP
921
Country
https://github.com/patters-syno/msxadvance

FluBBa's MSXAdvance is a solid emulator which runs very well on GBA. There are many absolute classic shooters on the MSX1:
  • Nemesis, Nemesis 2, Nemesis 3
  • Salamander
  • Zanac A.I.
  • Twin Bee
  • Parodius
  • Fantasy Zone
  • R-Type
However, until now MSXAdvance was let down by one significant usability issue - you had to manually select the ROM mapper for each game (which was hidden away in the Other Settings menu), and you also had to restart the emulator once you had changed it. Furthermore you need to remember which mapper for each game. Not anymore though!

I forked the MSXAdvance sourcecode to hack in automatic mapper selection. I remember begging for this feature on the PocketHeaven forums back in 2006, and I seem to recall that FluBBa answered something along the lines of "it's open source, so you can add that if you really want". Well now I did :)

My new Python 3 builder must be used for this feature. In fact it is the builder which detects the appropriate mapper to use and records this choice in a spare byte in the ROM header for retrieval by the emulator. I implemented the same algorithm which several other MSX emulators use to scan the ROM for likely bank switch instructions and rank the observed destination addresses.

To minimise the changes needed to the emulator ARM ASM code I repurposed the upper 3 bits of the emuflags 4 byte word passed by main.c to cart.s, meaning that the spritefollow half-word within is reduced from 16 bits to 13 bits wide. The rarely-used sprite follow feature will still function but the max value is now limited to 8191.

Although MSXAdvance v0.3 and v0.4 were released, they very significantly impacted game compatibility, which is why I forked v0.2. I have updated my EZ-Flash IV exit-patched emulator collection with this development.

I never in a thousand years thought I would be able teach myself the skills to pull off this kind of hackery, but it's all thanks to open source. I have zero training nor prior experience in C, Python, nor ARM assembler other than what I've pieced together from looking at this stuff. If I can do it, so can you with some experimentation.

Enjoy!
 
Last edited by patters,

patters

Well-Known Member
OP
Member
Joined
Jan 28, 2006
Messages
174
Trophies
1
XP
921
Country
I can see downloads for the wrong build. If you downloaded this and were wondering why the mapper choice is still manual, it's because you got the wrong build. GitHub was marking the wrong one as the latest, which was confusing. That's fixed now.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • S @ salazarcosplay:
    or like terminatior
  • S @ salazarcosplay:
    with living tissue
  • BigOnYa @ BigOnYa:
    @Xdqwerty there is health behaviour you can add to your character, then to use a health bar is lil more complicated, google n watch a few tutorial video on it, be too hard to explain here.
  • Xdqwerty @ Xdqwerty:
    @BigOnYa, the character has the health behavior
  • BigOnYa @ BigOnYa:
    I know you have to create a health and health max variable. Then there is a calculation you use in code to subtract width size of the health bar. Google few vids.
  • Xdqwerty @ Xdqwerty:
    @BigOnYa, the "greenflatbar" is one of the preset health bars btw
  • BigOnYa @ BigOnYa:
    Yea you can use any bar/sprite. It will just change the width. Ok good luck and have fun. I'm off to go shoot some pool at the bar. Talk to you later.
    +1
  • Xdqwerty @ Xdqwerty:
    @BigOnYa, why does the health behavior exist if you can just use a variable?
  • Xdqwerty @ Xdqwerty:
    and nope the number still doesnt change
  • Xdqwerty @ Xdqwerty:
    ok im gonna make my own asset
  • Xdqwerty @ Xdqwerty:
    nvm i think i fixed it
  • Xdqwerty @ Xdqwerty:
    @BigOnYa, I fixed it
    +1
  • S @ salazarcosplay:
    how are you\
  • Xdqwerty @ Xdqwerty:
    @salazarcosplay, we just talked like 2 hours ago
  • BigOnYa @ BigOnYa:
    I had the Goodyear blimp fly real low right over my house this morning, was weird out of nowhere looking up and seeing it that close up. Memorial golf tourney going on by me in Dublin Ohio and its there.
  • Xdqwerty @ Xdqwerty:
    @BigOnYa, i tried the gdevelop mobile app and theres a event limit and you have to pay to add more events
  • BigOnYa @ BigOnYa:
    I never used the mobile or online versions, just the pc version.
  • Xdqwerty @ Xdqwerty:
    @BigOnYa, i only use the online version
    +1
  • BigOnYa @ BigOnYa:
    I was at the bar for 1 hour and lost $40 playing pool, and said well that's enough for my unlucky day, better quit. Some sharks up there today.
  • Xdqwerty @ Xdqwerty:
    @BigOnYa, did you get drunk?
  • BigOnYa @ BigOnYa:
    No I don't drink much when i goto bar, cause I driving, or if/when I do, ill take a uber/cab home. But I'm working on it now tho I'm home, beer n whiskey shots today.
    BigOnYa @ BigOnYa: No I don't drink much when i goto bar, cause I driving, or if/when I do, ill take a uber/cab...