Multiboard

What have you built or do you want to design to go with your replica 1

Postby fsafstrom » Sep Thu 13, 2007 2:01 am

Mojoseph_12,
I made a short tutorial on how to control the 6551 on my project page.
Have a look at it and let me know if it useful or not...

The Project page now have 9 projects... ;-)
http://bamse.freehyperspace.com/
User avatar
fsafstrom
 
Posts: 154
Joined: Dec Tue 26, 2006 3:57 pm
Location: San Antonio, Texas

Postby vbriel » Sep Thu 13, 2007 6:50 am

Nice work,

I am working on a manual for the Multi I/O Board now. All features on the card appear to be working great! I should be able to start taking orders this weekend.

Kit price $75, Assembled $99

This board requires the 3 slot expander board or the new replica 1 to apple I adapter coming out this weekend.

Vince
User avatar
vbriel
Site Admin
 
Posts: 1184
Joined: Jul Tue 19, 2005 1:10 pm
Location: Ohio

Postby vbriel » Sep Fri 14, 2007 7:46 pm

Just a note, the prices above do not include the speakjet. I've decided to not sell it because you can just go to someplace like speechchips.com and buy them.

As far as basic goes, I have found the input locations and I'll try and post them as soon as possible. It would be easy to disassemble, write the serial code, reassemble somewhere like 6000 and then you could have a fully serial woz setup except for the programs in machine language that use the keyboard and video I/O.

Vince
User avatar
vbriel
Site Admin
 
Posts: 1184
Joined: Jul Tue 19, 2005 1:10 pm
Location: Ohio

Postby Mojoseph_12 » Sep Wed 19, 2007 11:53 pm

the ordering page says the multiboard is $79 but the post above says $75 which is it?
Last edited by Mojoseph_12 on Sep Thu 20, 2007 9:35 am, edited 1 time in total.
Mojoseph_12
 
Posts: 46
Joined: Jan Fri 05, 2007 4:07 pm
Location: New Mexico,USA

Postby fsafstrom » Sep Thu 20, 2007 2:17 am

[Updated with the code from Ken.]
My first crude attempt to disassemble Basic came up with two hits,

First, reading a char,
Code: Select all
$E003 AD 11 D0       LDA  $D011
$E006 10 FB          BPL  $E003
$E008 AD 10 D0       LDA  $D010
$E00B 60             RTS


Second, writing a char,
Code: Select all
$E3D5 2C 12 D0       BIT  $D012
$E3D8 30 FB          BMI  $E3D5
$E3DA 8D 12 D0       STA  $D012
$E3DD 60             RTS


And the code from Ken,
Code: Select all
$E86B 85 DC          STA  $DC
$E86D 84 DD          STY  $DD
$E86F 2C 11 D0       BIT  $D011
$E872 30 4F          BMI  $E8C3
$E874 18             CLC
$E875 69 03          ADC  #$03
$E877 90 01          BCC  $E87A


Is there more ???
Last edited by fsafstrom on Sep Thu 20, 2007 3:11 pm, edited 1 time in total.
User avatar
fsafstrom
 
Posts: 154
Joined: Dec Tue 26, 2006 3:57 pm
Location: San Antonio, Texas

Postby vbriel » Sep Thu 20, 2007 6:43 am

My notes show one more location at E86F.
User avatar
vbriel
Site Admin
 
Posts: 1184
Joined: Jul Tue 19, 2005 1:10 pm
Location: Ohio

Postby Kallikak » Sep Thu 20, 2007 6:46 am

I think there is probably at least one more place - because it tests for a keypress to interrupt a running program. You can use Krusader to disassemble from $E86B to find that one I think.

Code: Select all
E86B   85 DC       STA   $DC
E86D   84 DD       STY   $DD
E86F   2C 11 D0    BIT   $D011
E872   30 4F       BMI   $E8C3
E874   18          CLC   
E875   69 03       ADC   #$03
E877   90 01       BCC   $E87A
...

Ken
Kallikak
 
Posts: 172
Joined: Jan Sun 29, 2006 7:42 pm
Location: Sydney

Postby fsafstrom » Sep Thu 20, 2007 11:04 am

So all we need to do is adapt these to use ACIA... ;-)

Have a look at this piece of code,
Code: Select all
E86B   85 DC       STA   $DC
E86D   84 DD       STY   $DD
E86F   2C 11 D0    BIT   $D011
E872   30 4F       BMI   $E8C3
E874   18          CLC   
E875   69 03       ADC   #$03
E877   90 01       BCC   $E87A


I wonder what we could use in stead of BIT and BMI in this case ?

We need to test bit 3 in the ACIA status register (on my board $C003), if the bit is set, we have data ready to read...
User avatar
fsafstrom
 
Posts: 154
Joined: Dec Tue 26, 2006 3:57 pm
Location: San Antonio, Texas

Postby Kallikak » Sep Thu 20, 2007 5:12 pm

My first thought was that the "write a char" routine is also in the monitor, so you can convert BASIC to use the monitor routine instead and free up those 9 bytes for a test key press routine that tests bit 3 of $C003. Off the top of my head,
Code: Select all
PHA
LDA #$04
BIT $C003
PLA
RTS
will use 8 bytes and the bit test at $E86F can be replaced with a JSR. But this wont work because the code above the write a char relies on falling through, so we really only have 6 bytes free when we need 8.

