PSG Register

Date: 198x
Type: Program
Platform(s): TS 2068

Short program for editing the PSG (sound generator) register values.

Appears on

One of a series of library tapes. Programs on these tapes were renamed to a number series. This tape contained programs 20001 to 20050. These tapes were compiled by Tony Willing.

Gallery

PSG Register

Source Code

   10 REM PSG REGISTER PROGRAM
   11 REM 
   20 REM Set up
   21 REM 
   30 GO SUB 500
   40 REM 
   41 REM Loop
   42 REM 
  100 INPUT "Register?";r: IF r<0 OR r>14 THEN BEEP 1,10: GO TO 100
  110 PRINT AT r+4,12; FLASH 1;r
  120 INPUT "Value?";v: IF v<0 OR v>255 THEN BEEP 1,5: GO TO 110
  130 OUT 245,r: OUT 246,v: GO SUB 300
  140 PRINT AT r+4,12;r
  150 GO TO 100
  201 REM Print contents
  300 REM 
  302 REM 
  310 OUT 245,r: LET mod=IN 246: LET power=128: PRINT AT r+4,17;
  320 FOR x=0 TO 7: LET mod=mod-power: IF mod<0 THEN PRINT "0";: LET mod=mod+power: GO TO 340
  330 PRINT "1";
  340 LET power=power/2: NEXT x
  350 PRINT "  ";IN 246;"  ": RETURN 
  500 REM 
  501 REM Print screen
  502 REM 
  510 PAPER 1: BORDER 1: INK 6: CLS 
  520 PRINT TAB 2;"PSG REGISTRS";TAB 20;"CONTENTS": PRINT AT 2,0; INVERSE 1;"Function   No.";TAB 18;"Binary   Dec. ": PRINT 
  530 FOR y=0 TO 14: READ a$: PRINT a$;AT y+4,12;y: LET r=y: GO SUB 300: NEXT y
  540 RETURN 
  600 REM 
  601 REM String data
  602 REM 
  610 DATA "Ch.A Fine","   Coarse","Ch.B Fine","   Coarse","Ch.C Fine","   Coarse","Noise"
  620 DATA "Enable","Ch.A Ampl","Ch.B Ampl","Ch.C Ampl","Env.Fine","   Coarse","Env.Shape","Port"

People

No people associated with this content.

Scroll to Top