oldcomputernerd.com/md/Atari/entries/Action-language-walkthrough.md

8.6 KiB

Action! Language Walk-Through

Video Series

This series is ongoing. It began as an attempt to teach myself Action!, but has evolved into a continuous thing. My next extension to this project will involve Thomas Cherryholmes Fujinet! Keep an eye on this page, as I will be adding explanations, code samples, and other resource links here, to support the series.


Print the Action! Language Logo


; CIS Notice:
;  
; I am providing the program for you
; to look at and maybe help you get
; started with ACTION!.  It was
; written 'quick and dirty' and as
; such does not have many comments
; and is not the best of code in many
; places.  Feel free to show it to
; anyone you like as long as you keep
; the copyright notice.

; In case you are interested, this is
; the company logo for Action
; Computer Services (ACS).

;- Clinton Parker 70435,625

; PS: Hit ESC to exit program


; Copyright 1983 by Action Computer Services

; last modified April 13, 1983

MODULE ; LOGO.ACT

DEFINE RTI = "$40",
  PHA = "$48",
  PLA = "$68",
  TXA = "$8A",
  TAX = "$AA",
  TYA = "$98",
  TAY = "$A8"

BYTE start
BYTE ARRAY display
CARD ARRAY yLoc(96)


PROC NMI()
  BYTE color, cnt
  BYTE COLPF1=$D017, WSYNC=$D40A,
    VCOUNT=$D40B, COLPF2=$D018,
    COLPF0=$D016
  BYTE ARRAY col(0)=[$68 $C $96 $38]

  [PHA TXA PHA TYA PHA]

  IF VCOUNT=7 THEN
    color = start
    start = start - 1
    IF (start&$1F)=0 THEN cnt = cnt + 1 FI
  FI

  color = color - 2
  WSYNC = 1
  COLPF0 = color
  COLPF1 = color
  COLPF2 = col((cnt + VCOUNT) & 3)
[PLA TAY PLA TAX PLA RTI]


PROC Background()
  BYTE COLBK=$D01A, VCOUNT=$D40B, WSYNC=$D40A

  [PHA TXA PHA TYA PHA]
  WSYNC = 0
  IF VCOUNT>50 THEN
    COLBK = 0
  ELSE
    COLBK = $D6
  FI
[PLA TAY PLA TAX PLA RTI]


PROC Init7()
  BYTE i
  CARD screen, scrloc=88
 
  Graphics(23)
  SetColor(0,2,10)
  SetColor(1,0,12)
  SetColor(2,0,12)

  display = scrloc
  screen = scrloc
  i = 0
  WHILE i<96 DO
    yLoc(i) = screen
    screen = screen + 40
    i = i + 1
  OD
RETURN


PROC Plot7(BYTE x, y)
  BYTE ARRAY pos, bm(0)=[$C0$30$C$3],
  cm(0)=[$0 $55 $AA $FF]

  pos = yLoc(y)

  pos(x RSH 2) ==% (bm(x&3)&cm(color))
RETURN


PROC VLine(BYTE x, y1, y2)
  WHILE y1#y2 DO
    Plot7(x, y1)
    y1 = y1 + 1
  OD
RETURN


PROC HLine(BYTE x1, x2, y)
  WHILE x1#x2 DO
    Plot7(x1, y)
    x1 = x1 + 1
  OD
RETURN


PROC DLine(BYTE x1, x2, y1)
  BYTE incr

  incr = 1
  IF x2