It is currently Wed Nov 22, 2017 9:55 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 98 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7  Next
Author Message
 Post subject: Re: NES Programming Blog
PostPosted: Thu Feb 04, 2016 9:58 pm 
Offline
User avatar

Joined: Fri May 08, 2015 7:17 pm
Posts: 1828
Location: DIGDUG
I tried it, works perfectly, I'm going to update the MIDI section to indicate the better method, Bavi_H.

Options/Preferences/MIDI/ 96 ticks per quarter note.

You get 4 rows per note in Famitracker 0.4.2, through MIDI import.

_________________
nesdoug.com -- blog/tutorial on programming for the NES


Top
 Profile  
 
 Post subject: Re: NES Programming Blog
PostPosted: Thu Feb 11, 2016 9:36 am 
Offline
User avatar

Joined: Mon Feb 08, 2016 1:22 pm
Posts: 20
Very nice tutorials! I didn't even realize C was an option for NES programming.

You might want to consider adding a slight background to the code examples so it's easier to tell what is code instead of explanation. Otherwise, great stuff!


Top
 Profile  
 
 Post subject: Re: NES Programming Blog
PostPosted: Thu Feb 11, 2016 10:57 am 
Offline
User avatar

Joined: Fri May 08, 2015 7:17 pm
Posts: 1828
Location: DIGDUG
Thanks, I'll consider making color changes to the code...probably better I should improve the code, maybe.

I'm considering adding a few pages on ASM lessons, but I'm not sure how I should organize it. I don't want to go alphabetically, as some documents do...I wanted to start with simple LDA, STA...but it occurred to me that some of the more complicated LDA modes (indirect) probably shouldn't go on the first page...

Maybe I should start with math and bit shifting, and simple zero page LDA, STA.

_________________
nesdoug.com -- blog/tutorial on programming for the NES


Top
 Profile  
 
 Post subject: Re: NES Programming Blog
PostPosted: Thu Feb 11, 2016 4:24 pm 
Offline

Joined: Thu Jul 23, 2015 7:54 pm
Posts: 147
Location: USA
dougeff wrote:
I'm considering adding a few pages on ASM lessons, but I'm not sure how I should organize it. I don't want to go alphabetically, as some documents do...I wanted to start with simple LDA, STA...but it occurred to me that some of the more complicated LDA modes (indirect) probably shouldn't go on the first page...

Maybe I should start with math and bit shifting, and simple zero page LDA, STA.

I'd say start with explaining what the Accumulator and index registers are, and then introducing LDA, STA; LDX, STX; LDY, STY. Then explain the difference between an address and an immediate value (With maybe a brief mention of the zero-page). After that, you could gradually introduce new instructions, categorized by math, bitwise operations, logic, etc., and then later on go into more advanced addressing methods like Indexed and Indirect.

Just an idea.


Top
 Profile  
 
 Post subject: Re: NES Programming Blog
PostPosted: Tue Feb 16, 2016 9:42 am 
Offline

Joined: Thu Nov 24, 2011 7:16 am
Posts: 163
First of all , thank dougeff for the work he has done in his blog. He had long needed a tutorial and hands. I must also apologize for my bad English . This post has been translated by Google translator .

However , there are many things that escape me despite being fairly well explained .

My radical doubt ignorance when it comes to creating longer than two simple horizontal scroll Nametables levels.

How I can do to make the updating nametable go slowly while the background moves ?

Thank you.

PD: en español debajo de estas lineas.

Antes de nada, dar las gracias a dougeff por el trabajo que ha hecho en su blog. Hacía tiempo que necesitaba tener un tutorial así entre manos. También debo disculparme por mi mal ingles. Este post ha sido traducido mediante Google Traductor.

No obstante, hay muchas cosas que se me escapan pese a estar bastante bien explicado.

Mi duda radical en el desconocimiento a la hora de crear niveles más largos que dos simples Nametables en scroll horizontal.

¿Como puedo hacer para que el nametable se vaya actualizando poco a poco mientras avanza el background?

Gracias.


Top
 Profile  
 
 Post subject: Re: NES Programming Blog
PostPosted: Tue Feb 16, 2016 10:27 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19244
Location: NE Indiana, USA (NTSC)
Keep the camera position in a variable. This camera position defines what area is visible. From it, you can calculate the position of the column of tiles that is next to appear. If the camera has not yet advanced to a new column of tiles, there's nothing new to see, so don't update anything. But if it has, then prepare a list of tile numbers, and then copy it into nametable memory during the next vblank.

Image
The camera, represented by a red bracket, has advanced into the column of blocks that need to be updated.


Top
 Profile  
 
 Post subject: Re: NES Programming Blog
PostPosted: Tue Feb 16, 2016 4:27 pm 
Offline
User avatar

Joined: Fri May 08, 2015 7:17 pm
Posts: 1828
Location: DIGDUG
To add a bit...

'camera position' = Horizontal Scroll, the first number stored at register $2005

When Horizontal Scoll rolls over (>255) you tell it to change base nametables, controlled by the $2000 register.

xxxx xx00 = nametable #0, left screen
xxxx xx01 = nametable #1, right screen

Nerdy Nights also has a tutorial on this...

http://nintendoage.com/forum/messagevie ... adid=36958

_________________
nesdoug.com -- blog/tutorial on programming for the NES


Top
 Profile  
 
 Post subject: Re: NES Programming Blog
PostPosted: Sat Feb 20, 2016 9:17 am 
Offline

Joined: Thu Nov 24, 2011 7:16 am
Posts: 163
The truth is that this is very complicated . At the end I relied on lesson number 11 dougeff to get done scrolling .

