This is how far i am

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

Post Reply
User avatar
log in
Posts: 72
Joined: Tue Jun 24, 2008 1:06 pm
Location: neverland

This is how far i am

Post by log in »

Hi there newest member on the site and absolute newbie :wink:

Everybody talks about what they dont now and don't understand.
So i want to tell what i now and we can start from there.

first of English is not my mother language so look threw the bad language.
LOL :D

Ok i read some things on this and other sites and this is what i know:
( PLease correct me if you see errors already)




I Understand
Number systems and i can read decimal/ binary and hexadecimal (hex)
The nes is a 16 bit addres bus 8 digets get cut in 2 ,twice so you will get
a 4 diget hex number,hex is show with a$ so you will get something like $4017

I understand the nes system
it has a cpu (the 6502) heart of the system
apu (audio)
ppu (grapics chip)
and lockout chip

i understand the nes cart
Prg rom/chr rom or ram/it can hold wram and lockout chip

So how do the work together?
The nes cart is put into the system and put on.
The prg rom will send instructions to the cpu (6502)the cpu gives the apu instructions for sound and the ppu instructions to get images from the Chr rom.
If im correct :?:

I also saw a drawing of the cpu from the nes system and 1 from the nes his ppu,these drawings show all the parts and the $ hex codes that correspond with them.

And i now a little bit about opcodes and stuff,thats about it

NOW.. i saw that exsample from bunnyboy with the PPUMASK $2001 that you need to ad to get a background.
But where excatley?(under JMP Forecer )and what ppumask wont work to long only 3 digits for the upcode? so LDA $2001

So can you people help me with this tutorial and what should i learn,study next,or practice?
User avatar
Bregalad
Posts: 8036
Joined: Fri Nov 12, 2004 2:49 pm
Location: Caen, France

Post by Bregalad »

I Understand
Number systems and i can read decimal/ binary and hexadecimal (hex)
The nes is a 16 bit addres bus 8 digets get cut in 2 ,twice so you will get
a 4 diget hex number,hex is show with a$ so you will get something like $4017

I understand the nes system
it has a cpu (the 6502) heart of the system
apu (audio)
ppu (grapics chip)
and lockout chip

i understand the nes cart
Prg rom/chr rom or ram/it can hold wram and lockout chip

So how do the work together?
The nes cart is put into the system and put on.
The prg rom will send instructions to the cpu (6502)the cpu gives the apu instructions for sound and the ppu instructions to get images from the Chr rom.
If im correct Question
This seems all correct.
Yes, the CPU gets instructions from the PRGROM on the cartridge, and the programm can do things that tells the CPU to give instruction to do I/O stuff (audio, video, joypads), which is done trough registers. You should read a doc about registers.
Then again it's possible for the CPU to get instruction from the RAM inside the system, or for the cartridge to have logic to not have the classical CHRRAM/ROM on the cart, but those are special cases.

Reading $2001 will do absolutely nothing, this is a write only register. You'll just get garbage when reading this register.
Useless, lumbering half-wits don't scare us.
User avatar
log in
Posts: 72
Joined: Tue Jun 24, 2008 1:06 pm
Location: neverland

Post by log in »

Thanks for your reply bregalad :wink:

I already read some stuff about registers from bunnyboys lessons.
But today i read the 8bit beast of power.

EXCELLENT al newbie's should read this! For me it did wonders.

I Already understand some programming :D
The basic things that is..

Like that every thing starts with

;the INES header setup

.inesprg
.ineschr
.inesmir
.inesmap

.org
.bank

etc etc...(i also get why you have to do this first)

I understand how to input the color palette and the controllers

But i still have some silly :oops: :lol: questions

..................................................................................................


Where can i find (download/print) the YOSHi's nes doc? its talked about a lot in the 8 bit beast document,but i can't find it on nesdev.
Having this would even help me understand things better.

Ok,i understand a little bit of nes programming now.
BUT i dont understand the graphics part(background/sprites),i mean..i dont see the big picture

Lets say i would make a nes cart
Then i would have to put my asmfile in the prg rom?
And the chr rom? do i have to download a empty pattern table make the sprites and backgrounds and this would be the chr rom?

I need to do some more reading about this but can somebody give me a push in the right direction :?:
User avatar
Bregalad
Posts: 8036
Joined: Fri Nov 12, 2004 2:49 pm
Location: Caen, France

