#Periodic ARexx
2 messages in this thread
The FutureSound code looks kinda exactly like this:
PROCEDURE ReadFuture(buf:ADDRESS;len:LONGINT;rec_timer:LONGCARD);
TYPE
MySet = SET OF [0..7]; VAR
MyBuf : POINTER TO CHAR;
port_data : POINTER TO CHAR;
data_direction : POINTER TO CHAR;
int_control : POINTER TO MySet(*POINTER TO SET OF [0..7]*);
timera_low : POINTER TO CHAR;
timera_high : POINTER TO CHAR;
control_a : POINTER TO CHAR;
control_b : POINTER TO CHAR;
timerb_low : POINTER TO CHAR;
timerb_high : POINTER TO CHAR;
timeBlow,timeBhigh : CHAR;
Length : LONGCARD; BEGIN
rec_timer :=716D DIV (rec_timer DIV 1000D);
port_data := ADDRESS(PORT_DATA);
data_direction := ADDRESS(DATA_DIRECTION);
int_control := ADDRESS(INT_CONTROL);
timera_low := ADDRESS(TIMERA_LOW);
timera_high := ADDRESS(TIMERA_HIGH);
control_a := ADDRESS(CONTROL_A);
timerb_low := ADDRESS(TIMERB_LOW);
timerb_high := ADDRESS(TIMERB_HIGH);
control_b := ADDRESS(CONTROL_B);
timeBhigh := timerb_high^;
timeBlow := timerb_low^;
(* Say goodbye to the interrupts and hope we survive *)
Disable();
(* Set port for all input *)
data_direction^ := CHAR(00H);
(* Set timer prescaler *)
(* upper lower bytes *)
timeBlow := CHAR(rec_timer) (*1*);
timeBhigh := CHAR(rec_timer DIV 256D) (*0*);
timerb_low^ := timeBlow ;
timerb_high^ := timeBhigh ;
(* Set the interrupt control Mask *)
int_control^ := MySet(BITSET{7,1})(*82H*);
(* Set counter control Register *)
control_b^ := CHAR(01H);
Length := LONGCARD(len+LONGINT(buf));
MyBuf := buf;
WHILE (LONGCARD(MyBuf)< Length) DO
REPEAT
UNTIL ( (1 IN int_control^));
MyBuf^ := CHAR(INTEGER(port_data^)-127);
INC(ADDRESS(MyBuf));
END;
rec_timer := 256D;
timeBlow := CHAR(rec_timer) (*1*);
timeBhigh := CHAR(rec_timer DIV 256D) (*0*);
timerb_low^ := timeBlow ;
timerb_high^ := timeBhigh ;
Enable(); END ReadFuture;
I _think_ that's the code I have, only I have it in C and in asm. The
question is, is there anything that happens BEFORE that to tell the
futuresound that it's "on", or does the futuresound do the incrediobly
unfreindly thing of driving the AMiga's port ALL the time (even when the
machine is in OUTPUT mode, for instance) ??? btw – C or asm is a much
better choice – not to be ungrateful but my modula is pretty weak now, and
if I could only push it the REST of the way out of the few braincells it
still occupies I'd be quite happy :*) Remember, I'm one of those 'c/asm'
snobs. :*)))