Topic : TOS - das Betriebssystem
Author :
Version : tos.hyp (5. März 2013)
Subject : Programmieren/Atari
Nodes : 3001
Index Size : 93602
HCP-Version : 5
Compiled on : Atari
@charset : atarist
@lang :
@default : Titel
@help :
@options : +g -i -s +x +zz -t4
@width : 70
View Ref-File7.5.34 Bindings für v_justified TOS
C: void v_justified ( int16_t handle, int16_t x, int16_t y,
int8_t *string, int16_t length, int16_t word_space,
int16_t char_space, [int16_t *char_width] );
Umsetzung:
void v_justified (int16_t handle, int16_t x, int16_t y,
int8_t *string, int16_t length,
int16_t word_space, int16_t char_space,
[int16_t *char_width] )
{
int16_t *tmp;
ptsin[0] = x;
ptsin[1] = y;
ptsin[2] = length;
ptsin[3] = 0;
intin[0] = word_space;
intin[1] = char_space;
tmp = &(intin[2]);
while (*tmp++ = *string++)
;
contrl[0] = 11;
contrl[1] = 2;
contrl[3] = (int16_t) (tmp-&(intin))-1;
contrl[4] = 0; /* if word_space equale 0x0000 or 0x0001 */
contrl[4] = n; /* if word_space equale 0x8000 or 0x8001 */
contrl[5] = 10;
contrl[6] = handle;
vdi ();
char_with[0..n-1] = intout[0..n-1]; /* if word_space equale 0x8000 or 0x8001 */
}
GEM-Arrays:
Adresse Feldelement Belegung
contrl contrl[0] 11 # Opcode der Funktion
contrl+2 contrl[1] 2 # Einträge in ptsin
contrl+4 contrl[2] 0 # Einträge in ptsout
contrl+6 contrl[3] n+2 # Einträge in intin
contrl+8 contrl[4] 0 # Einträge in intout;
if word_space 0x0000 or 0x0001
contrl+8 contrl[4] n # Einträge in intout;
if word_space 0x8000 or 0x8001
contrl+10 contrl[5] 10 GDP-Nummer
contrl+12 contrl[6] handle
intin intin[0] word_space
intin+2 intin[1] char_space
intin+4 intin[2..n+1] string[0..n-1]
ptsin ptsin[0] x
ptsin+2 ptsin[1] y
ptsin+4 ptsin[2] length
ptsin+6 ptsin[3] 0
intout intout[0..n-1] char_with[0..n-1]
if word_space 0x8000 or 0x8001