Trying to figure out Action53

Are you new to 6502, NES, or even programming in general? Post any of your questions here. Remember - the only dumb question is the question that remains unasked.

Moderator: Moderators

blahblahblah
Posts: 37
Joined: Sun May 01, 2022 6:02 pm

Re: Trying to figure out Action53

Post by blahblahblah »

calima wrote: Tue May 03, 2022 1:09 am Manually editing each ROM means they can access the mapper's full abilities (up to 8mb total PRG size, etc). The 256kb limit is when it's pretending to be UNROM.

But to be clear, you can't feed such edited ROMs to the a53 menu maker scripts, they're not designed for that. You'd have to edit them as the complete whole, and make a menu manually too.
Would I have to rewrite the entire thing? I don't know any Python.
calima
Posts: 1745
Joined: Tue Oct 06, 2015 10:16 am

Re: Trying to figure out Action53

Post by calima »

Well, you don't need to know Python, you need to know 6502 asm. Both to do mapper change edits to ROMs, and to make a custom menu. If you don't have any programming experience, this is not doable in weeks.
blahblahblah
Posts: 37
Joined: Sun May 01, 2022 6:02 pm

Re: Trying to figure out Action53

Post by blahblahblah »

calima wrote: Tue May 03, 2022 1:29 am Well, you don't need to know Python, you need to know 6502 asm. Both to do mapper change edits to ROMs, and to make a custom menu. If you don't have any programming experience, this is not doable in weeks.
I know ASM. I thought you meant redo the entire thing. But it looks entirely Python to me -- there are no ASM files in the folders.
unregistered
Posts: 1318
Joined: Thu Apr 23, 2009 11:21 pm
Location: cypress, texas

Re: Trying to figure out Action53

Post by unregistered »

blahblahblah wrote: Mon May 02, 2022 11:27 pm
if prgsize not in (0x8000, 0x10000, 0x20000, 0x40000, 0x50000, 0x60000):
Weirdly I still get the error message from exitpatch.py even though it should be tolerating way more than 256kb. What am I missing?
blahblahblah, pleased you learned and figured part 1 out! :D


calima has you covered, but I wanted to point out a small detail in the, your, quoted code above.

From your posts, it’s shown that the 0x, in code like python code, always precedes a number in hexadecimal format.


0x40000 is equal to 256k.

0x80000 is equal to 512k.

Can easily check this with Windows 10 Calculator; open it and click the menu icon (3 short, stacked, horizontal white bars); select Programmer mode; finally, in Programmer mode, click on HEX and enter 80000. Then, next to DEC (for decimal), it will show the decimal version of 0x80000; same value you entered in your second code change.

It makes sense that the 0x50000 and 0x60000 values don’t make much sense in the context in which you are attempting to use them. That’s the reason for your part2 error message.



tldr: 0x60000 < 512k :)

EDITS were: a.) switched the bold equation comparison bc that seems to make more sense having 0x60000 first
b.) misspelled calima
Last edited by unregistered on Tue May 03, 2022 12:38 pm, edited 3 times in total.
calima
Posts: 1745
Joined: Tue Oct 06, 2015 10:16 am

Re: Trying to figure out Action53

Post by calima »

blahblahblah wrote: Tue May 03, 2022 1:41 am I know ASM. I thought you meant redo the entire thing. But it looks entirely Python to me -- there are no ASM files in the folders.
If you go the manual path, you won't be using the a53 menu scripts at all?
blahblahblah
Posts: 37
Joined: Sun May 01, 2022 6:02 pm

Re: Trying to figure out Action53

Post by blahblahblah »

calima wrote: Tue May 03, 2022 1:51 am
blahblahblah wrote: Tue May 03, 2022 1:41 am I know ASM. I thought you meant redo the entire thing. But it looks entirely Python to me -- there are no ASM files in the folders.
If you go the manual path, you won't be using the a53 menu scripts at all?
A custom menu is one thing; making an entire custom multicart on my own is another.
blahblahblah
Posts: 37
Joined: Sun May 01, 2022 6:02 pm

Re: Trying to figure out Action53

Post by blahblahblah »

Trying to convert Mapper 30 to Mapper 28, finding no help whatsoever. This is the bankswitch macro that works with Mapper 30:
doBankswitchY:
STA currentBank
bankswitchNoSave:
AND #%00011111
ORA chrRamBank
STA $c000

RTS
There are bankswitch suggestions for Mapper 28 on this page, but they all look completely different and I don't know what they even mean. What do I do with all this?

https://www.nesdev.org/wiki/Action_53_mapper

Just for kicks I hard-changed the ROM to Mapper 28 with Mesen and ran it through the program to see what would happen. Obviously the game doesn't boot that way but the compile script theoretically shouldn't know the difference. It recognizes it as 28 but still treats it the same way as 2. More specifically, it still thinks the ROM has 16 banks instead of 32. I can't find an instance of a 16-bank limit definitively mentioned, so I don't know how to change it. It also needs to overwrite Bank 15 with some information specific to the multicart, and can't. Can I alter what bank it tries to write to?
User avatar
rainwarrior
Posts: 8734
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Trying to figure out Action53

