mode7 like f-zero

Discussion of hardware and software development for Super NES and Super Famicom.

Moderator: Moderators

Forum rules
  • For making cartridges of your Super NES games, see Reproduction.
smkd
Posts: 101
Joined: Sun Apr 22, 2007 6:07 am

Post by smkd » Fri Apr 27, 2012 5:15 pm

MottZilla wrote:Does that mean SMK doesn't use the DSP chip after this table is precomputed?

Edit: Nevermind, it apparently does.
It still uses it to position sprites based on the current camera position and probably other stuff too.
Bregalad wrote:I don't really understand this approach.
If I were to program something like that I'd definitely do all the calculations in real time.
If the game design doesn't need extra angles and the RAM (or ROM) is free, it's an easy way to save a lot of frame time. For the racing games mentioned, you'd also have to draw new sprites to account for different angles or else it would like pretty weird too. Even with "cheating", any sort of loop involving math that runs for 100~200ish entries will take a good chunk of frame time to complete even if you unroll everything. It's a lot of time wasted if the memory would otherwise be unused, especially when CPU time can be put towards something that isn't as easy to optimise. Even SMK had a chip to do all of this and it still precomputed everything. SMK itself has very little extra frametime normally so it might have been an optimisation that they made later in development. Not saying there isn't room for optimisation in the game, but it wouldn't be a 60FPS game if they added the mode 7 work on top of everything else.

tepples
Posts: 21874
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples » Fri Apr 27, 2012 5:34 pm

Mario Kart Super Circuit (for Game Boy Advance) cheats. It moves the scroll position at 60 fps but recalculates the rotation table at 30 fps.

alekmaul
Posts: 54
Joined: Tue Apr 24, 2012 12:22 pm
Contact:

Post by alekmaul » Sat Apr 28, 2012 3:01 am

Also, I must said that my example was made using MATRIX A /D values from this link : http://www.smwcentral.net/?p=viewthread ... =1#p398172

Just one question : how can i manage each matrix A/B/C/D values regarding HBL value ?

I tried to do tables for each line but i don't think it's good (i currently do this code in BVL and only once) :

Code: Select all

		for (i=0;i<160*3;i+=3) {
			unsigned char linehbl = 0x40 + (i/3);
			REG_M7A=(_m7sx & 255); REG_M7A=(_m7sx>>8);
			REG_M7B = _m7sin; _m7mb = REG_MPYMH;
		
			REG_M7A=(j & 255); REG_M7A=(j>>8);
			REG_M7B = -_m7sin; _m7mc = REG_MPYMH;

			REG_M7A=(j & 255); REG_M7A=(j>>8);
			REG_M7B = _m7cos; _m7ma = REG_MPYMH;

			REG_M7A=(j & 255); REG_M7A=(j>>8);
			REG_M7B = _m7cos; _m7md = REG_MPYMH;

			m7_ma[i+1] = _m7ma & 255;m7_mb[i+1] = _m7mb & 255;m7_mc[i+1] = _m7mc & 255;	m7_md[i+1] = _m7md & 255;
			m7_ma[i+2] = _m7ma>>8;m7_mb[i+2] = _m7mb>>8;m7_mc[i+2] = _m7mc>>8;	m7_md[i+2] = _m7md>>8;
		}

Post Reply