Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!samsung!brutus.cs.uiuc.edu!wuarchive!cec2!meb4074 From: meb4074@cec1.wustl.edu (Mark Edward Bradley) Newsgroups: comp.sys.mac.programmer Subject: Low level printer driver calls Message-ID: <1989Dec8.040721.28042@cec1.wustl.edu> Date: 8 Dec 89 04:07:21 GMT Sender: news@cec2 (USENET News System) Distribution: na Organization: Washington University, St. Louis MO Lines: 45 If anyone is familiar with low-level printer driver calls, I would appreciate some advice. I am using the access routines described in Inside Mac II, chapter 5. I am trying to output a bitmap to the printer, with dubious success. My code follows: (I am programming in assembly language. Sorry, C gods, I'm a new boy) _PrDrvrOpen ; Open the driver move.w #iPrDevCtl,-(SP) ; Printer control code move.l #lPrReset,-(SP) ; Reset printer code move.l #0,-(SP) ; Unused move.l #0,-(SP) _PrCtlCall ; Call the driver routine move.w #iPrBitsCtl,-(SP) ; Bit map printing code move.l MyWindPtr,-(SP) ; Window pointer addq.l #2,(SP) ; Set pointer on stack to the portBits pea MyRect ; Enclosing rectangle move.l #lPaintBits,-(SP) ; Use square pixels _PrCtlCall move.w #iPrDevCtl,-(SP) move.l #lPrPageEnd,-(SP) ; End page code move.l #0,-(SP) move.l #0,-(SP) _PrCtlCall _PrDrvrClose ; Close the driver The first time this routine executes, everything works. Any time after that, the code executes (I checked w/ MacsBug), but the printer doesn't respond. When I go to the Chooser, the printer is no longer selected. After re-selecting, exiting, and re-entering, it still is not selected. When I exit my program, the system crashes, but not always immediately. And when I reboot, the printer will form feed without prompting at some point. (Seems to happen during window operations?) Very little of the code above is my own. It's almost verbatim from IM. I don't know what I'm missing. If you know what might be the problem or if I'm leaving something out, please e-mail. I'm using a Mac SE with 2MB, no special hardware, an AppleTalk Imagewriter and an AppleTalk ImageWriter LQ. I'm also using the Consulair Development System. Profuse thanks, Mark ------------------------------------------------------------------------------- "Come to .test, | meb4074@cec1.wustl.edu | "I'm brave! the land without | Mark Edward Bradley | But I'm careful." flames!" | Markie B.!! | -- Goofy