PCEngineFans.com - The PC Engine and TurboGrafx-16 Community Forum

Tech and Homebrew => Turbo/PCE Game/Tool Development => Topic started by: spenoza on March 12, 2012, 09:25:19 AM

Title: CPU speed for homebrew games
Post by: spenoza on March 12, 2012, 09:25:19 AM
So, all you guys working on homebrew games, what CPU speed setting are you using? Are you all using the highest speed or the middle speed, and if you are using the highest speed, is it because you need that much juice or just because it's easier not to have to do constant optimization? Or is it something else altogether?
Title: Re: CPU speed for homebrew games
Post by: Arkhan on March 12, 2012, 09:29:33 AM
I use the maximum because why the hell wouldn't I.

pretty much no games use the slow setting.  Some use it for trickery though.  IIRC you can set it to slow mode and do VRAM trickery.
Title: Re: CPU speed for homebrew games
Post by: spenoza on March 12, 2012, 10:16:12 AM
I use the maximum because why the hell wouldn't I.

pretty much no games use the slow setting.  Some use it for trickery though.  IIRC you can set it to slow mode and do VRAM trickery.

I read in one source (which I do not consider authoritative) than many of the chip games used the 3.58 mhz setting, and that with the small PC Engine case that heat might be a concern, but that's all I've read on the topic.

Does anyone know whether the slower speeds are common in commercial hucards?
Title: Re: CPU speed for homebrew games
Post by: nodtveidt on March 12, 2012, 10:17:21 AM
spenoza, all games run in 7.16MHz mode. There is no 'middle' speed... you get 1.79MHz or 7.16MHz. The only clock in the machine that changes is the dot clock, which changes depending on the horizontal resolution you're using. The only real reason to use 1.79MHz mode is to access BRAM, or, what Arkhan stated above. Suggesting that there's no "constant optimization" going on is insinuating laziness, and would likely earn you a bitchslap, best case scenario. :P
Title: Re: CPU speed for homebrew games
Post by: spenoza on March 12, 2012, 10:20:17 AM
spenoza, all games run in 7.16MHz mode. There is no 'middle' speed... you get 1.79MHz or 7.16MHz. The only clock in the machine that changes is the dot clock, which changes depending on the horizontal resolution you're using. The only real reason to use 1.79MHz mode is to access BRAM, or, what Arkhan stated above. Suggesting that there's no "constant optimization" going on is insinuating laziness, and would likely earn you a bitchslap, best case scenario. :P

The vast amount of inaccurate data out there about the PCE/TG-16 is really irksome. And I didn't mean that you guys didn't work hard to optimize code. I just meant that there's probably a limit to your patience with assembly-level optimization.
Title: Re: CPU speed for homebrew games
Post by: nodtveidt on March 12, 2012, 10:28:43 AM
Never a limit for me, I dunno about anyone else. The game has to run as best as it can, no exceptions.
Title: Re: CPU speed for homebrew games
Post by: TheOldMan on March 12, 2012, 01:37:44 PM
Quote
The only real reason to use 1.79MHz mode is to access BRAM, or, what Arkhan stated above.
Actually, there is a third reason. If you really want to know, I'll explain it in a PM.

Quote
you guys didn't work hard to optimize code. I just meant that there's probably a limit to your patience with assembly-level optimization.

Limit to my patience, no. Point of no return, yes.
I only optimize until the game runs at 60 fps. Anything else is a waste of my time, since that is as fast as the game loop runs. There's no point in saving 5 cycles in a routine (ore even 100) if that just means I have to waste those cycles waiting for a vsync.
Title: Re: CPU speed for homebrew games
Post by: ccovell on March 12, 2012, 01:52:20 PM
Only the SNES has 3 speeds (1.79, 2.68, 3.58Mhz), and yes, most games run in the middle speed most of the time.  The SNES is stupid and had different CPU speeds depending on what regions of memory were accessed.  Only when "FastROM" carts were produced did the full speed setting get used for game execution.
Title: Re: CPU speed for homebrew games
Post by: Arkhan on March 12, 2012, 02:53:19 PM
The SNES is stupid


=3 lol
Title: Re: CPU speed for homebrew games
Post by: Bonknuts on March 12, 2012, 03:45:48 PM
Accessing the VDC in 1.79mhz mode? What are you doing; putting a long line of single opcodes in slow mode to reduce jitter for an hsync call? You can do similar but changing the memory access speed in the VDC and doing a write that fills it up open slot. It's resync the cpu to the VDC once a free slot is open. Super Star Solder, IIRC, puts the cpu in 1.79mhz for idle. But I thought that was for battery savings on the Express (just speculation, don't have an Express to test this out).

Quote
Only the SNES has 3 speeds (1.79, 2.68, 3.58Mhz), and yes, most games run in the middle speed most of the time.  The SNES is stupid and had different CPU speeds depending on what regions of memory were accessed.  Only when "FastROM" carts were produced did the full speed setting get used for game execution.

 I heard it gets even more retarded than that. You probably know that any cycle of an opcode that touches wram will get the additional wait states on that cycle. But that lame thing is, accessing WRAM via the port/pointer register is full speed (no wait states on the fetch). Noca$h was mentioning this recently with his post in his findings (and his new SNES emulator). So Nintendo left the wait states on WRAM for no reason. It's also lame that no carts put extra ram in fastrom area to get a speed boost, yet they added costly other chips.
Title: Re: CPU speed for homebrew games
Post by: touko on March 13, 2012, 12:02:27 AM

The vast amount of inaccurate data out there about the PCE/TG-16 is really irksome. And I didn't mean that you guys didn't work hard to optimize code. I just meant that there's probably a limit to your patience with assembly-level optimization.
When you develop in assembly, optimisation is a natural thing ..
for exemple, you write naturaly cla rather than lda #$00 ..
with practice your assembly code is already optimised because you have the good reflexes .

Degree of optimisation depends on what you wanna do in your game/routine .
Title: Re: CPU speed for homebrew games
Post by: spenoza on March 13, 2012, 06:24:30 AM
I only optimize until the game runs at 60 fps. Anything else is a waste of my time, since that is as fast as the game loop runs. There's no point in saving 5 cycles in a routine (ore even 100) if that just means I have to waste those cycles waiting for a vsync.

This is what I was suggesting. If you have a higher CPU speed to work with, you probably have to do less of this to get this result, compared to a slower CPU speed.

Also, where on earth does all this incorrect information floating around in wikis and the like come from?
Title: Re: CPU speed for homebrew games
Post by: Arkhan on March 13, 2012, 06:32:30 AM
This is what I was suggesting. If you have a higher CPU speed to work with, you probably have to do less of this to get this result, compared to a slower CPU speed.

It's not always black and white. The speed is sort of relative.  It's faster than the Atari 2600, yes, but theres also more to work with.  The Atari 2600 doesn't have a bajillion sprites, tiles, and music.   So, the speed is needed to access all of the resources without making crapass games.

Quote

Also, where on earth does all this incorrect information floating around in wikis and the like come from?


(http://3.bp.blogspot.com/_8VRxXiG8XpU/TUS5mz11TzI/AAAAAAAAAA8/6YpbYHTuP3Q/s1600/1296343941243.jpg)

Neckbeard Mouthbreathers.