Previous Thread
Next Thread
Print Thread
Page 4 of 6 1 2 3 4 5 6
Re: c64 super sketch [Re: Golden Child] #116215 10/18/19 02:38 PM
Joined: Feb 2014
Posts: 354
G
Golden Child Offline OP
Senior Member
OP Offline
Senior Member
G
Joined: Feb 2014
Posts: 354
After getting a little frustrated with the versawriter, why not try something else:

[Linked Image from i.imgur.com][Linked Image from i.imgur.com]

Re: c64 super sketch [Re: Golden Child] #116218 10/19/19 03:39 AM
Joined: Feb 2014
Posts: 354
G
Golden Child Offline OP
Senior Member
OP Offline
Senior Member
G
Joined: Feb 2014
Posts: 354
[Linked Image from i.imgur.com]

They made units compatible with atari vcs, 400/800, apple ii, c64, vic20, and ibm pc.

It only needed two input lines (data,sense) and two output lines (clock, clear).

[Linked Image from i.imgur.com]

The manual for the programming kit gives lots of technical details.

[Linked Image from i.imgur.com]

Re: c64 super sketch [Re: Golden Child] #116221 10/19/19 01:42 PM
Joined: Feb 2014
Posts: 354
G
Golden Child Offline OP
Senior Member
OP Offline
Senior Member
G
Joined: Feb 2014
Posts: 354

Re: c64 super sketch [Re: Golden Child] #116222 10/19/19 02:09 PM
Joined: Mar 2001
Posts: 16,371
R
R. Belmont Online Content
Very Senior Member
Online Content
Very Senior Member
R
Joined: Mar 2001
Posts: 16,371
This would be easy to support on the A2 if the software turned up.

Re: c64 super sketch [Re: R. Belmont] #116231 10/20/19 01:40 PM
Joined: Feb 2014
Posts: 354
G
Golden Child Offline OP
Senior Member
OP Offline
Senior Member
G
Joined: Feb 2014
Posts: 354
Yes, I can't wait for the apple 2 stuff to show up.

Okay, here's my crap code that seems to work for microillustrator, leo's paintbrush and micromaestro.

Mangling the atari400.cpp file:

Code
// add to the a400_state initializer:

              m_mypot0(*this, "myanalog_0"),
              m_mypot1(*this, "myanalog_1"),
              m_test_buttons(*this, "TEST_BUTTONS")

// add a bunch of a400_state members:

    required_ioport m_mypot0,m_mypot1;
    required_ioport m_test_buttons;


  DECLARE_READ8_MEMBER(a800xl_d300_read);
  DECLARE_WRITE8_MEMBER(a800xl_d300_write);


int powerpad_sense;
int powerpad_clock;
int powerpad_clear;
int powerpad_clock_new;
int powerpad_clear_new;
int powerpad_shift;

int reverse_8bits(int x);


int powerpad_list_counter;
static const int powerpad_list_size=20;
int powerpad_list[powerpad_list_size][2];



// add our d300 read and write into the map

void a400_state::a800xl_mem(address_map &map)
{
        map(0x0000, 0xcfff).rw(FUNC(a400_state::a800xl_low_r), FUNC(a400_state::a800xl_low_w));
        map(0xd000, 0xd0ff).rw(m_gtia, FUNC(gtia_device::read), FUNC(gtia_device::write));
        map(0xd100, 0xd1ff).noprw();
        map(0xd200, 0xd2ff).rw("pokey", FUNC(pokey_device::read), FUNC(pokey_device::write));
        map(0xd300, 0xd3ff).rw(m_pia, FUNC(pia6821_device::read_alt), FUNC(pia6821_device::write_alt));
        map(0xd300, 0xd300).rw(FUNC(a400_state::a800xl_d300_read), FUNC(a400_state::a800xl_d300_write));   // add our d300 read and write into the map
        map(0xd400, 0xd4ff).rw(m_antic, FUNC(antic_device::read), FUNC(antic_device::write));
        map(0xd500, 0xd7ff).noprw();
        map(0xd800, 0xffff).rw(FUNC(a400_state::a800xl_high_r), FUNC(a400_state::a800xl_high_w));
}


