How did people program for Consoles with multiple CPUs?












30















I'm specifically interested in the Sega Mega Drive/Genesis, which used a 68000 CPU, but also a Z80, mainly used to control the sound hardware and provide backward compatibility with the Master System.



There was also the Atari Jaguar, with it's Tom and Jerry RISC chips, the Sega Saturn, Featuring a total of eight processors, and probably a lot more.



When writing code (assuming ASM), how would these additional processors be used/accessed? Did one write regular 68000 code (even for sound) and the 68000 itself handled talking to the Z80? Did one need to write two different programs, one for each CPU? If yes, how did they communicate with each other? Or is memory mapping used, which would require a binary that has both 68000 and Z80 instructions in them, making sure that the Z80 code is in a specific memory region?



(This isn't about "regular" multi-processing, like on newer consoles with multi-core CPUs that are all the same. This is about consoles with a main CPU and specialized co-processors for e.g., Sound. Basically, the Sega Genesis, though I'm looking at building my own custom system, so I'm more interested in the basic principles.)










share|improve this question


















  • 3





    "CPU" probably isn't the best term here, though I'm not certain what the idiomatic one of the time is; while you could have a 68k and a Z80, it was also common to see more specialized support chips. The general concept is called asymmetric multiprocessing.

    – chrylis
    Mar 29 at 3:29








  • 1





    Although not a console, in the 1980's, the ATR8000 was a Z80 CP/M system that had an option of replacing the socketed Z80 with a socketed small board that contained a Z80 and a 8088 and 512KB of ram. The 8088 could run MSDOS 2.11, using the Z80 to interface with the peripherals, floppy disks, serial port, printer, and a second serial port used for the ASCII terminal. In CP/M mode, the 512KB of ram could be used as a ramdisk. There was an 8 bit bus used to communicate between the Z80 and the 8088.

    – rcgldr
    Mar 29 at 8:59






  • 1





    The ATR8000 could also be used with an 8 bit Atari 400/800/65XE/130XE, with the Atari used as a terminal, or with the ATR8000 used as a peripheral controller for the Atari, adding a 6502 cpu into the mix, although even if present, the 8088 would not be used if using the ATR8000 as an Atari controller.

    – rcgldr
    Mar 29 at 9:05






  • 1





    Fun fact: New Phones have a similar model; they have a set of several processors of varying power needs/capabilities (at face value, to keep lower-need tasks on lower-power cores to save battery life). Could be worth looking into those for a modern approach to the given problem. IIRC in phones' case, though, it's all handled by the OS.

    – Delioth
    Mar 29 at 20:58








  • 2





    @Delioth While new phones have multiple cores of different speed (i.e. big.LITTLE), they all run the exact same ISA and are completely coherent, so it is transparent to the programmer. The modern equivalent to this problem is more like GPU vs CPU computing.

    – user71659
    Mar 30 at 7:03
















30















I'm specifically interested in the Sega Mega Drive/Genesis, which used a 68000 CPU, but also a Z80, mainly used to control the sound hardware and provide backward compatibility with the Master System.



There was also the Atari Jaguar, with it's Tom and Jerry RISC chips, the Sega Saturn, Featuring a total of eight processors, and probably a lot more.



When writing code (assuming ASM), how would these additional processors be used/accessed? Did one write regular 68000 code (even for sound) and the 68000 itself handled talking to the Z80? Did one need to write two different programs, one for each CPU? If yes, how did they communicate with each other? Or is memory mapping used, which would require a binary that has both 68000 and Z80 instructions in them, making sure that the Z80 code is in a specific memory region?



(This isn't about "regular" multi-processing, like on newer consoles with multi-core CPUs that are all the same. This is about consoles with a main CPU and specialized co-processors for e.g., Sound. Basically, the Sega Genesis, though I'm looking at building my own custom system, so I'm more interested in the basic principles.)










share|improve this question


















  • 3





    "CPU" probably isn't the best term here, though I'm not certain what the idiomatic one of the time is; while you could have a 68k and a Z80, it was also common to see more specialized support chips. The general concept is called asymmetric multiprocessing.

    – chrylis
    Mar 29 at 3:29








  • 1





    Although not a console, in the 1980's, the ATR8000 was a Z80 CP/M system that had an option of replacing the socketed Z80 with a socketed small board that contained a Z80 and a 8088 and 512KB of ram. The 8088 could run MSDOS 2.11, using the Z80 to interface with the peripherals, floppy disks, serial port, printer, and a second serial port used for the ASCII terminal. In CP/M mode, the 512KB of ram could be used as a ramdisk. There was an 8 bit bus used to communicate between the Z80 and the 8088.

    – rcgldr
    Mar 29 at 8:59






  • 1





    The ATR8000 could also be used with an 8 bit Atari 400/800/65XE/130XE, with the Atari used as a terminal, or with the ATR8000 used as a peripheral controller for the Atari, adding a 6502 cpu into the mix, although even if present, the 8088 would not be used if using the ATR8000 as an Atari controller.

    – rcgldr
    Mar 29 at 9:05






  • 1





    Fun fact: New Phones have a similar model; they have a set of several processors of varying power needs/capabilities (at face value, to keep lower-need tasks on lower-power cores to save battery life). Could be worth looking into those for a modern approach to the given problem. IIRC in phones' case, though, it's all handled by the OS.

    – Delioth
    Mar 29 at 20:58








  • 2





    @Delioth While new phones have multiple cores of different speed (i.e. big.LITTLE), they all run the exact same ISA and are completely coherent, so it is transparent to the programmer. The modern equivalent to this problem is more like GPU vs CPU computing.

    – user71659
    Mar 30 at 7:03














30












30








30


6






I'm specifically interested in the Sega Mega Drive/Genesis, which used a 68000 CPU, but also a Z80, mainly used to control the sound hardware and provide backward compatibility with the Master System.



There was also the Atari Jaguar, with it's Tom and Jerry RISC chips, the Sega Saturn, Featuring a total of eight processors, and probably a lot more.



When writing code (assuming ASM), how would these additional processors be used/accessed? Did one write regular 68000 code (even for sound) and the 68000 itself handled talking to the Z80? Did one need to write two different programs, one for each CPU? If yes, how did they communicate with each other? Or is memory mapping used, which would require a binary that has both 68000 and Z80 instructions in them, making sure that the Z80 code is in a specific memory region?



(This isn't about "regular" multi-processing, like on newer consoles with multi-core CPUs that are all the same. This is about consoles with a main CPU and specialized co-processors for e.g., Sound. Basically, the Sega Genesis, though I'm looking at building my own custom system, so I'm more interested in the basic principles.)










share|improve this question














I'm specifically interested in the Sega Mega Drive/Genesis, which used a 68000 CPU, but also a Z80, mainly used to control the sound hardware and provide backward compatibility with the Master System.



There was also the Atari Jaguar, with it's Tom and Jerry RISC chips, the Sega Saturn, Featuring a total of eight processors, and probably a lot more.



When writing code (assuming ASM), how would these additional processors be used/accessed? Did one write regular 68000 code (even for sound) and the 68000 itself handled talking to the Z80? Did one need to write two different programs, one for each CPU? If yes, how did they communicate with each other? Or is memory mapping used, which would require a binary that has both 68000 and Z80 instructions in them, making sure that the Z80 code is in a specific memory region?



(This isn't about "regular" multi-processing, like on newer consoles with multi-core CPUs that are all the same. This is about consoles with a main CPU and specialized co-processors for e.g., Sound. Basically, the Sega Genesis, though I'm looking at building my own custom system, so I'm more interested in the basic principles.)







software-development cpu sega-genesis






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 29 at 0:49









Michael StumMichael Stum

25336




25336








  • 3





    "CPU" probably isn't the best term here, though I'm not certain what the idiomatic one of the time is; while you could have a 68k and a Z80, it was also common to see more specialized support chips. The general concept is called asymmetric multiprocessing.

    – chrylis
    Mar 29 at 3:29








  • 1





    Although not a console, in the 1980's, the ATR8000 was a Z80 CP/M system that had an option of replacing the socketed Z80 with a socketed small board that contained a Z80 and a 8088 and 512KB of ram. The 8088 could run MSDOS 2.11, using the Z80 to interface with the peripherals, floppy disks, serial port, printer, and a second serial port used for the ASCII terminal. In CP/M mode, the 512KB of ram could be used as a ramdisk. There was an 8 bit bus used to communicate between the Z80 and the 8088.

    – rcgldr
    Mar 29 at 8:59






  • 1





    The ATR8000 could also be used with an 8 bit Atari 400/800/65XE/130XE, with the Atari used as a terminal, or with the ATR8000 used as a peripheral controller for the Atari, adding a 6502 cpu into the mix, although even if present, the 8088 would not be used if using the ATR8000 as an Atari controller.

    – rcgldr
    Mar 29 at 9:05






  • 1





    Fun fact: New Phones have a similar model; they have a set of several processors of varying power needs/capabilities (at face value, to keep lower-need tasks on lower-power cores to save battery life). Could be worth looking into those for a modern approach to the given problem. IIRC in phones' case, though, it's all handled by the OS.

    – Delioth
    Mar 29 at 20:58








  • 2





    @Delioth While new phones have multiple cores of different speed (i.e. big.LITTLE), they all run the exact same ISA and are completely coherent, so it is transparent to the programmer. The modern equivalent to this problem is more like GPU vs CPU computing.

    – user71659
    Mar 30 at 7:03














  • 3





    "CPU" probably isn't the best term here, though I'm not certain what the idiomatic one of the time is; while you could have a 68k and a Z80, it was also common to see more specialized support chips. The general concept is called asymmetric multiprocessing.

    – chrylis
    Mar 29 at 3:29








  • 1





    Although not a console, in the 1980's, the ATR8000 was a Z80 CP/M system that had an option of replacing the socketed Z80 with a socketed small board that contained a Z80 and a 8088 and 512KB of ram. The 8088 could run MSDOS 2.11, using the Z80 to interface with the peripherals, floppy disks, serial port, printer, and a second serial port used for the ASCII terminal. In CP/M mode, the 512KB of ram could be used as a ramdisk. There was an 8 bit bus used to communicate between the Z80 and the 8088.

    – rcgldr
    Mar 29 at 8:59






  • 1





    The ATR8000 could also be used with an 8 bit Atari 400/800/65XE/130XE, with the Atari used as a terminal, or with the ATR8000 used as a peripheral controller for the Atari, adding a 6502 cpu into the mix, although even if present, the 8088 would not be used if using the ATR8000 as an Atari controller.

    – rcgldr
    Mar 29 at 9:05






  • 1





    Fun fact: New Phones have a similar model; they have a set of several processors of varying power needs/capabilities (at face value, to keep lower-need tasks on lower-power cores to save battery life). Could be worth looking into those for a modern approach to the given problem. IIRC in phones' case, though, it's all handled by the OS.

    – Delioth
    Mar 29 at 20:58








  • 2





    @Delioth While new phones have multiple cores of different speed (i.e. big.LITTLE), they all run the exact same ISA and are completely coherent, so it is transparent to the programmer. The modern equivalent to this problem is more like GPU vs CPU computing.

    – user71659
    Mar 30 at 7:03








3




3





"CPU" probably isn't the best term here, though I'm not certain what the idiomatic one of the time is; while you could have a 68k and a Z80, it was also common to see more specialized support chips. The general concept is called asymmetric multiprocessing.

– chrylis
Mar 29 at 3:29







"CPU" probably isn't the best term here, though I'm not certain what the idiomatic one of the time is; while you could have a 68k and a Z80, it was also common to see more specialized support chips. The general concept is called asymmetric multiprocessing.

– chrylis
Mar 29 at 3:29






1




1





Although not a console, in the 1980's, the ATR8000 was a Z80 CP/M system that had an option of replacing the socketed Z80 with a socketed small board that contained a Z80 and a 8088 and 512KB of ram. The 8088 could run MSDOS 2.11, using the Z80 to interface with the peripherals, floppy disks, serial port, printer, and a second serial port used for the ASCII terminal. In CP/M mode, the 512KB of ram could be used as a ramdisk. There was an 8 bit bus used to communicate between the Z80 and the 8088.

– rcgldr
Mar 29 at 8:59





Although not a console, in the 1980's, the ATR8000 was a Z80 CP/M system that had an option of replacing the socketed Z80 with a socketed small board that contained a Z80 and a 8088 and 512KB of ram. The 8088 could run MSDOS 2.11, using the Z80 to interface with the peripherals, floppy disks, serial port, printer, and a second serial port used for the ASCII terminal. In CP/M mode, the 512KB of ram could be used as a ramdisk. There was an 8 bit bus used to communicate between the Z80 and the 8088.

– rcgldr
Mar 29 at 8:59




1




1





The ATR8000 could also be used with an 8 bit Atari 400/800/65XE/130XE, with the Atari used as a terminal, or with the ATR8000 used as a peripheral controller for the Atari, adding a 6502 cpu into the mix, although even if present, the 8088 would not be used if using the ATR8000 as an Atari controller.

– rcgldr
Mar 29 at 9:05





The ATR8000 could also be used with an 8 bit Atari 400/800/65XE/130XE, with the Atari used as a terminal, or with the ATR8000 used as a peripheral controller for the Atari, adding a 6502 cpu into the mix, although even if present, the 8088 would not be used if using the ATR8000 as an Atari controller.

– rcgldr
Mar 29 at 9:05




1




1





Fun fact: New Phones have a similar model; they have a set of several processors of varying power needs/capabilities (at face value, to keep lower-need tasks on lower-power cores to save battery life). Could be worth looking into those for a modern approach to the given problem. IIRC in phones' case, though, it's all handled by the OS.

– Delioth
Mar 29 at 20:58







Fun fact: New Phones have a similar model; they have a set of several processors of varying power needs/capabilities (at face value, to keep lower-need tasks on lower-power cores to save battery life). Could be worth looking into those for a modern approach to the given problem. IIRC in phones' case, though, it's all handled by the OS.

– Delioth
Mar 29 at 20:58






2




2





@Delioth While new phones have multiple cores of different speed (i.e. big.LITTLE), they all run the exact same ISA and are completely coherent, so it is transparent to the programmer. The modern equivalent to this problem is more like GPU vs CPU computing.

– user71659
Mar 30 at 7:03





@Delioth While new phones have multiple cores of different speed (i.e. big.LITTLE), they all run the exact same ISA and are completely coherent, so it is transparent to the programmer. The modern equivalent to this problem is more like GPU vs CPU computing.

– user71659
Mar 30 at 7:03










2 Answers
2






active

oldest

votes


















37














It varies machine to machine; at the simplest end is the Neo Geo — its 68000 and Z80 have completely independent buses. You write one program for the 68000 and one for the Z80 and a single pipe of communication joins the two: post a byte to the Z80 and it'll trigger an NMI; the Z80 can read the command byte from a certain port and write a response to another, the 68000 can poll for the response. Neo Geo also supplied a sample set of Z80 code so you could just treat it as an advanced sound generator and not worry about the implementation if you prefer.



The Mega Drive has a more complicated system of shared buses; the Z80 has some memory on a private bus but the cartridge bus is a shared resource and I think the Z80 can also share some RAM. In that system the VDP can also act as a bus master so in net it's the Z80 getting access to the shared resources only when nobody else is attempting an access, the 68000 having priority only when it doesn't chose to start a VDP transfer, and the VDP having top priority for those periods when the 68000 has command it to do something.



If you ever hear scratchy sampled audio in a Mega Drive game then it's likely to be the Z80 trying to stream from the cartridge but frequently losing out on access slots.



The Saturn is like a more advanced Mega Drive except that the main CPUs have caches that can also be configured as small local memory pools. So if you're careful you can mostly keep them off the shared bus, gaining a significant performance benefit — Virtua Fighter 2 manages to keep most of the data for each player local to a single CPU for most of a frame, the laziest PlayStation ports do nothing in particular and either end up only using a single CPU or effectively doing so as a result of collection.



The Jaguar is supposed to work similarly to the Saturn but, quelle surprise, Atari rushed it to market so there's a significant bug affecting the RISC CPU's accesses to RAM when performing certain types of jump. That's how it often ends up being treated as a machine with a 68000 central processor when really the 68000 was intended just to be an intelligent scheduler.



So: across these systems one generally writes a different program for each processor, and either nominates one as a coordinator or uses a series of ad hoc means of point-to-point communication.



If it sounds hard to get right, that's because it is — programmers much prefer systems like the original PlayStation with a single CPU that just goes quickly.






share|improve this answer
























  • Thank you for pointing out the Neo Geo, I found this article about the communication and this makes a lot of sense - basically two independent CPUs, with the 68k in the drivers seat, and literally different ROMs for each CPU. This looks more elegant than the shared memory approach that e.g., the C64 used, though I'm still doing research.

    – Michael Stum
    Mar 31 at 5:02






  • 1





    Yeah — if you check out the connector on a Neo Geo cartridge e.g. hit930.sakura.ne.jp/hitjapan/NeoGeoAES2/17011308023.jpg you'll notice it has two exposed PCBs rather than the usual one; that's because of the three independent buses in the system (the video system being the third) so there's a lot more than usual to connect.

    – Tommy
    Mar 31 at 18:46



















10














There are two basic techniques: shared memory and dedicated communication ports.



Shared memory simply allows both processors to access the same memory bus. There are some issues, as the bus has to be shared and one CPU has to get priority so code must be designed to take unpredictable extra delays into account. The Megadrive is a good example of that, with the Z80 CPU losing cycles to the 68000 and the graphics subsystem.



It's actually a quite awkward system but they wanted the Z80 for backwards compatibility with Master System games. The system has a dedicated sound chip and the overhead for playing back music and sound effects is so low that there is little benefit to offloading it from the 68000.



The other issue with shared memory is that if one CPU is writing to it while the other is reading it, the reading CPU can end up with corrupt data. Therefore some kind of arbitration is needed, often based on atomic update operations.



Communication ports allow two CPUs on separate buses to communicate. Each CPU has its own bus, its own RAM, its own peripherals and a single I/O port that lets it communicate with the other CPU(s). The port usually allows commands and small amounts of data to be sent, often one way, from one CPU to another and an acknowledgement to be sent back. The Neo Geo is an example of a system that works that, or more common in the west was BBC Micro with its optional second processor via the "tube".



Software for each CPU was written and debugged separately.






share|improve this answer
























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "648"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    noCode: true, onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fretrocomputing.stackexchange.com%2fquestions%2f9458%2fhow-did-people-program-for-consoles-with-multiple-cpus%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    37














    It varies machine to machine; at the simplest end is the Neo Geo — its 68000 and Z80 have completely independent buses. You write one program for the 68000 and one for the Z80 and a single pipe of communication joins the two: post a byte to the Z80 and it'll trigger an NMI; the Z80 can read the command byte from a certain port and write a response to another, the 68000 can poll for the response. Neo Geo also supplied a sample set of Z80 code so you could just treat it as an advanced sound generator and not worry about the implementation if you prefer.



    The Mega Drive has a more complicated system of shared buses; the Z80 has some memory on a private bus but the cartridge bus is a shared resource and I think the Z80 can also share some RAM. In that system the VDP can also act as a bus master so in net it's the Z80 getting access to the shared resources only when nobody else is attempting an access, the 68000 having priority only when it doesn't chose to start a VDP transfer, and the VDP having top priority for those periods when the 68000 has command it to do something.



    If you ever hear scratchy sampled audio in a Mega Drive game then it's likely to be the Z80 trying to stream from the cartridge but frequently losing out on access slots.



    The Saturn is like a more advanced Mega Drive except that the main CPUs have caches that can also be configured as small local memory pools. So if you're careful you can mostly keep them off the shared bus, gaining a significant performance benefit — Virtua Fighter 2 manages to keep most of the data for each player local to a single CPU for most of a frame, the laziest PlayStation ports do nothing in particular and either end up only using a single CPU or effectively doing so as a result of collection.



    The Jaguar is supposed to work similarly to the Saturn but, quelle surprise, Atari rushed it to market so there's a significant bug affecting the RISC CPU's accesses to RAM when performing certain types of jump. That's how it often ends up being treated as a machine with a 68000 central processor when really the 68000 was intended just to be an intelligent scheduler.



    So: across these systems one generally writes a different program for each processor, and either nominates one as a coordinator or uses a series of ad hoc means of point-to-point communication.



    If it sounds hard to get right, that's because it is — programmers much prefer systems like the original PlayStation with a single CPU that just goes quickly.






    share|improve this answer
























    • Thank you for pointing out the Neo Geo, I found this article about the communication and this makes a lot of sense - basically two independent CPUs, with the 68k in the drivers seat, and literally different ROMs for each CPU. This looks more elegant than the shared memory approach that e.g., the C64 used, though I'm still doing research.

      – Michael Stum
      Mar 31 at 5:02






    • 1





      Yeah — if you check out the connector on a Neo Geo cartridge e.g. hit930.sakura.ne.jp/hitjapan/NeoGeoAES2/17011308023.jpg you'll notice it has two exposed PCBs rather than the usual one; that's because of the three independent buses in the system (the video system being the third) so there's a lot more than usual to connect.

      – Tommy
      Mar 31 at 18:46
















    37














    It varies machine to machine; at the simplest end is the Neo Geo — its 68000 and Z80 have completely independent buses. You write one program for the 68000 and one for the Z80 and a single pipe of communication joins the two: post a byte to the Z80 and it'll trigger an NMI; the Z80 can read the command byte from a certain port and write a response to another, the 68000 can poll for the response. Neo Geo also supplied a sample set of Z80 code so you could just treat it as an advanced sound generator and not worry about the implementation if you prefer.



    The Mega Drive has a more complicated system of shared buses; the Z80 has some memory on a private bus but the cartridge bus is a shared resource and I think the Z80 can also share some RAM. In that system the VDP can also act as a bus master so in net it's the Z80 getting access to the shared resources only when nobody else is attempting an access, the 68000 having priority only when it doesn't chose to start a VDP transfer, and the VDP having top priority for those periods when the 68000 has command it to do something.



    If you ever hear scratchy sampled audio in a Mega Drive game then it's likely to be the Z80 trying to stream from the cartridge but frequently losing out on access slots.



    The Saturn is like a more advanced Mega Drive except that the main CPUs have caches that can also be configured as small local memory pools. So if you're careful you can mostly keep them off the shared bus, gaining a significant performance benefit — Virtua Fighter 2 manages to keep most of the data for each player local to a single CPU for most of a frame, the laziest PlayStation ports do nothing in particular and either end up only using a single CPU or effectively doing so as a result of collection.



    The Jaguar is supposed to work similarly to the Saturn but, quelle surprise, Atari rushed it to market so there's a significant bug affecting the RISC CPU's accesses to RAM when performing certain types of jump. That's how it often ends up being treated as a machine with a 68000 central processor when really the 68000 was intended just to be an intelligent scheduler.



    So: across these systems one generally writes a different program for each processor, and either nominates one as a coordinator or uses a series of ad hoc means of point-to-point communication.



    If it sounds hard to get right, that's because it is — programmers much prefer systems like the original PlayStation with a single CPU that just goes quickly.






    share|improve this answer
























    • Thank you for pointing out the Neo Geo, I found this article about the communication and this makes a lot of sense - basically two independent CPUs, with the 68k in the drivers seat, and literally different ROMs for each CPU. This looks more elegant than the shared memory approach that e.g., the C64 used, though I'm still doing research.

      – Michael Stum
      Mar 31 at 5:02






    • 1





      Yeah — if you check out the connector on a Neo Geo cartridge e.g. hit930.sakura.ne.jp/hitjapan/NeoGeoAES2/17011308023.jpg you'll notice it has two exposed PCBs rather than the usual one; that's because of the three independent buses in the system (the video system being the third) so there's a lot more than usual to connect.

      – Tommy
      Mar 31 at 18:46














    37












    37








    37







    It varies machine to machine; at the simplest end is the Neo Geo — its 68000 and Z80 have completely independent buses. You write one program for the 68000 and one for the Z80 and a single pipe of communication joins the two: post a byte to the Z80 and it'll trigger an NMI; the Z80 can read the command byte from a certain port and write a response to another, the 68000 can poll for the response. Neo Geo also supplied a sample set of Z80 code so you could just treat it as an advanced sound generator and not worry about the implementation if you prefer.



    The Mega Drive has a more complicated system of shared buses; the Z80 has some memory on a private bus but the cartridge bus is a shared resource and I think the Z80 can also share some RAM. In that system the VDP can also act as a bus master so in net it's the Z80 getting access to the shared resources only when nobody else is attempting an access, the 68000 having priority only when it doesn't chose to start a VDP transfer, and the VDP having top priority for those periods when the 68000 has command it to do something.



    If you ever hear scratchy sampled audio in a Mega Drive game then it's likely to be the Z80 trying to stream from the cartridge but frequently losing out on access slots.



    The Saturn is like a more advanced Mega Drive except that the main CPUs have caches that can also be configured as small local memory pools. So if you're careful you can mostly keep them off the shared bus, gaining a significant performance benefit — Virtua Fighter 2 manages to keep most of the data for each player local to a single CPU for most of a frame, the laziest PlayStation ports do nothing in particular and either end up only using a single CPU or effectively doing so as a result of collection.



    The Jaguar is supposed to work similarly to the Saturn but, quelle surprise, Atari rushed it to market so there's a significant bug affecting the RISC CPU's accesses to RAM when performing certain types of jump. That's how it often ends up being treated as a machine with a 68000 central processor when really the 68000 was intended just to be an intelligent scheduler.



    So: across these systems one generally writes a different program for each processor, and either nominates one as a coordinator or uses a series of ad hoc means of point-to-point communication.



    If it sounds hard to get right, that's because it is — programmers much prefer systems like the original PlayStation with a single CPU that just goes quickly.






    share|improve this answer













    It varies machine to machine; at the simplest end is the Neo Geo — its 68000 and Z80 have completely independent buses. You write one program for the 68000 and one for the Z80 and a single pipe of communication joins the two: post a byte to the Z80 and it'll trigger an NMI; the Z80 can read the command byte from a certain port and write a response to another, the 68000 can poll for the response. Neo Geo also supplied a sample set of Z80 code so you could just treat it as an advanced sound generator and not worry about the implementation if you prefer.



    The Mega Drive has a more complicated system of shared buses; the Z80 has some memory on a private bus but the cartridge bus is a shared resource and I think the Z80 can also share some RAM. In that system the VDP can also act as a bus master so in net it's the Z80 getting access to the shared resources only when nobody else is attempting an access, the 68000 having priority only when it doesn't chose to start a VDP transfer, and the VDP having top priority for those periods when the 68000 has command it to do something.



    If you ever hear scratchy sampled audio in a Mega Drive game then it's likely to be the Z80 trying to stream from the cartridge but frequently losing out on access slots.



    The Saturn is like a more advanced Mega Drive except that the main CPUs have caches that can also be configured as small local memory pools. So if you're careful you can mostly keep them off the shared bus, gaining a significant performance benefit — Virtua Fighter 2 manages to keep most of the data for each player local to a single CPU for most of a frame, the laziest PlayStation ports do nothing in particular and either end up only using a single CPU or effectively doing so as a result of collection.



    The Jaguar is supposed to work similarly to the Saturn but, quelle surprise, Atari rushed it to market so there's a significant bug affecting the RISC CPU's accesses to RAM when performing certain types of jump. That's how it often ends up being treated as a machine with a 68000 central processor when really the 68000 was intended just to be an intelligent scheduler.



    So: across these systems one generally writes a different program for each processor, and either nominates one as a coordinator or uses a series of ad hoc means of point-to-point communication.



    If it sounds hard to get right, that's because it is — programmers much prefer systems like the original PlayStation with a single CPU that just goes quickly.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Mar 29 at 1:27









    TommyTommy

    16k14678




    16k14678













    • Thank you for pointing out the Neo Geo, I found this article about the communication and this makes a lot of sense - basically two independent CPUs, with the 68k in the drivers seat, and literally different ROMs for each CPU. This looks more elegant than the shared memory approach that e.g., the C64 used, though I'm still doing research.

      – Michael Stum
      Mar 31 at 5:02






    • 1





      Yeah — if you check out the connector on a Neo Geo cartridge e.g. hit930.sakura.ne.jp/hitjapan/NeoGeoAES2/17011308023.jpg you'll notice it has two exposed PCBs rather than the usual one; that's because of the three independent buses in the system (the video system being the third) so there's a lot more than usual to connect.

      – Tommy
      Mar 31 at 18:46



















    • Thank you for pointing out the Neo Geo, I found this article about the communication and this makes a lot of sense - basically two independent CPUs, with the 68k in the drivers seat, and literally different ROMs for each CPU. This looks more elegant than the shared memory approach that e.g., the C64 used, though I'm still doing research.

      – Michael Stum
      Mar 31 at 5:02






    • 1





      Yeah — if you check out the connector on a Neo Geo cartridge e.g. hit930.sakura.ne.jp/hitjapan/NeoGeoAES2/17011308023.jpg you'll notice it has two exposed PCBs rather than the usual one; that's because of the three independent buses in the system (the video system being the third) so there's a lot more than usual to connect.

      – Tommy
      Mar 31 at 18:46

















    Thank you for pointing out the Neo Geo, I found this article about the communication and this makes a lot of sense - basically two independent CPUs, with the 68k in the drivers seat, and literally different ROMs for each CPU. This looks more elegant than the shared memory approach that e.g., the C64 used, though I'm still doing research.

    – Michael Stum
    Mar 31 at 5:02





    Thank you for pointing out the Neo Geo, I found this article about the communication and this makes a lot of sense - basically two independent CPUs, with the 68k in the drivers seat, and literally different ROMs for each CPU. This looks more elegant than the shared memory approach that e.g., the C64 used, though I'm still doing research.

    – Michael Stum
    Mar 31 at 5:02




    1




    1





    Yeah — if you check out the connector on a Neo Geo cartridge e.g. hit930.sakura.ne.jp/hitjapan/NeoGeoAES2/17011308023.jpg you'll notice it has two exposed PCBs rather than the usual one; that's because of the three independent buses in the system (the video system being the third) so there's a lot more than usual to connect.

    – Tommy
    Mar 31 at 18:46





    Yeah — if you check out the connector on a Neo Geo cartridge e.g. hit930.sakura.ne.jp/hitjapan/NeoGeoAES2/17011308023.jpg you'll notice it has two exposed PCBs rather than the usual one; that's because of the three independent buses in the system (the video system being the third) so there's a lot more than usual to connect.

    – Tommy
    Mar 31 at 18:46











    10














    There are two basic techniques: shared memory and dedicated communication ports.



    Shared memory simply allows both processors to access the same memory bus. There are some issues, as the bus has to be shared and one CPU has to get priority so code must be designed to take unpredictable extra delays into account. The Megadrive is a good example of that, with the Z80 CPU losing cycles to the 68000 and the graphics subsystem.



    It's actually a quite awkward system but they wanted the Z80 for backwards compatibility with Master System games. The system has a dedicated sound chip and the overhead for playing back music and sound effects is so low that there is little benefit to offloading it from the 68000.



    The other issue with shared memory is that if one CPU is writing to it while the other is reading it, the reading CPU can end up with corrupt data. Therefore some kind of arbitration is needed, often based on atomic update operations.



    Communication ports allow two CPUs on separate buses to communicate. Each CPU has its own bus, its own RAM, its own peripherals and a single I/O port that lets it communicate with the other CPU(s). The port usually allows commands and small amounts of data to be sent, often one way, from one CPU to another and an acknowledgement to be sent back. The Neo Geo is an example of a system that works that, or more common in the west was BBC Micro with its optional second processor via the "tube".



    Software for each CPU was written and debugged separately.






    share|improve this answer




























      10














      There are two basic techniques: shared memory and dedicated communication ports.



      Shared memory simply allows both processors to access the same memory bus. There are some issues, as the bus has to be shared and one CPU has to get priority so code must be designed to take unpredictable extra delays into account. The Megadrive is a good example of that, with the Z80 CPU losing cycles to the 68000 and the graphics subsystem.



      It's actually a quite awkward system but they wanted the Z80 for backwards compatibility with Master System games. The system has a dedicated sound chip and the overhead for playing back music and sound effects is so low that there is little benefit to offloading it from the 68000.



      The other issue with shared memory is that if one CPU is writing to it while the other is reading it, the reading CPU can end up with corrupt data. Therefore some kind of arbitration is needed, often based on atomic update operations.



      Communication ports allow two CPUs on separate buses to communicate. Each CPU has its own bus, its own RAM, its own peripherals and a single I/O port that lets it communicate with the other CPU(s). The port usually allows commands and small amounts of data to be sent, often one way, from one CPU to another and an acknowledgement to be sent back. The Neo Geo is an example of a system that works that, or more common in the west was BBC Micro with its optional second processor via the "tube".



      Software for each CPU was written and debugged separately.






      share|improve this answer


























        10












        10








        10







        There are two basic techniques: shared memory and dedicated communication ports.



        Shared memory simply allows both processors to access the same memory bus. There are some issues, as the bus has to be shared and one CPU has to get priority so code must be designed to take unpredictable extra delays into account. The Megadrive is a good example of that, with the Z80 CPU losing cycles to the 68000 and the graphics subsystem.



        It's actually a quite awkward system but they wanted the Z80 for backwards compatibility with Master System games. The system has a dedicated sound chip and the overhead for playing back music and sound effects is so low that there is little benefit to offloading it from the 68000.



        The other issue with shared memory is that if one CPU is writing to it while the other is reading it, the reading CPU can end up with corrupt data. Therefore some kind of arbitration is needed, often based on atomic update operations.



        Communication ports allow two CPUs on separate buses to communicate. Each CPU has its own bus, its own RAM, its own peripherals and a single I/O port that lets it communicate with the other CPU(s). The port usually allows commands and small amounts of data to be sent, often one way, from one CPU to another and an acknowledgement to be sent back. The Neo Geo is an example of a system that works that, or more common in the west was BBC Micro with its optional second processor via the "tube".



        Software for each CPU was written and debugged separately.






        share|improve this answer













        There are two basic techniques: shared memory and dedicated communication ports.



        Shared memory simply allows both processors to access the same memory bus. There are some issues, as the bus has to be shared and one CPU has to get priority so code must be designed to take unpredictable extra delays into account. The Megadrive is a good example of that, with the Z80 CPU losing cycles to the 68000 and the graphics subsystem.



        It's actually a quite awkward system but they wanted the Z80 for backwards compatibility with Master System games. The system has a dedicated sound chip and the overhead for playing back music and sound effects is so low that there is little benefit to offloading it from the 68000.



        The other issue with shared memory is that if one CPU is writing to it while the other is reading it, the reading CPU can end up with corrupt data. Therefore some kind of arbitration is needed, often based on atomic update operations.



        Communication ports allow two CPUs on separate buses to communicate. Each CPU has its own bus, its own RAM, its own peripherals and a single I/O port that lets it communicate with the other CPU(s). The port usually allows commands and small amounts of data to be sent, often one way, from one CPU to another and an acknowledgement to be sent back. The Neo Geo is an example of a system that works that, or more common in the west was BBC Micro with its optional second processor via the "tube".



        Software for each CPU was written and debugged separately.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 29 at 9:52









        useruser

        4,025818




        4,025818






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Retrocomputing Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fretrocomputing.stackexchange.com%2fquestions%2f9458%2fhow-did-people-program-for-consoles-with-multiple-cpus%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Færeyskur hestur Heimild | Tengill | Tilvísanir | LeiðsagnarvalRossið - síða um færeyska hrossið á færeyskuGott ár hjá færeyska hestinum

            He _____ here since 1970 . Answer needed [closed]What does “since he was so high” mean?Meaning of “catch birds for”?How do I ensure “since” takes the meaning I want?“Who cares here” meaningWhat does “right round toward” mean?the time tense (had now been detected)What does the phrase “ring around the roses” mean here?Correct usage of “visited upon”Meaning of “foiled rail sabotage bid”It was the third time I had gone to Rome or It is the third time I had been to Rome

            Slayer Innehåll Historia | Stil, komposition och lyrik | Bandets betydelse och framgångar | Sidoprojekt och samarbeten | Kontroverser | Medlemmar | Utmärkelser och nomineringar | Turnéer och festivaler | Diskografi | Referenser | Externa länkar | Navigeringsmenywww.slayer.net”Metal Massacre vol. 1””Metal Massacre vol. 3””Metal Massacre Volume III””Show No Mercy””Haunting the Chapel””Live Undead””Hell Awaits””Reign in Blood””Reign in Blood””Gold & Platinum – Reign in Blood””Golden Gods Awards Winners”originalet”Kerrang! Hall Of Fame””Slayer Looks Back On 37-Year Career In New Video Series: Part Two””South of Heaven””Gold & Platinum – South of Heaven””Seasons in the Abyss””Gold & Platinum - Seasons in the Abyss””Divine Intervention””Divine Intervention - Release group by Slayer””Gold & Platinum - Divine Intervention””Live Intrusion””Undisputed Attitude””Abolish Government/Superficial Love””Release “Slatanic Slaughter: A Tribute to Slayer” by Various Artists””Diabolus in Musica””Soundtrack to the Apocalypse””God Hates Us All””Systematic - Relationships””War at the Warfield””Gold & Platinum - War at the Warfield””Soundtrack to the Apocalypse””Gold & Platinum - Still Reigning””Metallica, Slayer, Iron Mauden Among Winners At Metal Hammer Awards””Eternal Pyre””Eternal Pyre - Slayer release group””Eternal Pyre””Metal Storm Awards 2006””Kerrang! Hall Of Fame””Slayer Wins 'Best Metal' Grammy Award””Slayer Guitarist Jeff Hanneman Dies””Bullet-For My Valentine booed at Metal Hammer Golden Gods Awards””Unholy Aliance””The End Of Slayer?””Slayer: We Could Thrash Out Two More Albums If We're Fast Enough...””'The Unholy Alliance: Chapter III' UK Dates Added”originalet”Megadeth And Slayer To Co-Headline 'Canadian Carnage' Trek”originalet”World Painted Blood””Release “World Painted Blood” by Slayer””Metallica Heading To Cinemas””Slayer, Megadeth To Join Forces For 'European Carnage' Tour - Dec. 18, 2010”originalet”Slayer's Hanneman Contracts Acute Infection; Band To Bring In Guest Guitarist””Cannibal Corpse's Pat O'Brien Will Step In As Slayer's Guest Guitarist”originalet”Slayer’s Jeff Hanneman Dead at 49””Dave Lombardo Says He Made Only $67,000 In 2011 While Touring With Slayer””Slayer: We Do Not Agree With Dave Lombardo's Substance Or Timeline Of Events””Slayer Welcomes Drummer Paul Bostaph Back To The Fold””Slayer Hope to Unveil Never-Before-Heard Jeff Hanneman Material on Next Album””Slayer Debut New Song 'Implode' During Surprise Golden Gods Appearance””Release group Repentless by Slayer””Repentless - Slayer - Credits””Slayer””Metal Storm Awards 2015””Slayer - to release comic book "Repentless #1"””Slayer To Release 'Repentless' 6.66" Vinyl Box Set””BREAKING NEWS: Slayer Announce Farewell Tour””Slayer Recruit Lamb of God, Anthrax, Behemoth + Testament for Final Tour””Slayer lägger ner efter 37 år””Slayer Announces Second North American Leg Of 'Final' Tour””Final World Tour””Slayer Announces Final European Tour With Lamb of God, Anthrax And Obituary””Slayer To Tour Europe With Lamb of God, Anthrax And Obituary””Slayer To Play 'Last French Show Ever' At Next Year's Hellfst””Slayer's Final World Tour Will Extend Into 2019””Death Angel's Rob Cavestany On Slayer's 'Farewell' Tour: 'Some Of Us Could See This Coming'””Testament Has No Plans To Retire Anytime Soon, Says Chuck Billy””Anthrax's Scott Ian On Slayer's 'Farewell' Tour Plans: 'I Was Surprised And I Wasn't Surprised'””Slayer””Slayer's Morbid Schlock””Review/Rock; For Slayer, the Mania Is the Message””Slayer - Biography””Slayer - Reign In Blood”originalet”Dave Lombardo””An exclusive oral history of Slayer”originalet”Exclusive! Interview With Slayer Guitarist Jeff Hanneman”originalet”Thinking Out Loud: Slayer's Kerry King on hair metal, Satan and being polite””Slayer Lyrics””Slayer - Biography””Most influential artists for extreme metal music””Slayer - Reign in Blood””Slayer guitarist Jeff Hanneman dies aged 49””Slatanic Slaughter: A Tribute to Slayer””Gateway to Hell: A Tribute to Slayer””Covered In Blood””Slayer: The Origins of Thrash in San Francisco, CA.””Why They Rule - #6 Slayer”originalet”Guitar World's 100 Greatest Heavy Metal Guitarists Of All Time”originalet”The fans have spoken: Slayer comes out on top in readers' polls”originalet”Tribute to Jeff Hanneman (1964-2013)””Lamb Of God Frontman: We Sound Like A Slayer Rip-Off””BEHEMOTH Frontman Pays Tribute To SLAYER's JEFF HANNEMAN””Slayer, Hatebreed Doing Double Duty On This Year's Ozzfest””System of a Down””Lacuna Coil’s Andrea Ferro Talks Influences, Skateboarding, Band Origins + More””Slayer - Reign in Blood””Into The Lungs of Hell””Slayer rules - en utställning om fans””Slayer and Their Fans Slashed Through a No-Holds-Barred Night at Gas Monkey””Home””Slayer””Gold & Platinum - The Big 4 Live from Sofia, Bulgaria””Exclusive! Interview With Slayer Guitarist Kerry King””2008-02-23: Wiltern, Los Angeles, CA, USA””Slayer's Kerry King To Perform With Megadeth Tonight! - Oct. 21, 2010”originalet”Dave Lombardo - Biography”Slayer Case DismissedArkiveradUltimate Classic Rock: Slayer guitarist Jeff Hanneman dead at 49.”Slayer: "We could never do any thing like Some Kind Of Monster..."””Cannibal Corpse'S Pat O'Brien Will Step In As Slayer'S Guest Guitarist | The Official Slayer Site”originalet”Slayer Wins 'Best Metal' Grammy Award””Slayer Guitarist Jeff Hanneman Dies””Kerrang! Awards 2006 Blog: Kerrang! Hall Of Fame””Kerrang! Awards 2013: Kerrang! Legend”originalet”Metallica, Slayer, Iron Maien Among Winners At Metal Hammer Awards””Metal Hammer Golden Gods Awards””Bullet For My Valentine Booed At Metal Hammer Golden Gods Awards””Metal Storm Awards 2006””Metal Storm Awards 2015””Slayer's Concert History””Slayer - Relationships””Slayer - Releases”Slayers officiella webbplatsSlayer på MusicBrainzOfficiell webbplatsSlayerSlayerr1373445760000 0001 1540 47353068615-5086262726cb13906545x(data)6033143kn20030215029