2023-01-17

What if VIC-II...

Ciriciao folks!

What if Commodore made VIC-II (the heart of the Commodore 64) slightly different from the start or evolved its original design over the years to include new features?

I've often wondered about how difficult it would have been to change this thing or add that other, now thanks to the VIC-II Kawari project I can experiment on this, let's go!

I will proceed in small steps, for each one I'll give the modifications to VIC-II Kawari and Vice, and a BASIC program to test them.

But before I start making the real juicy new features I need a starting test bed in Vice.
Let's add a new VIC-II chip model, actually two of them for the PAL and NTSC variants, called WIV for What If VIC-II, that will be shown in the settings:

In order to achieving that, the new models need to be added to an enumeration in vice/src/vicii.h:

/* PAL, hypotetical 6569 evolution */
#define VICII_MODEL_WIVPAL   7
/* NTSC, hypotetical 6567 evolution */
#define VICII_MODEL_WIVNTSC   8

And in the displayed list in vice/src/arch/gtk3/c64scui.c:

/** \brief  List of VIC-II models
 *
 * Used in the VIC-II model widget
 */
static const vice_gtk3_radiogroup_entry_t c64sc_vicii_models[] = {
    { "6569 (PAL)",             VICII_MODEL_6569 },
    { "8565 (PAL)",             VICII_MODEL_8565 },
    { "6569R1 (old PAL)",       VICII_MODEL_6569R1 },
    { "6567 (NTSC)",            VICII_MODEL_6567 },
    { "8562 (NTSC)",            VICII_MODEL_8562 },
    { "6567R56A (old NTSC)",    VICII_MODEL_6567R56A },
    { "6572 (PAL-N)",           VICII_MODEL_6572 },
    { "WIV (PAL)",              VICII_MODEL_WIVPAL },
    { "WIV (NTSC)",             VICII_MODEL_WIVNTSC },
    { NULL, -1 }
};

Other modifications are needed in vice/src/viciisc/vicii-chip-model.c, in vice/src/viciisc/vicii-color.c, and in vice/src/viciisc/vicii-resources.c.

Finally in file vice/src/viciisc/vicii-resources.h a handy macro is added that will be useful later to conditionally enable WIV features:

#define IS_WIV (vicii_resources.model == VICII_MODEL_WIVPAL || vicii_resources.model == VICII_MODEL_WIVNTSC)

That's all for today, no modifications to VIC-II Kawari and no BASIC test needed, that'll be for the next posts.

No comments:

Post a Comment