READ8_MEMBER(a400_state::a800xl_d300_read)
{  // return two things: data bit and sense bit
int retval=((powerpad_shift & (1<<15)) ? 0 : 1) | ((powerpad_sense ? 1 : 0) << 3);
//printf("RETURN %x  %s\n",retval,machine().describe_context().c_str());
return  retval;
}

WRITE8_MEMBER(a400_state::a800xl_d300_write)
{
//printf("d300 write: %x\n",data);
powerpad_clock_new = data & (1<<2);
powerpad_clear_new = data & (1<<1);

if ((powerpad_clock_new) && (powerpad_clock == 0))  // clock going high
   {   powerpad_shift <<= 1;  // shift it one to the left
       printf("SHIFT powerpad shift=%x , %s   %s\n",powerpad_shift,std::bitset<16>(powerpad_shift).to_string().c_str(),machine().describe_context().c_str());
  }

if ((powerpad_clear_new) && (powerpad_clear==0)) // clear going high
{
   printf("CLEAR %s\n",machine().describe_context().c_str());
   powerpad_sense=0;

    // send next list point
    powerpad_list_counter--;

    if(powerpad_list_counter<0) // then we need to build a new list
    {

    //first entry is always 0,0
    powerpad_list_counter++;
    powerpad_list[powerpad_list_counter][1]= 0;
    powerpad_list[powerpad_list_counter][0]= 0;

if ( ((m_test_buttons->read()^0xff)&0x01)==0  )   // button 1 pressed is "pick up all presses"
{
    // now add the current position of our analog input (reversing it and clamping it to 0-119)
    // x coordinate gets reversed (since x grows to the left)
    // y coordinate is not reversed

    powerpad_list_counter++;
    powerpad_list[powerpad_list_counter][0]= 119-std::min((int)m_mypot0->read()&0x7f,119);
    powerpad_list[powerpad_list_counter][1]=     std::min((int)m_mypot1->read()&0x7f,119);
}

// hardcode some powerpad locations, button 2 is "pen down" for microillustrator
    if ((m_test_buttons->read()^0xff)&0x02)  // button 2 pressed
     { powerpad_list_counter++;
      powerpad_list[powerpad_list_counter][0]= 5;
      powerpad_list[powerpad_list_counter][1]= 5;
     }
    if ((m_test_buttons->read()^0xff)&0x04)  // button 3 pressed  "menu for microillustrator"
     { powerpad_list_counter++;
      powerpad_list[powerpad_list_counter][0]= 25;
      powerpad_list[powerpad_list_counter][1]= 5;
     }
    if ((m_test_buttons->read()^0xff)&0x08)  // button 4 pressed  "lock button for microillustrator"
     { powerpad_list_counter++;
      powerpad_list[powerpad_list_counter][0]= 60;
      powerpad_list[powerpad_list_counter][1]= 5;
     }
    if ((m_test_buttons->read()^0xff)&0x10)  // button 5 pressed   "rightmost note for micromaestro"
     { powerpad_list_counter++;
      powerpad_list[powerpad_list_counter][0]= 4;
      powerpad_list[powerpad_list_counter][1]= 115;
     }

    if ((m_test_buttons->read()^0xff)&0x20)  // button 6 pressed  "second to rightmost note for micromaestro"
     { powerpad_list_counter++;
      powerpad_list[powerpad_list_counter][0]= 12;
      powerpad_list[powerpad_list_counter][1]= 115;
     }

    // now lets sort our list in y major order (x first sort key y secondary sort key)
    // bubble sort is inefficient, but there's only going to be a couple of points here

   int swaps,temp;
   for (int pass=1;pass<powerpad_list_size;pass++)
  {  swaps=0;
     for (int i=1;i<powerpad_list_counter-1;i++)  
         if (  (powerpad_list[i][0] >  powerpad_list[i+1][0]) ||
               ((powerpad_list[i][0] == powerpad_list[i+1][0]) && (powerpad_list[i][1] >  powerpad_list[i+1][1]))
            ) {  swaps++;
                 temp = powerpad_list[i][0]; powerpad_list[i][0]=powerpad_list[i+1][0];powerpad_list[i+1][0]=temp;
                 temp = powerpad_list[i][1]; powerpad_list[i][1]=powerpad_list[i+1][1];powerpad_list[i+1][1]=temp;  // oops had a 0 instead of a 1
              }
      if (swaps==0) break;
   } // end bubblesort

     printf("POINT LIST SIZE=%x\n",powerpad_list_counter);
      for (int i=0;i<=powerpad_list_counter;i++) printf("POINT LIST %x: %x,%x\n",i,powerpad_list[i][0],powerpad_list[i][1]);

    }  // end building list

     powerpad_shift = 0x01<<14 |   // first two bits are 0 and 1 
                      ((reverse_8bits(powerpad_list[powerpad_list_counter][1])>>1)<<7)  |   // 7 bits of y coordinate LSB first
                      ((reverse_8bits(powerpad_list[powerpad_list_counter][0])>>1)<<0);}    // 7 bits of x coordinate LSB first

     printf("m_mypot0=%x   m_mypot1=%x ",m_mypot0->read()&0x7f,m_mypot1->read()&0x7f);
     printf("LOAD powerpad shift=%x , %s   y=%x  x=%x\n",powerpad_shift,std::bitset<16>(powerpad_shift).to_string().c_str(),reverse_8bits( ((powerpad_shift&(0x7f<<7))>>7)<<1),reverse_8bits((powerpad_shift&0x7f)<<1));

powerpad_clock = powerpad_clock_new;
powerpad_clear = powerpad_clear_new;
}



