Path: csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Benoit0123 Newsgroups: comp.sys.apple2.programmer Subject: A fix for the Uthernet II manual and a tiny enhancement for the detection routine Date: Wed, 9 Mar 2016 14:36:10 -0000 (UTC) Organization: Mac GUI Lines: 98 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Wed, 9 Mar 2016 14:36:10 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="ac9e0e4d7dd3957fb97803ee6801bab8"; logging-data="7164"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/CStPMWPwGCX8Qz3nyO+GZ" User-Agent: Mac GUI Usenet Cancel-Lock: sha1:XgCR4p4IRV9ScVkbl7a6LQNglk4= Xref: csiph.com comp.sys.apple2.programmer:2456 I've got a look at the Uthernet 2 manual, and noted some discrepancy within the published listing. Despite the fact that the WDATA was equated to $C0C7 value within the listing, the instruction STA WDATA to write to the data port was assembled as 8D 07 C0 (for instance at lines 89 and 106 page 28). Here is a subroutine that tries to detect the UII card within an Apple 2. The changes from the one published is that it automatically skips all Disk 2 interface cards (detected by a checksum routine on the Cnxx ROM space). and also skips any card with a firmware entry point as the UII card dos'nt have any at this time. The checked bytes are at offsets: 06 (value 38) 07 (value 18) and 0B (value 01). * Routine pour deviner ou se cache la carte Uthernet II AUXPTR EQU $06 SLOT EQU $FE SLOT16 EQU $FF YMODR = $85 Offset to Wizchip mode register COUT1 EQU $FDF0 ORG $0300 JSR CHKSLTS BCS :0 LDA #MESSOK LDY #>MESSOK JSR PRINT LDA SLOT ORA #$B0 JSR COUT1 LDA #$8D JMP COUT1 :0 LDA #MESSNOK LDY #>MESSNOK PRINT STA AUXPTR STY AUXPTR+1 LDY #0 ]LOOP LDA (AUXPTR),Y BEQ :0 JSR COUT1 INY BNE ]LOOP Always :0 RTS MESSOK HEX 8D ASC "FOUND A UII CARD IN SLOT #",00 MESSNOK HEX 8D ASC "NO UII CARD DETECTED",8D,00 CHKSLTS LDA #0 STA AUXPTR LDA #$C7 STA AUXPTR+1 AND #7 STA SLOT ]LOOP1 LDX #MVAL-MOFFST-1 ]LOOP LDY MOFFST,X LDA (AUXPTR),Y CMP MVAL,X BNE :1 DEX BPL ]LOOP ]NEXT DEC AUXPTR+1 DEC SLOT BPL ]LOOP1 SEC RTS * No firmware card found in this slot: good! * Is it a drive II controler card? :1 LDA #0 TAX TAY ]LOOP ADC (AUXPTR),Y BCC *+3 INX INY BNE ]LOOP CMP #$C2 ;$7BC2 is the checksum for DII interface cards BNE *+6 CPX #$7B BEQ ]NEXT LDA AUXPTR+1 LUP 4 ASL --^ STA SLOT16 ORA #YMODR TAY LDA #$80 STA $BFFF,Y LDA #3 STA $BFFF,Y CMP $BFFF,Y BNE ]NEXT CLC RTS MOFFST HEX 06070B MVAL HEX 381801 -- Growing old is mandatory.. growing up is optional.. But the other way round is as true.