Here's our C++ code for that.
I have defined the ID arrays somewhere on top first.
static int _autotiles[6][8][4] = {
{{27, 28, 33, 34}, { 5, 28, 33, 34}, {27, 6, 33, 34}, { 5, 6, 33, 34},
{27, 28, 33, 12}, { 5, 28, 33, 12}, {27, 6, 33, 12}, { 5, 6, 33, 12}},
{{27, 28, 11, 34}, { 5, 28, 11, 34}, {27, 6, 11, 34}, { 5, 6, 11, 34},
{27, 28, 11, 12}, { 5, 28, 11, 12}, {27, 6, 11, 12}, { 5, 6, 11, 12}},
{{25, 26, 31, 32}, {25, 6, 31, 32}, {25, 26, 31, 12}, {25, 6, 31, 12},
{15, 16, 21, 22}, {15, 16, 21, 12}, {15, 16, 11, 22}, {15, 16, 11, 12}},
{{29, 30, 35, 36}, {29, 30, 11, 36}, { 5, 30, 35, 36}, { 5, 30, 11, 36},
{39, 40, 45, 46}, { 5, 40, 45, 46}, {39, 6, 45, 46}, { 5, 6, 45, 46}},
{{25, 30, 31, 36}, {15, 16, 45, 46}, {13, 14, 19, 20}, {13, 14, 19, 12},
{17, 18, 23, 24}, {17, 18, 11, 24}, {41, 42, 47, 48}, { 5, 42, 47, 48}},
{{37, 38, 43, 44}, {37, 6, 43, 44}, {13, 18, 19, 24}, {13, 14, 43, 44},
{37, 42, 43, 48}, {17, 18, 47, 48}, {13, 18, 43, 48}, { 1, 2, 7, 8}}
};
Bitmap::bltOver simply overwrites the already existing pixels, nothing special. "autotile" is a the actual bitmap loaded from the file (the one that is 96x128 pixels) and "generated" is the bitmap that is put together for rendering. It looks the same like the generated bitmap that you can view in the RMXP editor when you open an autotile in a tileset setting.