int a400_state::reverse_8bits(int x){  // little routine to reverse 8 bits
int retval=0;
for (int i=0;i<8;i++){retval |= ((x & (1 << (7-i)) ? (1 << i) : 0));}
printf("reverse bits %x %x\n", x, retval);
return retval;
}




#define JOYSTICK_DELTA          10
#define JOYSTICK_SENSITIVITY    50



        PORT_START("myanalog_0")
        PORT_BIT(0xff, 0x3c, IPT_PADDLE) PORT_SENSITIVITY(JOYSTICK_SENSITIVITY) PORT_KEYDELTA(JOYSTICK_DELTA) PORT_MINMAX(0x00,0x77) PORT_PLAYER(1) PORT_NAME("myanalog_0")

        PORT_START("myanalog_1")
        PORT_BIT(0xff, 0x3c, IPT_PADDLE) PORT_SENSITIVITY(JOYSTICK_SENSITIVITY) PORT_KEYDELTA(JOYSTICK_DELTA) PORT_MINMAX(0x00,0x77) PORT_PLAYER(2) PORT_NAME("myanalog_1")

        PORT_START("TEST_BUTTONS")
        PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("BUT1") PORT_CODE(KEYCODE_1_PAD)
        PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("BUT2") PORT_CODE(KEYCODE_2_PAD)
        PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("BUT3") PORT_CODE(KEYCODE_3_PAD)
        PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("BUT4") PORT_CODE(KEYCODE_4_PAD)
        PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("BUT5") PORT_CODE(KEYCODE_5_PAD)
        PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("BUT6") PORT_CODE(KEYCODE_6_PAD)
        PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME("BUT7") PORT_CODE(KEYCODE_7_PAD)
        PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON8 ) PORT_NAME("BUT8") PORT_CODE(KEYCODE_8_PAD)
        PORT_BIT( 0x00, IP_ACTIVE_LOW, IPT_UNKNOWN )





So a couple of notes:

First, the software is supposed to read the powerpad and check for any stuck points, so you should hold down the keypad 1 until this is done (picks up the "stylus").
I've used an analog input to represent the "finger" that is pressing.

Control of the software is pretty difficult since you're just "blind" clicking on different spots with the mouse since you can't see the mylar overlay.
So what you see is what I could do with random clicking.

The micromaestro shows "multitouch" with the mouse plus holding down the 5 key.


The "insert power pad" screen is when I accidentally reversed the sense bit.


And some pictures:

[Linked Image from i.imgur.com][Linked Image from i.imgur.com][Linked Image from i.imgur.com][Linked Image from i.imgur.com][Linked Image from i.imgur.com][Linked Image from i.imgur.com][Linked Image from i.imgur.com][Linked Image from i.imgur.com][Linked Image from i.imgur.com]