(Edit: it also won't work because the PLA will bugger up the flags...)

However, the "read a char" routine at $E003 does not have this problem, and there is a read char routine in the Krusader part of ROM you could reuse to free up this chunk, but it is not fully compatible because it zeros the high bit and so character compares will fail. But, the the code from $E29E is only place that calls the read char routine, and it (by a wonderful stroke of luck!) is followed by two NOPs, so I think if we call the Krusader read char routine, then replace the two NOPs at $E2A1 and $E2A2 with ORA #$80 it should work.

If no one beats me to it, I'll have a go at this later this morning...

Ken
Last edited by Kallikak on Sep Fri 21, 2007 12:59 am, edited 1 time in total.
Kallikak
 
Posts: 172
Joined: Jan Sun 29, 2006 7:42 pm
Location: Sydney

Postby Kallikak » Sep Fri 21, 2007 12:23 am

Well substituting in the Krusader read char call works fine, so we definitely have from $E003 to $E00B free to play with. We could even have from $E000 to $E00B as long as you are prepared to remember a different start address for Basic - specifically $E2B0 (i.e. 3 bytes before the normal warm start address of $e2b3).

But I have not managed to get the BMI related patch right yet. To be more specific, to test the Apple 1 keyboard Woz uses the BIT instruction above, and that sets flags according to bits 7 and 6 in $D011 regardless of the value in the accumulator. But it is not so easy to test for bit 3. My best effort so far to both preserve the accumulator and the flags from the bit test needs 10 bytes - i.e. one too many. :-(

Here is some code to try though (remember to start BASIC from $E2B0 and substitute for $FEED the appropriate Krusader read char address)
Code: Select all
BITTST .M  $E000
;      BRK
       TAX
       LDA #$4
       BIT $C003
       PHP
       TXA
       PLP
       RTS
RDLINE .M  $E29E
       JSR $FEED
       ORA #$80
PATCH  .M  $E86F
       JSR BITTST
       BNE $E8C3



Still, it's fun to experiment. :-)

Ken
Kallikak
 
Posts: 172
Joined: Jan Sun 29, 2006 7:42 pm
Location: Sydney

Postby fsafstrom » Sep Fri 21, 2007 1:42 am

Here is a really crazy idea... 8)

The Multiboard have a 6522 and you could use a timer to generate an interrupt at regular interval.
The interrupt would read the 6551 and "emulate" the apple keyboard and screen but at a different address, say $0010...
Then just change $D010-$D012 in the apple basic to your emulated $0010-$0012 address and that's it...

Why make it easy when you can complicate things... :P
User avatar
fsafstrom
 
Posts: 154
Joined: Dec Tue 26, 2006 3:57 pm
Location: San Antonio, Texas

Postby Kallikak » Sep Fri 21, 2007 1:42 am

Got it!

Here is the patch in 9 bytes. I save A on the stack, load the byte at $C003, shift bit 3 into the carry, restore A and return. On return, the carry flag will still have the bit we require, so we can branch on the status of that bit with a BCS. As before, $FEED needs to be adjusted to the relevant Krusader_ACIA address for reading a character.

Code: Select all
BITTST .M  $E003
       PHA
       LDA $C003
       LSR
       LSR
       LSR
       PLA
       RTS
RDLINE .M  $E29E          CHECK
       JSR $FEED          ADDRESS!
       ORA #$80
PATCH  .M  $E86F
       JSR BITTST
       BCS $E8C3



Edit: Nope - that won't work :-( Need one more LSR. But there is a function in the Krusader code that does 4 LSRs, so that could be used to get it back to 3 bytes.

Ken
Last edited by Kallikak on Jan Tue 01, 2008 12:51 am, edited 2 times in total.
Kallikak
 
Posts: 172
Joined: Jan Sun 29, 2006 7:42 pm
Location: Sydney

Postby fsafstrom » Sep Fri 21, 2007 11:11 am

Kewl...

I knew you would figure it out... ;-)

Is there a Basic that I could load in RAM in stead of re-programming $E000 ?
That way it would be easier to try out all the fixes etc...

I might even start using Basic... 8)
User avatar
fsafstrom
 
Posts: 154
Joined: Dec Tue 26, 2006 3:57 pm
Location: San Antonio, Texas

Postby Kallikak » Sep Fri 21, 2007 7:03 pm

We could try running it through a relocating program. I had one written by Woz somewhere actually - will look. It just has to go through and fix up any absolute addresses - e.g. with JSR and JMP statements, and data references. Jump tables might cause some problems though...

Ken
Kallikak
 
Posts: 172
Joined: Jan Sun 29, 2006 7:42 pm
Location: Sydney

Postby Kallikak » Sep Fri 28, 2007 3:06 am

Here's a link to the relocating program I mentioned: http://homepage.mac.com/bobsc/aal/1982/aal8201.html#a3

Easiest thing would be to run it on an Apple II, else you have to muck about a bit. The trickiest thing is the routine to determine the length of the instruction. You could use the equivalent routine in Krusader if you like.

Ken
Kallikak
 
Posts: 172
Joined: Jan Sun 29, 2006 7:42 pm
Location: Sydney

PreviousNext

Return to Creation Room

Who is online

Users browsing this forum: No registered users and 4 guests

cron