4-way freely-scrolling engine with status bar

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
4-way freely-scrolling engine with status bar
by on (#183224)
So I just mostly finished coding this 4-way, freely scrolling engine that I'll probably use in a game later on.
For now, I just wanted to show this off to my fellow NES developers :)

There might be a few attribute issues, as well as having the actual scrolling taking a long time to execute (Press select to see the runtime. It's been only half-optimized, ha!), but I believe this is decent enough to show off without it looking like a completely unfinished mess.
Oh, and it even has a status bar :D

DL link is attached to this post. Let me know if you have any feedback ^^
Re: 4-way freely-scrolling engine with status bar
by on (#183254)
Wow
Re: 4-way freely-scrolling engine with status bar
by on (#183256)
Speed BLAST PROCESSING!! :shock:
Re: 4-way freely-scrolling engine with status bar
by on (#183259)
Cool looking demo. The technique you're using for the status bar reminds me of the status bar in The Jungle Book. Having to redraw the status bar all the time is something that doesn't sit well with me, though. You're using horizontal mirroring, right? This means you have attribute artifacts at the side(s) of the screen when scrolling, so you could achieve the exact same effect if you used 1-screen mirroring and had the gameplay and the status bar each in a separate name table, so you wouldn't need to keep redrawing the status bar to dodge the scroll.
Re: 4-way freely-scrolling engine with status bar
by on (#183260)
tokumaru wrote:
Cool looking demo. The technique you're using for the status bar reminds me of the status bar in The Jungle Book. Having to redraw the status bar all the time is something that doesn't sit well with me, though. You're using horizontal mirroring, right? This means you have attribute artifacts at the side(s) of the screen when scrolling, so you could achieve the exact same effect if you used 1-screen mirroring and had the gameplay and the status bar each in a separate name table, so you wouldn't need to keep redrawing the status bar to dodge the scroll.


I got inspired by The Jungle Book indeed ;)
Attribute artifacts are definitely an unavoidable problem here, and I thought about doing it alla Crystalis for a while, especially since I'm using MMC3 for the IRQs, but I ultimately ended up doing it Jungle Book style. Just a matter of personal preference I guess...
Re: 4-way freely-scrolling engine with status bar
by on (#183261)
If I'm not mistaken, The Jungle Book users vertical mirroring, so getting a scrolling window plus a status bar in just 30 tiles of vertical space is a very tight fit, but I believe the game gets away with it by blanking part of the screen. The biggest advantage is that there are no attribute artifacts at all when scrolling.

You can also get rid of the attribute artifacts if you use a cartridge containing VRAM for 4 screens. You'd still have to redraw the status bar sometimes, or skip it using IRQs.
Re: 4-way freely-scrolling engine with status bar
by on (#183262)
This demo uses MMC3, whose standard boards don't support 1-screen mirroring. It also uses WRAM at $6000. TLSROM (mapper 118, MMC3 with A10 out = CHR A17) supports arbitrary mirroring, but unlike TSROM and TKROM, TLSROM has no WRAM at $6000. TKSROM (mapper 118 with battery RAM) supports both 1-screen mirroring and battery RAM, but it isn't very Ys-y to find a game using that board. (Only its Super NES port made it across the Pacific.)

One optimization suggestion for this general technique of moving the status bar back and forth: Use only the last two rows of each nametable ($2380-$23BF) for the status bar so that you don't have to redraw it quite as often.

Another optimization suggestion, specific to MMC3 or other mappers with an interval timer: Set the timer to when scanline 223 of the nametable is about to be rendered, so that you can wrap around to Y=0 in software just before line 224. That way:
  1. You can keep the status bar at Y=224 ($2380) without needing to redraw anything.
  2. You get a plane that's 7 attribute rows tall instead of 7 1/2, making camera control somewhat simpler especially with your 32x32 pixel metatiles.
  3. You can arrange the nametable horizontally (vertical mirroring) to completely eliminate the attribute clash on the trailing edge.
Re: 4-way freely-scrolling engine with status bar
by on (#183270)
What mappers support the "L" mirroring? Or is that something custom?
Re: 4-way freely-scrolling engine with status bar
by on (#183273)
Only two mappers that I'm aware of have L-shaped mirroring as a distinct mode: Sachen 374N and Sachen 8259. Anything that allows assigning a separate A10 out value for each combination of PA10 and PA11 in also supports L-shaped mirroring, such as TLSROM, MMC5, and Namco 163.
Re: 4-way freely-scrolling engine with status bar
by on (#183302)
tepples wrote:
This demo uses MMC3, whose standard boards don't support 1-screen mirroring. It also uses WRAM at $6000. TLSROM (mapper 118, MMC3 with A10 out = CHR A17) supports arbitrary mirroring, but unlike TSROM and TKROM, TLSROM has no WRAM at $6000. TKSROM (mapper 118 with battery RAM) supports both 1-screen mirroring and battery RAM, but it isn't very Ys-y to find a game using that board. (Only its Super NES port made it across the Pacific.)

I have yet to be able to see the demo, but I see no reason for not using TKSROM equivalent if one would like to. It can be easily supported on flash carts, and if there is a need to test from a Nintendo board it's just a single wire change from TSROM or TKROM.
Re: 4-way freely-scrolling engine with status bar
by on (#183311)
TKSROM is one of infiniteNESlives' "coming soon" items; though the list could benefit from an update or a priority list or pipeline queue.