Page 1 of 2 12 LastLast
Results 1 to 20 of 25

Thread: Discussion about new Coleco projects and Coleco programming

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Strawberry (Level 2) newcoleco's Avatar
    Join Date
    Jul 2002
    Location
    Quebec (Canada)
    Posts
    503
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    0
    Thanked in
    0 Posts

    Default Discussion about new Coleco projects and Coleco programming

    Quote Originally Posted by Aswald
    That's more or less how I programmed several games on the Vic-20 and Commodore 64; Tunelayer was an early effort.

    The version of Island of Foxes that I will program has been revised using (most) of the methods you mentioned, including the "where-is-the-thing-I-found"

    *Origin is 10 West; 4 South.
    *Woora is 7 East; 5 North.

    and a couple of changes in the dangers you face in mazes, as well as the addition of the Mist-Marshes and Mirawrans within.

    The line-maze (1-dimensional maze) method is the best though- you can easily fit a 16X16 maze on a string of 256 Bytes, just as if you were only storing 256 numbers somewhere- it's a great memory-saver, allows you to put these things in places where you couldn't normally fit them, and allows you to use any number for up and down movement (such as 32 on a Commodore 64, instead of 40!). Yae!

    The problem I'm having here is that I don't even have anything with which I CAN program a ColecoVision game. Most emulators I cannot get running here. I've found nothing that allows one to type in a program as if one was programming on a ColecoVision. It's like my current problem with the Commodore 64: I don't have one with which to program. Even most of your tools will not run here.

    And I don't know how to program for a ColecoVision- only IBMs and Commodore computers. I have had no luck finding manuals anywhere. Not even on-line. Nothing.
    Before programming a ColecoVision project you must learn about the "limits" of this game system.

    ROM :
    The binary code in the cartridge is named ROM because it's a read-only memory. The memory address (for the game) start at 8000. Today, we have no cash problem to use big memory capacity so we try to use all the 32K available : 8000 - FFFF. At 8000, there is a header. The header start with 55 AA or AA 55. The Coleco bios try to read this code to check if the cartridge is correctly inserted. After this 2 bytes, there are hex values in the header to say where start the game, what to do if there is an interrupt (ex. : rst 08h, NMI), etc...
    By using the Coleco library by Marcel de Kogel, you don't have to worry about the header already compiled into the crtcv.obj file.

    RAM :
    The RAM is a bit weird. only 1K RAM (with a copy of himself at another memory location) and this RAM is not fully available. The Coleco bios routines use some parts of the RAM at specific memory locations. This is important to know to avoid memory corruption by using too big tables in RAM. Normally, a classic arcade game project will have no RAM space problem.
    Long time no see. Still playing my coleco games?
    http://newcoleco.dev-fr.org

  2. #2
    Strawberry (Level 2) newcoleco's Avatar
    Join Date
    Jul 2002
    Location
    Quebec (Canada)
    Posts
    503
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    0
    Thanked in
    0 Posts

    Default

    The Coleco library by Marcel de Kogel is writen in ASM and C to be used with Hi-Tech C compiler. This compiler is a freeware for CP/M computers. To be used under DOS, you have to use an emulator like 22NICE. 22NICE uses interruptions to activate the emulation, but it needs a step to prepare the hi-tech c compiler.

    To avoid this unfriendly installation, I have done an archive (ZIP format). The only thing to do is unarchive the ZIP file to install the compiler, the emulator, and also the coleco library.

    Before starting a new Coleco project in C, you have to know the C language.. more specificly the standard ANSI C. Try to find at least a web page for newbies to learn the base of the C language (#include, #define, void main(void), syntax, how to do an if statement, etc..).

    I created also a new program (for Windows) named CCI. Create a new sub-directory of the hitech-c compiler and add the CCI software. Before running CCI, you have to start programming.

    URL :
    http://www.chez.com/cdi/cci/cci.html
    Long time no see. Still playing my coleco games?
    http://newcoleco.dev-fr.org

  3. #3
    Strawberry (Level 2) newcoleco's Avatar
    Join Date
    Jul 2002
    Location
    Quebec (Canada)
    Posts
    503
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    0
    Thanked in
    0 Posts

    Default

    Before seeing any "hello world" on screen, you have to setup the screen mode and update the video ram memory with an appropriate charset.

    To find informations about the Video Display Processor (VDP), look at this txt file.
    URL :
    http://www.msxnet.org/tech/tms9918a.txt

    More visual in the following link but with a few variations.
    URL :
    http://home.swipnet.se/~w-16418/tech_vdp.htm

    For a ONLY TEXT adventure, the screen mode 1 with 40 collumns should be a good choice. But for the other Coleco projects, the screen mode 0 or 2 are the more appropriate. the screen mode 3 is not a good choice with very big pixels on screen. Do not use the undoccumented screen mode. For all my ColecoVision projects, I use the screen mode 2. This screen mode allow me to do bitmap title screen and colorfull characters.

    Compute the vdp control registers' values based on your own requierments. Included in the Coleco library, vdp_out to update the vdp control registers' values : vdp_out(register,value);

    The most important control registers are 0 and 1.
    0 : - - - - - - M2 EXTVID
    1 : 4/16K Blank IE M1 M3 - SI MAG

    M1, M2 and M3 are the bits to set the screen mode.
    EXVID is External VDP input (always disable this one with bit 0)
    ... (see TXT file)

    To set the screen mode 2 (like in my all my Coleco projects), I compute M1=0 (disable), M2=1 (enable), M3=0 (disable), EXTVID=0 (disable), 4/16K=1 (16K), Blank=1 (enable display), IE=1 (enable NMI interruptions), SIze=1 (16x16 sprites), MAG=0 (normal sprites, not doubled in size).

    0 : 0 0 0 0 0 0 1 0 = 02 (hex value) = 2
    1 : 1 1 1 0 0 0 1 0 = E2 (hex value)

    SCREEN MODE 2 (normal with 16x16 sized sprites) :
    vdp_out(0,2);
    vdp_out(1,0xe2);

    We need to setup the other vdp registers too. The screen mode need video address locations (pointers) to show the right things on screen.

    For the special screen mode 2, we have to imagine the screen divided in three parts : TOP, MIDDLE, BOTTOM. Each part (of 8 lines) can use the same charset or different charset. Normally, we use three different charset to do a bitmap title screen. Otherwise, only one charset is needed.

    Control register #4 which sets the PG address of the PG has a different function in mode 2. Only bit 2, PG13, sets the address of the PG (so it's either address 0 or 2000h). Bits 0 and 1 are an AND mask over the character number. The character number is 0 - 767 (2FFh) and these two bits are ANDed over the two highest bits of this value (2FFh is 10 bits, so over bit 8 and 9). So in effect, if bit 0 of control register #4 is set, the second array of 256 patterns in the PG is used for the middle 8 rows of characters, otherwise the first 256 patterns. If bit 1 is set, the third array of patterns is used in the PG, otherwise the first.

    The relation PN -> CT is the same as PN -> GT. Each byte in the CT sets the colour of one pixel line of a character. The high four bits set the foreground colour, the low the background colour. If either of these is 0, it is transparent and the colour of the backdrop (BD) is used.

    Also control register #3 has a different meaning. Only bit 7 (CT13) sets the CT address. Somewhat like control register #4 for the PG, bits 6 - 0 are an AND mask over the top 7 bits of the character number.

    The TC in control register #7 is not used in this mode.
    In other words, we have to be careful when computing the vdp control registers' values.
    Long time no see. Still playing my coleco games?
    http://newcoleco.dev-fr.org

  4. #4
    Strawberry (Level 2) newcoleco's Avatar
    Join Date
    Jul 2002
    Location
    Quebec (Canada)
    Posts
    503
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    0
    Thanked in
    0 Posts

    Default

    To upload the charset in video memory, you can use the upload_ascii routine from Coleco library or by using your own charset.

    syntax :
    void upload_ascii (byte first,byte count,unsigned offset,byte flags);

    upload_ascii (29,128-29,chrpos+29*8,BOLD); /* chrpos is the address location in video memory for the char patterns */

    To create your own charset, you can use one of my tools (for Windows) named Win-ICVGM (or I.C.V.G.M (Win)). This tool is based on the screen mode 0 but can be used for the screen mode 2 too (except for the color patterns).

    URL :
    http://www.geocities.com/newcoleco/tools.html

    When your charset is done, save as a C file and upload your charser into video memory by using one of these routines from Coleco library.

    put_vram (video memory location for character patterns, pointer to charset table without RLE compression, size of the charset table);

    rle2vram(pointer to charset table with RLE compression, video memory location for character patterns);

    Win-ICVGM can be used to create screen and sprites(16x16) too, so it's a very usefull software.
    Long time no see. Still playing my coleco games?
    http://newcoleco.dev-fr.org

  5. #5
    Strawberry (Level 2) newcoleco's Avatar
    Join Date
    Jul 2002
    Location
    Quebec (Canada)
    Posts
    503
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    0
    Thanked in
    0 Posts

    Default

    I imagine many of you looking at these messages and running away or sleeping because you see some technicals informations.


    But, don't be afraid, you only have to read all this information only one time and (after) looking at the technical informations when is necessary.

    For example : the VDP control registers. Do you think I computed the VDP control registers each time I started a new Coleco project? No. I computed the VDP values only one time and I based all my Coleco projects on the same screen mode to always re-use the same vdp values.

    So, after this not too easy part of learning about ColecoVision, the fun of creating video games started. Ok, you may have to learn the C language too but this language could be used for many OS, for many computers and gamesytems.

    Good questions and remarks are welcome!
    Long time no see. Still playing my coleco games?
    http://newcoleco.dev-fr.org

  6. #6
    Strawberry (Level 2) newcoleco's Avatar
    Join Date
    Jul 2002
    Location
    Quebec (Canada)
    Posts
    503
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    0
    Thanked in
    0 Posts

    Default

    To return to the VDP registers values for the MODE 2, this is the C code to do for a BITMAP TITLE SCREEN. Remarks in C are between '/*' and '*/'. The '//' is not ANSI C standard remark syntax but used in C++ language.

    /* this is the header file for the Coleco library by Marcel de Kogel */
    #include<coleco.h>

    /* Important Video Memory Locations based on VDP control registers values */
    #define chrgen 0x0000
    #define coltab 0x2000
    #define chrtab 0x1800

    /* title is the name of the bitmap title screen table generated with PP2C in another C file */
    extern byte title[];

    void nmi(void)
    {
    /* do nothing */
    }

    /* To setup the graphic screen mode 2 */
    void screen_mode_2_bitmap(void)
    {
    /* disable NMI */
    disable_nmi();
    /* screen mode 2 */
    vdp_out (0,2);
    /* set video memory address for chrgen and colortable */
    vdp_out (3,0xff);
    vdp_out (4,0x03);
    /* fill screen with characters 00 to FF three times */
    set_default_name_table (chrtab);
    /* clear chrgen and color table */
    fill_vram(chrgen,0x00,0x1800);
    fill_vram(coltab,0x00,0x1800);
    /* setup sprites and video memory size and enable NMI */
    vdp_out(1,0xe2);
    }
    By using tools like BMP2PP by Marcel de Kogel and PP2C by Daniel Bienvenu (me), you can do a bitmap title screen without any problem. The title screen will be RLE encoded so you can use the following lines to show the title screen.
    /* To show a picture on screen */
    void show_picture(void *picture)
    {
    /* turn display off */
    screen_off ();
    /* disable NMI */
    disable_nmi ();
    /* Upload picture */
    rle2vram (rle2vram(picture,coltab),chrgen);
    /* turn display on */
    screen_on ();
    /* enable NMI */
    enable_nmi ();
    }
    So the "main" routine to show the title screen could be something like this :
    void main(void)
    {
    /* init graphic mode 2 */
    screen_mode_2_bitmap();
    /* show title screen */
    show_picture(title);
    /* infinite loop : cause a warning when compiling */
    while(1);
    }
    Now, you can re-use this code for your own Coleco projects to show a bitmap title screen.

    Have fun!
    Long time no see. Still playing my coleco games?
    http://newcoleco.dev-fr.org

  7. #7
    Strawberry (Level 2) newcoleco's Avatar
    Join Date
    Jul 2002
    Location
    Quebec (Canada)
    Posts
    503
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    0
    Thanked in
    0 Posts

    Default

    GRAPHICS

    Difference between characters (tiles) and sprites.

    The characters are used for most of the graphics on screen. They can be copied many times on screen without any problem. All the letters, numbers and symbols are characters. A character is 8x8 pixels sized. Normally, there is 32x24 spaces on screen where characters can be placed. In screen mode 2, a character can be defined with more than two colors : the limit is 2 colors per line of 8 pixels. in screen mode 0, a character can be defined with only 2 colors : this limit is 2 colors per 8 characters.

    The sprites are easy to use because you can place them anywhere on screen. Each sprite can be identified like a layer on screen. Normally, the size of sprites is 16x16 but there is also the 8x8 sized sprites. The limits for using sprites are : never more than 4 sprites on the same scan line -and- never more than 32 sprites on screen at the same time. The sprites can be magnified by 2 so they looks bigger (but only because the pixels for the sprites are bigger).

    This is the space character
    OOOOOOOO
    OOOOOOOO
    OOOOOOOO
    OOOOOOOO
    OOOOOOOO
    OOOOOOOO
    OOOOOOOO
    OOOOOOOO

    This is a spaceship character pattern (or 8x8 sprite)
    OOOMMOOO
    OOOMMOOO
    MOOMMOOM
    MOOMMOOM
    MMOMMOMM
    MMMOOMMM
    MMMMMMMM
    OOMMMMOO

    This is a spaceship character with 2 colors
    OOOMMOOO
    OOOMMOOO
    MOOMMOOM
    MOOMMOOM
    MMOMMOMM
    MMMOOMMM
    MMMMMMMM
    OOMMMMOO

    This is a spaceship character with 2 colors per each line of 8 pixels
    OOOMMOOO
    OOOMMOOO
    MOOMMOOM
    MOOMMOOM
    MMOMMOMM
    MMMOOMMM
    MMMMMMMM
    OOMMMMOO

    And this is a 16x16 sprite pattern
    OOOOOOOOOOOOOOOO
    OOOOOOMMMMMOOOOO
    OOOOMMMMMMMMMOOO
    OOOMMOOMMMOOMMOO
    OOMMOMMOMOMMOMMO
    OOMMMMMMMMMMMMMO
    OMMMMMMMMMMMMMMM
    OMMMMMMMMMMMMMMM
    OMMMMMMMMMMMMMMM
    OMMMOOOOOOOOOMMM
    OOMMOOOOOOOOOMMO
    OOMMMOOOOOOOMMMO
    OOOMMMMOOOMMMMOO
    OOOOMMMMMMMMMOOO
    OOOOOOMMMMMOOOOO
    OOOOOOOOOOOOOOOO

    The previous 16x16 sprite pattern with yellow color.
    OOOOOOOOOOOOOOOO
    OOOOOOMMMMMOOOOO
    OOOOMMMMMMMMMOOO
    OOOMMOOMMMOOMMOO
    OOMMOMMOMOMMOMMO
    OOMMMMMMMMMMMMMO
    OMMMMMMMMMMMMMMM
    OMMMMMMMMMMMMMMM
    OMMMMMMMMMMMMMMM
    OMMMOOOOOOOOOMMM
    OOMMOOOOOOOOOMMO
    OOMMMOOOOOOOMMMO
    OOOMMMMOOOMMMMOO
    OOOOMMMMMMMMMOOO
    OOOOOOMMMMMOOOOO
    OOOOOOOOOOOOOOOO
    Long time no see. Still playing my coleco games?
    http://newcoleco.dev-fr.org

  8. #8
    Strawberry (Level 2) newcoleco's Avatar
    Join Date
    Jul 2002
    Location
    Quebec (Canada)
    Posts
    503
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    0
    Thanked in
    0 Posts

    Default

    The names of the three tables in Video RAM for characters are :

    NAME : The screen (24x32)
    PATTERN : The characters pattern (256 characters : HEX values 00-FF)
    COLOR : The characters color(s)

    A character have the same pattern and color anywhere on screen (one exception in screen mode 2). So you can't use the same character to print a blue 'A' and a red 'A' side-by-side. The solution is using two characters with the same pattern but with different colors.

    In the ASCII code, the character '1' is the character 49 (31 in HEX value). You must understand the difference between the ASCII code and the symbol. The ASCII code for the character 'A' is 65 (41 in hex value).

    Now, if the color of the character 'A' is blue and if you change the pattern of the character '1' to looks like an 'A' but with a red color, then you just have to print the characters 'A' and '1' side-by-side on screen to show two 'A' side-by-side... one blue and one red.

    In the NAME table, there is HEX values 41 for the 'A' and 31 for the '1'.
    In the PATTERN table, there are identical HEX values for the character 'A' and '1'.
    In the COLOR table, there are diffirent HEX values to have blue color(s) for the character 65 ('A') and red color(s) for the character 49 ('1').

    If you understand, you have enough knowledge to start programming your first ColecoVision game by using only characters (tiles). DACMAN is a good example of a video game based on characters graphics.
    Long time no see. Still playing my coleco games?
    http://newcoleco.dev-fr.org

  9. #9
    ServBot (Level 11) Aswald's Avatar
    Join Date
    Jul 2002
    Posts
    3,719
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    4
    Thanked in
    4 Posts

    Default

    I shouldn't use the 40-column mode; "Island of Foxes" does have a title screen. And I've decided to use different colors for the text (a whopping 2 colors!).
    I'm running out of time today, but I'll try what you posted here this Saturday. I usually get more time then.

  10. #10
    ServBot (Level 11) Aswald's Avatar
    Join Date
    Jul 2002
    Posts
    3,719
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    4
    Thanked in
    4 Posts

    Default

    When you say "two colors," do you also mean the "background color?" A Commodore-64 character is said to have "4 colors," but this includes the background color. Technically, therefore, a ColecoVision sprite would be 2-colors, not one. Otherwise, a Commodore-64 character is only 3 colors.

    Then again, the title screen would only be white for the letters (or maybe yellow), and red for the picture itself. In any one space, there is only one color.

  11. #11
    Strawberry (Level 2) newcoleco's Avatar
    Join Date
    Jul 2002
    Location
    Quebec (Canada)
    Posts
    503
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    0
    Thanked in
    0 Posts

    Default

    Quote Originally Posted by Aswald
    When you say "two colors," do you also mean the "background color?" A Commodore-64 character is said to have "4 colors," but this includes the background color. Technically, therefore, a ColecoVision sprite would be 2-colors, not one. Otherwise, a Commodore-64 character is only 3 colors.

    Then again, the title screen would only be white for the letters (or maybe yellow), and red for the picture itself. In any one space, there is only one color.
    Good questions!

    For the characters graphics, when I say two colors you have to understand one color for bits 1 and one color for bits 0. In my examples, the 'O' represents the bits 0 and the 'M' represents the bits 1. If you want to see the background color you have to use the INVISIBLE color.

    For the sprite, the bits 0 are already replaced by the invisible color so there is only one color per sprite. To use more than one colors you have two solutions : use more than one sprite (one for each color), use a combination of sprites and characters like the ghots' eyes (in Atarisoft PacMan game) are characters but the body of the ghosts are sprites.

    ----------------------------------------------------------------------------------

    CHARACTERS

    I re-use here the spaceship character pattern example.

    You can compute the binary and also HEX values easily to be in PATTERN table.

    OOOMMOOO : 00011000 : 18
    OOOMMOOO : 00011000 : 18
    MOOMMOOM : 10011001 : 99
    MOOMMOOM : 10011001 : 99
    MMOMMOMM : 11011011 : DB
    MMMOOMMM : 11100111 : E7
    MMMMMMMM : 11111111 : FF
    OOMMMMOO : 00111100 : 3C

    This is the Coleco color palette :

    0 : Invisible
    1 : Black
    2 : Medium Green
    3 : Light Green
    4 : Dark blue
    5 : Light blue
    6 : Dark Red (brown)
    7 : Cyan
    8 : Medium Red
    9 : Light Red (Pink/orange)
    10 (A) : Dark Yellow (Yellow)
    11 (B) : Light Yellow (Yellow+Light Grey)
    12 (C) : Dark Green
    13 (D) : Magenta
    14 (E) : Grey (Light Grey)
    15 (F) : White

    Computing the colors to be in the COLOR table is very easy. you can calculated the HEX values by checking which color are the '1' (M) and which color are the '0' (O).

    Screen Mode 0

    For the screen mode 0, only one byte is used to setup the color per set of 8 characters. The following example use color blue (bits 1) and black (bits 0), so the color code to be in the COLOR table is (in HEX value) : 41.

    OOOMMOOO
    OOOMMOOO
    MOOMMOOM
    MOOMMOOM
    MMOMMOMM
    MMMOOMMM
    MMMMMMMM
    OOMMMMOO

    Screen Mode 2

    Because the limit for the screen mode 2 is two colors per line of 8 pixels, you have to compute 8 bytes for the color per character.

    OOOMMOOO : 81
    OOOMMOOO : 41
    MOOMMOOM : 81
    MOOMMOOM : 41
    MMOMMOMM : 41
    MMMOOMMM : 4F
    MMMMMMMM : 4X
    OOMMMMOO : 81

    Note : Because all the bits in one line of 8 pixel are set to 1, the color for the 0 bits can be anything. So the color code 4X could be 40, 41, 42, 43, etc.

    Note : To see the background color around this spaceship, change all the black color codes (1) for the invisible color code (0).

    SPRITES

    A sprite has four(4) parameters : position X, position Y, pattern number and color. These parameters must be correctly placed in the video memory to show sprites on screen.

    The 16x16 sprite is like four(4) 8x8 patterns displayed this way.

    1|3
    -+-
    2|4

    OOOOOOOOOOOOOOOO : 00 | 00
    OOOOOOMMMMMOOOOO : 03 | E0
    OOOOMMMMMMMMMOOO : 0F | F8
    OOOMMOOMMMOOMMOO : 19 | CC
    OOMMOMMOMOMMOMMO : 36 | B6
    OOMMMMMMMMMMMMMO : 3F | FE
    OMMMMMMMMMMMMMMM : 7F | FF
    OMMMMMMMMMMMMMMM : 7F | FF
    -------------------------------- : ---+---
    OMMMMMMMMMMMMMMM : 7F | FF
    OMMMOOOOOOOOOMMM : 70 | 07
    OOMMOOOOOOOOOMMO : 30 | 06
    OOMMMOOOOOOOMMMO : 38 | 0E
    OOOMMMMOOOMMMMOO : 1E | 3C
    OOOOMMMMMMMMMOOO : 0F | F8
    OOOOOOMMMMMOOOOO : 03 | E0
    OOOOOOOOOOOOOOOO : 00 | 00

    So the previous HEX codes must be in the video memory space named SPRITE PATTERN table.

    (to be continued...)

    Finally, what's the correct color palette for the ColecoVision? The following link will show you an article about the color palette.

    http://junior.apk.net/~drushel/pub/c.../wk961201.html
    Long time no see. Still playing my coleco games?
    http://newcoleco.dev-fr.org

  12. #12
    Strawberry (Level 2) newcoleco's Avatar
    Join Date
    Jul 2002
    Location
    Quebec (Canada)
    Posts
    503
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    0
    Thanked in
    0 Posts

    Default

    Quote Originally Posted by Aswald
    I shouldn't use the 40-column mode; "Island of Foxes" does have a title screen. And I've decided to use different colors for the text (a whopping 2 colors!).
    I'm running out of time today, but I'll try what you posted here this Saturday. I usually get more time then.
    You can use the screen mode 2 for your "bitmap" title screen. And you can use the screen mode 1 for your text adventure in 40 collumns.

    You can use only one screen mode at a time.

    I suggest you to exploit the screen mode 2 to do great graphics and color effects.
    Long time no see. Still playing my coleco games?
    http://newcoleco.dev-fr.org

  13. #13
    Strawberry (Level 2) newcoleco's Avatar
    Join Date
    Jul 2002
    Location
    Quebec (Canada)
    Posts
    503
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    0
    Thanked in
    0 Posts

    Default

    JOYSTICK

    Note : The following text is based on coleco library by Marcel de Kogel.

    The joystick is divided in two parts : keypad and joypad.

    JOYPAD

    Use joypad_1 and joypad_2 to know the direction and the (pressed) fire button(s). The joypad_1 is for the joystick at the port#1. The joypad_2 is for the joystick at the port#2.

    How to use the joypad_1 and joypad_2 values?
    The value is a byte and each bit in this byte represent a fire button or a direction.

    F4|F3|F2|F1|LT|DN|RT|UP

    UP : Up
    RT : Right
    DN : Down
    LT : Left
    F1 : Fire #1
    F2 : Fire #2
    F3 : Fire #3
    F4 : Fire #4

    So, you need to use a mask (AND MASK) to extract the value you need.

    Example : I want to do nothing until a fire button is pressed on port#1.
    Answer : The fire buttons bits are the four(4) highest bits in the joypad byte. So, you need to do a mask with four(4) bits 1 and four(4) bits 0 like this : 11110000 (F0 in HEX value).

    while((joypad_1&0xf0)==0); /* loop if no fire button is pressed (port#1) */
    KEYPAD

    Use keypad_1 and keypad_2 to know which number was pressed. The keypad_1 is for the keypad on port#1. The keypad_2 is for the keypad on port#2.

    Note : The first time you call keypad_1 and keypad_2, the result will be 0 but it doesn't mean the number 0 was pressed. After this first time, the keypad value will match with the number key pressed.

    0-9 = 0-9
    10 = * (standard to pause the game and replay game with the same game option)
    11 = # (standard to return to menu after the game)
    12-15 = ... (no key pressed)

    Have fun!
    Long time no see. Still playing my coleco games?
    http://newcoleco.dev-fr.org

  14. #14
    Strawberry (Level 2) newcoleco's Avatar
    Join Date
    Jul 2002
    Location
    Quebec (Canada)
    Posts
    503
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    0
    Thanked in
    0 Posts

    Default

    What kind of video game will be your first ColecoVision project?

    Good question!

    I think you have to create a video game for you first, to increase your experience in Coleco programming. Don't hesitate to ask for help. Do not talk about your first Coleco project before doing beta versions... otherwise the stress to finish the game as soon as possible will kill the magic.
    You can do any kind of video game... but you have to be carefull. This great video game system is not perfect (think about the graphics and memory limits). So you must start with an easy (for you) video game project first.

    Arcade games can be done for the ColecoVision game system. Playing arcade games at home is one of the goal of this incredible game system. But I suggest you to create your own video games. Use your imagination and create as many new games as you can.

    A few years ago I asked a question about which video games the gamers want for the ColecoVision. I received this answer :

    Pengo
    Ewoks adventure
    Pong
    Rip Cord
    (any weird arcade game from '80)
    Othello/Reversi
    Chess
    Checkers

    A few months later, I started a Reversi game for ColecoVision but I reached the RAM space limit. The ROM was release but to play only with an emulator because the game still buggy.

    If I ask again the question about which new arcade game you want for the ColecoVision?... the answer will be something else than Othello/Reversi.

    My suggestions to the next generation of ColecoVision game designer:

    - Bomberman (for those who like to remake arcade classics)
    - an original adventure game (not a remake)

    GOOD LUCK!
    Long time no see. Still playing my coleco games?
    http://newcoleco.dev-fr.org

  15. #15
    Strawberry (Level 2) newcoleco's Avatar
    Join Date
    Jul 2002
    Location
    Quebec (Canada)
    Posts
    503
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    0
    Thanked in
    0 Posts

    Default

    I don't feel good. I'm sick... and I want to be in a very good shape soon to complet at least one of my Coleco projects for the PhillyClassic. :/

    I didn't receive any message from you about Coleco programming so I suppose you are not ready for this kind of information. too technical? I don't think so, there is just enough informations to let you know what kind of informations your need to start a colecovision project.

    I'm very happy about the award for the homebrew game of the year 2002 ... Coleco Bejeweled.

    I suggest you to copy this topic (before you lose all this information) just in case some of you will want to do the new homebrew games for the ColecoVision game system.

    Note : After a few more messages, I wanted to show you how to do a project from the idea to the first prototype version. Maybe next time... or visit my web site.
    Long time no see. Still playing my coleco games?
    http://newcoleco.dev-fr.org

  16. #16
    Strawberry (Level 2) newcoleco's Avatar
    Join Date
    Jul 2002
    Location
    Quebec (Canada)
    Posts
    503
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    0
    Thanked in
    0 Posts

    Default

    I will not talk about sound or noise generator.
    I still have problem to fully understand the sound chip and there is no informations available about the Coleco sound routines in the Coleco bios.

    BUT, I use the sound routines included in the Coleco library by Marcel de Kogel so I can talk about sounds a little bit.

    The way I learn how to generate sounds in my Coleco project is by looking the source code of Marcel de Kogel's Cosmo Challenge (available with his coleco library).

    To avoid computing myself a sound effect, I created a tool named WAV2CV to convert a sound from a normal WAV file into a C file to be used with the coleco library sound routines. I have done two programs about sound effects with menus. The source code of these programs are available : visit my coleco web site.

    http://www.geocities.com/newcoleco

    Ok, my Coleco web site is not up-to-date but this is the page where you can found some of my codes. It's in french only (sorry)

    http://www.geocities.com/newcoleco/dev/devfr.html

    THE SOUND ROUTINES I USE

    At the end of the NMI routine, I add the following instruction :
    update_sound ();
    This instruction placed in the nmi will update the sound at each vertical retrace. Yes, in the NMI routine, it's the best place to put this instruction.

    start_sound (sound_data,sound_priority);
    This instruction add some informations in the RAM like the pointer to the sound in ROM and the sound priority. The informations in RAM will be used by the update_sound routine to play the sound. When 3 sounds are played and another sound is started, the sound_priority is used to see wich sound must be ignored because there is only 3 sound channel. A sound priority number 10 win over a sound priority number 1. (I hope you understand)

    sound_pointer = start_sound(sound_data, sound_priority);
    You can get the information about the pointer in RAM where the sound informations are placed. This way, you can use the following instruction to stop this particular sound without stoping all sounds:

    stop_sound(sound_pointer);
    You cannot use stop_sound without the sound_pointer otherwise all sounds may stop forever.

    THE WAY I ADD SOUNDS IN MY COLECO PROJECTS

    I don't fully understand how works the sound routine "update_sound" but I can talk about wav2cv.

    It's very easy. Simply open wav2cv and select the WAV file you want to convert. You can also change the parameters before selecting the WAV file to increase or decrease the sound quality. If it's a simple sound like BEEP, use only one channel. If it's a complex sound like a digitalized sound, use two or three channels. Remarks : WAV2CV can freeze if you ask for more channel than you really need (it's a bug i can't fix). Normaly, WAV2CV will minimized for short laps of time and take 90% of your CPU time. More longer is the sound, more longer you will freeze your Windows. WAV2CV applies FAST FOURRIER TRANSFORM to find frequencies of the sound... for each laps of time based on the vertical retrace frequency (NTSC 60Hz or PAL 50Hz).

    The generated C file can be renamed and added into your Coleco project. You can also copy-paste the C code into your source code where you want to avoid having too much C files to compile. I suggest to use one C file to regroup all the sound data for your coleco project.

    WAV2CV cannot convert noisy sounds. To add a noise sound effect, you must refer to the sound data you can found in the cosmo challenge source code.

    static byte shoot_sound[]=
    {
    1,
    0xf8,0xe4, 1,0xf2, 1,0xe4, 1,0x63,0x02,0x01,0xe5, 1,0xe4,
    1,0xe5, 1,0xe4, 1,0xe5, 1,0xe4,
    1,0xe5, 1,0xe4, 1,0xe5, 1,0xe4,
    5,
    0,0,0
    };
    Remark : Sound data end with three zero : "0,0,0".

    Ok, You have informations about SOUNDS, GRAPHICS, JOYSTICK and TOOLS you can use. If you know how to program in ANSI C language, you have all the informations to program your own ColecoVision projects. There is no reason to ask again how to program a ColecoVision game in C.

    NOW, it's YOUR TURN to talk about NEW ColecoVision HOMEBREW GAMES.
    Long time no see. Still playing my coleco games?
    http://newcoleco.dev-fr.org

  17. #17
    ServBot (Level 11) Aswald's Avatar
    Join Date
    Jul 2002
    Posts
    3,719
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    4
    Thanked in
    4 Posts

    Default

    Quote Originally Posted by newcoleco
    Quote Originally Posted by Aswald
    I shouldn't use the 40-column mode; "Island of Foxes" does have a title screen. And I've decided to use different colors for the text (a whopping 2 colors!).
    I'm running out of time today, but I'll try what you posted here this Saturday. I usually get more time then.
    You can use the screen mode 2 for your "bitmap" title screen. And you can use the screen mode 1 for your text adventure in 40 collumns.

    You can use only one screen mode at a time.

    I suggest you to exploit the screen mode 2 to do great graphics and color effects.

    After some consideration, this is probably the best way. Originally, I had intended to use different colors for the text; your actions would be red, but enemy reactions would be in green, while basic descriptions would be in blue. But since the 40-column mode in the ColecoVision only allows one color at any one time, this is impossible.

    Therefore, I have two choices...

    1) If I want to make the text different colors, I must go with the 32 column mode. Since the Commodore version of this game uses 40 columns, the text would have to be arranged differently if it ever goes past 32 letters on a line.

    2) Use the 40-column mode. This allows for a "straight" text translation, but all text must now be of one color.

    Incidently, I can only use 30/38 characters in these modes. Why? Because on a television screen, often the far left and the far right columns cannot be seen; Dac-Man has this problem. Therefore, I'd have to leave a column on both sides to center everything better. This complicates matters a bit; losing those two spaces is more of a bother than you'd think.

    But first, I must get a working Commodore 64 computer to get this game off of the ground. I can even program a fancy title screen for it; at least I can do that much. The crude prototype version I did just before the computer blew (December was an awful month) was actually pretty enjoyable, if a bit simple by today's standards. We'll see.

  18. #18
    Strawberry (Level 2) newcoleco's Avatar
    Join Date
    Jul 2002
    Location
    Quebec (Canada)
    Posts
    503
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    0
    Thanked in
    0 Posts

    Default

    Originally, I had intended to use different colors for the text; your actions would be red, but enemy reactions would be in green, while basic descriptions would be in blue.

    Therefore, I'd have to leave a column on both sides to center everything better.
    Ok, I have an idea on how you can solve your problem.

    You will probably have to write your own "PRINT" routine to print text on screen without using the first left and the first right collumns. This special print routine can use a color parameter to print the correct characters on screen. the character printed on screen must be an association of a pattern and a color (or a color effect). You must use SCREEN MODE 2.
    Long time no see. Still playing my coleco games?
    http://newcoleco.dev-fr.org

  19. #19
    Strawberry (Level 2) newcoleco's Avatar
    Join Date
    Jul 2002
    Location
    Quebec (Canada)
    Posts
    503
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    0
    Thanked in
    0 Posts

    Default

    Who change the name of this topic?

    "Discussion about creepified Coleco projects and Coleco programming"

    is not the original name I choose for this topic.

    I don't understand why and how it was modified.
    Long time no see. Still playing my coleco games?
    http://newcoleco.dev-fr.org

  20. #20
    Strawberry (Level 2) newcoleco's Avatar
    Join Date
    Jul 2002
    Location
    Quebec (Canada)
    Posts
    503
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    0
    Thanked in
    0 Posts

    Default

    I need to update my ColecoVision web site but I can answer your question here (if you ask a question).

    I think I will rewrite all this information about colecovision in another form... to be added in my web site.
    Long time no see. Still playing my coleco games?
    http://newcoleco.dev-fr.org

Similar Threads

  1. 32X, NES, Coleco and More
    By coreys429 in forum Buying and Selling
    Replies: 1
    Last Post: 05-15-2009, 08:59 AM
  2. The demise of Coleco is almost upon us!
    By digitalpress in forum Classic Gaming
    Replies: 65
    Last Post: 04-28-2005, 02:20 PM
  3. Help me specify a problem...Coleco
    By Emily in forum Technical and Restoration Society
    Replies: 6
    Last Post: 02-01-2005, 08:51 AM
  4. Presentation of Coleco projects in development
    By newcoleco in forum Classic Gaming
    Replies: 0
    Last Post: 11-21-2004, 02:18 AM
  5. Coleco?
    By Asylum Seeker in forum Classic Gaming
    Replies: 1
    Last Post: 12-11-2002, 05:49 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •