SEGA SC-3000 / SF-7000 Technical Page
SEGA COMPUTER SC-3000 + SF-7000

This page contains technical informations on the Sega SC3000 computer equipped with the SF7000 extension

It has been done for people who want to extend the capacity of their emulator (SG-1000 only or SC-3000) to support SC-3000 / SF-7000.

I've worked on Darcnes to make it supporting SC3000 + SF7000. See snapshots at the end of this page, and you will see that it works (since november 2000) !
 

INTRODUCTION

 The SC3000 is the computer version of the SG1000 including a keyboard and a serial printer interface.

 The SF7000 is an extension for the SC3000 including :

You can take a look at : http://homepages.ihug.co.nz/~pinwhiz/sc3000.htm
 

HARDWARE

Memory Map
The SF-7000 is equipped with a 64kb RAM and a 8kb ROM for the IPL (Initial Program Loader).

The memory map for the SF-7000, either on power-on or during execution of system utility program, is as shown in fig (a) where the IPL is ready for its execution.

At the SF-7000 startup, the system programs (e.g. Disk Basic) are loaded onto RAM starting from the address 0, then after the load has completed, the adress 0 thru 3FFF is switched to RAM and the execution is passed to the starting address of a user program.

The interchange between ROM and RAM in the adress range 0 thru 3FFF is handled by the P.P.I. PC6 Signal  (SF-7000 Port Map).

Port Map SC-3000

P.P.I. (8255)
Port Address Mode Assignment
&hDC
&hDD
&hDE
&hDF
PA : Input
PB : Input
PC : Output
Control register
Keyboard (input)
Keyboard (input)/printer, cassette
Keyboard scan/printer, cassette

VDP (TMS 9918A)
Port Address Assignment
&hBE
&hBF
VDP data register
VDP command register

PSG (SN 76489)
Port Address Assignment
&h7F PSG

Port Map SF-7000

P.P.I. (8255A)
Port Address Mode Assignment
&hE4
&hE5
&hE6
&hE7
PA : Input
PB : Input
PC : Output
Control register
FDC/printer check
Printer data output (parallel)
FDC/printer control

FDC (765AC)
Port Address Assignment
&hE0
&hE1
Status register
Data register

USART (8251)
Port Address Assignment
&hE8
&hE9
USARTD (data)
USARTC (command)

PPI Functional Table

P.P.I. (SC-3000)
PA0
to
PA7
Keyboard input
PB0
to
PB3
PB4
PB5
PB6
PB7

Keyboard input

/CONT (to the external terminal B-11)
FAULT (serial printer SP-400)
BUSY (serial printer SP-400)
Cassette tapes input

PC0
to
PC2
PC3
PC4
PC5
PC6
PC7

Keyboard raster (output)

N.C.
Cassette tapes output
Data
/RESET (serial printer SP-400)
/FEED (serial printer SP-400)

P.P.I. (SF-7000)
PA0
PA1
PA2
FDC INT : INT signal from input from FDC
BUSY from Centronics printer
Pin 17 of the FDC ?
PB0
PB1
PB2
PB3
PB4
PB5
PB6
PB7

Data outputs to Centronics printer
PC0
PC1
PC2
PC3
PC4
PC5
PC6
PC7
/INUSE signal to FDD
/MOTOR ON signal to FDD
TC signal to FDD
RESET signal to FDC
N.C.
N.C.
/RON SEL:Switching between IPL ROM and RAM
/STROBE to Centronics printer


 

DISKS FORMAT

The surface of each disks is divided into 40 tracks numbered from 0 to 39 counting from the outer-most track.
The surface is further divided into 16 equi-angular sectors, and the cross section of a sector and a track is simply called a "sector". Sectors are numbered from 1 thru 16 and each sector can contain 256 bytes of data. Note that a track consists of 16 sectors.

Also a group of 4 sectors is called a cluster which is the unit utilised in file management.

Thus, since one surface of a disk holds 40 tracks each consisting of 16 x 256-byte sectors, the total amount of data recordable on one disk side is :
    256 bytes x 16 sectors x 40 tracks = 163 840 bytes

Since a space must be reserved on each side of one disk for file management purposes, the user available space is diminished by the amound of that space.

The available space is further diminished in disks such as system disk that already contains some system programs (e.g. DISK BASIC).

Disk Structure :
 
