changeset 1992:4f05cb56a8ec

Added MPI support code
author boisy
date Mon, 13 Feb 2006 12:30:30 +0000
parents b2c463319b9a
children d5e3d4f5c45a
files 3rdparty/p2mods/noice/noice.asm
diffstat 1 files changed, 35 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/3rdparty/p2mods/noice/noice.asm	Sun Feb 05 16:51:05 2006 +0000
+++ b/3rdparty/p2mods/noice/noice.asm	Mon Feb 13 12:30:30 2006 +0000
@@ -47,6 +47,10 @@
 rev            SET       $00
 edition        SET       1
 
+* If an MPI is being used, set RS232SLOT to slot value - 1 and set MPI to 1
+*MPI            EQU       1
+*RS232SLOT      EQU       3            slot 2
+
 FN_ERROR       EQU       $F0
 FN_SET_BYTES   EQU       $F9
 FN_RUN_TARGET  EQU       $FA
@@ -67,6 +71,9 @@
                ORG       0
 callregs       RMB       2
 firsttime      RMB       1
+               IFNE      MPI
+slot           RMB       1
+               ENDC
 combuff        RMB       cbsize
 size           EQU       .
 
@@ -507,23 +514,51 @@
 *
 * Note, this routine currently doesn't timeout
 llread                   
+               IFNE      MPI
+               lda       $FF7F
+               sta       slot,u
+               lda       #RS232SLOT
+               sta       $FF7F
+               ENDC
 r@             lda       A_STATUS            get status byte
                anda      #$08                mask rx buffer status flag
                beq       r@                  loop if rx buffer empty
                lda       A_RXD               get byte from ACIA data port
+               IFNE      MPI
+               pshs      b
+               ldb       slot,u
+               stb       $FF7F
+               puls      b,pc
+               ELSE
                rts       
+               ENDC
 
 * llwrite - Write one character to 6551
 *
 * Entry: A = character to write
 * Exit:  None
 llwrite                  
+               IFNE      MPI
+               pshs      d
+               ldb       $FF7F
+               stb       slot,u
+               ldb       #RS232SLOT
+               stb       $FF7F
+               ELSE
                pshs      a                   save byte to write
+               ENDC
 w@             lda       A_STATUS            get status byte
                anda      #$10                mask tx buffer status flag
                beq       w@                  loop if tx buffer full
+               IFNE      MPI
+               puls      d                   get byte
+               sta       A_TXD               save to ACIA data port
+               lda       slot,u
+               sta       $FF7F
+               ELSE
                puls      a                   get byte
                sta       A_TXD               save to ACIA data port
+               ENDC
                rts       
 
 * llterm - Terminate