Post by Bregalad »

Where can i find (download/print) the YOSHi's nes doc? its talked about a lot in the 8 bit beast document,but i can't find it on nesdev.
Having this would even help me understand things better.
I guess you're confising with Yoshi's SNES doc, which are old and outdated anyway.
Most docs are on http://www.romhacking.net

You have to learn about tiles. You can play with a tile editor or Nesticle (outdated emulator but none has yet to equal it's tile viewer) to see them.
Useless, lumbering half-wits don't scare us.
tepples
Posts: 22345
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

Bregalad wrote:
Where can i find (download/print) the YOSHi's nes doc? its talked about a lot in the 8 bit beast document,but i can't find it on nesdev.
Having this would even help me understand things better.
I guess you're confising with Yoshi's SNES doc
That or "Nintendo Entertainment System documentation v2.0 by Jeremy Chadwick" available from the main page.
which are old and outdated anyway.
As is the NES one.
User avatar
log in
Posts: 72
Joined: Tue Jun 24, 2008 1:06 pm
Location: neverland

Post by log in »

Thanks again for the replies,

I read the doc from Jeremy Chadwick and it helped me understand the graphics a little bit better.

Also did some romhacking in the past(Tile layer pro)i hacked box boy and made the boy mario,pretty funny to see mario walking around :D

Because of my english i had to read the doc. a couple of times.
But i think i get it... The A picture in the doc. helped me .

I think i can awnser my own question about the chr rom :idea:
The prg rom has the source code and the chr rom is just a chip that brings colors and graphics to the tv screen.

a sprite or tile for exsample is made of 8x8 pixels.
But its not in the chr rom
That sprite is made of 8x8 digits that are in the prg rom that form 1 sprite.
You tell the cpu to load them from the ppu.
Thats it right, told it a bit simple but this is the big picture.

CAN somebody please confirm or deny my story please :?:

..................................................................................................

First source code attempt
I read a lot of docs now and saw a few source codes.
So this is my first attempt to program something for the nes .
A complete red screen.
PS. i didnt write all the; comments because the are not needed and the first things are pretty clear and dont need comments,i think?
..................................................................................................

.inesprg 1
.ineschr 0
.inesmir 1
.inesmap 0

.org $8000
.bank 0

reset:
sei
cld
ldx #$40
stx $4017
ldx #$FF
txs
inx
stx $2000
stx $2001
stx $4010

vblankwait1:
bit #2002
bpl vblankwait1

txa
clrmem:
sta $ 000,x
sta $ 100,x
sta $ 200,x
sta $ 300,x
sta $ 400,x
sta $ 500,x
sta $ 600,x
sta $ 700,x
inx
bne clrmen

vblankwait 2:
bit $ 2002
bpl vblankwait2

lda #%00100000 ;intensify red
sta $2001 ; ppu port

loop:

jmp loop

.bank1
.org $FFFA
.dw 0
.dw reset
.dw 0




..................................................................................................

Does this code work :?: I have no idea :?
tried to load it in the nesasm3 but the programm doesnt run because no intern programm/file is found :shock:
I think this is because its DOS and i have windows,or my program is total crap :D hahahaha lol

So can somebody plaese check my homework :wink:
User avatar
log in
Posts: 72
Joined: Tue Jun 24, 2008 1:06 pm
Location: neverland

Post by log in »

topic back to the top,for some help please :oops:
User avatar
Bregalad
Posts: 8036
Joined: Fri Nov 12, 2004 2:49 pm
Location: Caen, France

Post by Bregalad »

Oh yeah. You shouldn't confuse sprites and tiles. A sprite is usually a tile (but on the NES it can also be 2 tiles, and it's very common to refer a group of adjacent sprites as "a sprite"), but a tile isn't necessary a sprite. Sprite are stuff that moves, while background is stuff that doesn't. The NES has one background and one sprite layer, but some more modern 2D consoles like the Super NES have many background layers.

You should read docs about nametables and try to at least clear the background in your code. Just setting the red bit would have no effect, as the NES's memory contain unknown data when tunred on. You'd want to clear the nametable and pattern tables so you get a solid screen. Then you should try to write stuff on the screen like "Hello world" or thing like that, assuming you have a font.
Useless, lumbering half-wits don't scare us.
Post Reply