Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Make the BEST simulation EVER!! :D !!!SUPER CHALLENGE!!!
#31
Windows 98 simulator

Code:
COLOR 15,1:CLS
1 GOTO 1
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#32
Quote:Why dont you clear the keyboard buffer? The sticking problem will dissappear =P.

I do clear the KB buffer...

DEF SEG = &H40: POKE &H1C, PEEK(&H1A)

Do I need to clear it using another method?
(K$=INKEY$ would be slower by the way.)
Reply
#33
Thank SJ for this. Try it out =P.

Code:
DECLARE FUNCTION KEYSPRESSED$ ()

DIM SHARED Keyflag%(0 TO 127)
DO
  
    li% = i%
    i% = INP(&H60)
    IF i% = 170 OR i% = 54 OR i% = 42 THEN FOR a = 0 TO 127: Keyflag%(a) = 0: NEXT a
    IF (i% AND 128) THEN Keyflag%(i% XOR 128) = 0
    IF (i% AND 128) = 0 THEN Keyflag%(i%) = -1
    WHILE INKEY$ <> "": WEND
    IF i% = 1 THEN END

  IF i% <> li% THEN
    LOCATE 1, 1: PRINT KEYSPRESSED$
  END IF
  IF ext% THEN EXIT DO
LOOP
END

FUNCTION KEYSPRESSED$
  'A string of all the keys curently being pressed
  kp$ = ""
  FOR k% = 0 TO 127

    IF Keyflag%(k%) THEN
      kpa$ = LTRIM$(RTRIM$(STR$(k%))): kl% = LEN(kpa$)
      kpa$ = "*" + kpa$
      kp$ = kp$ + kpa$
    END IF
  NEXT k%
  kp$ = kp$ + "*"
  lk% = LEN(kp$)
  kp$ = kp$ + (SPACE$((40 - lk%)))
  KEYSPRESSED$ = kp$
END FUNCTION
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)