Chalk Board's LogicMaster is really a lame game, but it's far more interesting to find out how it works. The game is just mastermind with card suits and colors. Personally I like the Coleco Digits game for a mastermind-type game. It'd be an interesting exercise to make a coleco digits overlay and game for the powerpad.

The overlay has got a lot of "buttons", there are 34.


[Linked Image from i.imgur.com]

So let's try to make a list of buttons to press:

Code
int powerpad_map[64][2];  // map buttons to powerpad coordinates


void apple2_state::powerpad_make_buttons(int loc,int xo,int yo, int xnum, int ynum, int xoffset, int yoffset, int xrowoffset, int yrowoffset) {

for (int y=0;y<ynum;y++){
for (int x=0;x<xnum;x++){
       powerpad_map[loc][0]=(xo +xoffset*x + xrowoffset*y);
       powerpad_map[loc][1]=(yo+ yoffset*x + yrowoffset*y);
       printf("Add button  %d  %x  at (%d,%d)\n",loc,loc,powerpad_map[loc][0],powerpad_map[loc][1]);
       powerpad_map[loc][0]*=-1;
       powerpad_map[loc][0]+=119;  // xcoordinates are reversed since x=0 is at the right
       loc++;
}
}
}


Code
static int makebuttonsflag=0;
if (!makebuttonsflag){

powerpad_make_buttons(1*8,38,62,6,1,12,0,0,0);  // 123456 
powerpad_make_buttons(2*8,45,11,2,2,12,-7,12,14);  // suits  
powerpad_make_buttons(3*8,93,5,2,3,14,8,0,16);  // colors
powerpad_make_buttons(4*8,79,105,3,2,14,-8,14,8);  // lower right
powerpad_make_buttons(5*8,56,97,1,2,14,-8,0,16);  // lower middle
powerpad_make_buttons(6*8,8,90,3,2,14,8,0,16);  // lower left
powerpad_make_buttons(7*8,8,45,2,2,14,-8,0,16);  // middle left
powerpad_make_buttons(0*8,8,15,2,1,14,-8,0,16);  // upper left

makebuttonsflag=1;
}



When running it I get a list of buttons as I make them:
Add button 8 8 at (38,62)
Add button 9 9 at (50,62)
Add button 10 a at (62,62)
Add button 11 b at (74,62)
Add button 12 c at (86,62)
Add button 13 d at (98,62)
Add button 16 10 at (45,11)
Add button 17 11 at (57,4)
Add button 18 12 at (57,25)
etc


then we can scan our button numpadkeys from 0 to 7, then 8 to 15 and if they're both pressed, issue the coordinates from our 8x8 table, ignoring it if the coordinates are 0,0.

Code
int but1,but2;
int buttonread;
int item;

for(but1=0;but1<8;but1++){
for(but2=0;but2<8;but2++){  
    buttonread=m_test_buttons->read() ^ 0xffff; 
    if ( ((buttonread) & (1<<but1)) && ((buttonread) & (1<<(but2+8))) )
     { 
     item = but1*8+but2;
     printf("item = %d   (%d,%d)\n",item,119-powerpad_map[item][0],powerpad_map[item][1]);     
     if ((powerpad_map[item][0] !=0) && (powerpad_map[item][1] !=0))
        {powerpad_list_counter++;
         powerpad_list[powerpad_list_counter][0]= powerpad_map[item][0];
         powerpad_list[powerpad_list_counter][1]= powerpad_map[item][1];
        }
     }
   }
   }




and expand our test buttons up to 16 buttons, using up all the keypad keys
Code
     PORT_START("TEST_BUTTONS")
        PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON16 ) PORT_NAME("BUT0") PORT_CODE(KEYCODE_0_PAD)
        PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("BUT1") PORT_CODE(KEYCODE_1_PAD)
        PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("BUT2") PORT_CODE(KEYCODE_2_PAD)
        PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("BUT3") PORT_CODE(KEYCODE_3_PAD)
        PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("BUT4") PORT_CODE(KEYCODE_4_PAD)
        PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("BUT5") PORT_CODE(KEYCODE_5_PAD)
        PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("BUT6") PORT_CODE(KEYCODE_6_PAD)
        PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME("BUT7") PORT_CODE(KEYCODE_7_PAD)
        PORT_BIT( 0x100, IP_ACTIVE_LOW, IPT_BUTTON8 ) PORT_NAME("BUT8") PORT_CODE(KEYCODE_8_PAD)
        PORT_BIT( 0x200, IP_ACTIVE_LOW, IPT_BUTTON9 ) PORT_NAME("BUT9") PORT_CODE(KEYCODE_9_PAD)
        PORT_BIT( 0x400, IP_ACTIVE_LOW, IPT_BUTTON10 ) PORT_NAME("BUTA") PORT_CODE(KEYCODE_SLASH_PAD)
        PORT_BIT( 0x800, IP_ACTIVE_LOW, IPT_BUTTON11 ) PORT_NAME("BUTB") PORT_CODE(KEYCODE_ASTERISK)
        PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON12 ) PORT_NAME("BUTC") PORT_CODE(KEYCODE_MINUS_PAD)
        PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON13 ) PORT_NAME("BUTD") PORT_CODE(KEYCODE_PLUS_PAD)
        PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON14 ) PORT_NAME("BUTE") PORT_CODE(KEYCODE_ENTER_PAD)
        PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON15 ) PORT_NAME("BUTF") PORT_CODE(KEYCODE_DEL_PAD)



It's not easy to enter button presses with a chord keyboard but it works.

So now I can "play" a game, but something's weird with the randomization, I get the same card/suits for each item.

This game is really complicated enough that I had to read the manual to figure out what's going on, S= suits, C=colors,Sp =Suit correct position, Cp = color correct position.

Here's the game setup for 6 cards, 4 suits and 6 colors.

[Linked Image from i.imgur.com]

I guessed it correctly, 6 white hearts!

[Linked Image from i.imgur.com]