So, I want a tool that would allow me to put tiles on a screen that lets me see what my level looks like so I can type in the data for the game. I need one that lets me see multiple nametables.
Would the
tiled map editor be usable? It's not an exact match, but ...
NES Screen Tool is the most popular software for designing Name Tables, but you do it all graphically, not typing values, and when you're done you can export the data to include in your project.
Most people don't build levels out of raw name tables though, because these take a lot of space. Keep in mind that an NROM cartridge has only 32Kb of PRG-ROM, and each raw name table (plus it's attribute table) is 1Kb, so you'll hardly be able to hold over a dozen or so screens along with the code, music, and other things a game needs.
Most programmers come up with more compact formats to represent level maps, otherwise SMB could never fit in 32Kb!
Do you mean...
"How did they design the levels?"
Or
"How did they program the levels?"
The first question = they drew them out on graph paper.
The second question = very complicated compressed metatile system.
So, at the start of each level, it will find a pointer to some level data. It has separate sets of data for enemies and for BG.
The first few bytes of data will tell it what kind of world it is, and it uses that to switch palettes and switch music.
The next byte will set a master design... something like, 2 blocks of floor, and blank sky. (Filled with scenery appropriate for that world...like clouds)
The next bytes it gets will give it directions for how to draw a room...starting at X=2,Y=3, draw left to right 5 bricks.
Then it has an automated routine draw the tiles for a brick metatile (4 tiles)....and it will repeat 5 times, shifting right each time.
And, even more complicated, it buffers writes to occur only during v-blank. So you can scroll smoothly without having to turn rendering off.
You don't have to do any of this like the SMB programmers do, but this is one of many ways to compress a level.
Edit - it can also use 1 byte to say...draw a flagpole here. Or, draw an end of level castle here.
Those are represented as 'objects', and there is a separate set of data to represent the tiles of that object. Like an array of tile numbers.
Thanks, Doug! you've really saved me a whole lot of time! Imagine how long it would have took me if I did each nametable individually!
I'm guessing you are being sarcastic.
Mario Bros used a complex system, because they were trying to cram 32 levels into 32000 bytes.
Use a simpler system. Use the NES screen tool. Make a nametable with it. Either compress it with the RLE system that comes with it, or some other compression method.
You can uncompress into expansion RAM at $6000-7fff.
And then load to the PPU as you scroll, a little at a time.
I actually wasn't being sarcastic, because my levels use a lot of looping tiles, I came up with a method that would use the Y register for the high byte, the X register for the low byte, and the accumulator for the tile number. To write a nametable, all you would have to do is load X with the low byte of where your starting to write, the A register with whatever tile number you wanted to use, and then store the low byte of the memory address you want to end on. every loop, it will increase the low byte and check if it's equal to the low byte you want to end on. If they aren't equal, it repeats. It would look like this.
Code:
GetRegistersReady:
LDA #$03 ;Prepares A register
LDY #$20 ;Prepares Y register
LDX #$FF
STX NametableEndByte ;Sets at what address to stop
LDX #0 ;Prepares X register
JSR NametableLoop
; You can prepare other tiles here
NametableLoop:
STY $2006 ;Stores high byte
STX $2006 ;Stores low byte
STA $2007 ;Stores tile number
INX ;Increases low byte
CPX NametableEndByte ;Checks if safe to end loop
BNE NametableLoop ;If not, repeat
RTS ;When done, check for more tiles.
Here's my tilemap tool,
MapEd ProIt uses metatiles of different sizes, not raw name tables. You would need to setup palettes and chr mapping before you could build a map.
Quote:
That's a tile editor, though. Not a map editor.
It can't output a nametable.