Program music from Famitracker into game?
Page 3 of 3

Author:  JWinslow23 [ Fri Apr 28, 2017 12:46 pm ]
Post subject:  Re: Program music from Famitracker into game?

This will be an arcade-style game, and it will play very similar to Flappy Bird. The walrus will fly around the screen as obstacles (I have mines, some will be stationary while others will move up and down towards the player) and collectibles (fish will give you points, and there might be some special invincibility object) fly past him horizontally. This keeps going until the maximum score is reached, or you die (whichever comes first). That's the gameplan, just like my original Scratch project and my subsequent Atari 2600 port.

I kinda figured I'd need modes to handle different game states, but I think I'll cross that bridge when I get there. I still got actual gameplay to worry about for a while.

By the way, "what else do I need to do" did not refer to general game programming, but rather, it referred to ways to fix problems with my existing code (like, was I still drawing backgrounds and rendering outside of VBlank? or something). I've developed games before, but never for the NES, and I still have a lot of questions (which I will ask when I get to them).

Author:  dougeff [ Fri Apr 28, 2017 2:02 pm ]
Post subject:  Re: Program music from Famitracker into game?

While you aren't having problems (no PPU writes outside v-blank), you got lucky. It only works because your entire logic fits inside the v-blank, and on that frame the music code didn't push you just past v-blank.

It's the changing palette on death that I'm worried about.

So, this is where my lengthy 'game planning' post becomes relevant.

You need a vram update system. Inside the NMI code. And a control flag.

So you'd have a page of RAM dedicated to vram updates. 2 bytes for address. (3f00) 1 byte for length of data stream (1), and then follows the data (06), terminate with ff, or a new address, for another ppu update. An automated system. You can write to the vram buffer any time, then set a flag to inform the NMI code that you have an update ready. The NMI code will start at the start of v-blank, and automatically push your color change.

Page 3 of 3 All times are UTC - 7 hours
Powered by phpBB® Forum Software © phpBB Group