atarionline.pl Display List - Forum Atarum

Jeśli chcesz wziąć udział w dyskusjach na forum - zaloguj się. Jeżeli nie masz loginu - poproś o członkostwo.

  • :
  • :

Vanilla 1.1.4 jest produktem Lussumo. Więcej informacji: Dokumentacja, Forum.

    • 1: CommentAuthorPaladina
    • CommentTime6 Dec 2009
     
    What is problem when I change DLIST for GR15 that I become only two row window, the cursor is away,as there was 4 rows... any correction? Thx for help.

    1 ? "{125}"
    10 REM * DL3 *
    20 GRAPHICS 15
    70 FOR I=33015 TO 33019:READ D:POKE I,D:NEXT I
    90 DATA 240,240,66,96,159
    100 POKE 82,0
    150 ? "HERE THE TEXT,THAT IS LONG 40 CHARACTERS"

    Or other way that I see only the last two rows.
    • 2: CommentAuthormono
    • CommentTime6 Dec 2009 zmieniony
     
    If you want change behaviour of textwindow you must change start address of LMS command in dlist to 3rd line of standard textwindow (96+256*159+2*40) - for example:
    90 DATA 240,240,66,176,159

    Cursor won't be run out of bottom line, but still will be run out of top line of textwindow. Possible remedy against this requires change of system S: device handler, because changing address of textwindow at TXTMSC ($294) and size of textwindow at BOTSCR ($2BF) don't bring correct effect (OS S: procedures check existence of textwindow with condition BOTSCR==4).
    You must remember about two upper lines of textwindow are hidden and do clrscr followed by two eols - like this:
    ? CHR$(125); CHR$(155); CHR$(155);

    or in this manner:
    ? CHR$(125); CHR$(155)
    • 3: CommentAuthorPaladina
    • CommentTime6 Dec 2009
     
    Super...that it what I need... another question...is possible to load only piece of .MIC picture and to draw only any pixels...that some pixel become TRANSPARENT, how do it ? ( in turbobasic ). Thx.
    • 4: CommentAuthorPaladina
    • CommentTime6 Dec 2009
     
    whups...another problem..this DL dont work in TurboBasic...whats the problem? thx.
    • 5: CommentAuthormono
    • CommentTime6 Dec 2009 zmieniony
     
    You have used fixed dlist textwindow addres in DATA lines. Try to get textwindow address under tbxl - maybe it is located at a bit another address than under Atari Basic control.
    • 6: CommentAuthorPaladina
    • CommentTime7 Dec 2009
     
    fuu...I do somewhere miss...when I load picture then the 2 hide row of windows dont become any grafik...

    1 ? "{125}"
    10 REM * DL3 *
    70 FOR I=41207 TO 41211:READ D:POKE I,D:NEXT I
    90 DATA 240,240,66,176,191
    100 POKE 82,0
    150 ? "HERE THE TEXT,THAT IS LONG 40 CHARACTERS"


    15 EXEC LP
    200 GOTO 200
    2000 PROC LP
    2010 GRAPHICS 15+32:EK=PEEK(88)+256*PEEK(89):EPUZ=EK-8192:EMEM=EPUZ-8192
    2011 POKE 752,1
    2020 OPEN #1,4,0,"D1:PICTURE.MIC":BGET #1,EK,7680:BGET #1,712,1:BGET #1,708,3
    2030 CLOSE #1:REM MOVE EK,EPUZ,7860
    2040 ENDPROC

    Thx.
    • 7: CommentAuthormono
    • CommentTime7 Dec 2009 zmieniony
     
    1. Every GRAPHICS instruction makes new dlist program. You need to modify displaylist after each GRAPHICS.
    2. Graphic screen in mode with textwindow has 160/4*160=6400 bytes length - not 7680 (4 textrows takes 4*8=32 lines, so graphic screen has 192-32=160 lines height). 7680 is the size of 160x192 full graphics screen (without textwindow - GR.15+16). If you don't want to see trashes in textwindow after GR.15+32 you need to BGET only 6400 bytes from MIC picture.
    • 8: CommentAuthorPaladina
    • CommentTime7 Dec 2009
     
    I test...if I change DL adres POKE 41209,2 and POKE 41210,2 I becom two lines...but how I input text in this lines? Thx.
    • 9: CommentAuthormono
    • CommentTime7 Dec 2009 zmieniony
     
    If I understand now you have a code like this:
    70 FOR I=41207 TO 41211:READ D:POKE I,D:NEXT I
    90 DATA 240,240,2,2,191

    what means: 8 empty lines, 8 empty lines (both with dli), mode 0 text row, mode 0 text row, mode 8 graphics line with hvscroll (191). After this code lies rest of standard GR.15 dlist: row of mode 0 text and jvb dlist command.
    It looks like big confusion (erased lms for textwindow, accidential graphics 8 mode line). Tell me what do you want to do, because I don't understand your goal :)
    • 10: CommentAuthorPaladina
    • CommentTime7 Dec 2009
     
    I am working on game, Grafik 15 + 16 (no window) but for some text I need two lines of standart text ( GR 0 ), the standart window of 4 rows is too big, in this way I am search how it do to become and write the text only in two rows down. (If I use text in GR15 its too long,then this two lines GR0 text. And many thanks mono for your help :D
    • 11: CommentAuthormono
    • CommentTime8 Dec 2009
     
    Ok. I propose to modify dlist program to eliminate big space between graphicarea and textwindow:
    10 GRAPHICS 15
    20 DL=PEEK(560)+256*PEEK(561)
    30 TW=DL+3+158+3+3
    40 LMS=PEEK(TW+1)+256*PEEK(TW+2)+2*40
    50 POKE TW+1,LMS-INT(LMS/256)*256
    60 POKE TW+2,INT(LMS/256)
    70 FOR I=0 TO 2
    80 POKE TW+4+I,PEEK(TW+6+I)
    90 NEXT I

    This code limit textwindow to 2 rows (on view), but keep internally 4 lines for correct S: handler operations.
    If you want to get more than 160 lines of graphics mode (f.ex. 176) I must to experiment a little with modifying dlist program and addresses of screen start and lines count.
    • 12: CommentAuthormono
    • CommentTime8 Dec 2009 zmieniony
     
    But maybe better thing is textwindow has hidden most upper and most lower lines? You can print full 2 rows of text then.
    To achieve it modify code like this (because cursor after fill whole row goes down to hidden line):
    40 LMS=PEEK(TW+1)+256*PEEK(TW+2)+40
    • 13: CommentAuthorPaladina
    • CommentTime8 Dec 2009
     
    But I cannot write in this windows via PRINT...ok..fuu..what is next step... hm..example...I load my FONT, then MIC and I need two last rows for text, but in other grafic as 15...2 choose..GR0 or GR8 (change the DL) and how to become other colors in this rows and how to write text? possible with POSITION and PRINT or TEXT x,y,"text". In this window I give question too and write answer... too hard for me MONO, but I see you are realy good and its easy for you....
    1. change DL (two rows)
    2. other colors of this rows (background and text)
    3. possible to write text there (in this 2 rows)

    Thanks
    • 14: CommentAuthormono
    • CommentTime8 Dec 2009 zmieniony
     
    Do you need (or will need) input text from user in textwidow rows?
    • 15: CommentAuthorPaladina
    • CommentTime8 Dec 2009
     
    For editing too. Example

    "There are big golden doors ...ou yeah..there si text.. TELL ME MAGIC WORDS"
    ? OPEN SEZAME (this text is interactiv - writet be player)

    ok of this example?
    • 16: CommentAuthorPaladina
    • CommentTime8 Dec 2009
     
    And this example...from book

    20 GR.0:POKE 82,0
    30 POKE 710,0:POKE 712,0:POKE 709,10
    40 DL=PEEK(560)+256*PEEK(561)
    50 POKE DL+7,7:POKE DL+9,6
    60 POS.0,0:?"PROGRAMS TEXT"
    70 POS.6,2:?"GRAPHICS"
    80 POS.32,2:?"============"
    90 POS.22,3:?"GRPHIC 1"
    100 POS.4,4:?"------------------"
    110 LIST

    anything as this example..but standart GR 15 + 0 or 8 for text down...and questios too as INPUT.

    Thx.
    • 17: CommentAuthorPaladina
    • CommentTime8 Dec 2009
     
    And in this I need that work the two line text of other DL.
    • 18: CommentAuthormono
    • CommentTime8 Dec 2009
     
    Ok. I think I understand what you need. Let me think for a while.
    • 19: CommentAuthormono
    • CommentTime11 Dec 2009 zmieniony
     
    I think about machine procedure called by USR you could show some text in GR.0 rows (with custom colors of course), and get some text from user. Size of textwindow will depend of length of showing text and expected length of text input by user. Bottom location of textwindow would be constant - for example bottom border of normal GR.15 mode. Textwindow would be (when called) hide part of graphic screen, but its content wouldn't be lost.
    Typical usage:
    10 MAXT=100: MAXI=200
    20 DIM T$(MAXT),I$(MAXI)
    30 GRAPHICS 15+16
    40 COLOR 1: PLOT 0,0: DRAWTO 159,191
    50 T$="Where do you go now? "
    60 EXPI=10
    70 COLBAK=4: COLINK=10
    80 I$(1+USR(machine_procedure_addr,COLINK,COLBAK,ADR(T$),LEN(T$),ADR(I$),EXPI))=""

    Unfortunatelly USR function can't directly manipulate text strings (USR expecting numbers in range 0..65535 as parameters and returns such number too), so using T$ and I$(LEN)="" is a bit tricky* :) but guarantees correct afterprocessing I$ variable in BASIC.
    EXPI is expecting length of input text - machine procedure don't allow user to enter more. EXPI can't be larger than MAXI of course; machine procedure don't allow user to erase shown prompt text (unlike BASIC INPUT command).
    COLBAK is background color and COLINK is ink color of textwindow. They are independent of graphic screen colours.
    In case when you don't need any data input by user simply set IEXP to 0 - textwindow will be shown until user press RETURN key (ILEN=0 will be returned) or try:
    80 I$(1+USR(machine_procedure_addr,COLINK,COLBAK,ADR(T$),LEN(T$)))=""

    Textwindow will be shown when you call USR, and hidden after pressing RETURN key.
    I want to write fully relocatable machine procedure possible to use by USR(ADR("machineprocedure"),...) and not occupies 6th page.
    What do you think about this (proposed) solution (maybe I misunderstand of you again :])?

    * - I$(length)="" sets length of text variable without initializing of variable content; try to execute
    DIM I$(20): I$(20)="": ? I$
    • 20: CommentAuthormono
    • CommentTime12 Dec 2009 zmieniony
     
    An example:
    1. Load POPUPTW.OBJ from DOS (f.ex. L option from DOS2.5 DUP.SYS).
    2. Go to BASIC (B option of DUP).
    3. Run POPUPTW.BAS.
    At this moment you can print text only. Procedure calculates size of textwindow and locate one on screen (try to change text for larger one at line 50). Because it don't use DLI interrupts you can show g2f pictures and pops up textwindow when you need to show any text.
    Program isn't relocatable at all and occupies $9800..$98FF. Upper bytes are occupied for dynamic created dlist and screen of textwindow.
    CAUTION! I$(1+USR(...))="" don't run correctly, so I use assignment to variable and then shrink I$.
    • 21: CommentAuthormono
    • CommentTime13 Dec 2009 zmieniony
     
    First functional version.

    Features:
    1. You can print any prompt text and request some text.
    2. You can specify initial text (for example default response).
    3. Function don't allow override your prompt text with entering input text.
    4. Function calculates height of textwindow based on length of prompt and max length of input.
    5. You can insert inverted, lowercase, uppercase, control characters.
    6. ESC key exits from textwindow with empty text.
    7. Pressing BREAK key stops program at USR function :)
    8. Pressing CTRL+3 (EOF) throws ERROR-136 :)
    9. You can use CTRL+DEL, BACKSPACE, CURSOR LEFT and RIGHT, CLR, SHIFT+DEL shortcuts.
    10. Pressing RETURN enter text into variable.
    11. Function returns length of entered text.
    12. You can call textwindow on any text/graphic mode (GTIA 9,10,11 too).

    Disadvantages:
    1. 2KB requirements from $9800..$9FFF for program (~1KB) and textwindow (~1KB).
    2. Program isn't protected from too big textwindow.
    3. Program isn't protected from memory mistakes (too short text variables declaration).
    4. Textwindow is blinking from time to time.
    5. Error 136 request mechanizm may not runs correctly with BASIC another than Atari BASIC (I jump directly to GETERR procedure at $B934 - unfortunatelly Atari BASIC don't service errors throws from USR).
    6. Some Atari BASIC level preparations, and postprocessing to get entered text (reasoned by constraints of USR function of Atari BASIC).

    Usage:
    10 PL=200: IML=100
    20 DIM P$(PL),I$(IML+1)
    30 PA=ADR(P$): IA=ADR(I$)
    40 P$="Where do you want TO go now? "
    50 I$="GO WEST"
    60 PL=LEN(P$): ICL=LEN(I$): CP=ICL
    70 L=USR(PROC,IC,BC,PA,PL,IA,IML,ICL,CP)
    80 I$(1+L)=""


    Where:
    PROC is procedure address (152*256)
    IC is ink color
    BC is background color
    PA is prompt text variable address (ADR(P$))
    PL is prompt length (LEN(P$))
    IA is input text variable address (ADR(I$))
    IML is max input length (dimension of I$-1)
    ICL is current input length (LEN(I$))
    CP is current cursor position (LEN(I$))

    CAUTION! Input text MUST be declared with +1 size, because of BASIC constraints (A$(1)="" can't be executed on 0 size string regardless of that first position of string isn't initialized with any character, but empty string!). So BE PATIENT with input text variable declaration DIM I$(length+1)!
    • 22: CommentAuthorPaladina
    • CommentTime13 Dec 2009
     
    Very nice work MONO, but I cannot it run. For first when I load DOS I cannot go back to TurboBasic, then I load Dos, OBX and the TurboBasic. After that I load BAS, but when I run I see no text... only interrupt one line a some crush grafihc window...thats all...
    Fuu..not easy to become only two text rows... adn the other will be a normal GR15... Other qustion, I see you will declare the text to variable... if I have got file with more variable, how I can point the position from where I will start to read? ( BGET,...)

    10 GRAPHICS 15›
    15 EXEC LP›
    999 END ›
    1100 PROC LP›
    1110 EK=PEEK(88)+256*PEEK(89):EPUZ=EK-8192:EMEM=EPUZ-8192›
    1111 POKE 752,1›
    1120 OPEN #1,4,0,"D1:BOX.MIC":BGET #1,EK,7680:BGET #1,712,1:BGET #1,708,1:BGET #1,709,1:BGET #1,710,1›
    1130 CLOSE #1›
    1140 ENDPROC ›

    and to this become only eay two rows...I dont think its too hard for do in Atari...hm.I am beginner, but you are advanced programmer _D
    thx for your help.
    • 23: CommentAuthormono
    • CommentTime13 Dec 2009 zmieniony
     
    To load POPUPTW.OBJ binary from TBXL don't load it from DOS - try to do:
    POKE 106,152: GR.15+16: BLOAD ...

    But from TBXL don't try to press CTRL+3 :) because it possibly to hang up your machine.
    • 24:
       
      CommentAuthorFly
    • CommentTime13 Dec 2009
     
    Tak si konečně přečti nějakou tu knížku o programování a netrap toho MONa tolik... hehe
    • 25:
       
      CommentAuthorMaW
    • CommentTime15 Dec 2009
     
    aż translatora zapuściłem :-) - Fly: it's simply - MONO (not: MON:P ) has too much time ;-) (albo myśli, że Paladin to 'ona' ;D )
    • 26:
       
      CommentAuthorFly
    • CommentTime15 Dec 2009
     
    To MaW: Je to klasické české skloňování. MONO vyskloňuješ jako MONA i ja napsal MONa bo je to zajimavější. :-)