home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Fred Fish Collection 1.5
/
ffcollection-1-5-1992-11.iso
/
ff_disks
/
200-299
/
ff204.lzh
/
PopInfo
/
PopInfo.h
< prev
next >
Wrap
C/C++ Source or Header
|
1989-04-30
|
7KB
|
220 lines
#include <exec/tasks.h>
#include <exec/memory.h>
#include <intuition/intuitionbase.h>
#include <devices/trackdisk.h>
#include <devices/timer.h>
#include <libraries/dosextens.h>
#include <exec/execbase.h>
#include <stdio.h>
#define DF0 1
#define DF1 2
#define DF2 3
#define DF3 4
#define BLK 5
#define SAVE 6
#define LOAD 7
#define WIPE 8
#define EXIT 9
/* Image-Ed Image generation */
/* Start of Image data */
USHORT popgad1ImageData[]={
/* Plane 0 */
0x0000, 0x0000, 0x3fff, 0xfff0, 0x3dfb, 0xdff0,
0x3dd7, 0x5df0, 0x3dd7, 0x5df0, 0x3df7, 0x5ff0,
0x3df7, 0x5ff0, 0x3df7, 0x5ff0, 0x3dfb, 0xdff0,
0x3fff, 0xfff0, 0x3fff, 0xfff0, 0x2fba, 0xfdf0,
0x3bba, 0xfbb0, 0x3baa, 0xfbb0, 0x3baa, 0xfbb0,
0x3baa, 0xfbb0, 0x3bb6, 0xfbb0, 0x2fba, 0xfdf0,
0x3fff, 0xfff0, 0x0000, 0x0000,
/* Plane 1 */
0xffff, 0xfffc, 0xffff, 0xfffc, 0xfe1c, 0x61fc,
0xfeeb, 0xaefc, 0xfeeb, 0xaefc, 0xfe1b, 0xa1fc,
0xfefb, 0xaffc, 0xfefb, 0xaffc, 0xfefc, 0x6ffc,
0xffff, 0xfffc, 0xffff, 0xfffc, 0xf05d, 0x063c,
0xfdcd, 0x7ddc, 0xfdd5, 0x7ddc, 0xfdd5, 0x0ddc,
0xfdd5, 0x7ddc, 0xfdd9, 0x7ddc, 0xf05d, 0x7e3c,
0xffff, 0xfffc, 0xffff, 0xfffc
};
/* End of Image data */
struct Image popgad1Image={
0,0, /* LeftEdge, TopEdge */
30,20,2, /* Width, Height, Depth */
&popgad1ImageData[0], /* ImageData */
0x3,0x0, /* PlanePick, PlaneOnOff */
NULL /* NextImage */
};
/* Start of Image data */
USHORT popgad2ImageData[]={
/* Plane 0 */
0x0000, 0x0000, 0x3fff, 0xfff0, 0x3ff3, 0xfff0,
0x3fe7, 0xfff0, 0x3fcf, 0xfff0, 0x3fcf, 0xfff0,
0x3fcf, 0xfff0, 0x3fcf, 0xfff0, 0x3fcf, 0xfff0,
0x3fe7, 0xfff0, 0x3fe7, 0xfff0, 0x3fe7, 0xfff0,
0x3ff3, 0xfff0, 0x3ff3, 0xfff0, 0x3fff, 0xfff0,
0x3ff3, 0xfff0, 0x3ff3, 0xfff0, 0x3ff3, 0xfff0,
0x3fff, 0xfff0, 0x0000, 0x0000,
/* Plane 1 */
0xffff, 0xfffc, 0xffff, 0xfffc, 0xfffc, 0x7ffc,
0xfff8, 0x3ffc, 0xfff0, 0x1ffc, 0xfff0, 0x1ffc,
0xfff0, 0x1ffc, 0xfff0, 0x1ffc, 0xfff0, 0x1ffc,
0xfff8, 0x3ffc, 0xfff8, 0x3ffc, 0xfff8, 0x3ffc,
0xfffc, 0x7ffc, 0xfffc, 0x7ffc, 0xffff, 0xfffc,
0xfffc, 0x7ffc, 0xfffc, 0x7ffc, 0xfffc, 0x7ffc,
0xffff, 0xfffc, 0xffff, 0xfffc
};
/* End of Image data */
struct Image popgad2Image={
0,0, /* LeftEdge, TopEdge */
30,20,2, /* Width, Height, Depth */
&popgad2ImageData[0], /* ImageData */
0x3,0x0, /* PlanePick, PlaneOnOff */
NULL /* NextImage */
};
struct Gadget popgad={
NULL,0,0,30,20,GADGHIMAGE|GADGIMAGE,RELVERIFY,BOOLGADGET,&popgad1Image,
&popgad2Image,NULL,NULL,NULL,NULL,NULL};
/* End of Image-Ed Image generation */
USHORT popstay1[]={
0xFFFF,0x8E63,0xB5AD,0xB5AD,0x8DA3,0xBDAF,0xBDAF,0xBE6F,0xFFFF};
USHORT popstay2[]={
0xFFFF,0xC895,0xB565,0xBD65,0xCD0B,0xF56B,0xB56B,0xCD6B,0xFFFF};
struct Image pim1={
0,0,16,9,1,&popstay1[0],0x1,0x0,NULL};
struct Image pim2={
0,0,16,9,1,&popstay2[0],0x1,0x0,NULL};
struct Gadget popstaygad={
NULL,0,-8,16,9,GADGHIMAGE|GADGIMAGE|GRELBOTTOM,RELVERIFY|TOGGLESELECT,
BOOLGADGET,(APTR)&pim1,(APTR)&pim2,NULL,NULL,NULL,NULL,NULL};
short xyborder[]={
-1,-1,50,-1,50,11,-1,11,-1,-1};
struct Border Border={
0,0,2,0,JAM1,5,xyborder,NULL};
struct IntuiText exittext={
3,0,JAM1,10,2,NULL,"EXIT",NULL};
struct IntuiText wipetext={
3,0,JAM1,10,2,NULL,"WIPE",NULL};
struct IntuiText loadtext={
3,0,JAM1,10,2,NULL,"LOAD",NULL};
struct IntuiText savetext={
3,0,JAM1,10,2,NULL,"SAVE",NULL};
struct IntuiText blktext={
3,0,JAM2,10,2,NULL,"BLK1",NULL};
struct IntuiText df3text={
3,0,JAM1,10,2,NULL,"DF3:",NULL};
struct IntuiText df2text={
3,0,JAM1,10,2,NULL,"DF2:",NULL};
struct IntuiText df1text={
3,0,JAM1,10,2,NULL,"DF1:",NULL};
struct IntuiText df0text={
3,0,JAM1,10,2,NULL,"DF0:",NULL};
struct Gadget exitgadget={
NULL,584,117,50,11,GADGHCOMP,RELVERIFY,BOOLGADGET,&Border,NULL,
&exittext,NULL,NULL,EXIT,NULL};
struct Gadget wipegadget={
&exitgadget,584,103,50,11,GADGHCOMP,RELVERIFY,BOOLGADGET,&Border,NULL,
&wipetext,NULL,NULL,WIPE,NULL};
struct Gadget loadgadget={
&wipegadget,584,89,50,11,GADGHCOMP,RELVERIFY,BOOLGADGET,&Border,NULL,
&loadtext,NULL,NULL,LOAD,NULL};
struct Gadget savegadget={
&loadgadget,584,75,50,11,GADGHCOMP,RELVERIFY,BOOLGADGET,&Border,NULL,
&savetext,NULL,NULL,SAVE,NULL};
struct Gadget blkgadget={
&savegadget,584,61,50,11,GADGHCOMP,RELVERIFY,BOOLGADGET,&Border,NULL,
&blktext,NULL,NULL,BLK,NULL};
struct Gadget df3gadget={
&blkgadget,584,47,50,11,GADGHCOMP,RELVERIFY,BOOLGADGET,&Border,NULL,
&df3text,NULL,NULL,DF3,NULL};
struct Gadget df2gadget={
&df3gadget,584,33,50,11,GADGHCOMP,RELVERIFY,BOOLGADGET,&Border,NULL,
&df2text,NULL,NULL,DF2,NULL};
struct Gadget df1gadget={
&df2gadget,584,19,50,11,GADGHCOMP,RELVERIFY,BOOLGADGET,&Border,NULL,
&df1text,NULL,NULL,DF1,NULL};
struct Gadget df0gadget={
&df1gadget,584,5,50,11,GADGHCOMP,RELVERIFY,BOOLGADGET,&Border,NULL,
&df0text,NULL,NULL,DF0,NULL};
struct NewWindow SWindow={
0,10,30,20,3,0,GADGETUP,BORDERLESS|SMART_REFRESH,&popgad,NULL,NULL,
NULL,NULL,0,0,0,0,WBENCHSCREEN};
struct NewWindow MWindow={
0,10,639,0,-1,-1,CLOSEWINDOW|INACTIVEWINDOW|GADGETUP|DISKINSERTED|RAWKEY|
DISKREMOVED|REFRESHWINDOW|MOUSEBUTTONS,WINDOWCLOSE|INACTIVEWINDOW|ACTIVATE|
SMART_REFRESH|RMBTRAP|WINDOWDEPTH|WINDOWDRAG|WINDOWSIZING,&popstaygad,
NULL,"PopInfo v2.9 © Copyright 1989 Jonathan Potter",NULL,NULL,
90,21,639,0,WBENCHSCREEN};
struct NewWindow LWindow={
0,0,640,200,-1,-1,GADGETUP,ACTIVATE|RMBTRAP|SMART_REFRESH,
&df0gadget,NULL,NULL,NULL,NULL,0,0,0,0,WBENCHSCREEN};
struct NewWindow WWindow={
170,85,300,30,-1,-1,MOUSEBUTTONS|RAWKEY|INACTIVEWINDOW,ACTIVATE|RMBTRAP,
NULL,NULL,NULL,NULL,NULL,0,0,0,0,WBENCHSCREEN};
struct IntuitionBase *IntuitionBase;
struct Window *Window, *CWindow;
struct Screen *scr;
struct Port *diskport;
struct IOStdReq *diskreq;
struct IntuiMessage *Msg;
struct FileLock *lock;
struct InfoData *data;
struct DosLibrary *DosBase;
struct DeviceList *devlist;
struct RootNode *rootnode;
struct DosInfo *dosinfo;
struct GfxBase *GfxBase;
struct FileInfoBlock *finfo;
struct DateStamp now;
struct timerequest TimeReq;
struct MsgPort *TimerPort;
FILE *bbsavefile;
char txt[80], wintit[]="PopInfo v2.9 © Copyright 1989 Jonathan Potter";
unsigned char diskbuffer[1024];
unsigned char bootblock[]={
'D','O','S',0,0xC0,0x20,0x0F,0x19,0x00,0x00,0x03,0x70,0x43,0xFA,0x00,
0x18,0x4E,0xAE,0xFF,0xA0,0x4A,0x80,0x67,0x0A,0x20,0x40,0x20,0x68,0x00,
0x16,0x70,0x00,0x4E,0x75,0x70,0xFF,0x60,0xFA,0x64,0x6F,0x73,0x2E,0x6C,
0x69,0x62,0x72,0x61,0x72,0x79,0x00,0x00,0x00,0x00,0x00};
short ScreenHeight;
struct IntuiText mesg={
1,0,JAM1,10,12,NULL,txt,NULL};
int oldpri,numdevs,nondos,nodisk,flag,flag2,sbbflag,a,b,c,x,y,savebb,
dnum,sum,lastsum,error,nsbb[4],oldw,oldh,oldtop,oldleft,maxnumdevs,
onumdevs,namep,popflag,ractreq,xyz,fast,chip,total,hours,mins,secs,
checkbbs,VirusBase;
UBYTE devname[4];
char *volumename, *filename, *bbmess, *status;
char *virusdesc[19];
unsigned int *point1;
unsigned int *point2;
#define iprint Window->RPort
#define cprint CWindow->RPort
#define CHIPMEMORY (AvailMem(MEMF_CHIP) >> 10)*1024
#define FASTMEMORY (AvailMem(MEMF_FAST) >> 10)*1024
#define TOTALMEMORY CHIPMEMORY+FASTMEMORY
#define HOURS now.ds_Minute/60
#define MINS now.ds_Minute%60
#define SECS now.ds_Tick/TICKS_PER_SECOND
#define WINDOWMESSAGE 1L<<Window->UserPort->mp_SigBit
#define TIMERMESSAGE 1L<<TimerPort->mp_SigBit