TIP: Click on subject to list as thread! ANSI
echo: apple
to: comp.sys.apple2
from: schmidtd
date: 2009-01-12 23:24:18
subject: Re: Apple Game Server - updates

On Jan 13, 1:18=A0am, BLuRry  wrote:
> > The serial port part isn't particularly hard, having done that kind of
> > thing before. :-) =A0I started that work a while ago, but got bogged
> > down in trying to detect (remotely, automatically) which kind of Apple
> > is at the other end. =A0It would be a whole lot easier if one just
> > picked ahead of time which kind of device one were talking to.
>
> You wouldn't happen to have a sample of a polling read loop would
> you?
Why, yes.  From:
http://adtpro.cvs.sourceforge.net/viewvc/adtpro/adtpro/client/src/prodos/se=
rial/iigsscc.asm?view=3Dmarkup

;---------------------------------------------------------
; ZCCG - Get a character from the SCC serial port (XY unchanged)
;---------------------------------------------------------

ZCCG:
	LDA GSCMDB	; DUMMY READ TO RESET 8530 POINTER TO 0

pollSCC:
	lda $C000
	cmp #CHR_ESC	; Escape =3D abort
	bne SCCNEXT
	jmp PABORT

SCCNEXT:
	LDA GSCMDB	; READ 8530 READ REGISTER 0
	AND #$01        ; BIT 0 MEANS RX CHAR AVAILABLE
	cmp #$01
	bne pollSCC

			;  THERE'S A CHAR IN THE 8530 RX BUFFER
pullIt:
	LDA #$01	;  SET 'POINTER' TO rr1
	STA GSCMDB
	LDA GSCMDB	;  READ THE 8530 READ REGISTER 1
	AND #$20	;  CHECK FOR bit 5=3DRX OVERRUN
	BEQ itsOK
	ldx #$30	; Clear Receive overrun
	stx GSCMDB
	ldx #$00
	stx GSCMDB

itsOK:
	LDA #$08	;  WE WANT TO READ rr8
	STA GSCMDB	;  SET 'POINTER' TO rr8
	LDA GSCMDB	;  READ rr8
	rts

Where:
PABORT =3D (some abort code)
GSCMDB	=3D $C038
CHR_ESC =3D  $9B

> Also, on a similar note (i have now 2 hours of 65816 asm experience
> under my belt), if I enable emulation mode that automatically sets the
> accumulator and index registers to 8-bit right?

I suppose so.  The GS starts up in 8-bit mode under normal DOSes, so I
don't generally worry about 65816 mode, myself.  It must start up that
way too, since serial bootstrapping operations work normally on power-
up.
--- SBBSecho 2.12-Win32
* Origin: Derby City Gateway (1:2320/0)
SEEN-BY: 10/1 3 34/999 120/228 123/500 140/1 222/2 226/0 236/150 249/303
SEEN-BY: 250/306 261/20 38 100 1404 1406 1410 1418 266/1413 280/1027 320/119
SEEN-BY: 393/11 396/45 633/260 267 712/848 800/432 801/161 189 2222/700
SEEN-BY: 2320/100 105 200 2905/0
@PATH: 2320/0 100 261/38 633/260 267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.