Post by rainwarrior »

blahblahblah wrote: Wed May 04, 2022 2:22 pmI can't find an instance of a 16-bank limit definitively mentioned, so I don't know how to change it.
It's here:

Code: Select all

=== $01: Inner bank ===
7654 3210
   M BBBB
   | ++++- Set current PRG ROM bank
   +------ Set mirroring mode bit 0 if H/V mirroring is disabled
The inner bank register only has 4 bits.

To expand to 5 bits, you'll need to replace banking with something more compilcated that transfers the 5th bit to the outer bank register.

In a lot of cases, you might be able to replace a bankswitching STA with a JSR to a more complicated subroutine, though this will add extra execution time to every bankswitch. As long as you're not bankswitching too many times per frame, the speed difference might be fine. If you use the CHR bankswitching as well, it gets a little more complicated. Depending on your threading situation you might need to take care to avoid register corruption during NMI.

Also, when you switch outer banks, you'll also be switching the "fixed" bank, so you'll probably need to reserve bank 15 as a duplicate of bank 31... or if you can't, use a third outer bank and yet more bankswitch complexity to work around that.
blahblahblah
Posts: 37
Joined: Sun May 01, 2022 6:02 pm

Re: Trying to figure out Action53

Post by blahblahblah »

rainwarrior wrote: Wed May 04, 2022 3:58 pm
blahblahblah wrote: Wed May 04, 2022 2:22 pmI can't find an instance of a 16-bank limit definitively mentioned, so I don't know how to change it.
It's here:

Code: Select all

=== $01: Inner bank ===
7654 3210
   M BBBB
   | ++++- Set current PRG ROM bank
   +------ Set mirroring mode bit 0 if H/V mirroring is disabled
The inner bank register only has 4 bits.

To expand to 5 bits, you'll need to replace banking with something more compilcated that transfers the 5th bit to the outer bank register.

In a lot of cases, you might be able to replace a bankswitching STA with a JSR to a more complicated subroutine, though this will add extra execution time to every bankswitch. As long as you're not bankswitching too many times per frame, the speed difference might be fine. If you use the CHR bankswitching as well, it gets a little more complicated. Depending on your threading situation you might need to take care to avoid register corruption during NMI.

Also, when you switch outer banks, you'll also be switching the "fixed" bank, so you'll probably need to reserve bank 15 as a duplicate of bank 31... or if you can't, use a third outer bank and yet more bankswitch complexity to work around that.
Ugh, this is all way above my skill level. I only have experience manipulating the NESMaker engine, not shoving bits of other engines in there. I don't know what to do. I wish someone could guide me completely step-by-step on this.
User avatar
rainwarrior
Posts: 8734
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Trying to figure out Action53

Post by rainwarrior »

blahblahblah wrote: Wed May 04, 2022 4:36 pmI wish someone could guide me completely step-by-step on this.
I think trying to guide you to do it would be a lot more difficult than just doing it for you. The details of what to do will require a lot of hands-on knowledge of the ROM you're working with, I can't just make a recipe.

Sometimes it's worth making free step by step tutorials, if I think there's a public value to them, but you're asking for something extremely specific, and the contributed value would mostly be to someone else's commercial product (NESMaker).

So, maybe there's other people out there who want an NESMaker multicart. If anybody should invest time into this problem, it should probably be the makers of NESMaker, or at least people who are involved with that product.

Trying to do it with Action 53's multicart, which was definitely not designed for this purpose, will be an uphill battle. Creating a new multicart hardware for NESMaker specifically would make the operation easy and turnkey, repeatable for any NESMaker user that needs it. Unfortunately there just doesn't exist such hardware right now, as far as I know.

Otherwise if you do want to hammer your square-peg NESMaker ROMs into this round-hole Action 53 multicart, it's certainly possible to do. I think there are some people here who might be willing to do it for hire, if it's worth enough to you, but it might be expensive.


Alternative idea: if your NESMaker game isn't using the whole ROM, maybe figure out how to make a 256k NESMaker ROM that doesn't need CHR bankswitching. Then it's reduced to being the same as UxROM and Action 53 mapper will work properly. Not sure if that's possible because I have no idea what your game contains, but it's something worth checking.

Another idea: if your NESMaker games don't use the whole ROM... what about trying to merge them into a single NESMaker game? How feasible is that sort of thing?
blahblahblah
Posts: 37
Joined: Sun May 01, 2022 6:02 pm

Re: Trying to figure out Action53

Post by blahblahblah »

rainwarrior wrote: Wed May 04, 2022 4:58 pm
blahblahblah wrote: Wed May 04, 2022 4:36 pmI wish someone could guide me completely step-by-step on this.
Alternative idea: if your NESMaker game isn't using the whole ROM, maybe figure out how to make a 256k NESMaker ROM that doesn't need CHR bankswitching. Then it's reduced to being the same as UxROM and Action 53 mapper will work properly. Not sure if that's possible because I have no idea what your game contains, but it's something worth checking.
I purposely didn't use CHR bankswitching, or any of the other Mapper 30 exclusive features, because I was concerned it might cause problems in the future and I was right.

