Page 1 of 10
All my questions are here.. ;o)
Posted: Fri Feb 03, 2006 7:30 am
by lord_Chile
Question 1:
i read about any games load in $8000 where prg start.. then if i open a .nes rom in a hexadecimal editor..... it means that prg start at $8000..
i am getting conffused... cpu address??? nes address???
my question is because... i have readchr.. i can know where chr data start in rom... but when open rom with hex editor.. is same address???
or exists a mathematic expression in order to translate it to roms address?? in order to i find exactly address with a hex editor??
Posted: Fri Feb 03, 2006 8:00 am
by Memblers
$8000 is the CPU address. In a .nes file the PRG is right after the header (so it starts at $0010). If the PRG is 32kB, then the CHR would start at $8010 in the .nes file. You have to know how many PRG banks there are to see where CHR starts, the header has that info.
Posted: Fri Feb 03, 2006 8:14 am
by tokumaru
This question is a bit confusing...
Well, when you run games, the NES maps ROM to the space $8000-$FFFF (32k). If you have only 16k of PRG, it is duplicated to fill all the space. Many games have their reset vector pointing to $8000, because that's where PRG ROM starts, but that is not mandatory.
In the ines files, PRG will start right after the header, wich would be offset 16 (after the 16 bytes of header). They will be arranged in banks of 16k, one after the other.
EDIT: Oh, Memblers answered. I got a call while writing and it took some time =)
yes.. then cpu address is cpu 6502 address
Posted: Fri Feb 03, 2006 8:43 am
by lord_Chile
thanks!!
yes.. then cpu address is cpu 6502 address.. i was thinking cpu address = cpu intel pc address haahahaaa...
.nes is address in file then when i open with a hex edit .nes file i search by .nes address....
ANOTHER QUESTION
Question 2:
i made my demo of hello world... but in nesasm is possible making a sound player????...
in order to load a nsf and play it???..
how can i loading a nsf on nesasm src code???
and what steps i do in order to play a tone in a asm 6502-... i noticed that only writing tone is not valid!!.. i have set another thing first!! which???
Question 3: do you know Ben Fry's Mario Deconstructulator.. it's a java emu that visually show how sprites are managed in nes 6502 memory!!
i cannot getting any link.. do you know a direct link to dowload it??
one question about nes 8 sprites limit in a row
Posted: Mon Feb 06, 2006 7:54 am
by lord
one question about nes 8 sprites limit in a row
all documents speak about nes 8 sprite limit.. then did you play any time nes game called "LEMMINGS"??
how lemmings show more than 10 lemmings in a row???... each lemmings is an autonomist.. each lemming is
a object... i imagine that lemmings takes 2 lemmings or more than 1 lemming like one sprite.. but if each lemming is an autonomist object, my imagination is a error.. what type of technique use lemmings??.. the most funny and headache game of nintendo????
Posted: Mon Feb 06, 2006 8:39 am
by tokumaru
I haven't played the NES version of lemmings in a while... I didn't even remember it existed!
I bet it does it like any other game that shows more than 8 sprites in a scanline do: OAM cycling.
You have to rearrange the sprites in different SPR RAM slots every frame so that their priorities cycle. Then, when you have more than 8 in the same scanline, not the same 8 will be shown every frame, they will cycle. That's why sprites flicker some times. It may not be very noticeable if lemmings are flickering as they're usually so grouped together.
I doubt the game draws lemmings to the background or something like this, it most likely uses the good old OAM cycling method.
can you explain OAM cycling method for a newbie please???
Posted: Mon Feb 06, 2006 9:44 am
by lord
can you explain OAM cycling method for a newbie please???
i dont get good it..
Re: can you explain OAM cycling method for a newbie please??
Posted: Mon Feb 06, 2006 10:06 am
by tokumaru
lord wrote:can you explain OAM cycling method for a newbie please???
There is a discussion about it here:
http://nesdev.com/bbs/viewtopic.php?t=469
A few different methods are presented there. I can't tell you what the best one is as I haven't played much with OAM cycling myself. I'll just try a few different methods when the time is right, and decide what works best for me.
Bregalad seems to have a very interesting technique. Maybe he can explain it to you?
Posted: Mon Feb 06, 2006 10:11 am
by Bregalad
Each lemming is a sprite. When more that 8 lemmings comes on a row, they flicker (this actually happen fairly often).
However, usually, a single people/object is more than one sprite whide (often 2 or 3). The only "trick" used in Lemmings is to not take more than one single sprite for one single lemming.
then paradigma is
Posted: Mon Feb 06, 2006 10:18 am
by lord
yeah.. documents saying: "nes system dont accept more than 8 sprites by scanline"... then... "more than 8 sprites" what mean?? more than 8 sprites with a width of??? 2 tiles, 1 tile or 3 maybe????..
Re: then paradigma is
Posted: Mon Feb 06, 2006 10:20 am
by lord
1 sprite width = 8 tiles..??
then nes dont accept more than 64 tiles (8 sprite) by scanline??
Posted: Mon Feb 06, 2006 10:22 am
by tokumaru
Bregalad wrote:The only "trick" used in Lemmings is to not take more than one single sprite for one single lemming.
They're probably 8x16 too, right? That fits the size of a lemming pretty well, and would allow for a good number of lemmings on screen. I remember the PC version, and I can imagine how they flicker on the NES as lemmings usually gather up in huge packs...
checking my question (only a edit)
Posted: Mon Feb 06, 2006 10:23 am
by lord
yeah.. documents saying: "nes system dont accept more than 8 sprites by scanline"... then... "more than 8 sprites" what mean?? more than 8 sprites with a width of??? 2 groups of 8 tiles in width, 1 group of 8 tile width or 3 groups maybe????..
yes tokumaru but..
Posted: Mon Feb 06, 2006 10:24 am
by yeah
tile layer pro shows me that each lemming is one single sprite.. (8x8 tiles)
Re: then paradigma is
Posted: Mon Feb 06, 2006 10:29 am
by tokumaru
lord wrote:1 sprite width = 8 tiles..??
NES sprites are always 8
pixels (not tiles) wide. That means you can only have 64 pixels worth of sprites in a scanline.
In the NES, the player is not 1 sprite. It's made of multiple sprites (well, the lemmings are only 1 sprite each). One sprite is always 1 tile wide.
You can place more than 8 in a scanline, but the ones with lower priority will simply not be displayed. They're there, but invisible. That's why you should cycle the priorities, so that the ones that were invisible the last frame will be visible in the next, and vice-versa.