CompuServe Thread

#Screen Clearing

6 messages in this thread
#105139From: Bob ShimboJan 24, 1988 7:51 PM
Here a bit of a weird problem. I'opened an Intuition screen and tried to clear it. The problem is that in addition to blanking the screen, the ClearScreen also zeros part of an array. I've been beating on this problem for 3 days now and I'm sure it must be something simple. Here is the code in question, any ideas will be greatly appreciated: #include <exec/types.h> #include <exec/nodes.h> #include <exec/lists.h> #include <exec/memory.h> #include <exec/interrupts.h> #include <exec/errors.h> #include <exec/ports.h> #include <exec/libraries.h> #include <exec/io.h> #include <exec/devices.h> #include <devices/console.h> #include <devices/timer.h> #include <devices/keymap.h> #include <devices/inputevent.h> #include <devices/narrator.h> Thank Bob
#105174From: John DraperJan 24, 1988 11:22 PM
Bob, Your code didn't all make it. (I'm trying very hard to refrain from noting that the code that did make it to the messsage will produce a singularly uninteresting program, but am not succeeding). One tip… a '/' at the beginning of a line is an editor command here. Regards, Larry.
#105328From: Bob ShimboJan 25, 1988 8:47 PM
Ok Larry, I'll reformat the program and try again. It never occured to me to watch for the / at the beginning of the line.
#105334From: Bob ShimboJan 25, 1988 9:29 PM
Ok, once more with feeling. /* Aztec C V3.40a, cc test, ln -W +cd test.o -lc */ /* includes */ #include <exec/types.h> #include <exec/nodes.h> #include <exec/lists.h> #include <exec/memory.h> #include <exec/errors.h> #include <exec/ports.h> #include <exec/libraries.h> #include <exec/io.h> #include <exec/devices.h> #include <devices/inputevent.h> #define Msg IOStdReq #include <libraries/dos.h> #include <libraries/dosextens.h> #include <graphics/gfx.h> #include <graphics/regions.h> #include <hardware/blit.h> #include <hardware/custom.h> #define blitNode bltnode #include <graphics/copper.h> #include <graphics/display.h> #include <graphics/gels.h> #include <graphics/clip.h> #include <graphics/rastport.h> #include <graphics/view.h> #include <graphics/gfxbase.h> #include <graphics/text.h> #include <graphics/gfxmacros.h> #include <graphics/layers.h> #include <intuition/intuition.h> #include <intuition/intuitionbase.h> #includ <stdio.h> #include <math.h> #include <ctype.h> #include <fcntl.h> #include <functions.h> #define SBMWIDTH 320L #define SBMHEIGHT 200L #define SBMDEPTH 5L #define INTUITION_REV 29L #define GRAPHICS_REV 29L int debug = 1; struct DosLibrary *DosBase; struct IntuitionBase *IntuitionBase; struct GfxBase *GfxBase; struct Screen *Screen; struct TextAttr MyFont = { (UBYTE *)"topaz.font", TOPAZ_EIGHTY, FS_NORMAL, FPF_ROMFONT }; struct NewScreen NewScreen = { 0L, 0L, SBMWIDTH, SBMHEIGHT, SBMDEPTH, 26L, 1L, NULL, CUSTOMSCREEN | SCREENBEHIND, &MyFont, NULL, NULL, NULL }; int Stars[512]; main() { DosBase = (struct DosLibrary *)OpenLibrary("dos.library", 0L); IntuitionBase = (struct IntuitionBase *)OpenLibrary("intuition.library", INTUITION_REV); GfxBase = (struct GfxBase *)OpenLibrary("graphics.library", GRAPHICS_REV); Screen = OpenScreen(&NewScreen); Stars[510] = 10; Move(&Screen->RastPort, 0l, 0l); printf("mag=%d\n", Stars[510]); /* prints 10 */ ClearScreen(&Screen->RastPort); printf("mag=%d\n", Stars[510]); /* prints 0 */ CloseScreen(Screen); CloseLibrary((struct Library *)GfxBase); CloseLibrary((struct Library *)IntuitionBase); CloseLibrary((struct Library *)DosBase); }
#105355From: Steve AhlstromJan 25, 1988 10:06 PM
Looks like the code came thru fine this time, but, I forgot the question. Just looking at it as it scrolled by at 2400 baud I didn't see anything 'wrong' but what are you forcing intuition rev 29 ?
#105530From: Bob ShimboJan 26, 1988 6:57 PM
The question is why does clearing the screen zero part of the array contents? I've a work-around but it bothers me that I can't explain the problem. As to forcing rev 29, I just hadn't updated the rev number in this test. (I have been using an old boiler plate for simple programs.) At this point, I'm more curious than frantic about the problem. Bob