Author Topic: CPU speed for homebrew games  (Read 500 times)

spenoza

  • Hero Member
  • *****
  • Posts: 2751
CPU speed for homebrew games
« 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?
<a href="http://www.pcedaisakusen.net/2/34/103/show-collection.htm" class="bbc_link" target="_blank">My meager PC Engine Collection so far.</a><br><a href="https://www.pcenginefx.com/forums/" class="bbc_link" target="_blank">PC Engine Software Bible</a><br><a href="http://www.racketboy.com/forum/" c

Arkhan

  • Hero Member
  • *****
  • Posts: 14142
  • Fuck Elmer.
    • Incessant Negativity Software
Re: CPU speed for homebrew games
« Reply #1 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.
[Fri 19:34]<nectarsis> been wanting to try that one for awhile now Ope
[Fri 19:33]<Opethian> l;ol huge dong

I'm a max level Forum Warrior.  I'm immortal.
If you're not ready to defend your claims, don't post em.

spenoza

  • Hero Member
  • *****
  • Posts: 2751
Re: CPU speed for homebrew games
« Reply #2 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?
<a href="http://www.pcedaisakusen.net/2/34/103/show-collection.htm" class="bbc_link" target="_blank">My meager PC Engine Collection so far.</a><br><a href="https://www.pcenginefx.com/forums/" class="bbc_link" target="_blank">PC Engine Software Bible</a><br><a href="http://www.racketboy.com/forum/" c

nodtveidt

  • Guest
Re: CPU speed for homebrew games
« Reply #3 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

spenoza

  • Hero Member
  • *****
  • Posts: 2751
Re: CPU speed for homebrew games
« Reply #4 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.
<a href="http://www.pcedaisakusen.net/2/34/103/show-collection.htm" class="bbc_link" target="_blank">My meager PC Engine Collection so far.</a><br><a href="https://www.pcenginefx.com/forums/" class="bbc_link" target="_blank">PC Engine Software Bible</a><br><a href="http://www.racketboy.com/forum/" c

nodtveidt

  • Guest
Re: CPU speed for homebrew games
« Reply #5 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.

TheOldMan

  • Hero Member
  • *****
  • Posts: 958
Re: CPU speed for homebrew games
« Reply #6 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.

ccovell

  • Hero Member
  • *****
  • Posts: 2245
Re: CPU speed for homebrew games
« Reply #7 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.

Arkhan

  • Hero Member
  • *****
  • Posts: 14142
  • Fuck Elmer.
    • Incessant Negativity Software
Re: CPU speed for homebrew games
« Reply #8 on: March 12, 2012, 02:53:19 PM »
[Fri 19:34]<nectarsis> been wanting to try that one for awhile now Ope
[Fri 19:33]<Opethian> l;ol huge dong

I'm a max level Forum Warrior.  I'm immortal.
If you're not ready to defend your claims, don't post em.

Bonknuts

  • Hero Member
  • *****
  • Posts: 3292
Re: CPU speed for homebrew games
« Reply #9 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.

touko

  • Hero Member
  • *****
  • Posts: 953
Re: CPU speed for homebrew games
« Reply #10 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 .
« Last Edit: March 13, 2012, 06:36:05 AM by touko »

spenoza

  • Hero Member
  • *****
  • Posts: 2751
Re: CPU speed for homebrew games
« Reply #11 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?
<a href="http://www.pcedaisakusen.net/2/34/103/show-collection.htm" class="bbc_link" target="_blank">My meager PC Engine Collection so far.</a><br><a href="https://www.pcenginefx.com/forums/" class="bbc_link" target="_blank">PC Engine Software Bible</a><br><a href="http://www.racketboy.com/forum/" c

Arkhan

  • Hero Member
  • *****
  • Posts: 14142
  • Fuck Elmer.
    • Incessant Negativity Software
Re: CPU speed for homebrew games
« Reply #12 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?




Neckbeard Mouthbreathers.


[Fri 19:34]<nectarsis> been wanting to try that one for awhile now Ope
[Fri 19:33]<Opethian> l;ol huge dong

I'm a max level Forum Warrior.  I'm immortal.
If you're not ready to defend your claims, don't post em.