Qbasicnews.com

Full Version: Text mode screen 0 revisited....
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
Quote:in my experience i've only been able to use the DAC registers with the first 5 colors in screen zeros. The color palette goes up to 31, but 16-31 is simple 0-15 blinking.

Could I have an example/demo of how you get the other 64?

Follow and read the FAQ entry. Your problem is 'cause colour 6 is mapped to 20. If you do

Code:
FOR i%=0 to 15: PALETTE i%,i%: NEXT

before playing with DACs, you won't have any problems (check the example in the FAQ).
Anybody for full motion video? (in glorious ega dithervision!)

http://www.betterwebber.com/test2/fmv.zip

yeah, i broke the "no external files" rule about 138 times but it was a fun way to test out my rgb tables.
That was pretty neat. I did something similar, but in ascii. It breaks rel's rules as well, but only once Tongue

http://usuarios.lycos.es/firstqbasicforu...jedi2.html

(and ... have anyone checked "nadya"?)
Rel, inspired by......... http://www.tAAt.fi/tmdc/

?
For... for QBNZ? For me??? I... I don't know what to say... :lol: I'll take them, but I won't make one (as usual :rollSmile
Quote:Rel, inspired by......... http://www.tAAt.fi/tmdc/

?

Yeah, toonski gave me a link while talking at leah. ;*)
haha cool stuff there toonski.. 10secs of matrix in text mode ish movie hehe.

And nice text mode game there nathan Smile Very funny.
Textmode rotozoomer, ya it's prolly a lil late but owell....
i forced myself to do it in 25 lines aswell Tongue


Code:
1  FOR I% = 0 TO 7
2       PALETTE I%, I%
3       OUT 968, I%
4       OUT 969, I% * 4
5       OUT 969, I% * 4
6       OUT 969, 0

7       PALETTE I% + 8, I% + 8
8       OUT 968, I% + 8
9       OUT 969, (8 - I%) * 4
10      OUT 969, (8 - I%) * 4
11      OUT 969, 0
12 NEXT

13 DEF SEG = &HB800
14 Ang! = Ang! + .01             '<--- adjust this for speed of rotozoomer

15 Ss% = COS(Ang!) * 128 * SIN(Ang!)
16 Cs% = SIN(Ang!) * 128 * SIN(Ang!)

17 FOR Ix% = 0 TO 79
18      FOR Iy% = 0 TO 24

19           Ys = (Iy% * Cs% + Ix% * Ss%) * 1.5
20           Xs = (Iy% * Ss% - Ix% * Cs%) * 1.5
21           POKE Ix% * 2 + Iy% * 160, (((Iy% + Ix%) + L&) AND 7) + 199
22           POKE (Ix% * 2 + Iy% * 160) + 1, (((Ys XOR Xs)) \ 256) AND 15

23      NEXT Iy%, Ix%
24 L& = (L& + 1) AND 32767       '<--- adjust this for speed of BG

25 IF LEN(INKEY$) = 0 THEN 14
Kool!!!

