Good
Deal Games constantly receives inquiries about how to program
for the classic systems. In response to reader demands,
we contacted ace Colecovision programmer Daniel Bienvenu
and he was kind enough to share his entire documentation
and toolkits. This is simply HUGE as these docs and tools
would require years to develop. Thanks again Daniel!
We cannot express how thankful that we are to Daniel for
his very generous donation. The contents of all the materials
are simply too extensive to cover on this page, but you
can download the documents in their entirety below.
Download
Full Documentation
Version
1-k
Last update: October 26, 2005
This
document shows you the basic of the ColecoVision capabilities
with technical information, programming tools and simple
codes in C language. This document is "a good starting
point" to learn how to program ColecoVision games in
C language like I did. However, don't hesitate to seek for
more information and to ask questions to other ColecoVision
programmers.
The first part of this document contains the basic concepts
of the ANSI C language based on the Coleco library and the
Hi-Tech C compiler. If you don't know how to program in
ANSI C language, look for C programming (not C++ or C#)
in the Internet.
The second part of this document talks about tools (for
Windows) Marcel de Kogel and I programmed to speed up the
development process.
The third part of this document is about specific libraries
already made for the ColecoVision game development, and
programming samples.
The annexe gives you technical information for programmers
about the ColecoVision.
Before trying to do your first ColecoVision project, improve
your programming skills first by testing all the concepts
mentioned in this documentation before thinking of releasing
new ColecoVision games.
This document can be used as a tutorial and a reference
guide.
Have fun making new games for the ColecoVision game system!
Good Luck!
TABLE
OF CONTENTS
TABLE OF CONTENT.. 2
INTRODUCTION.. 8
SETUP YOUR DEVELOPMENT ENVIRONMENT...9
MEMORY..10
ROM (Read Only Memory)..10
RAM (Read-Write Memory)..10
MEMORY MAP..10
RAM USED BY THE COLECOVISION BIOS.. 11
INITIALIZING TABLES AND ARRAYS..12
DATA TYPES...13
char..13
byte..13
int..13
unsigned..13
float..14
char [n]..14
* (pointer)..14
void..14
SPECIAL DATA TYPES..15
sprite_t..15
sound_t..15
score_t..15
STRUCTURES (CUSTOM DATA TYPE)..16
typedef struct.16
OPERATORS...17
USUAL SET OF BINARY ARITHMETIC OPERATORS:.17
INCREMENT (++) AND DECREMENT (--)..17
BITWISE OPERATORS..17
COMBINED OPERATORS ..17
RELATIONAL OPERATORS. 18
LOGICAL OPERATORS..18
IF STATEMENT..19
SIMPLE IF..19
IF
ELSE..19
LOOPS...19
FOR LOOP..19
WHILE LOOP..19
DO WHILE LOOP..19
SCREEN MODES..20
CHARACTERS..21
VIDEO MEMORY FOR CHARACTERS...21
CHARACTER PATTERN..22
EXAMPLE - SPACESHIP..22
UPLOAD CHARACTER SET. 24
SPRITES..25
SPRITES COLOR..25
SPRITES LOCATIONS ON SCREEN..25
SPRITES PATTERN..25
8x8 SPRITE..25
16x16 SPRITE..26
SPRITES ROUTINES..26
JOYSTICK (Hand Controller) ..27
JOYPAD ..27
KEYPAD ..27
OTHER CONTROLLERS..28
Super Action Controller..28
Expansion Module 2: Turbo 28
Roller Controller..28
SPINNERS VARIABLES..28
SOUND..29
THE SOUND ROUTINES ..29
update_sound (); ..29
start_sound (sound_data,sound_priority); ..29
sound_pointer = start_sound(sound_data, sound_priority);
..29
stop_sound(sound_pointer); 29
sound_on();...30
sound_off();..30
play_dsound(sound_pointer, step);..30
THE WAY I ADD SOUNDS IN MY COLECO PROJECTS ..31
TOOLS..32
WAV2CV..32
WAV2CVDS..33
I.C.V.G.M. v2..34
I.C.V.G.M. v3..35
BMP2PP...36
PP2C and PP2ASM..37
CVPAINT..38
CCI - Coleco Compiler Interfa 39
How to use CCI?..39
LIBRARY: COLECO..40
ROUTINES IN COLECO LIBRARY..40
rle2ram..40
rle2vram..40
put_vram ..40
get_vram..40
fill_vram..40
put_vram_ex..40
put_vram_pattern..40
set_default_name_table..41
vdp_out..41
screen_on..41
screen_off..41
disable_nmi..41
enable_nmi..41
update_sound...41
start_sound..42
stop_sound..42
sound_on..42
sound_off..42
delay ..42
get_random..42
upload_ascii..42
utoa..42
sprites struct and table..43
update_sprites..43
check_collision..43
LIBRARY: COLECO OPTIMIZED FOR 4K..44
NEW ROUTINES IN THIS COLECO LIBRARY..44
play_sound..44
stop_sound...44
reflect_vertical..44
reflect_horizontal..44
rotate_90..44
LIBRARY: GETPUT..45
GETPUT...45
cls..45
get_char..45
put_char..45
center_string..45
print_at..46
pause ..46
GETPUT 1..47
pause_delay...47
rnd..47
rnd_byte...47
str..47
show_picture..47
screen_mode_2_bitmap..48
screen_mode_2_text..48
upload_default_ascii..48
paper..48
load_color...48
load_namerle...48
load_patternrle..49
load_spatternrle..49
change_pattern...49
change_spattern..49
change_color..49
fill_color...50
change_multicolor..50
change_multicolor_pattern...50
choice_keypad_1 and choice_keypad_2..50
updatesprites..50
sprites_simple..51
sprites_double..51
sprites_8x8..51
sprites_16x16...51
Set of "AND" masks for the joystick: UP, DOWN,
LEFT, RIGHT and FIREs ...51
wipe_off_down..51
wipe_off_up..51
New routines in Getput1 library in years 2003-2004..52
play_dsound..52
put_frame..52
get_bkgrnd...52
load_colorrle..52
strlen...52
put_frame0..52
screen..53
swap_screen...53
put_at..53
fill_at...53
Extra routines in Getput library version 1.1..54
score_reset..54
score_add..54
score_str.54
score_cmp_lt..54
score_cmp_gt..54
score_cmp_equ..54
intdiv256..54
utoa0..54
load_ascii...55
rlej2vram..55
GETPUT-1 VIDEO MEMORY MAP..56
Screen Mode 2 Text - Video Memory Map..56
Screen Mode 2 Bitmap - Video Memory Map...56
LIBRARY: C....57
memcpy..57
memset...57
sizeof..57
switch case..57
SHOW BITMAP PICTURE WITHOUT GETPUT 1..58
SHOW BITMAP PICTURE WITH GETPUT 1.. 60
FACES - SPRITES DEMO..61
REBOUND..63
THE IDEA...63
THE PROGRAM..65
COMPILING...67
STILL BUGY?..71
CAN IT BE BETTER?..72
SMASH - A VIDEO GAME VERSION OF REBOUND..73
PADDLE GRAPHIC..75
THE PROGRAM...76
DEBUG EXERCISE...80
A TEST PROGRAM TO 80
SOLUTION..81
OPTIMIZATION TRICKS...82
Trick #1 : divide and multiply by using bit shifting...82
Trick #2 : a useful pointer ..82
Trick #3 : fill up RAM with memset...83
Trick #4 : load_ascii VS upload_ascii VS upload_default_ascii...83
Trick #5 : do your own sprite routines..83
THAT'S ALL?..84
APPENDIX A - MORE TECHNICAL INFORMATION..85
HARDWARE SPECIFICATIONS.. 85
CARTRIDGE (ROM) HEADER..86
SOUND GENERATION HARDWARE..87
TONE GENERATORS..87
NOISE GENERATOR..87
CONTROL REGISTERS..88
SOUND DATA FORMATS...88
NOTES TABLE CONVERSION: FREQUENCIES (Hz) <-> HEX values...89
SCALES..89
MARCEL's SOUND DATA FORMAT...90
Sound Header..90
Sound Body...90
VDP - VIDEO DISPLAY PROCESSOR..91
REGISTERS..91
Control registers..91
Status register..91
VDP register access..92
NMI Non maskable interrupt..92
Screen modes..93
Mode 0 - Graphic I..93
Mode 1 - Text..93
Mode 2 - Graphic II...93
Mode 3 - Multicolor...93
COLECO SCREEN MODE 1 (TEXT MODE)..94
COLECO SCREEN MODE 0 & 2 (GRAPHIC I & II MODE)..95
COLOR PALETTE..96
COLECO ASCII TABLE...97
APPENDIX B - ORIGINAL OS7' BIOS INFORMATION.99
JUMP TABLE..99
OTHER OS SYMBOLS..100
MEMORY MAP...101
COLECOVISION GENERAL MEMORY MAP..101
GAME CARTRIDGE HE..101
COMPLET OS 7' RAM MAP.102
Have
Fun! Remember, if you complete a game that makes you proud,
Good Deal Games would love to feature it and help you publish
the game for release.
Long live the Colecovision!
|