A83: HAL?


[Prev][Next][Index][Thread]

A83: HAL?




-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Does anyone know HAL?
I found it on the TIcalc site, but there was no documentation about
it, so I need a reference about it.
It seems to be a tool to write assembly programs in a C- and
BASIC-like language, but the Z80 files look good, contrary to TI8XBAS
or TI8X-SmallC.
Also, inline assembly is possible.
Code looks like:

("TANK!.HAL")

;Tank! v-0.0
;works on 85. probably only 85.

;*** Declarations ***
  page 4
Rt  = 0
Dn  = 1
Lt  = 2
Up  = 3
Speed = 5
  warray tank 4
  tank[Rt] = TankRight
  tank[Lt] = TankLeft
  tank[Up] = TankUp
  tank[Dn] = TankDown
  barray dir 2
  barray x_loc 2
  barray y_loc 2
  byte cur_plr
  byte x
  byte y
  byte d
  warray count 2
  byte a
  byte plr
  constr blanks "             "
;*** Opening screen ***
  cls
  reverse
  disp text 4 0 blanks
  disp text 4 1 blanks
  disp menu 55 5 "TANK!"
  normal
  disp text 2 4 "L  L  "
  disp menu 19 32 "IVE"
  disp menu 37 32 "INK"
  locate_t 8 4
  disp char_tx $D4
  disp text 10 4 "Technology"
  disp text 4 6 "F1 - Player 1"
  disp text 4 7 "F2 - Player 2"

;*** Main Menu ***
MenuLoop:
  a = (waitkey)
  if (a == K_EXIT)
    RET
  endif
  if (a == K_F1)
    plr = 0
    goto Init
  endif
  if (a == K_F2)
    plr = 1
    goto Init
  endif
  goto MenuLoop

; *** Initalize Variables ***
Init:
  cls
  dir[0] = Rt
  x_loc[0] = 10
  y_loc[0] = 10
  dir[1] = Lt
  x_loc[1] = 30
  y_loc[1] = 30
  cur_plr = 1
  count[0] = 0
  count[1] = 0

;*** Main Loop ***
MainLoop:
  inc cur_plr
  if (cur_plr == 2)
    cur_plr = 0
  endif
  if (cur_plr == plr)
    a = (readkey)
    send_byte a
  endif
  if (not (cur_plr == plr))
    a = (get_byte)
  endif
  if (a == K_EXIT)
    RET
  endif
  locate_t 0 6
  disp hex cur_plr
  inc count[cur_plr]
  locate_t 0 7
  disp hex count[cur_plr]
  x = x_loc[cur_plr]
  y = y_loc[cur_plr]
  d = dir[cur_plr]
  if (a == K_UP)
    d = Up
  endif
  if (a == K_DOWN)
    d = Dn
  endif
  if (a == K_LEFT)
    d = Lt
  endif
  if (a == K_RIGHT)
    d = Rt
  endif
  if (((count[cur_plr] mod Speed) == 0) or (a == K_MORE))
    if (x > 95)
      dec x
    endif
    if (x < 1)
      inc x
    endif
    if (y > 55)
      dec y
    endif
    if (y < 1)
      inc y
    endif
    if (not (dir[cur_plr] == d))
      sprite x y TankBlank
      dir[cur_plr] = d
    endif
    if (d == Rt)
      inc x
    endif
    if (d == Lt)
      dec x
    endif
    if (d == Dn)
      inc y
    endif
    if (d == Up)
      dec y
    endif
    x_loc[cur_plr] = x
    y_loc[cur_plr] = y
    sprite x y tank[d]
    goto MainLoop
  endif
  if (not (dir[cur_plr] == d))
    sprite x y TankBlank
    dir[cur_plr] = d
  endif
  goto MainLoop

TankRight:
.db 8,5 ; x- and y-width in pixels
.db %01110000
.db %01111000
.db %01111111
.db %01111000
.db %01110000

TankLeft:
.db 8,5 ; x- and y-width in pixels
.db %00001110
.db %00011110
.db %11111110
.db %00011110
.db %00001110

TankUp:
.db 5,8
.db %00100000
.db %00100000
.db %00100000
.db %01110000
.db %11111000
.db %11111000
.db %11111000
.db %00000000

TankDown:
.db 5,8
.db %00000000
.db %11111000
.db %11111000
.db %11111000
.db %01110000
.db %00100000
.db %00100000
.db %00100000


TankBlank:
.db 8,8
.db %00000000
.db %00000000
.db %00000000
.db %00000000
.db %00000000
.db %00000000
.db %00000000
.db %00000000
























-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 6.5.1 Int. for non-commercial use
<http://www.pgpinternational.com>
Comment: Get a free virus at file://localhost/dev/aux/clock$

iQA/AwUBOWxJr5HoP2uzWQlaEQLsPACfcTcHdncdlTNjSSpBVzvU90OtRnsAoJ/S
L9mw/MEv/Jb7nHO0xpYFUWrf
=dEK9
-----END PGP SIGNATURE-----





References: