2020-11-03 10:53:57 +11:00
|
|
|
( Routines for interacting with SMS controller ports.
|
2020-11-09 00:43:24 +11:00
|
|
|
Requires CPORT_MEM, CPORT_CTL, CPORT_D1 and CPORT_D2 to be
|
|
|
|
defined. CPORT_MEM is a 1 byte buffer for CPORT_CTL. The last
|
|
|
|
3 consts will usually be 0x3f, 0xdc, 0xdd. )
|
2020-11-03 10:53:57 +11:00
|
|
|
( mode -- set TR pin on mode a on:
|
|
|
|
0= output low 1=output high 2=input )
|
|
|
|
CODE _TRA! HL POP, chkPS, ( B0 -> B4, B1 -> B0 )
|
|
|
|
L RR, RLA, RLA, RLA, RLA, L RR, RLA,
|
2020-11-09 00:43:24 +11:00
|
|
|
0x11 ANDi, L A LDrr, CPORT_MEM LDA(i),
|
|
|
|
0xee ANDi, L ORr, CPORT_CTL OUTiA, CPORT_MEM LD(i)A,
|
2020-11-03 10:53:57 +11:00
|
|
|
;CODE
|
|
|
|
CODE _THA! HL POP, chkPS, ( B0 -> B5, B1 -> B1 )
|
|
|
|
L RR, RLA, RLA, RLA, RLA, L RR, RLA, RLA,
|
2020-11-09 00:43:24 +11:00
|
|
|
0x22 ANDi, L A LDrr, CPORT_MEM LDA(i),
|
|
|
|
0xdd ANDi, L ORr, CPORT_CTL OUTiA, CPORT_MEM LD(i)A,
|
2020-11-03 10:53:57 +11:00
|
|
|
;CODE
|