03.02.2014, 22:19 
		
	
	
		hallo, hier nochmal meine bisherige, unzuverlässige Vorgehensweise, wenn ich einen RTG-Screen öffnen will. Unzuverlässig deshalb, weil das Programm offenbar bei Closescreen einfriert; allerdings nur manchmal und nur mit Debugger On.
 
das folgende wird bei Verwendung der load/save Option in Envarc: gespeichert:
wer sieht was Illegales/falsches? Wie gesagt, es funktioniert eigentlich. Ich wüßte nur gerne, warum es manchmal eben nicht funktioniert. Ich glaube ja, mein ASL-Screenrequest wird manchmal getrasht, weil ich zum Teil Einträge wie dieses hier finde:
22230303x4202020x2048 oder so. Da ging dann irgendwas schief?
	
	
	
	
Code:
; picasso 96 8 bit display, prepared for truecolor
; by Frank Brandis
; CHG: 25.05.2010
; CHG: 06.06.2010   ;alsreq -> fallback. new dispload/save from env:
; Function.l p96_openscreen   {num.w,w.l,h.l,d.l,m.l,t$} ;returns *scr.Screen (.l)
; Function.l p96_askforscreen {num.w,stit$,w.l,h.l,d.l}  ;ask for and opens screen, ret *scr.Screen
; Statement  dispsave {destdir$,w.l,h.l,d.l,m.l}         ;saves DisplayModeID to e.g. Env:
; Function.l dispload {srcdir$ ,w.l,h.l,d.l}             ;loads and returns DisplayID, if exists
INCDIR "blitzinc:src/"
XINCLUDE"screeninfo.ntype.bb"
XINCLUDE"screen_tags.bb"
bb2_p96display$="ENVARC:BlitzP96Modes/" ;directory for storing used GFXCard Modes to use
#p96_loadsave=1     ;set to 0 later
CNIF #p96_loadsave=1
;save given parameters of displaymode to a file usually in ENVARC:
Statement dispsave {dest$,w.l,h.l,d.l,m.l}
  Format""
  newn$=dest$+Str$(w)+"x"+Str$(h)+"x"+Str$(d)   ;"ENV:800x600x8"
  o$="$"+Hex$(m.l)                              ;$50041000
  If NOT(Exists(newn$))
    If WriteFile(1,newn$)
      FileOutput1
        NPrint o$
      CloseFile1:DefaultOutput
    EndIf
  EndIf
End Statement
Function.l dispload {src$,w.l,h.l,d.l}
  Format""
  newn$=src$+Str$(w)+"x"+Str$(h)+"x"+Str$(d)   ;"ENV:800x600x8"
  o$=""                              ;$50041000
  If ReadFile(1,newn$)
    FileInput1
      o$=Inkey$(20)
    CloseFile1:DefaultInput
  EndIf
  Function Return Val(o$)
End Function
CEND
Function.l p96_openscreen {num.w,w.l,h.l,d.l,m.l,t$}
 ScreenTags num.w,t$,#Width,w,#Height,h,#Dpth,d,#AutoScroll,1,#DPen,1,#BPen,2,#DisplayID,m,#LikeWorkbench,1
; ScreenTags num.w,t$,#Width,w,#Height,h,#Dpth,d,#AutoScroll,1,#DisplayID,m
 ;Screen num,0,0,w,h,d,m,t$,1,2
 Function Return Peek.l(Addr Screen(num))
End Function
Function.l p96_askforscreen {num.w,stit$,w.l,h.l,d.l}
 SHARED bb2_p96display$
 FindScreen0    ;get a screen to open asl req on
 scrimem.l=AllocVec_ (SizeOf.screeninfo,#MEMF_PUBLIC|#MEMF_CLEAR)
 If scrimem>0
   *scri.screeninfo=scrimem
 ;  *scri\width  =800 :  *scri\height =600
 ;  *scri\dpth   =8   :  *scri\id     =$50041000
 ;   dispsave {bb2_p96display$,800,600,8,$50041000}
 ;  *scri\width  =640 :  *scri\height =480
 ;  *scri\dpth   =8   :  *scri\id     =$50031000
 ;   dispsave {bb2_p96display$,640,480,8,$50031000}
   *scri\width  =w.l
   *scri\height =h.l
   *scri\dpth   =d.l
   CNIF#p96_loadsave=1
   res.l = dispload {bb2_p96display$,*scri\width,*scri\height,*scri\dpth}
   *scri\id     =res
   CEND
   If *scri\id=0
     *scri=ASLScreenRequest(1|2|4)   ;uncomment this to chg new mode (snoop id with scout)
   EndIf
 Else
   End  ;cancel
 EndIf
 res.l=p96_openscreen {num.w,*scri\width,*scri\height,*scri\dpth,*scri\id,stit$}
 If res
   CNIF#p96_loadsave=1
    dispsave {bb2_p96display$,*scri\width,*scri\height,*scri\dpth,*scri\id}
   CEND
   ;*sc.Screen=res
   ;Gosub main
   Use Screen num
 EndIf
 *scri=0
 FreeVec_ scrimem.l
 Function Return res
End Function
;
;test.l= p96_askforscreen{1,"testscreen",800,600,8}
;If test
;  Delay_150
;  CloseScreen 1
;EndIf
;NPrint Hex$(test)
;MouseWait
;Enddas folgende wird bei Verwendung der load/save Option in Envarc: gespeichert:
Code:
envarc:blitzp96modes
   800x600x4
   720x576x24
   800x600x5
   896x600x8
   896x600x24
   800x600x24
   640x480x24
   1152x768x8
   1152x768x24
   1280x854x8
   1280x854x24
   1024x768x8
   1024x768x24
   800x600x8
   720x480x8
   720x480x24
   640x480x8wer sieht was Illegales/falsches? Wie gesagt, es funktioniert eigentlich. Ich wüßte nur gerne, warum es manchmal eben nicht funktioniert. Ich glaube ja, mein ASL-Screenrequest wird manchmal getrasht, weil ich zum Teil Einträge wie dieses hier finde:
22230303x4202020x2048 oder so. Da ging dann irgendwas schief?

 

 

![[Bild: evtt.png]](http://imageshack.com/a/img541/5916/evtt.png)
![[Bild: 71mq.png]](http://imageshack.com/a/img811/9435/71mq.png) 
	
