[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

LONG - AppleWorks TimeOut SlotRegister



in article C916B328.14229%hughhood@earthlink.net, Hugh Hood at
hughhood@earthlink.net wrote on 11/27/10 1:07 PM:

> Since I'm primarily an AppleWorks nut, I'll make up and post a nifty
> switching macro to implement and document all this stuff.
> 
> It will be well commented so you non-AppleWorks guys can easily move it to
> BASIC or assembly should you need this type of thing.
> 
> Thanks, Antoine, for your earlier feedback and suggestions. I appreciate it.
> 
> 
>  
> 
> Hugh Hood


Fellas,

Here's the Source for a Menu-Driven TimeOut Application for AppleWorks 5.1
that will allow you to view and change (Only on a IIGS) the Internal
Port/External Card selections for slots 1 and 2 without having to change
them in the Control Panel and then re-booting.

If you use multiple printers (or are sending to a Unix machine serially) you
may have a need for the extra ports.

If someone is unable to compile this and save it as a TimeOut application,
(hint - use TimeOut Ultra Mac2Menu) please supply me an email address (and
the format you'd like) and I'll send it to you.

Remember, it is a _good_ idea to put the slot back to its original setting
after you are done with it. But, should you forget, (3) things bring back
the original settings:

(1) Assessing the Desk Manager/CDA Menu (oa-ctrl-esc)

(2) Re-booting (obviously)

(3) Quitting back to a GS/OS selector such as the Finder.


For the non AppleWorks guys, you can see the op codes and procedure required
from the comments. Let me know if you can't figure it out.



Hugh Hood



------------BEGIN APPLEWORKS SOURCE FILE------------------------------

Labels

\SA-A          Read Slot 1 & Slot 2 Status
\SA-B          Set Slot 1 "Internal Port"
\SA-C          Set Slot 1 "Your Card"
\SA-D          Set Slot 2 "Internal Port"
\SA-E          Set Slot 2 "Your Card"
\BA-L          Launch Default Macros


.SlotRegister

#value    =    V(0)           // Value of Bank $00 Slot Register
#E102Cx   =    E(0)           // Bank $E1 Page $02 Slot Low Byte
                              // Slot 1 = $C0 ; Slot 2 = $CC
#slotreg  =    $C02D          // Slot Register Softswitch Address
#slotone  =    S(1)           // State of Slot 1: Port = 0, Card = 1
#slottwo  =    S(2)           // State of Slot 2: Port = 0, Card = 1
#LDA      =    $A9            // LDA (Immediate) 65C02/816 Op Code
#LDAA     =    $AD            // LDA (Absolute) 65C02/816 Op Code
#STA      =    $8D            // STA (Absolute) 65C02/816 Op Code
#STAL     =    $8F            // STA (Long) 65C02/816 Op Code
#AND      =    $29            // AND 65C02/816 Op Code
#ORA      =    $09            // ORA 65C02/816 Op Code
#CLC      =    $18            // CLC 65C02/816 Op Code
#XCE      =    $FB            // XCE 65C02/816 Op Code
#REP      =    $C2            // REP 65C02/816 Op Code
#SEC      =    $38            // SEC 65C02/816 Op Code
#RTS      =    $60            // RTS 65C02/816 Op Code
#NOP      =    $EA            // RTS 65C02/816 Op Code
#BRK      =    $00            // RTS 65C02/816 Op Code

Start

     // Thanks to Bill Robbins for the initial idea.

<ba-]>:<all: sa-A :                     //
>!

<ba-[>:<all: sa-A :                     //
>!

A:<all: clear 255 :                     // clear all variables
   #value = peek #slotreg :             // read $C02D slot status register
   #slotone = .AndBits #value, $2:      // reads bit 1 : .and also works
   #slottwo = .AndBits #value, $4:      // reads bit 2 : .and also works
   $1 = "Slot 1 Status:  Your Card":
   $2 = "Slot 1 Status:  Internal Port":
   $3 = "Slot 2 Status:  Your Card":
   $4 = "Slot 2 Status:  Internal Port":
   $9 = "   @   ":                      // MouseText "@" = Solid Apple
   $5 = $1 + $9 + $3:
   $6 = $1 + $9 + $4:
   $7 = $2 + $9 + $3:
   $8 = $2 + $9 + $4:
   if #slotone = 2 and #slottwo = 4 .MsgBox $5,4,1 :
   endif :
   if #slotone = 2 and #slottwo = 0 .MsgBox $6,4,1 :
   endif :
   if #slotone = 0 and #slottwo = 4 .MsgBox $7,4,1 :
   endif :
   if #slotone = 0 and #slottwo = 0 .MsgBox $8,4,1 :
   endif :
   .MacroNames : goto SA-A :            // goto allows MacroNames to work
>!

B:<all:                                 // Slot 1 Internal Port
   #E102Cx = $C0 :
   sa-G :                               // Bank $E1 Routine
   jsr $900 :
   sa-H :                               // $00/C02D Routine
   jsr $900 :
   sa-A :
>!

C:<all:                                 // Slot 1 Your Card
   #E102Cx = $C0 :
   sa-G :                               // Bank $E1 Routine
   jsr $900
   sa-I :                               // $00/C02D Routine
   jsr $900 :
   sa-A :
>!

D:<all:                                 // Slot 2 Internal Port
   #E102Cx = $CC :
   sa-G :                               // Bank $E1 Routine
   jsr $900 :
   sa-J :                               // $00/C02D Routine
   jsr $900 :
   sa-A :
>!

E:<all:                                 // Slot 2 Your Card
   #E102Cx = $CC :
   sa-G :                               // Bank $E1 Routine
   jsr $900
   sa-K :                               // $00/C02D Routine
   jsr $900 :
   sa-A :
>!

G:<asr:                                 // allows internal initialization
   x = $900 :                           // location for machine language
   poke x, #CLC :                       // prep for native 65C816 mode
   x = x + 1 :
   poke x, #XCE :                       // now in native 65C816 mode
   x = x + 1 :
   poke x, #REP : poke x + 1, $30 :     // 16 bit registers
   x = x + 2 :
   poke x, #LDA : poke x + 1, $00 :     // 'Printer Port' = $00
   poke x + 2, $00 :                    // 'Modem Port' = $01
   x = x + 3 :                          // 'AppleTalk' = $02
                                        // 'Your Card' = $03
   poke x, #STAL :                      // store for internal firmware
   poke x + 1, #E102Cx :                // $C0 (Slot 1); $CC (Slot 2)
   poke x + 2, $02 : poke x + 3, $E1 :  // {has no effect on firmware
   x = x + 4 :                          //  resident in external card}
   poke x, #SEC :                       // prep for emulation change
   x = x + 1 :
   poke x, #XCE :                       // now in 65C02 emulation mode
   x = x + 1 :
   poke x, #RTS :                       // Back to AppleWorks
   x = x + 1 :
   poke x, #BRK : poke x + 1, #BRK :    // shows End
   poke x + 2, #BRK : poke x + 3, #BRK :
                                        // optional routines follow
>!

H:<asr:                                 // Set Slot 1 Internal Port
   y = $900 :                           // location for machine language
   poke y, #LDAA : poke y + 1, $2D :    // read current Slot Register
   poke y + 2, $C0 :
   y = y + 3 :
   poke y, #AND : poke y + 1, $FD       // 1111101 (Force Slot 1 Low)
   y = y + 2 :
   poke y, #NOP :                       // improves monitor listing
   y = y + 1 :
   poke y, #STA : poke y + 1, $2D :     // store new Slot Register
   poke y + 2, $C0 :
   y = y + 3 :
   poke y, #RTS :                       // Back to AppleWorks
   y = y + 1 :
   poke y, #BRK : poke y + 1, #BRK :    // shows End
   poke y + 2, #BRK : poke y + 3, #BRK :
>!

I:<asr:                                 // Set Slot 1 Your Card
   y = $900 :                           // location for machine language
   poke y, #LDAA : poke y + 1, $2D :    // read current Slot Register
   poke y + 2, $C0 :
   y = y + 3 :
   poke y, #ORA : poke y + 1, $02       // 0000010 (Force Slot 1 High)
   y = y + 2 :
   poke y, #NOP :                       // improves monitor listing
   y = y + 1 :
   poke y, #STA : poke y + 1, $2D :     // store new Slot Register
   poke y + 2, $C0 :
   y = y + 3 :
   poke y, #RTS :                       // Back to AppleWorks
   y = y + 1 :
   poke y, #BRK : poke y + 1, #BRK :    // listing shows End
   poke y + 2, #BRK : poke y + 3, #BRK :
>!

J:<asr:                                 // Set Slot 2 Internal Port
   y = $900 :                           // location for machine language
   poke y, #LDAA : poke y + 1, $2D :    // read current Slot Register
   poke y + 2, $C0 :
   y = y + 3 :
   poke y, #AND : poke y + 1, $FB       // 1111011 (Force Slot 2 Low)
   y = y + 2 :
   poke y, #NOP :                       // improves monitor listing
   y = y + 1 :
   poke y, #STA : poke y + 1, $2D :     // store new Slot Register
   poke y + 2, $C0 :
   y = y + 3 :
   poke y, #RTS :                       // Back to AppleWorks
   y = y + 1 :
   poke y, #BRK : poke y + 1, #BRK :    // shows End
   poke y + 2, #BRK : poke y + 3, #BRK :
>!

K:<asr:                                 // Set Slot 2 Your Card
   y = $900 :                           // location for machine language
   poke y, #LDAA : poke y + 1, $2D :    // read current Slot Register
   poke y + 2, $C0 :
   y = y + 3 :
   poke y, #ORA : poke y + 1, $04       // 0000100 (Force Slot 2 High)
   y = y + 2 :
   poke y, #NOP :                       // improves monitor listing
   y = y + 1 :
   poke y, #STA : poke y + 1, $2D :     // store new Slot Register
   poke y + 2, $C0 :
   y = y + 3 :
   poke y, #RTS :                       // Back to AppleWorks
   y = y + 1 :
   poke y, #BRK : poke y + 1, #BRK :    // listing shows End
   poke y + 2, #BRK : poke y + 3, #BRK :
>!

<BA-L>:<all: Launch "seg.um":>!         // Launch Default Macros

------------END APPLEWORKS SOURCE FILE------------------------------