help with ipl under gfa

GFA BASIC-related articles in here please

Moderators: simonsunnyboy, Mug UK, Zorro 2, Moderator Team

User avatar
charles
10 GOTO 10
10 GOTO 10
Posts: 2565
Joined: Tue Aug 17, 2004 12:11 am
Location: ont. Canada
Contact:

help with ipl under gfa

Postby charles » Wed Aug 28, 2019 7:09 am

ive tried porting this interrupt code from omikron to gfa....
anybody able to render usefull?

Code: Select all

 sof
'
SAVE "a:\keyoutb.gfa"
LIST "a:\keyoutb.lst"
'
' Diese Prozedur fgt Zeichen in den Tastatur-Buffer ein, so
' als ob sie der Benutzer selbst eingetippt h„tte.
' Die Zeichen erscheinen dann als eingetippte Tastendrcke, sobald irgendein
' Programm auf Eingaben von der Tastatur wartet.
'
'
DIM ipl_3&(2)
ipl_3&(0)=&H7C
ipl_3&(1)=&H300
ipl_3&(2)=&H4E75
ipl_3%=V:ipl_3&(0)
'
DIM ipl_7&(2)
ipl_7&(0)=&H7C
ipl_7&(1)=&H700
ipl_7&(2)=&H4E75
ipl_7%=V:ipl_7&(0)
'
@key_string("Das ist ein Test")
'
REPEAT
UNTIL LEN(INKEY$)
'
END
'
PROCEDURE key_string(k$)
  '
  LOCAL tbuf%,size&,headptr%,tailptr%,i%,t%
  '
  ' Tastatur-Prozessor ruhig stellen
  ~BIOS(3,4,&H13)
  '
  t%=TIMER+1
  WHILE TIMER<t%
  WEND
  '
  '  ==> IPL 7!                  Interrupts sperren
  CALL ipl_7%
  sp%=GEMDOS(32,L:0)
  BYTE{&HFFFFFA09}=BCLR(BYTE{&HFFFFFA09},6)
  BYTE{&HFFFFFA05}=BSET(BYTE{&HFFFFFA05},4)
  BYTE{&HFFFFFA0B}=BSET(BYTE{&HFFFFFA0B},4)
  '
  tbuf%=XBIOS(14,1)          ! alle Informationen ber den IO-Record
  ibuf%=LPEEK(tbuf%)         ! der Tastatur ermitteln
  size&=DPEEK(tbuf%+4)
  headptr%=tbuf%+6
  tailptr%=tbuf%+8
  t%=DPEEK(tailptr%)
  '
  FOR i%=1 TO LEN(k$)
    ADD t%,4
    IF t%>=size& THEN
      t%=0
    ENDIF
    '
    EXIT IF t%=DPEEK(headptr%)         !     šberlauf
    '
    LPOKE ibuf%+t%,0                   ! keinen Scancode
    POKE ibuf%+t%+3,ASC(MID$(k$,i%,1)) ! nur ASCII-Code eintragen
    '
  NEXT i%
  '
  DPOKE tailptr%,t%
  '
  CALL ipl_3%
  '  ==> IPL 3!
  BYTE{&HFFFFFA0B}=BCLR(BYTE{&HFFFFFA0B},4)
  BYTE{&HFFFFFA05}=BCLR(BYTE{&HFFFFFA05},4)
  BYTE{&HFFFFFA09}=BSET(BYTE{&HFFFFFA09},6)
  VOID GEMDOS(32,L:sp%)
  '
  ~BIOS(3,4,8)
  '
RETURN
'
' eof

The radioactive half-life : )
Atari is a lifestyle,not a hobby.
HOLD ON ! ! ! Im printing unreadable characters ...!

Social Media

     

Return to “GFA BASIC”

Who is online

Users browsing this forum: No registered users and 1 guest