Making NES Kung-Fu

Topics related to the API, programming discussions & questions, coding tips, bugs, etc. should go here.
CunningFellow
Posts: 1488
Joined: Mon Feb 11, 2013 8:08 am
Location: Brisbane, Australia

Re: Making NES Kung-Fu

Post by CunningFellow »

So anyways.

Interrupt driven EOL (end of line) saves 2 clocks per tile (DEC & BRNE)
Aligned sections for RAM/ROM tiles saves 1 clock per tile

Thinking I can sneek it in 6 clocks. 240 pixel wide viewport/window with a 32byte/256pixel wide buffer

Renderline: is looking like it will take 4K+ of flash. But seeing as ROMTiles are 0.5*flash usage it should be OK.

Leave it with me for 5 or 6 hours to make sure.
User avatar
uze6666
Site Admin
Posts: 4821
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Making NES Kung-Fu

Post by uze6666 »

D3thAdd3r wrote:It would be nice to have a compile time option to eliminate ram_tiles_restore, obviously trivial to implement. A lot of games can easily redraw the entire screen making it unnecessary and it gets us 1.5-2 ram tiles back. We should easily be able to redraw that blue background, the only place sprites ever go and we have to draw over Thomas' old tiles from last frame anyhow.
I have to dig back into that complicated code but your suggestion is feasible. I have created a new compile time switch "VRAM_RESTORE_BUFFER" and created a branch in svn to test changes we will make to video mode 3. Perhaps we'll eventually find that a custom mode is required but let see first if we can leverage what we have.

New branch in google code, I'll commit all stuff there. You can checkout that branch and point your makefile kernel to that dir.
https://code.google.com/p/uzebox/source ... new-vmode3

Code: Select all

KERNEL_DIR = ../../../../branch-kernel-new-vmode3
...
KERNEL_OPTIONS += -DVRAM_RESTORE_BUFFER=0
...
Leave it with me for 5 or 6 hours to make sure.
Were ain't going anywhere!
User avatar
nicksen782
Posts: 714
Joined: Wed Feb 01, 2012 8:23 pm
Location: Detroit, United States
Contact:

Re: Making NES Kung-Fu

Post by nicksen782 »

I actually started a Flappy Bird clone. I can help by covering the creation process. Getting the graphics correct enough was the first challenge. I'm not sure how to do scrolling in mode 3. Maybe it could be mode 2? I dunno but I have a flapping and poorly flapping bird now. I'm thinking only move the bird up and down and then just scroll the pipes. Or maybe some kind of background tile trick. The tiles are small.

Competition entry? Lol.
User avatar
D3thAdd3r
Posts: 3293
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: Making NES Kung-Fu

Post by D3thAdd3r »

nicksen782 wrote:Competition entry?
Definitely!
CunningFellow
Posts: 1488
Joined: Mon Feb 11, 2013 8:08 am
Location: Brisbane, Australia

Re: Making NES Kung-Fu

Post by CunningFellow »

mmm - not great news.

My first attempt actually used 40K of flash for the renderline state machine.

Back to drawing board.

At least it shows it CAN be done.

I still have a few more ideas to reduce the flash usage.
User avatar
nicksen782
Posts: 714
Joined: Wed Feb 01, 2012 8:23 pm
Location: Detroit, United States
Contact:

Re: Making NES Kung-Fu

Post by nicksen782 »

Why so much? This whole thread is pretty darn informative. Keep it nerds. Lovin' it. Also, how do multiple screen sections work in mode 3 with scrolling?
User avatar
uze6666
Site Admin
Posts: 4821
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Making NES Kung-Fu

Post by uze6666 »

At least it shows it CAN be done.
I think up to 20K-25K I would consider a fair tradeoff. Still think it can be pulled off though. I was looking at the latest c64 demos at I still can't believe they are finding new tricks for it. 32 years later. 8-)
User avatar
uze6666
Site Admin
Posts: 4821
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Making NES Kung-Fu

Post by uze6666 »

nicksen782 wrote:Why so much? This whole thread is pretty darn informative. Keep it nerds. Lovin' it. Also, how do multiple screen sections work in mode 3 with scrolling?
Currently mode 3 does not support multiple scrolling sections. Only a main section that can scroll arbitrary and an optional overlay that is fixed. The overlay is always at the top and can have an arbitrary height. It can not scroll but can have it's own tileset independently of the main section. Check out the SuperMarioDemo for scrolling and overlay usage in mode 3. Be sure to read the wiki mode 3 article to decipher how it actually works. Not for the feint of hearth!

Anyhow, I'm looking into adding multiple scroll section to mode 3 with some restrictions. More explanations on that soon.
CunningFellow
Posts: 1488
Joined: Mon Feb 11, 2013 8:08 am
Location: Brisbane, Australia

Re: Making NES Kung-Fu

Post by CunningFellow »

nicksen782 wrote:Why so much? This whole thread is pretty darn informative. Keep it nerds. Lovin' it. Also, how do multiple screen sections work in mode 3 with scrolling?
Nicksen, The way I did it was to make a big code table that was jumped around like a state machine.

Look in the tempest thread for a description of how that works.

I didn't think it was going to be as bad as tempest, but it actually worked out even worse on the first attempt.

My current attempt looks like it is coming in at 24K but I don't know yet if I will blow the 48 clock budget.

There is still plenty of tactics left including dropping down to 3 bits per pixel (8 colours) but that does make the blitting maths harder.
CunningFellow
Posts: 1488
Joined: Mon Feb 11, 2013 8:08 am
Location: Brisbane, Australia

Re: Making NES Kung-Fu

Post by CunningFellow »

24k byte version works on paper.

I am going to try some other combinations during the week to see if I can get it down to a bit less.

Note - this does not mean I will have a new video mode any time real quick. All I have done so far is prove (I think) it is possible in a spreadsheet.

From the point where I proved tempest mode was possible in a spreadsheet to the point where I had coloured lines bouncing around the screen was several weeks.
Post Reply