Gameboy clock speed: 4.1943mhz or 1.05mhz?

Discussion in 'Modding and Hacking - Consoles and Electronics' started by Nitroiris, Dec 6, 2017.

  1. Nitroiris

    Nitroiris Active Member

    Joined:
    Aug 2, 2017
    Messages:
    48
    Likes Received:
    3
    So, you guys are saying that the dmg cpu has no ppu, or sound processor and it's all done in software? Because if it was a discrete z80 cpu with some instructions removed, that would surely be the case.

    I also found this and would like to know what sense he is making (I'm not going against what you guys are saying, I just want to know why this dev is so inclined to say such a thing):"I wrote the first Tombraider game on the GBC & my engine was used by the second game. The CPU is clocked at 1.05MHz but can be switched to run at 2.1MHz. The DMA of the sprites & BG meant the game ran at 30Hz. Switching back to 1.05MHz and dispatching a HALT intruction was tested and proved to increase battery-life. The clock was used by the video core & the CPU but was divided for the latter. I can assure you that it didn't run at 8MHz. If it did, I would have rendered the 3D model into an array of OBJs". — Preceding unsigned comment added by 81.99.74.135(talk) 21:44, 17 July 2017 (UTC)
     
    Last edited by a moderator: Mar 15, 2018
  2. TriMesh

    TriMesh Site Supporter 2013-2017

    Joined:
    Jul 3, 2008
    Messages:
    2,324
    Likes Received:
    750
    This has already been explained to you several times - it's written like that because it's an accurate description of the way it behaves from the viewpoint of a programmer.

    The exact wording in the original Nintendo documentation is as follows:

    Instruction cycles

    <DMG> 0.954uS (source oscillation: 4.1943 MHz)
    <CGB> 0.954uS/0.477uS switchable (source oscillation: 8.3886 MHz)

    And to answer your other question, from Nintendo's point of view, it's all just a CPU
    You could consider the audio generation an "SPU" and the video generation a "PPU" (or
    an "LCDC") if you like - but Nintendo clearly didn't and just included them as integral
    parts of the processor.

    [​IMG]
     
  3. Nitroiris

    Nitroiris Active Member

    Joined:
    Aug 2, 2017
    Messages:
    48
    Likes Received:
    3
    So, is the gameboy cpu clocked at a much higher speed than the nes, since it is 4.1943mhz? Also this guy states that the 1.78mhz clock rate for the new is in machine cycles as well, which I call bullshit and think he is a omplet fucking retard:

    "NES:
    The master clock is 21.5 MHz, same as Super NES.
    The dot clock is 5.4 MHz, same as Super NES.
    The CPU takes multiples of twelve master clock cycles to do anything because of the divide-by-12 behavior of the clock regulator. (On Super NES, this is usually 6 or 8 depending on the address bus.)
    The effective speed of the CPU is 1.8 MHz, or 1.8 million machine cycles per second.

    Game Boy:
    The master clock is 4.2 MHz.*
    The dot clock is 4.2 MHz.
    The CPU takes multiples of four master clock cycles (or "tstates") to do anything because of a state machine in the CPU core.
    The effective speed of the CPU is 1.05 MHz, or 1.05 million machine cycles per second.
    Game Boy Color can run at double speed, which is 2.1 million machine cycles per second. Enabling double speed mode will flash the screen briefly, so it's something that a game will usually set and then leave on or off.

    One difference between the Game Boy's CPU (Sharp LR35902) and more common CPUs that it resembles (Intel 8080 and Zilog Z80) is that while the LR35902's microcode state machine always divides by 4, the one in the 8080 and Z80 divides by 3 to 5 depending on what part of what instruction is being run. This variable length of a machine cycle ("mcycle") in input cycles ("tstates") is probably the origin of the difference between how Z80 programmers count cycles (as tstates) and how LR35902 programmers count cycles (as mcycles)."
     
  4. Bad_Ad84

    Bad_Ad84 The Tick

    Joined:
    May 26, 2011
    Messages:
    8,566
    Likes Received:
    1,308
    My god, not this thread again.
     
    MottZilla and Bearking like this.
  5. Nitroiris

    Nitroiris Active Member

    Joined:
    Aug 2, 2017
    Messages:
    48
    Likes Received:
    3
    Calm down, this has nothing to do with the clock rate of the gameboy anymore (I am now aware that the clock speed is indeed 4.1943mhz) but has to do with the clock speed of the nes cpu. Before you stop reading this and post a comment, I would like to inform you people about this guy on another thread and site, that seems to know what he's talking about, made a bold statement about the beloved slow clock speed of the nes at 1.79mhz. He stated that this measurement is actually in machine cycles, believe it or not! Just read whats below and share your opinions on if the nes 1.7mhz clock speed is actually in machine cycles or not.

    NES: 1.79 MHz in machine cycles
    Game Boy: 1.05 MHz in machine cycles

    Game Boy CPU makes up for the lower clock speed somewhat in increased instructions per clock. Many LR35902 instructions take one mcycle to execute, compared to a minimum of 2 for a 6502. For which is actually faster, see topic "Is a Game Boy faster than an NES?".

    And the link he shared was: https://forums.nesdev.com/viewtopic.php?f=20&t=17193
     
  6. Bad_Ad84

    Bad_Ad84 The Tick

    Joined:
    May 26, 2011
    Messages:
    8,566
    Likes Received:
    1,308
    Let's say 1mhz is 1 hour of time.

    You get 2 people to do a task for an hour. But one person is better at the job and can get double the amount done in one hour than the other.

    They both have the same time (clock speed), but do more in that time (cycles).

    In your above example, the gameboy does double the work in the same period of time as the nes.

    So nes does 1x 1.79 and gameboy does 2x 1.05

    So that's 1.79 vs 2.10 (it's a massive over simplification, your second link has far more detail - but hopefully it helps you understand as it still doesn't seem like you "get it").

    Its not accurate to just directly compare clock speed. Same as it's not accurate to give 2 people an hour and expect exactly the same amount of work.
     
    Last edited: Jul 16, 2018
sonicdude10
Draft saved Draft deleted
Insert every image as a...
  1.  0%

Share This Page