chiark / gitweb /
check that point is on a board with points
authorian <ian>
Mon, 26 Dec 2005 23:34:09 +0000 (23:34 +0000)
committerian <ian>
Mon, 26 Dec 2005 23:34:09 +0000 (23:34 +0000)
detpic/morse.messages
detpic/points.asm

index 578985c6a79ac81e2918eaa8af0bbe47c335fe5f..1c0d2bc72ce76729517b1a3cd033d3db4603f348 100644 (file)
@@ -53,7 +53,6 @@ TI5                           ; for iwj
 # Unimplemented things
 UEC
 UER
-UPC
 UCT
 UCI
 UCP
@@ -88,6 +87,7 @@ RL    FSR0L                           ; POLARITY message too long
 PB     points:pointmsg                 ; Firing point when already busy
 PI     points:pointmsg,T3CON           ; Unexpected Timer 3 interrupt
 PU     points:pointmsg                 ; Firing nonexistent point
+PS     points:pointslave,points:pointmsg ; Firing point on nonexistent board
 PF     ::t                             ; Flash mentions point not on board
 PX                                     ; Host sent >2-byte POINT command
 PM                                     ; Firing point when master/CDU busy
index c194bb6673eae1236eb6b0d8b3c36bb9e2eb87ec..b7c02cd540ea7125b5524c7f3d5190572969c283 100644 (file)
@@ -20,6 +20,10 @@ ptix2latbit_section udata ptix2latbit
 pointslave             res     1       ; 00SS Sss0  ie slave*2 !
 pointmsg               res     1
 
+ udata 0x340
+slave2ptinfo           res     maxpics
+slave2ptinfo_anypoints equ     0
+
 ;======================================================================
 
 ;======================================================================
@@ -240,6 +244,23 @@ point_timer_init_endif_masterslave
 points_master_init
        clr_f   pointslave
        clr_f   pointmsg
+
+       load_tblptr picno2ptmap
+       mov_lfsr slave2ptinfo-1, 0
+       mov_lw  maxpics
+       mov_wf  t
+points_master_init_board_loop
+       clr_f   PREINC0
+       mov_lw  maxpoints/8
+points_master_init_byte_loop
+       tblrd_postinc_fixup
+       tst_f_ifnz TABLAT
+       bs_f    INDF0, slave2ptinfo_anypoints
+       dec_w_ifnz
+       bra     points_master_init_byte_loop
+       dec_f_ifnz t
+       bra     points_master_init_board_loop
+
        return
 
 ;----------------------------------------------------------------------
@@ -266,9 +287,8 @@ command_point
        and_lw  0x06                    ; W =           0000 0ss0
        ior_wff pointslave              ; pointslave =  00SS Sss0
 
-       panic   morse_UPC ; should check that this slave exists
        rr_fw   pointslave              ; W =           000S SSss
-       bra_nz  point_needwrite_yes
+       bra_nz  command_point_ifslave
 
        mov_fw  pointmsg
        goto    point_local_do
@@ -276,6 +296,15 @@ command_point
 command_point_badmsg panic morse_PX
 command_point_busy panic morse_PB
 
+;----------
+command_point_ifslave
+       mov_lfsr slave2ptinfo, 0
+       add_wff FSR0L
+       bt_f_if1 INDF0, slave2ptinfo_anypoints
+       goto    i2c_needwrite
+       ; oops:
+       panic   morse_PS
+
 ;----------
 points_needwrite
        rr_fw   pointslave              ; W =           000S SSss