The games definitely are not using the whole ROM:
banksnstuff.jpg
Of the games completed so far, the one depicted above is the only one that takes over 50% and even then, not by much. Shrinking the space is also uncharted territory for me though. People on the Discord have suggested compression routines, but I took a look at the compression entry on NESDEV and didn't understand a word of it. I have no idea how to marry it with the NESMaker engine.
User avatar
rainwarrior
Posts: 8734
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Trying to figure out Action53

Post by rainwarrior »

Another route might be to use a PowerPak or Everdrive and replace the menu.

There's no ready made menu replacement for it that I know of, but at least the hardware exists and is very capable of doing it.

PowerPak's menu has available source code: http://nespowerpak.com/

Everdrive would be trickier, it has some development info but not source code like that.

The downside is it's an expensive cartridge, and maybe tricky to hide that CF card. If you're trying to make 100 of these, maybe this isn't a viable option, but if you're only making 1 or 2 for personal use the price is probably pretty reasonable?
blahblahblah
Posts: 37
Joined: Sun May 01, 2022 6:02 pm

Re: Trying to figure out Action53

Post by blahblahblah »

OK, I'm back. I was right -- the shrinking was totally doable. I was able to rearrange one of my games into 16 banks and compile it into a 256k ROM!
banks.jpg
Now my issues are with Action53 again. When I tried submitting it, it thought my ROM was EIGHT banks, not 16, and attempted to shove the exit patch into Bank 7 (where there is no room) instead of Bank 15 (where there is plenty of room).
2 titles across 2 roms on 1 pages loaded successfully
start_bank is 0
Unused for C:\Users\HP ProDesk\Desktop\action53-master\collections\demo\roms\Allison2256.nes
[[(50288, 65530)], [], [], [], [], [], [], []]
Traceback (most recent call last):
File "C:\Users\HP ProDesk\Desktop\action53-master\tools\a53build.py", line 721, in get_exit_patches
patcher.add_patch(method, prgbank)
File "C:\Users\HP ProDesk\Desktop\action53-master\tools\exitpatch.py", line 356, in add_patch
loc, data = self.find_dest(method, entrybank)
File "C:\Users\HP ProDesk\Desktop\action53-master\tools\exitpatch.py", line 334, in find_dest
raise UnpatchableError("no room in bank %d for an exit patch"
exitpatch.UnpatchableError: no room in bank 7 for an exit patch

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\HP ProDesk\Desktop\action53-master\tools\a53build.py", line 1500, in <module>
main()
File "C:\Users\HP ProDesk\Desktop\action53-master\tools\a53build.py", line 1296, in main
exit_patches = get_exit_patches(titles, roms, skip_full)
File "C:\Users\HP ProDesk\Desktop\action53-master\tools\a53build.py", line 725, in get_exit_patches
raise UnpatchableError("%s: %s" % (path, e))
exitpatch.UnpatchableError: C:\Users\HP ProDesk\Desktop\action53-master\collections\demo\roms\Allison2256.nes: no room in bank 7 for an exit patch
When I was trying the 32-bank ROMs it also thought those were 16 banks. How do I get it to read the ROMs correctly?
JRoatch
Formerly 43110
Posts: 422
Joined: Wed Feb 05, 2014 7:01 am
Contact:

Re: Trying to figure out Action53

Post by JRoatch »

blahblahblah wrote: Sat May 07, 2022 6:28 pm Unused for C:\Users\HP ProDesk\Desktop\action53-master\collections\demo\roms\Allison2256.nes
[[(50288, 65530)], [], [], [], [], [], [], []]

...

exitpatch.UnpatchableError: C:\Users\HP ProDesk\Desktop\action53-master\collections\demo\roms\Allison2256.nes: no room in bank 7 for an exit patch
Last I remembered (being the guy who put together a53v4), in most cases the builder does not automatically mark what's free space for use of the exit patch. I've always had to manually use prgunused.py --a53 rom.nes to quickly gauge the unused space to type into the collection's cfg file. You can probably start out with a line like prgunused0=ffe0-ffff to mark the last 32 bytes.
Last edited by JRoatch on Sat May 07, 2022 7:09 pm, edited 1 time in total.
blahblahblah
Posts: 37
Joined: Sun May 01, 2022 6:02 pm

Re: Trying to figure out Action53

Post by blahblahblah »

JRoatch wrote: Sat May 07, 2022 7:04 pm
blahblahblah wrote: Sat May 07, 2022 6:28 pm Unused for C:\Users\HP ProDesk\Desktop\action53-master\collections\demo\roms\Allison2256.nes
[[(50288, 65530)], [], [], [], [], [], [], []]

...

exitpatch.UnpatchableError: C:\Users\HP ProDesk\Desktop\action53-master\collections\demo\roms\Allison2256.nes: no room in bank 7 for an exit patch
Last I remembered (being the guy who put together a53v4), in most cases the builder does not automatically mark what's free space for the input ROM. I've always had to manually use prgunused.py (with the --a53 option) to quickly gauge the unused space to type into the collection's cfg file
Manually? How do you go about that? I'm new to command lines.
Post Reply