Source code now public on GitHub

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Andrew Davie

You can now view/follow the source code on GitHub...

GitHub Atari 2600 Sokoban 2025

It's released under GPL 3.0.  The LICENSE file details the requirements. I have mentioned/excluded files not of my own creation; specifically the CDFJ drivers and AtariVox stuff. Let me know if I've missed anything and I'll update.

Please note that this is a rolling hodge-podge of many years of programming. Some files I haven't touched for many years, and the formatting and coding conventions may be very old. Consequently, it's not exactly neat or consistent. So be it; I try to clean up as I go but there's a lot there.

Building may be a problem for you; you'll need to update paths in main/Makefile to point to various tools/utilities.
The Makefile is setup for MacOS zsh usage; you may need to modify that for your OS.
Please don't ask me for advice regarding Windows - I am a Mac/Linux person and have no time for it.
You will need a copy of the arm compiler, too.  And of course dasm.
For an emulator - I use Gopher2600 (recommended!)

Once it's all configured properly, you just type "make" from the root directory, or setup your IDE to do that for you.

For those interested in how iCC and ChronoColour work, you'll probably be interested in main/menu.c in the function drawICCScreen() and drawPalette() which together contain complete and working code to draw the "SOKOBAN 2025" title screen.

Essentially just this code...

void drawPalette(const unsigned char *palette) {

    unsigned char *p = RAM + _BUF_MENU_COLUPF;

    unsigned char pal[3];

    int baseRoller = roller;
    for (int i = 0; i < 3; i++) {
        pal[i] = convertColour(palette[baseRoller]);
        if (++baseRoller > 2)
            baseRoller = 0;
    }

    for (int i = 0; i < _ARENA_SCANLINES; i += 3) {
        p[i] = pal[0];
        p[i + 1] = pal[1];
        p[i + 2] = pal[2];
    }
}

void drawICCScreen(const unsigned char *icc) {

    drawPalette(iCC_title_colour);
    icc += 3;

    unsigned char *pf1L = RAM + _BUF_MENU_PF1_LEFT;
    for (int line = 0; line < _ARENA_SCANLINES << 2; line += 3) {


            for (int i = 0; i < 3; i++) {

                *pf1L++ = icc[roller];

                if (++roller > 2)
                    roller = 0;
            }
            icc += 3;
    }
}

As you can see, it's astoundingly simple. The only actual difference bewteen iCC and ChronoColour is that 'roller' is incremented every frame in the former, and remains at 0 in the latter.

As far as the character graphics display(s), look to drawScreen.c for implementations of the three zoom levels and how those are drawn using iCC and ChronoColour.

Anyway, have at it. I don't expect anyone/many to even be interested. But it's "out there" now, and you can follow my progress. Sorry it's so messy; will clean it up as we go.

Please respect the LICENSE.