Track # Sector # Contents
0 1 Disk information
IPL in case of a system disk
0 2-16 Reserved
1 - (*1) 1-16 System programs area
User's area for non-system disk
(*2)-19 1-16 User's area used for storage of programs, etc
20 1-12 Directory (filename storage)
20 13-16 FAT (sector 13 only)
21-39 1-16 User's area (program area) 77 kb

( *1, *2 depend on the volume of system programs)
A system disk contains the filename IPL in the first sector on track 0, which is loaded on a disk system boot into memory with the address starting from FF00 up to FFFF.

Sectors 1 thru 12 of track 20 contains the directory and so does 13 thru 16 contain the FAT (File Allocation Table, a table containing location and order of files), each occupying 160 bytes. In fact only sector 13 is utilized for storage of the FAT.

The Disk Capacity :
 
Track Cluster
(for file management)
Sector
(Unit of I/O)
Byte
/ / 1 256
/ 1 4 1 024
1 4 16 4 096
40 160 640 163 840

The Directory :
The directory is contained in sectors 1 thru 12 on track 20.

Example of Track N°20, Sector N°1:
4B  41  4B  45  49  2F  44  20 2E 20  20  20 28 00 00  00
(KAKEI/D .   )
00  00  00  00  00  00  00  00 00 00  00 00 00 00 00  00
('KILL'ed file)
54  45  4E  53  55 20  20  20 2E 20  20  20 42 00 00  00
(TENSU   .   )
53  41  4C  4F  2F  44  20  20 2E 20  20  20 45 00 00  00
(SALO/D  .BAS)
File Name (8 bytes) "." Extension see * Attribute Not Used
* The number of the first group of cluster in which the file is contained.

Attributes :
Value Meaning
00 Non-ASCII format [.]
01 ASCII format [ ]
02 Hexadecimal data [*]
80 Non-ASCII read-only
81 ASCII read-only
82 Headecimal read-only

The FAT :
Files are managed under units of clusters the total number of which is 160 (0 thru 159) on one side of a diskette. The FAT records the usage of each cluster on the side of the diskette. The FAT is 160-bytes long and is contained in sector 13 on track 20, the remaining 96 bytes of the sector being unused.

Meaning of each byte datum in the FAT :
FAT data Meaning
0 - 9F Clusters in use, having succeeding clusters the value is the number of the cluster succeeding to it.
C1 - C4 The last clusters in use, the lower 4-bits indicates the number of sectors the cluster is using
FE Reserved, can't be used for files (IPL, system programs, directory, etc...)
FF Unused clusters

System Disks :
At system disk startup, the loader first loads the content of the first sector on truck 0 into memory in the adress range FF00 thru FFFF, then checks the first 4 bytes starting from adress FF00. It then displays onto the screen the filename immediately following the first 4 bytes, and jumps to the IPL program from the adress FF20.

Thus if you want to create a system disk, the first thing you have to do is to save the system disk id code, the filename, and the IPL program onto the first sector on truck 0 of the disk.
 
Address Data (hex) Data (ascii) Contents
FF00
FF01
FF02
FF03
53
59
53
3A
S
Y
S
:
System disk identification code
FF04
 
 
 
 
 
 
 
 
 
 

FF1F

20
64
69
73
6B
20
42
41
53
49
43
00
...

d
i
s
k

B
A
S
I
C

 

File name displayed on screen during boot

IPL Program on disk (referencial example)
 

 
 
 
 

LOOP
 
 
 
 
 
 
 
 
 
 
 
 
 

EXIT
 
 

 

ORG
CALL
JP
LD
LD
LD

CALL
JP
PUSH
OR
SBC
POP
JR
INC
INC
LD
CP
JR
LD
INC
JR

LD
OUT
LD
OUT
JP

OFF20H
8
C,0
DE,0
BC,0101h
HL,1009h

10h
C,0
HL
A
HL,BC
HL
Z,EXIT
D
B
A,B
11h
NZ,LOOP
B,1
C
LOOP

A,3
(E7h),A
A,Dh
(E7h),A
0


; track 0
; error then boot
; load start adress
; start sector=1 track=1
;end sector=10h track=9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

; Motor off

; select
; 0~3FFF -> RAM#1
 

DISK BASIC COMMANDS, STATEMENTS AND FUNCTIONS

[ ] means an optional parameter
In bold are the minimum to known if you want to run a program ;-)

