Page 12 of 20
Re: NES Screen Tool
Posted: Thu Nov 07, 2013 4:01 pm
by lidnariq
NES Screen tool makes it easier to draw a screen for the NES, or set of screens.
To actually display on a NES, you will still need a little bit of program, but it's a task that could easily be done using cc65.
Re: NES Screen Tool
Posted: Thu Nov 07, 2013 4:02 pm
by rainwarrior
caramelpuffpuff it is just a very nice tool for making NES screens. The nicest, actually.
It's not "needed"; there are lots of ways to make an NES screen. For example, some people just type nametables out as hex numbers in the assembly code. Shiru's tool is really convenient though, since it already obeys all the NES rules.
Re: NES Screen Tool
Posted: Thu Nov 07, 2013 5:17 pm
by caramelpuffpuff
RainyHero, so is this tool, "universal-usage" or "exclusive-usage", which is only use for certain games only, like SMB3 tools? And is this tool usable to everything I'd use it on, like title screen, background, game-over, stages, selection, etc? Or it has limitations/more than I said?
Re: NES Screen Tool
Posted: Thu Nov 07, 2013 6:00 pm
by tepples
It can be used on any screen, but some things related to nametables (such as collision or heavy compression) are best done with specialized tools.
Re: NES Screen Tool
Posted: Thu Nov 07, 2013 6:35 pm
by caramelpuffpuff
Is nametable the "entire group" of sprites and graphics and backgrounds? Or the is term is different?
Re: NES Screen Tool
Posted: Thu Nov 07, 2013 6:37 pm
by lidnariq
"pattern table" is the term for the group of small 8x8 pixel pictures that are combined to make sprites and backgrounds.
Name table is the term for the list of numbers that say what pattern table pattern is drawn where in the background.
Re: NES Screen Tool
Posted: Thu Nov 07, 2013 6:39 pm
by tepples
A background consists of three parts of video memory: the pattern table ($0000-$0FFF), the nametable ($2000-$23FF), and the palette ($3F00-$3F0F). The pattern table is the 256 tiles, the nametable is a 32x30-tile map plus a 16x15-area coloration map that tells which part of the palette each 2x2 block of tiles uses. Sprites use OAM (a separate memory space) and typically use the other pattern table ($1000-$1FFF).
Re: NES Screen Tool
Posted: Thu Nov 07, 2013 6:44 pm
by caramelpuffpuff
Oooooooooooooh. So nametable it's a file-code to organize on what sprites and background it appears and what does not.
Re: NES Screen Tool
Posted: Wed Nov 13, 2013 6:28 pm
by darkhog
Could you add export for nametable as .asm text file with .byt/.db instructions? I've found out that easiest method to put nametable into memory is to divide it into 6 "segments", each of 5 rows so we can load it each by 160 bytes with 6 loops, like this:
Code: Select all
loop:
lda face,y
sta PPUDATA
iny
sty $A1
lda $A1
cmp #160
bne loop
ldy #00
loop2:
lda face2,y
sta PPUDATA
iny
sty $A1
lda $A1
cmp #160
bne loop2
ldy #00
;snip for rest of loops as they are largely same
To do that, I need to put symbols (labels) every 5 rows of nametable, so I need text output (hex numbers) instead of binary (.nam files).
Re: NES Screen Tool
Posted: Wed Nov 13, 2013 6:41 pm
by Kasumi
You could split the binary file yourself using python/whatever other languages you know, or just add 160 to the pointer each time in 6502.
Re: NES Screen Tool
Posted: Wed Nov 13, 2013 6:42 pm
by tepples
You can copy a whole nametable from one label with (d),Y addressing mode. Load a pointer into two adjacent zero page locations, increase Y after each byte, and when Y wraps, increase the high byte of the pointer.
Re: NES Screen Tool
Posted: Wed Nov 13, 2013 6:55 pm
by Shiru
It is already possible, sans nametable attributes - just select the whole nametable, then Nametable/Put selection to clipboard as ASM.
Also, you can normally define labels as an absolute address or an expression, so you probably can just do something like
Code: Select all
part1
part2=part1+160
part3=part2+160
...
incbin "nametable.bin"
Re: NES Screen Tool
Posted: Thu Nov 14, 2013 3:20 am
by darkhog
tepples wrote:You can copy a whole nametable from one label with (d),Y addressing mode. Load a pointer into two adjacent zero page locations, increase Y after each byte, and when Y wraps, increase the high byte of the pointer.
Yeah, but my way is easier (and until it makes game too slow I'll keep it)
@Shiru: Thanks, will try that!
Re: NES Screen Tool
Posted: Thu Nov 14, 2013 8:41 am
by thefox
darkhog wrote:Code: Select all
;snip for rest of loops as they are largely same
And this is when you should use macros. On ca65, you can even use macros to generate the labels Shiru was talking about.
Re: NES Screen Tool
Posted: Sat Nov 16, 2013 9:30 am
by darkhog
thefox wrote:darkhog wrote:Code: Select all
;snip for rest of loops as they are largely same
And this is when you should use macros. On ca65, you can even use macros to generate the labels Shiru was talking about.
Shutup, I'm still learning

.
Anyway, I suppose I'll eventually convert it into macro as I am big fan of code reuse, but first I want to make something that works. Then I will learn how to do it properly, but so it'd still be working.