I use DMODE in a boot file, to prepare the screen for the main program. But many times DMODE is interpreted as a undeclared variable, thus giving an error. It seems DMODE works fine or not depending on the boot's content. Sometimes it works fine after removing some lines. Other times it works fine after adding some REMarks at the start of certain lines. I've found no logic at all -- in fact those "offending" lines are not executed in the tests! I suspected the problem had something to do with the lenght of the boot file, but it doesn't. Then I thought it had something to do with the Q-emuLator's option to press F1 or F2 at the inital prompt, but it doesn't.
I've done a lot of tests, trying to guess what causes the problem, but I didn't success. I don't know if the problem is in the toolkit, in Q-emuLator, in the ROMs or any combination of them.
Actually, the fact DMODE, FLIM_W and FLIM_H are not linked in is clear because they remain lowercase in the QL listing. But not always the three words are not linked in at the same time.
I want to show you some examples about DMODE.
The following test doesn't work with MGE and JM. It should print the screen mode (0 or 8) and then stop, but it prints "*" instead, because DMODE is not linked in:
Code: Select all
100 tk2_ext
110 lrespr "flp1_display_code"
120 print dmode
130 stop
330 defproc init_ql_colours
400 enddef
410 deffn rgb(red,green,blue)
430 enddef
440 defproc init_the_window
450 let csize_w=3-(scr_w=512)
460 let csize_h=scr_w>512
470 let tw=fopen("con_")
480 csize #tw,csize_w,csize_h
490 let tw_w=minimum(800,scr_w)
500 let tw_h=minimum(600,scr_h)
510 let tw_x=(scr_w-tw_w)/2
520 let tw_y=(scr_h-tw_h)/2
530 window #tw,tw_w,tw_h,tw_x,tw_y
540 paper #tw,black
550 ink #tw,light_grey
560 wipe_the_window
570 init_the_font
580 enddef
590 defproc wipe_the_window
600 border #tw,0
610 cls #tw
620 border #tw,8
630 enddef
640 defproc splash_screen
650 if flim_w(#0)=512 and flim_h(#0)=256
660 lbytes dev$&img_ayc8_scr,address(#0)
670 endif
680 enddef
If I remove all lines from 330, nothing changes:
Code: Select all
100 tk2_ext
110 lrespr "flp1_display_code"
120 print dmode
130 stop
Another test that doesn't work fine:
Code: Select all
100 tk2_ext
110 lrespr "flp1_display_code"
120 print dmode
130 stop
330 defproc init_ql_colours
400 enddef
410 deffn rgb(red,green,blue)
430 enddef
440 defproc init_the_window
450 let csize_w=3-(scr_w=512)
460 let csize_h=scr_w>512
470 let tw=fopen("con_")
480 csize #tw,csize_w,csize_h
490 let tw_w=minimum(800,scr_w)
500 let tw_h=minimum(600,scr_h)
510 let tw_x=(scr_w-tw_w)/2
520 let tw_y=(scr_h-tw_h)/2
580 enddef
590 defproc wipe_the_window
630 enddef
640 defproc splash_screen
680 enddef
1700 deffn prog_device$
1850 enddef
1860 deffn prog_found_in(device$)
1910 enddef
I've tried with and without TK2_EXT, with LRESPR and with LBYTES and CALL. No difference.
Another test that doesn't work with MGE... unless I remove line 510!:
Code: Select all
100 rem tk2_ext
110 rem lrespr "flp1_display_code"
110 let a=alchp(1094):lbytes "flp1_display_code",a:call a
120 print dmode
130 stop
330 defproc init_ql_colours
400 enddef
410 deffn rgb(red,green,blue)
430 enddef
440 defproc init_the_window
450 let csize_w=3-(scr_w=512)
460 let csize_h=scr_w>512
470 let tw=fopen("con_")
480 csize #tw,csize_w,csize_h
490 let tw_w=minimum(800,scr_w)
500 let tw_h=minimum(600,scr_h)
510 let tw_x=(scr_w-tw_w)/2
580 enddef
590 defproc wipe_the_window
630 enddef
640 defproc splash_screen
680 enddef
1700 deffn prog_device$
1850 enddef
1860 deffn prog_found_in(device$)
1910 enddef
I don't see any logic. Any clue?