home *** CD-ROM | disk | FTP | other *** search
- /*PROC programinfo
-
- Program : BouncingPixel
- Contents : Bildschirmschoner-Modul
- Author : Aicke Schulz
- Address : Neudecker Weg, 12355 Berlin, Deutschland
- Phone : 030/6644822
- Copyright : Teil des Shareware-Programms Madhouse ©1994-1996 by Carsten Jahn und Aicke Schulz
- Compiler : 3.2e
- OS : 2.0+ (?)
- History : 1.0, 27.11.1995
- - erste Veröffentlichung, in Amos programmiert
- 1.1, 18.03.1996
- - INT: in E neugeschrieben
- - CHG: Sound erstmal nicht mehr drin (wie mach ich das bloß ???)
- 1.2, 04.04.1996
- - INT: Screenmode wählbar (u.a. kleine Hammerroutine die jumpheightmax bestimmt)
- - INT: nutze jetzt den COMPLEMENT-Modus beim zeichnen
- 1.3, 11.07.1996
- - INT: benutzt neues Madhouse2 Protokoll
- 1.35, 06.01.1997
- - INT: Madhouse2 Protokoll-Anpassung vervollständigt
- 1.40, 18.03.1997
- - INT: kleine Optimierungen im Sourcecode
- 1.50, 09.12.1997 [CJ]
- - CHG: Kein Complement-Modus mehr (killt GraKas...)
- 1.55, 09.12.1997 [CJ]
- - INT: Pixelfarbe einstellbar.
-
- ENDPROC*/
-
- MODULE 'dos/dos',
- 'exec/memory',
- 'graphics/modeid',
- 'intuition/intuition',
- 'intuition/screens',
- 'madblankersupport',
- 'madhouse/madblankersupport',
- 'other/stayrandom'
-
- DEF blankjob : PTR TO mbs_blankjob,
- screen : PTR TO screen,
- window : PTR TO window,
- color : mbs_color,
- screenmode, jumpwidth, palette
-
- PROC exit ()
-
- IF palette THEN Mbs_freepalette (palette)
-
- IF window THEN CloseWindow (window)
- IF screen THEN CloseScreen (screen)
-
- Mbs_quit ()
- CloseLibrary (madblankersupportbase)
- CleanUp (0)
-
- ENDPROC
- PROC readprefs ()
-
- jumpwidth := Mbs_getprefs ('jumpwidth', 2)
- screenmode := Mbs_getscreenmodeprefs (0)
-
- ENDPROC
- PROC setup ()
-
- IF (screen := OpenScreenTagList (NIL,
- [SA_COLORS, [0, 0, 0, 0, 1, 15, 15, 15, - 1] : colorspec,
- SA_DEPTH, 1,
- SA_DISPLAYID, screenmode,
- SA_OVERSCAN, OSCAN_STANDARD,
- SA_QUIET, TRUE,
- SA_TITLE, 'BouncingPixel',
- NIL])) = NIL OR
-
- (window := OpenWindowTagList (NIL,
- [WA_ACTIVATE, TRUE,
- WA_AUTOADJUST, TRUE,
- WA_BORDERLESS, TRUE,
- WA_CUSTOMSCREEN, screen,
- WA_NOCAREREFRESH, TRUE,
- NIL])) = NIL
-
- IF StrCmp (blankjob.language, 'deutsch')
- Mbs_errorreport ('Kann den Screen nicht öffnen.\n')
- ELSE
- Mbs_errorreport ('Could not open Screen.\n')
- ENDIF
-
- exit ()
-
- ENDIF
-
- Mbs_clearmousepointer (screen)
- -> SetDrMd (screen.rastport, $2)
-
-
- IF (palette := Mbs_allocpalette ()) = NIL THEN exit ()
- Mbs_setpalettescreen (palette, screen)
-
- color.r := 0
- color.g := 0
- color.b := 0
- Mbs_putpalettecolor (palette, 0, color)
-
- color.r := 255
- color.g := 255
- color.b := 0
- Mbs_getcolorprefs ('pixelcol', color)
- Mbs_putpalettecolor (palette, 1, color)
-
- Mbs_refreshpalette( palette, screen )
- ENDPROC
- PROC main ()
-
- DEF counter = 100, jumpheight, jumpheightmax = 0, screenheight, screenwidth, screenrastport, x, y
-
- IF madblankersupportbase := OpenLibrary ('madblankersupport.library', MADBLANKERSUPPORT_VMIN)
-
- ->Mbs_debugmode ()
- blankjob := Mbs_getblankjob ()
-
- ELSE
-
- CleanUp (0)
-
- ENDIF
-
- stayrandom ()
- readprefs ()
- setup ()
-
- screenheight := screen.height * 10
- screenwidth := screen.width
- screenrastport := screen.rastport
-
- x := Rnd (screenwidth)
- y := screenheight
-
- IF Rnd (2) = 0 THEN jumpwidth := - jumpwidth
-
- WHILE screenheight > counter
-
- INC jumpheightmax
- counter := counter + jumpheightmax
-
- ENDWHILE
-
- WHILE Mbs_continueblanking () = MBSCB_CONTINUE
-
- SetAPen( screenrastport, 0 )
- WritePixel (screenrastport, x, y / 10)
-
- x := x + jumpwidth
- INC jumpheight
- y := y + jumpheight
-
- IF x > screenwidth OR x < 0
-
- jumpwidth := - jumpwidth
- x := jumpwidth * 2 + x
-
- ENDIF
-
- IF y > screenheight
-
- y := screenheight
- jumpheight := - Rnd (jumpheightmax - 20) - 20
- y := jumpheight * 2 + y
-
- ENDIF
-
- SetAPen( screenrastport, 1 )
- WritePixel (screenrastport, x, y / 10)
- WaitTOF ()
-
- ENDWHILE
-
- exit()
-
- ENDPROC
-
- CHAR '$VER: MadhouseBlanker - BouncingPixel® 1.55 (09.12.1997) Aicke Schulz'
-
-