Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!sdd.hp.com!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!ira.uka.de!fauern!opal!ki From: ki@opal.cs.tu-berlin.de (Karsten Isakovic) Newsgroups: comp.sys.atari.st Subject: Re: vro_cpyfmt() blues Keywords: ATARI ST, GEM, VDI, C Message-ID: <3417@quepasa.cs.tu-berlin.de> Date: 21 May 91 13:04:50 GMT References: <1991May21.104617.26475@informatik.uni-erlangen.de> Organization: Technical University of Berlin, Germany Lines: 36 In article <1991May21.104617.26475@informatik.uni-erlangen.de> lsmichae@immd4.informatik.uni-erlangen.de (Lars Michael) writes: >I have some problems with the VDI function 'copy raster opaque'. > line = (Getrez()==2)?80:160; /* get number of Words in scanline */ Don't use Getrez(). This code will crash under nearly all graphics cards (MATRIX, MGE, OverScan, Reflex) and even on the TT. If you blit to / from the screen you must set fd_addr = NULL. In this case all other values are filled in by the VDI. You can't know how many BytesPerLine the actual graphics card has. For the 'offscreen' MFDB, you must use w/16*planes. It does not matter if the BPL in the offscreen area is different to the screen MFDB (As in OverScan mode or with the Reflex card), the VDI handles this correctly. > src_mfdb.fd_nplanes = 4>>Getrez(); You get the plane count with the vq_extend call or in the AES global[10] array but NOT with Getrez()! >The routine will be entered by a call like >copy_block(Logbase(), temp, xdial, ydial, wdial, hdial); Don't intercept VDI and XBIOS calls. The Xbios calls are only for the 'main console' of the ST and not for a graphics card. (But most cards have an emulation of the calls). If you use Getrez() with a Matrix card installed, you will get the rez of the (probably not connected) ST-monitor. With Physbase(), Setpallete, Setcolor there is the same problem. >Now, can someone tell me, what's wrong ? Your main 'bug' is in the pxy array. The '+3' copys more memory lines than possible, so you get an bus-error in the color resolution. > lsmichae@faui43.uni-erlangen.de Karsten, ki@opal.cs.tu-berlin.de (Meet me in +Atari on IRC...)