xbios equ 14 bios equ 13 * program start shell section text opt a+ dostart lea mystack,a7 my stack pointer **** do appl_init move.l #appl_init,aespb bsr gem move.w intout,apid move.w apid,intin move.l #rocp,addr_in move.l #menu_register,aespb bsr gem move.w intout,acc_id bpl prg_start move.l #alert,addr_in alert box info move.w #1,intin default button number move.l #form_alert,aespb bsr gem display the alert box bra wait ************************************* * program start area * ************************************* prg_start move.w #140,intin read the desktop.inf file move.l #buffer,addr_in move.l #shel_get,aespb bsr gem lea buffer,a5 f1 cmp.b #"#",(a5)+ find the beginning of the information bne f1 * * * SET THE RS232 parameters * * lea b_ascii,a1 baud ascii address to a1 move.w #-1,d0 offset pointer (-1) move.b 2(a5),d2 move desktop baud ascii value to d2 for comparison loop1 tst.b (a1) beq bad_baud addq.w #1,d0 increment offset counter cmp.b (a1)+,d2 check for equality bne loop1 branch if not equal move.w d0,d7 save baud rate value in d7 bra good_baud bad_baud move.w #-1,d7 else, don't change baud rate good_baud clr.w d6 set up for CTS/RTS move.b 5(a5),d6 get the CTS/RTS byte from Desktop.INF sub.w #"0",d6 subtract ascii offset move.l #-1,d0 move.l d0,-(sp) don't change MFP registers move.l d0,-(sp) ditto move.w d6,-(sp) set CTS/RTS move.w d7,-(sp) baud rate move.w #15,-(sp) opcode for configure RS232 trap #xbios lea 14(sp),sp reset stack pointer * * * SET THE PRINTER parameters * * f2 cmp.b #"#",(a5)+ find the next info line bne f2 addq #1,a5 point to first of printer set bits clr d7 move d7,d6 clr 2 registers move.w #5,d0 counter register loop2 asl.w #1,d7 move.b (a5)+,d6 sub.w #"0",d6 add d6,d7 set correct bits in printer config dbra d0,loop2 move.w d7,-(sp) move the config to the stack move.w #33,-(sp) printer config opcode trap #xbios addq.w #4,sp clean up stack f3 cmp.b #"#",(a5)+ next..... bne f3 addq #1,a5 a5 now points to beginning of color table move.l a5,-(sp) hold beginning of line on stack move.w #4,-(sp) get the resolution trap #xbios addq #2,sp clean up stack (d0 contains resolution) lea c_table,a3 table of color table info lea color_counter,a4 lsl.w #1,d0 word offset for the resolution color counter move.w 0(a4,d0.w),d7 d7=counter clr d6 d6=offset pointer ***** set the desktop colors color_loop clr d4 d4=color value of above register move.w #2,d2 loop counter cloop1 move.b (a5)+,d0 sub.b #"0",d0 add.b d0,d4 asl.w #4,d4 dbra d2,cloop1 loop until RGB values are in d4 asr.w #4,d4 reset to correct value move.w d4,-(sp) set the color value move.w (a3)+,d6 move.w d6,-(sp) set the register # move.w #7,-(sp) color set opcode trap #xbios addq #6,sp clear stack dbra d7,color_loop until all colors are done ******** set the mouse click rate move.l (sp)+,a5 restore line beginning to a5 add #48,a5 point to mouse info clr.w d0 cleared, just in case move.b (a5)+,d0 get mouse click rate sub.b #"0",d0 subtract ascii offset move.w d0,intin save double click rate move.w #1,-(sp) move.l #evnt_dclick,aespb bsr gem set the mouse double click rate ******* set the key click, bell sounds as necessary move.l a5,addr_out save desktop info pointer pea click_routine address of supervisor routine to execute move.w #38,-(sp) trap #xbios addq.l #6,sp ******* set the blitter chip loop3 cmp.b #"E",(a5)+ find blitter info bne loop3 clr.w d0 move.b 4(a5),d0 get blitter info sub.b #"0",d0 subtract ascii offset move.w d0,-(sp) move value to stack move.w #64,-(sp) set/reset blitter as necessary trap #xbios addq #4,sp wait move.l #msg_buf,addr_in set up message buffer move.l #evnt_message,aespb set control array bsr gem wait for message lea msg_buf,a0 get message type move.w (a0),d0 cmp.w #40,d0 accessory call? bne wait move.w 8(a0),d0 get accessory id cmp.w acc_id,d0 is it our accessory? bne wait not ours, wait some more bra prg_start it's ours...do your thing ****** supervisor mode key click routine click_routine move.l addr_out,a5 get our old pointer register move.l #$484,a4 address of click/bell move.w (a4),d0 get old value move.b (a5)+,d1 get desktop ascii value for click sub.b #"0",d1 subtract ascii offset move.b (a5)+,d2 get desktop ascii value for bell sub.b #"0",d2 subtract ascii value asl.w #2,d2 correct bit position add.b d2,d1 set/clear as necessary andi.w #$FaFF,d0 mask out old click/bell values asl.w #8,d1 or d1,d0 set as necessary move.w d0,(a4) store in protected memory rts *********************************************************************** gem move.l #aespb,d1 move.w #200,d0 magic number trap #2 rts section data **** data statements....don't add anything above current_handle even * GEM LIBRARIES appl_init dc.w 10,0,1,0,0 form_alert dc.w 52,1,1,1,0 shel_get dc.w 122,1,1,1,0 evnt_dclick dc.w 26,2,1,0,0 evnt_message dc.w 23,0,1,1,0 menu_register dc.w 35,1,1,1,0 aespb dc.l control,global,intin,intout,addr_in,addr_out even b_ascii dc.b '4015678293:;<=>?',0 color_counter dc.w 15,3,1 *# of colors (-1) to do for each resolution c_table dc.W 0,15,1,2,4,6,3,5,7,8,9,10,12,14,11,13 ROCP dc.b " ROCP ",0 alert dc.b "[1][ ROCP| not| Installed][ Rats ]",0 section bss *** bss section even msg_buf ds.w 8 message buffer current_handle ds.w 1 acc_id ds.w 1 control ds.w 30 intin ds.w 16 intout ds.w 10 global ds.w 30 addr_out ds.l 2 addr_in ds.l 2 apid=global+2 rollout ds.l 16 register save area buffer ds.b 140 ds.w 256 mystack ds.w 10 underflow.... end_bss