Re: c64 super sketch [Re: Golden Child] #116233 10/20/19 03:40 PM
Joined: Feb 2014
Posts: 354
G
Golden Child Offline OP
Senior Member
OP Offline
Senior Member
G
Joined: Feb 2014
Posts: 354
In searching about, I did find an a2r file of Logicmaster for Apple II, but this is a huge file made by applesauce. How would I convert this to a usable disk image?

LogicMaster - Disk 1, Side A.a2r
04-Apr-2019 18:23
18.8M

Re: c64 super sketch [Re: Golden Child] #116236 10/21/19 12:01 AM
Joined: Mar 2001
Posts: 16,371
R
R. Belmont Online Content
Very Senior Member
Online Content
Very Senior Member
R
Joined: Mar 2001
Posts: 16,371
A2R can be converted to .WOZ or .DSK with the AppleSauce program, which currently only runs on a recent modern Mac.

Re: c64 super sketch [Re: R. Belmont] #116238 10/21/19 12:58 AM
Joined: Feb 2014
Posts: 354
G
Golden Child Offline OP
Senior Member
OP Offline
Senior Member
G
Joined: Feb 2014
Posts: 354
I've got an older Mac (Core 2 Duo) but that probably isn't recent enough to run AppleSauce perhaps. Would you be kind enough to convert it for me if I send you the link?

I did manage to find a .woz image of Apple II BearJam! Huzzah!

I just had a quick look and it looks pretty simple:

It looks like it hits AN0 for the clock and AN1 for the clear, and c061 for the data bit and c063 for the sense bit. Now let's see if I can get it to work.

Code
556E: D0 FD    bne $556d
5570: AD 63 C0 lda RD63
5573: 10 0C    bpl $5581
5575: 20 D7 53 jsr $53d7
5578: E8       inx
5579: D0 F0    bne $556b
557B: 20 6C 45 jsr $456c
557E: 4C 69 55 jmp $5569
5581: AD 5B C0 lda SETAN1
5584: AD 5A C0 lda CLRAN1
5587: 20 B7 55 jsr $55b7
558A: 85 12    sta $12
558C: 20 B7 55 jsr $55b7
558F: 85 13    sta $13
5591: AD 59 C0 lda SETAN0
5594: AD 58 C0 lda CLRAN0



Code
55B7: A2 07    ldx #$07
55B9: A9 00    lda #$00
55BB: 85 1F    sta $1f
55BD: AD 5B C0 lda SETAN1
55C0: AD 5A C0 lda CLRAN1
55C3: AD 61 C0 lda RDBTN0
55C6: 0A       asl a
55C7: 66 1F    ror $1f
55C9: CA       dex
55CA: D0 F1    bne $55bd
55CC: A5 1F    lda $1f
55CE: 49 FF    eor #$ff
55D0: 4A       lsr a
55D1: 60       rts

Re: c64 super sketch [Re: Golden Child] #116240 10/21/19 01:58 AM
Joined: Mar 2001
Posts: 16,371
R
R. Belmont Online Content
Very Senior Member
Online Content
Very Senior Member
R
Joined: Mar 2001
Posts: 16,371
Yeah, I can convert if you send the link.

Re: c64 super sketch [Re: R. Belmont] #116243 10/21/19 01:16 PM
Joined: Feb 2014
Posts: 354
G
Golden Child Offline OP
Senior Member
OP Offline
Senior Member
G
Joined: Feb 2014
Posts: 354
Thanks, RB!

Inserting my powerpad code into the Apple 2 driver allows me to get past the title screens of BearJam and LogicMaster.


[Linked Image from i.imgur.com][Linked Image from i.imgur.com]
[Linked Image from i.imgur.com][Linked Image from i.imgur.com]

I'm not sure if it's working correctly yet in sending the proper data but it seems to do something.

I'm going to create a list of points and "click" on the location by using a combination of 2 keypad keys (there's 16 keys on the keypad so that should let me do 8x8= 64 button locations).

Page 4 of 6 1 2 3 4 5 6

Who's Online Now
4 registered members (Fake Shemp, Carbon, R. Belmont, 1 invisible), 145 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
ShoutChat Box
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Forum Statistics
Forums9
Topics8,710
Posts114,489
Members4,869
Most Online510
Aug 26th, 2019
Powered by UBB.threads™ PHP Forum Software 7.7.3