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"
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:
90DATA240,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:
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.
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.
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"
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.
70FOR I=41207TO41211:READ D:POKE I,D:NEXT I 90DATA240,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 :)
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
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.
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):
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)
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 20DIM T$(MAXT),I$(MAXI) 30GRAPHICS15+16 40COLOR1: PLOT0,0: DRAWTO159,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:
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
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$.
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 20DIM 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)!
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,...)
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.