This is an old revision of the document!
Table of Contents
How to write Retro Games on the SD-8516
Introduction
Would you like to write cool retro games? Would you like them to be “really” retro? Not “fake retro”? Well, this is the guide you should follow.
Here is the cheat sheet; the numbers will be explained below.
| Era | Computer | RAM Size | Speed Settings | Graphics Settings | Sound Settings |
|---|---|---|---|---|---|
| 1985 | 8-bit computer/console | 256k | 1 MIPS | Mode #1, #2, #3 | Int 11h |
| 1990 | 16-bit console/PC | 1mb | 10 MIPS | Mode #3, Mode #4 + PPU | Int 11h/ASU |
| 1991 | 32-bit computer | 2mb | 40 MIPS | 640×480 + PPU | ASU |
| 1996 | N64 era | 8mb | 125 MIPS | 320×240, 480×360, 640×480 + PPU | ASU |
The above modes will help you constrain the system to reasonable specs while still allowing some breathing room. However, you cannot constrain the system to less than 128k because the Kernal is in Bank 1. Thus the SD-8516 is really only intended to replicate the 8 bit microcomputer BASIC era and up.
A guide to System Speed
You can alter the run speed of the CPU. The call you are looking for here is INT 0x19, AH=$02. The number in B is the desired system speed in MIPS, divided by 100.
LDAH $02 LDB #128 ; Set system speed to 1.28 MIPS. INT 0x19
To run the system at 10,000 instructions per second, you could do:
LDAH $02 LDB #1 INT 0x19
This sets the system speed to 0.01 MIPS, or, 10,000 instructions per second.
To run the system at 12.5 or 125 mips:
LDAH $02 LDB #1250 ; Set system speed to 12.5 MIPS. INT 0x19
LDAH $02 LDB #12500 ; Set CPU to 125 MIPS INT 0x19
Numbers above 65000 are considered “unlocked”. It is expected that this will become a realistic concern in 2050 but by then I'll sure we will be using the SD-9532!
Standard Speeds
Why not run in 125 MIPS mode (or unlocked) all the time? This is a good question. There are two reasons. One, if you want to write era-authentic games, what is the point of running at 100 mips when 1 MIPS is already fast enough? Some games went up against the hardware limitations of the time and were designed without frame timers. The game speed was the limit of what the computer could do. So for retro, era-authentic games, it's actually harder to code them if the system is too fast. You have to start writing timer code. And if you get lazy and start to rely on that speed, your games will not have the look and feel that era-authentic games had.