Commands List
Command name Function
AUTO Automatically generates line numbers
BOOT Re-loads system programs from disk
CLOAD ["file"] Loads programs from cassette
COMLOAD Receives programs via RS-232C interface
COMSAVE Sends programs via RS-232C interface
CONT Resumes interruptes programs
CSAVE "file" Saves programs onto cassettes
DELETE Deletes parts of programs
FILES Displays names of files on disk
LFILES Outputs to printer names of files on disk
LIST [-][LineNumber][-][LineNumber] Displays programs onto the screen
LLIST [-][LineNumber][-][LineNumber] Outputs programs to printer
LOAD "file" Loads programs from disk
MAXFILE n Declares number of simultaneously openables files
MERGE "file" Merges programs on disk with program in memory
NEW Deletes/resets programs and variables in memory
NEWON StartAddress Sets starting address for program area
RENUM Re-sequence line numbers of programs
RUN ["file" or LineNumber] [Load] / Begin execution of programs [at the Line given]
SAVE "file" Saves programs onto disk
UTILITY Enters disk utility program (at the prompt :
F : to format a disk, C : to copy a disk, B : to boot)
VERIFY Compares program in memory with that saved on cassette

Statements List
Statement name Function
BCIRCLE Deletes by circle
BEEP [n] Beeps
BLINE Deletes by line
CALL Address Calls machine language subroutines
CIRCLE Draws circles
CLOADM "file"[,StartAddress] Loads machine language programs from cassette
CLOSE [n,...] Closes specified files
CLS Clears screen
COLOR Specifies color
COMSET lgt,parity Used for RS232C interface to specify data length (5,6,7,8), sets/resets parity bit (E,O,N)
By default : 8 bits, Even parity
CONSOLE Sets scroll limit for the screen, click sound, upper/lower case distinction, and select printer
CSAVEM "file",StartAddress,EndAddress Saves machine language programs onto cassette
CURSOR Sets cursor position on the screen
DATA Specifies data to be read by the READ statement
DEF FN Defines user functions
DIM Declare arrays
DSKI$ Track,Sector;Var,Start,End Does direct read of a sector from disk
DSKO$ Track,Sector;Var,Start,End Does direct write of a sector to disk
END Terminates program execution
ERASE Clears declared arrays
FOR TO [STEP] - NEXT Repeat lines between FOR and NEXT - STEP means increment to FOR
GET #n,fic;Var,Start,End Read into variable data in random files
GOSUB LineNumber-
RETURN
Jumps to line specified by line number
Returns from subroutine
GOTO LineNumber Jumps to line specified by line number
HCOPY Outputs to printer current screen image
IF THEN Conditionnally jumps to/executes statements
INPUT Input value or character string from keyboard
INPUT #n,Var Input value or character string from indicated sequential file or from RS232C interface (n = file(1 to 8) or RS232C (0) )
KILL "file" Erase files from disk
LET Assigns value to variable (omittable)
LIMIT EndAddress Sets end address for BASIC program area
LINE Draws line
LOADM "file"[,StartAddress] Loads machine language programs into specified memory area
LPRINT or L? Ouput to printer value or character string
Characters and symbols must be enclosed in " "
MAG Set sprite mode/width
NAME "OldFile" AS "NewFile" Change name of programs on disk
ON GOSUB -
RETURN
Conditionnally jumps to subroutine indicated by line number
Returns from subroutine
ON GOTO Conditionnally jumps to line indicated by line number
OPEN "file" FOR "mode" AS#n Opens disk files (mode="INPUT" or "OUTPUT" or "APPEND")
OUT Outputs data to output board
PAINT Paints specified region
PATTERN t#x,"" Sets character (C#) or sprite (S#) pattern
POKE Write data in memory
POSITION Sets coordinate for graphics screen
PRESET Deletes by points
PRINT or ? Display value or string onto screen
Characters and symbols must be enclosed in " "
PRINT #n,Var Write value or character string to specified sequential or RS-232C interface (n = file(1 to 8) or RS232C (0) )
PSET Draws point
PUT #n,fic;Var,Start,End Write value of expression to random file
READ Reads data specified in DATA statement
REM Marks comment
RESTORE Specifies DATA statement to be read by READ statement
SAVEM "file",StartAddress,EndAddress Save machine language program onto disk
SCREEN Declare text window, graphics window
SET "file","P" Sets file mode ("P" for read-only)
SOUND Generates sound
SPRITE Specifies sprite
STOP Interrupt program execution
VERIFYM "file"[,StartAddress] Compares machine language program saved on cassette with program in memory
VPOKE Write data into VRAM

