Random game
Random software
Random game
  • Entry name:
     GTIA DEMO - SoftSide issue #40 
  • Category:
    Graphics
  • Publisher/Developer:
    SoftSide Publications
  • Year:
    1983
  • Code:
    Alan J. Zett
  • Programming language:
    Atari BASIC
source: GTIA DEMO - SoftSide issue #40 GTIA DEMO - SoftSide issue #40
Listing 1
100 GRAPHICS 24:POKE 712,0:POKE 559,0
110 DL=PEEK(560)+PEEK(561)*256+4
120 POKE DL-1,71:POKE DL+2,134
130 POKE DL+3,2:POKE DL+4,130
140 FOR X=5 TO 95:POKE DL+X,15:NEXT X:FOR X=98 TO 158:POKE DL+X,15:NEXT X:POKE DL+95,79:POKE DL+159,65:M=1663
150 POKE DL+160,PEEK(560):POKE DL+161,PEEK(561):POKE DL+55,143:POKE DL+106,143:POKE DL+108,143:POKE DL+132,143
160 M=M+1:READ D:IF D=999 THEN 500
170 POKE M,D:GOTO 160
300 DATA 216,72,138,72,174,195,6,189
310 DATA 183,6,201,0,208,12,189,189
320 DATA 6,141,10,212,141,24,208,76
330 DATA 163,6,189,189,6,141,10,212
340 DATA 141,26,208,189,183,6,141,27
350 DATA 208,232,224,6,208,2,162,0
360 DATA 142,195,6,104,170,104,64
400 DATA 0,64,192,192,0,0
410 DATA 0,0,8,0,0,148,0,999
500 POKE 512,128:POKE 513,6
510 POKE 54286,192:POKE 559,34
520 POKE 87,0:POSITION 0,0:? "     gtia DEMO"," softside issue #40":? "    EXPLORING THE ATARI FRONTIER"
530 POKE 752,1:? "    GTIA DISPLAY LIST INTERRUPTS":POKE 87,9:FOR Y=3 TO 52:COLOR INT(Y/4):PLOT 0,Y:DRAWTO 79,Y
540 NEXT Y:POKE 87,11:FOR Y=53 TO 102:COLOR INT((Y-53)/3):PLOT 0,Y:DRAWTO 79,Y:NEXT Y
550 POKE 87,8:Y=99:A=0:FOR X=15 TO 319 STEP 64:GOSUB 580:NEXT X
560 COLOR 1:PLOT 0,143:DRAWTO 319,143:FOR X=0 TO 315:PLOT X+2,-SIN(X/25)*12+143:NEXT X
570 GOTO 570
580 COLOR 1:FOR ZA=0 TO 10:FOR AZ=0 TO ZA STEP 2:PLOT X+15+AZ,Y-ZA+25:PLOT X+15-AZ,Y-ZA+25:NEXT AZ:NEXT ZA
590 FOR ZA=11 TO 15:FOR AZ=0 TO 10 STEP 2:PLOT X+15+AZ,Y-ZA+25:PLOT X+15-AZ,Y-ZA+25:NEXT AZ:NEXT ZA
600 Z=-2:FOR ZA=16 TO 18:Z=Z+2:FOR AZ=Z TO 8-Z STEP 2:PLOT X+15+AZ,Y-ZA+25:PLOT X+15-AZ,Y-ZA+25:NEXT AZ:NEXT ZA
610 RETURN	
Listing 2
               1000        .OR $0680 
               1010        .TA $4000 
               1020 * 
               1030 * DEFINE SYSTEM EQUATES 
               1040 * 
D01B-          1050 PRIOR  .EQ $0018 ;GTIA MODE ENABLE REGISTER. 
D40A-          1060 WSYNC  .EQ $040A ;WAIT VERTICAL SYNC REGISTER. 
D01B-          1070 COLPF2 .EQ $0018 ;CTIA BACKGROUND COLOR REGISTER. 
D018-          1080 COLBK  .EQ $001A ;GTIA BACKGROUND COLOR REGISTER. 
               1090 * 
               1100 * START OF GTIA HANDLER 
               1110 * 
0680- D8       1120 START  CLD         ;CLEAR THE DECIMAL MODE. 
0681- 48       1130        PHA         ;SAVE THE 'A' REGISTER ON STACK. 
0682- 8A       1140        TXA         ;TRANSFER 'X' TO 'A' AND 
0683- 48       1150        PHA         ; AND SAVE IT ON THE STACK ALSO. 
0684- AE C3 06 1160        LDX STORE   ;GET COLOR TABLE OFFSET POINTER. 
0687- BD B7 06 1170        LDA MODE,X  ;GET CTIA/GTIA STATUS MODE. 
068A- C9 00    1180        CMP #$00    ;CHECK FOR CTIA MODE. 
068C- D0 0C    1190        BNE GTIA    ;60 TO GTIA ROUTINE IF NOT. 
068E- BD BD 06 1200 CTIA   LDA COLOR,X ;GET COLOR TO REPLACE. 
0691- 8D 0A D4 1210        STA WSYNC   ;WAIT FOR VERTICAL SYNC. 
0694- 8D 18 D0 1220        STA COLPF2  ;STORE NEW COLOR IN REGISTER. 
0697- 4C A3 06 1230        JMP CHECK   ;JUMP TO CHECK ROUTINE. 
069A- BD BD 06 1240 GTIA   LDA COLOR,X ;GET COLOR TO REPLACE. 
069D- 8D 0A D4 1250        STA WSYNC   ;WAIT FOR VERTICAL SYNC. 
06A0- 80 1A D0 1260        STA COLBK   ;STORE NEW COLOR IN REGISTER. 
06A3- BD B7 06 1270 CHECK  LDA MODE,X  ;GET CTIA/GTIA MODE STATUS. 
06A6- 8D 1B D0 1280        STA PRIOR   ;STORE IT INTO THE REGISTER. 
06A9- E8       1290        INX         ;BUMP COLOR TABLE POINTER. 
06AA- E0 06    1300        CPX #$06    ;CHECK FOR END OF TABLE.
06AC- D0 02    1310        BNE OUT     ;IF NOT, JUMP OUT.
06AE- A2 00    1320        LDX #$00    ;RESTORE COLOR TABLE POINTER.
06B0- 8E C3 06 1330 OUT    STX STORE   ;SAVE CURRENT POINTER FOR 
06B3- 68       1340        PLA         ; NEXT DLI, GET AND RESTORE
06B4- AA       1350        TAX         ; THE 'X' REGISTER FROM THE 
06B5- 68       1360        PLA         ; STACK, RESTORE THE 'A'
06B6- 40       1370        RTI         ; REGISTER AND EXIT.
               1380 * 
               1390 * DLI COLOR TABLE AND POINTER 1400 * 
06B7- 00 40 CO 
06BA- C0 00 00 1410 MODE   .HS 0040C0C00000 
06BD- 00 00 08 
06C0- 00 00 94 1420 COLOR  .HS 000008000094 
06C3- 00       1430 STORE  .HS 00	

This is non-commercial site, its content is based on Atari 8-bit home computer contents and references.
If you feel your rights are violated by showing/using any part of contents of your product represented on this page, please contact me immediatelly so I can remove it!