I climb a small demo: https://www.dropbox.com/home/public/NES ... 022016.nes

Why did the rare artifacts appear in the sky ? My NameTable is not it. By not charging it :roll:

Image

PD : Remember that 'm programming based on the lessons dougeff

Spanish:
La verdad es que esto es muy complicado. Al final me he basado en la lección número 11 de dougeff para conseguir hacer scrolling.
Os subo una pequeña demo.
¿Por que me aparecen los artefactos raros en el cielo? Mi Nametable no es así. No se por que carga eso :roll:

PD: Recordad que estoy programando basandome en las lecciones de shiru


Top
 Profile  
 
 Post subject: Re: NES Programming Blog
PostPosted: Sat Feb 20, 2016 9:32 am 
Offline
User avatar

Joined: Fri May 08, 2015 7:17 pm
Posts: 1828
Location: DIGDUG
Definitely attribute table has wrong color palette defined for those bits of screen. Maybe you're writing too many byes to the PPU, and it's corrupting the attribute table.

_________________
nesdoug.com -- blog/tutorial on programming for the NES


Top
 Profile  
 
 Post subject: Re: NES Programming Blog
PostPosted: Sat Feb 20, 2016 10:13 am 
Offline

Joined: Thu Nov 24, 2011 7:16 am
Posts: 163
dougeff wrote:
Definitely attribute table has wrong color palette defined for those bits of screen. Maybe you're writing too many byes to the PPU, and it's corrupting the attribute table.


Mmmm , I've been messing with the code of the lesson 10 and if I modify the allocation of tiles from heaven , the same fault occurs.

Simply assigning address 1 where previously put 0 in the tiles, and skips the error.

const unsigned char METATILES[]={
0, 0, 0, 0, //0 sky
....

Image

const unsigned char METATILES[]={
1, 1, 1, 1, //0 sky
...

Image

Could it be a problem of the code itself ? Any misconfiguration ?


Top
 Profile  
 
 Post subject: Re: NES Programming Blog
PostPosted: Sat Feb 20, 2016 10:19 am 
Offline
User avatar

Joined: Fri May 08, 2015 7:17 pm
Posts: 1828
Location: DIGDUG
I'll look at it later today.

_________________
nesdoug.com -- blog/tutorial on programming for the NES


Top
 Profile  
 
 Post subject: Re: NES Programming Blog
PostPosted: Sat Feb 20, 2016 10:23 am 
Offline

Joined: Thu Nov 24, 2011 7:16 am
Posts: 163
dougeff wrote:
I'll look at it later today.


Thanks!!! :P


Top
 Profile  
 
 Post subject: Re: NES Programming Blog
PostPosted: Sat Feb 20, 2016 2:42 pm 
Offline
User avatar

Joined: Fri May 08, 2015 7:17 pm
Posts: 1828
Location: DIGDUG
Apparently I forgot how to do math when I wrote this one, and it was only by dumb luck that it worked to begin with.

The tile buffering system was buggy...each was overflowing into the next one because...

(in BufferMT.c)...

while (index < 16){

should have been...

while (index < 15){

Since the screen is only 15 metatiles high (*16 pixels = 240)...and it should index from 0-14.

And I also increased the buffer sizes (in lesson11.c)...slightly larger than we need, but now easier to read in the hex editor debugging tool...

unsigned char BUFFER1[32];//left column 1
unsigned char BUFFER2[32];//right column 1
unsigned char BUFFER3[32];//left column 2
unsigned char BUFFER4[32];//right column 2

(before I erroneously had them 26, but was indexing up to 30).

Anyway, the link has been updated...sorry for the trouble.

http://dl.dropboxusercontent.com/s/08oi ... sson11.zip

_________________
nesdoug.com -- blog/tutorial on programming for the NES


Top
 Profile  
 
 Post subject: Re: NES Programming Blog
PostPosted: Sun Feb 21, 2016 7:47 am 
Offline

Joined: Thu Nov 24, 2011 7:16 am
Posts: 163
Ouh yeah!!! Thank you dougeff :D

Indeed , that was the problem . I keep messing with this demo. :wink:


Top
 Profile  
 
 Post subject: Re: NES Programming Blog
PostPosted: Sun Feb 21, 2016 2:26 pm 
Offline

Joined: Thu Nov 24, 2011 7:16 am
Posts: 163
Continuing research the code, I decided to increase the number of rooms 4 to 5 (for example)

I created a new CSV called A5.csv
I stuck a #include " BG / A5.csv "
In the array ROOMS [ ] I added (int) & A5
In move_logic() function, variable Room &= 3 converted it to 4.
In New_Room() function, RoomB &= 3 variable became to 4.
In the main() function, RoomPlus &= 3 variable became to 4.

Still, I can not get this new room appears.

Am I skipping a step?

Spanish:
Continuando con la investigación del código, me propuse aumentar el numero de habitaciones de 4 a 5 (por ejemplo)

Creé un nuevo CSV llamado A5.csv,
Metí un #include "BG/A5.csv"
En el array ROOMS[] añadí (int) &A5
En la función move_logic, la variable Room &= 3 la convertí a 4.
En la función New_Room, la variable RoomB &= 3 la convertí a 4.
En la función main, la variable RoomPlus &= 3 la convertí a 4.

Pese a todo, no consigo que aparezca esta nueva habitación.

¿Me estoy saltando algún paso?


Last edited by Diskover on Mon Feb 22, 2016 12:58 am, edited 1 time in total.

Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 98 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: samwise970 and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group