Functions List
Function name Function
ABS(x) Gives absolute value of x
ACS(x) Gives inverse cosine of x in radian
ASC(S) Converts character S into equivalent ASCII code
ASN(x) Gives inverse sine of x in radian
ATN(x) Gives inverse tangent of x in radian
CHR$(x) Converts ASCII code into character or control code
COS(x) Gives cosine of x
DEG(x) Converts radian to degree
DSKF Used to check free space on disk
EOF(#x) Used to check whether sequential file is read to the end of file, -1: yes, 0: no
EXP(x) Gives e to the power of x
FRE Used to check free space in user memory area
HEX$(x) Converts x into hexadecimal numeric character string
INKEY$ Gives code of the key being pushed
INP(x) Gives input value of input board x
INPUT$(x,#y) Set character string x-characters long from sequential file #y
INT(x) Gives greatest integer not greater than x
LEFT$(S,x) Gives substring x-characters long from the beginning of character string S
LEN(S) Gives length of character string S
LGT(x) Gives common logarithm of x
LOC(n) Gives logical offset in file
LOF(n) Give file size
LOG(x) Gives natural logarithm of x
LTW(x) Gives logarithm of x to the base 2
MID$(S,x[,y]) Gives substring starting from x-th character, y-characters long, to the end if y omitted
PEEK(x) Gives contents of memory at address x
PI Gives ratio of circumference of circle to diameter (3.1415926536)
RAD(x) Gives equivalent angle in radian of x in degree
RIGHT$(S,x) Gives substring from x-th character counting from right to the end of string S
RND(x) Generates random number
SGN(x) Gives numerical sign of x
SIN(x) Gives sine of x in radian
SPC(x) Used in PRINT statement, print x consecutive spaces
SQR(x) Gives square root of x
STICK(n) Detects input direction for joystick n
STR$(x) Converts x into equivalent character string
STRIG(n) Detects condition of push-button of joystick n
TAB(x) Used in PRINT statement, sets the start position to be x-th column from left
TAN(x) Gives tangent of x in radian
TIME$ Used to see inner clock
VAL(S) Converts numeric character string S into equivalent number
VPEEK(x) Gives content of VRAM at address x

DOWNLOAD

Downloading the IPL ROM of 8kb.
Downloading the SEGA BASIC SYSTEM DISK.
Downloading KAMIKAZE IMAGE DISK (Loriciels game)- Fixed for sf7000 (Original on K7)
Downloading CROCKY IMAGE DISK (Loriciels game) - Does not work, needs to be fixed. (Original on K7).
Downloading POSEIDON WARS/SPACE PANIC DISK (Z80 games done by myself).
Downloading Z80 STUFFS INCLUDING THE MONITOR DESSASSEMBLER (Loriciels - original on K7).
To run The Monitor/Desassembler type : LOADM "MO-D808.HEX" then CALL &HD808
Downloading TOOL TO DRAW PICTURES + DATA PICTURES (done by myself).
Downloading DATA PICTURES (done by myself and others).
Downloading Some progs from the book '102 Progs For Yeno'.
Downloading Some progs form the book 'Super Jeux Yeno'.
Downloading Games_1.
Downloading Games_2.
Downloading Board games.
Downloading Olympiades.
Downloading Educational games.
Downloading Graphics.
Downloading Musics.
Downloading Electricity utility.
 

HOW TO TRANSFER SF7000 DISKS

I used a basic program on the SC3000 to transfer disk on the serial port. On the other side (Amiga) I obtain an ascii file with a terminal utility. This one must be converted to an image disk before use with an emulator.
Downloading the Basic program to transfer disk on serial port of the sf7000.
Downloading the C source to convert ascii file transfered to a bin file (image of the disk).
Note: You will have to type the basic program on the sc3000. You will have to compile the c source to obtain the exe.

SOME SNAPSOTS WITH THE VERSION OF DARCNES I'VE MODIFIED


Sega basic demos


Kamikaze


Poseidon wars


Space panic

LINKS

Darcnes
MasterGear
Meka

Back to my main home page


SF7000 documentation retranscripted by Marc Le Douarain - Last update : 20 October 2001, 17h40

SC3000, SF7000 are (still?) coyrighted by SEGA.