Path: blob/master/BizHawk.Emulation.Cores/Consoles/Coleco/docs/CV-Tech.txt
2 views
1Coleco Vision Cart Info2-----------------------34567All carts start at 8000h with a header that tells the BIOS what to do.898000 - 8001: If bytes are AAh and 55h, the CV will show a title screen10and game name, etc.1112If bytes are 55h and AAh, the CV will jump directly to the13start of code vector.14158002 - 8003: Vector; ??? --\16\178004 - 8005: Vector; ??? \18>--- These always point to 0000 or RAM (7xxx)198006 - 8007: Vector; ??? /20/218008 - 8009: Vector; ??? --/2223800A - 800B: Vector; Start of code2425800C - 800E: Jmp to: RST 08h2627800F - 8011: Jmp to: RST 10h28298012 - 8014: Jmp to: RST 18h30318015 - 8017: Jmp to: RST 20h32338018 - 801A: Jmp to: RST 28h3435801B - 801D: Jmp to: RST 30h3637801E - 8020: Jmp to: RST 38h38398021 - 8023: JMP to: NMI (Vertical Blanking Interrupt from video chip)40418024 - nnnn: Title screen data:424344Data for the title screen is composed of 4 lines in the format:45464748+--------------+49| COLECOVISION |50| |51| LINE 2 |52| LINE 3 |53|(c)xxxx COLECO|54+--------------+5556Typical Screen575859The 'ColecoVision' line cannot be changed, as well as the '(C)xxxx Coleco'60part of the bottom line. Only the xxxx part can be changed.616263The data is stored as one string with the '/' character (2Fh) used as a64delimiter. It signals the end of a line, and isn't printed.6566The lines are stored out of order like so:676869"LINE 3/LINE 2/xxxx" There isn't an end-of-line delimiter, because the70last line is always 4 characters (it's meant for a year like 1983)717273So, if we want to see the following:747576+--------------+77| COLECOVISION |78| |79| MY GAME! |80| BY: ME |81|(c)1995 COLECO|82+--------------+83848586We would use the string:878889"BY: ME!/MY GAME!/1995"9091Remember, we cannot change the "(c)xxxx COLECO" part, only the xxxx in the92middle of the line.9394The lines are self-centering on the screen.9596Altho the BIOS ROM has both upper-case and lower-case characters in the97character set, only upper-case is supported.9899All printable characters are based on the ASCII character set:100101102(all values in hex)10310400-1C: Blank1051D : (c) (Copyright symbol)1061E-1F: tm (TradeMark symbol, uses 2 chars side-by-side)10720-2E: (respectively) space ! " # $ % & ' ( ) * + , - .1082F : Delimiter- used to end a line, not printable10930-39: 0-91103A-40: (respectively) : ; < = > ? @11141-5A: A-Z1125B-5F: (respectively) [ \ ] ^ _113114The chars # 60-8F are the 4-char blocks that make up the 'COLECOVISION'115name at the top, arranged like so:1161171186062 6466 686A 6C6E 7072 7476 787A 7C7E 8082 8486 888A 8C8E1196163 6567 696B 6D6F 7173 7577 797B 7D7F 8183 8587 898B 8D8F120121122C O L E C O V I S I O N123124(purple) (orange) (pink) (yellow) (green) (blue)125126127What's intresting, is when these are in the title lines, they show up in128their respective colours! All other printable chars are white.129130131Chars 90-FF are all blank132133134135Controls:136---------137138139There are 4 ports governing the operation of the controls. They are:14014180- When written to, enables the keypads and right buttons on both controls.142143C0- When written to, enables the joysticks and left buttons on both controls.144145These 2 ports toggle a flip-flop, so the data going out the ports146is irrelevant.147148FC- Reading this port gives the status of controller #1. (farthest from front)149150FF- Reading this one gives the status of controller #2. (closest to front)151152153All switch closures are represented by a '0' Open switches are '1'154155Only 5 bits of ports FC and FF are used:156157158'80' mode (port 80 written to)159160161bit #6= status of right button162163The keypad returns a 4-bit binary word for a button pressed:164165bit #166167btn: 0 1 2 3168-----------------------1690 0 1 0 11701 1 0 1 11712 1 1 1 01723 0 0 1 11734 0 1 0 01745 1 1 0 01756 0 1 1 11767 1 0 1 01778 1 0 0 01789 1 1 0 1179* 1 0 0 1180# 0 1 1 0181182183Re-arranged, in order:184185186187btn: 0 1 2 3 hex#188-------------------------------189inv. 0 0 0 0 01908 1 0 0 0 11914 0 1 0 0 21925 1 1 0 0 3193inv. 0 0 1 0 41947 1 0 1 0 5195# 0 1 1 0 61962 1 1 1 0 7197inv. 0 0 0 1 8198* 1 0 0 1 91990 0 1 0 1 A2009 1 1 0 1 B2013 0 0 1 1 C2021 1 0 1 1 D2036 0 1 1 1 E204inv. 1 1 1 1 F (No buttons down)205206207The controllers have 28 diodes in them that generate the above table.208Coleco did this so the programmer wouldn't have to scan the keys. Also,209there wouldn't have been enough pins on the end of the cable to accomodate210the array. (There are only 7 pins on the connector. That's just enough211to scan a 3*4 matrix, but that doesn't include the stick or other 2212buttons.)213214215216'C0' mode (port C0 written to)217218219This mode allows you to read the stick and left button:220221222Bit 6=Left button223Bit 0=Left224Bit 1=Down225Bit 2=Right226Bit 3=Up227228229CV's memory/IO map230------------------231232The CV uses 2 74138 3-8 line decoders to generate the memory and IO maps.233234As you would expect, memory is broken up into 8 8K blocks. However, the IO235map is broken up into 4 write and 4 read ports.236237Memory:238239(ABC lines of decoder go to A5, A6, and A7 respectively /E1 -> /M_request240/E2 -> Reset; E3 -> +V)2412420000-1FFF = BIOS ROM2432000-3FFF = Expansion port2444000-5FFF = Expansion port2456000-7FFF = SRAM (1K)2468000-9FFF = Cart247A000-BFFF = Cart248C000-DFFF = Cart249E000-FFFF = Cart250251252IO:253254(ABC lines of decoder go to /WR, A5, and A6 respectively /E1 -> /IO_request255/E2 -> Reset; E3 -> A7)25625725880-9F (W) = Controls _ Set to keypad mode25980-9F (R) = Not Connected260261A0-BF (W) = Video \___ A0 also decoded by video chip262A0-BF (R) = Video /263264C0-DF (W) = Controls _ Set to joystick mode265C0-DF (R) = Not Connected266267E0-FF (W) = Sound268E0-FF (R) = Controls _ A1 also decoded by chips (A1=0 ctrl 1; A1=1 ctrl 2)269270271272CV's sound chip273---------------274275The sound chip in the CV is a SN76489AN manufactured by Texas Instruments.276It has 4 sound channels- 3 tone and 1 noise.277278The volume of each channel can be controlled seperately in 16 steps from279full volume to silence.280281A byte written into the sound chip determines which register is used, along282with the frequency/ attenuation information.283284The frequency of each channel is represented by 10 bits. 10 bits won't285fit into 1 byte, so the data is written in as 2 bytes.286287Here's the control word:288289+--+--+--+--+--+--+--+--+290|1 |R2|R1|R0|D3|D2|D1|D0|291+--+--+--+--+--+--+--+--+2922931: This denotes that this is a control word294R2-R0 the register number:295296000 Tone 1 Frequency297001 Tone 1 Volume298010 Tone 2 Frequency299011 Tone 2 Volume300100 Tone 3 Frequency301101 Tone 3 Volume302110 Noise Control303111 Noise Volume304305D3-D0 is the data306307Here's the second frequency register:308309+--+--+--+--+--+--+--+--+310|0 |xx|D9|D8|D7|D6|D5|D4|311+--+--+--+--+--+--+--+--+3123130: This denotes that we are sending the 2nd part of the frequency314315D9-D4 is 6 more bits of frequency316317318To write a 10-bit word for frequenct into the sound chip you must first319send the control word, then the second frequency register. Note that the320second frequency register doesn't have a register number. When you write321to it, it uses which ever register you used in the control word.322323So, if we want to output 11 0011 1010b to tone channel 1:324325First, we write the control word:326327LD A,1000 1010b328OUT (F0h),A329330Then, the second half of the frequency:331332LD A,0011 0011b333OUT (F0h),A334335To tell the frequency of the wave generated, use this formula:3363373383579545339f= -------34032n341342Where f= frequency out,343and n= your 10-bit binary number in344345346To control the Volume:347348349+--+--+--+--+--+--+--+--+350|1 |R2|R1|R0|V3|V2|V1|V0|351+--+--+--+--+--+--+--+--+352353R2-R0 tell the register354355V3-V0 tell the volume:3563570000=Full volume358.359.360.3611111=Silence362363364The noise source is quite intresting. It has several modes of operation.365Here's a control word:366367+--+--+--+--+--+--+--+--+368|1 |1 |1 |0 |xx|FB|M1|M0|369+--+--+--+--+--+--+--+--+370371FB= Feedback:3723730= 'Periodic' noise3741= 'white' noise375376The white noise sounds, well, like white noise.377The periodic noise is intresting. Depending on the frequency, it can378sound very tonal and smooth.379380M1-M0= mode bits:38138200= Fosc/512 Very 'hissy'; like grease frying38301= Fosc/1024 Slightly lower38410= Fosc/2048 More of a high rumble38511= output of tone generator #3386387You can use the output of gen. #3 for intresting effects. If you sweep388the frequency of gen. #3, it'll cause a cool sweeping effect of the noise.389The usual way of using this mode is to attenuate gen. #3, and use the390output of the noise source only.391392The attenuator for noise works in the same way as it does for the other393channels.394395396397Video398-----399400The CV uses a TMS9918a chip made by Texas Instruments.401402403404405