Anyone else?
wow... :o i never about doing things like that in text mode (most likely because i can't! :lol: ) My favourite is rel's floormapping plasma, but binaryshock's rotozoomer isn't far behind... personally, i think rel's plasma and binaryshock's rotozoomer is better than most graphics ones.

unfortunately, my math skills are not quite up to par. i can give you one: one i found on the net a while back. remember, it's not mine. i just thought you guys would like to look at it. not quite as nice to look at as the rotozoomer or plasma though. oh, btw, don't exe it. it runs much too fast exe'd!!!

Code:
' rayasci1.bas version 1.01 by dieter marfurt
' version with &hffff& -multiplyer , poke-instead of line
' ,"peek-division" used to determine wall-height,
' and height-table.
' Just for fun:  USES 80*50 TEXTMODE!!!
' this one is pretty fast but hard to read...
'

'use the numeric keys to navigate.
'you might replace the keyboardhandler - it really sucks now if not compiled

DIM a$(50)
FOR i% = 0 TO 50
a$(i%) = STRING$(80, CHR$(178))
NEXT i%

SCREEN 0: WIDTH 80, 50
DIM Grid%(13, 13)
  
DIM xxyyt&(500) ' divider-table
FOR i% = 0 TO 500
xxyyt&(i%) = &HFFFF& + 1
xxyyt&(i%) = xxyyt&(i%) * i%
NEXT i%

DIM hht%(1200)' height-table
FOR i% = 1 TO 1200      '-9000  80*
hht%(i%) = ((-3000& + (64& * (hh% + 150))) \ i%)' AND &HEFFF
NEXT i%

REDIM SHARED STable!(-192 TO 1992), CTable!(-192 TO 1992)
REDIM SHARED iSTable%(-192 TO 1992), iCTable%(-192 TO 1992)
PX& = 150000: PY& = 150000 ' start position
' init fast peek-division
XX& = 0: YY& = 0: txx2& = 0: tyy2& = 0
xxseg% = VARSEG(XX&)
yyseg% = VARSEG(YY&)
xxptr% = VARPTR(XX&) + 2
yyptr% = VARPTR(YY&) + 2

Stride2% = 3
Heading% = 980
Turn% = 30

FOR Y% = 1 TO 12
  FOR X% = 1 TO 12
    READ Grid%(X%, Y%)
  NEXT
NEXT

Factor! = (ATN(1) * 8) / 1800
FOR a% = 0 TO 1799
  Angle! = CSNG(a%) * Factor!
  STable!(a%) = SIN(Angle!) * .1
  CTable!(a%) = COS(Angle!) * .1
NEXT
FOR a% = 1800 TO 1800 + 192
  STable!(a%) = STable!(a% - 1800)
  CTable!(a%) = CTable!(a% - 1800)
NEXT
FOR a% = 0 TO -192 STEP -1
  STable!(a%) = STable!(a% + 1800)
  CTable!(a%) = CTable!(a% + 1800)
NEXT
FOR a% = -192 TO 1992
  iSTable%(a%) = STable!(a%) * &HFFFF&
  iCTable%(a%) = CTable!(a%) * &HFFFF&
NEXT a%
REDIM SHARED STable!(0), CTable!(0)

DO '..........   Main loop !!!!
z% = z% + 1
IF z% >= 100 THEN
  z% = 0
  t2# = 101 / (TIMER - t#)
  t# = TIMER
END IF
aa% = INP(&H60)
a$ = INKEY$
IF aa% <> 0 THEN
  IF aa% = 75 THEN                    'turn left
    Heading% = (Heading% + Turn%) MOD 1800
  END IF
  IF aa% = 77 THEN                    'turn right
    Heading% = (Heading% + (1800 - Turn%)) MOD 1800
  END IF
  IF aa% = 72 THEN                    'walk forward
    NewPX& = PX& - (iSTable%(Heading%) * Stride2%)
    NewPY& = PY& - (iCTable%(Heading%) * Stride2%)
    IF Grid%(NewPX& \ &HFFFF&, NewPY& \ &HFFFF&) = 0 THEN
      PX& = NewPX&: PY& = NewPY&
    ELSE 'tried to walk through a wall
      SOUND 80, 1
    END IF
  END IF
  IF aa% = 80 THEN                    'walk back
    NewPX& = PX& + (iSTable%(Heading%) * Stride2%)
    NewPY& = PY& + (iCTable%(Heading%) * Stride2%)
    IF Grid%(NewPX& \ &HFFFF&, NewPY& \ &HFFFF&) = 0 THEN
      PX& = NewPX&: PY& = NewPY&
    ELSE 'tried to walk through a wall
      SOUND 80, 1
    END IF
  END IF
END IF
PALETTE 0, 0
GOSUB ComputeView
  LOCATE 50, 20
  PRINT "FPS: "; INT(t2#); " ";
LOOP UNTIL aa% = 1 'a$ = CHR$(27)
END '.. ......eo mainloop

ComputeView:
x1% = 0
FOR i% = 0 TO 49
a$(i%) = STRING$(80, "²")
NEXT i%
FOR a% = Heading% + 160 TO Heading% - 159 STEP -4
  XX& = PX&: YY& = PY&
  L% = 0
   stepx% = iSTable%(a%) \ 5: stepy% = iCTable%(a%) \ 5
  '***************************************************************************
  DO   'raycaster
    XX& = XX& - stepx%: YY& = YY& - stepy%
     L% = L% + 2
     xg% = PEEK(xxptr%)
     yg% = PEEK(yyptr%)
     k% = Grid%(xg%, yg%)
  LOOP UNTIL k%
  '***************************************************************************
     DD% = hht%(L%)
     ddasc% = DD% \ 3
     IF ddasc% > 23 THEN ddasc% = 23
     flasc% = 25 + ddasc%
     rasc% = 24 - ddasc%
     FOR i% = rasc% TO flasc%
      MID$(a$(i%), x1% + 1, 1) = CHR$(32 + k%)
     NEXT i%
     x1% = x1% + 1
NEXT a%
LOCATE 1, 1
FOR i% = 1 TO 48
PRINT a$(i%);
NEXT i%

RETURN
' Level data for Grid%(,)
DATA  9,  1,  9,  1,  9,  1,  9,  1,  9,  1,  9,  1
DATA  1,  0,  0,  0,  0,  0,  0,  0,  0,  4,  0,  9
DATA  9,  0,  2, 10,  0,  0,  0,  0,  0, 12,  0,  1
DATA  1,  0, 10,  2,  0,  0,  0,  0,  0,  4,  0,  9
DATA  9,  0,  0,  0,  0,  0,  0,  0,  0, 12,  0,  1
DATA  1,  0,  0,  0,  0,  7,  7,  0,  0,  0,  0,  9
DATA  9,  0,  0,  0,  0,  7,  7,  0,  0,  0,  0,  1
DATA  1,  0, 13,  0,  0,  0,  0,  8,  0, 12,  0,  9
DATA  9,  0,  5,  0,  0,  0,  0,  7,  0,  4,  0,  1
DATA  1,  0, 13,  0,  0,  0,  0,  8,  0, 12,  0,  9
DATA  9,  0,  5,  0,  0,  0,  0,  7,  0,  4,  0,  1
DATA  1,  9,  1,  9,  1,  9,  1,  9,  1,  9,  1,  9
Pages: 1 2 3