home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Devil's Doorknob BBS Capture (1996-2003)
/
devilsdoorknobbbscapture1996-2003.iso
/
Dloads
/
SYSOP
/
MODS1.ZIP
/
AQUA25A.MOD
< prev
next >
Wrap
Text File
|
1994-05-03
|
13KB
|
459 lines
┌──────────────────────────────────────────────────────────────────────────┐
│ Mod Name: AQUA25A.MOD Author: AquaMaestro 1@7704 IceNET │
│ Difficulty: ████▒▒▒▒▒▒ Date: 12/25/93 1@7724 WW4net │
│ Modified: COM.C, BBSUTL.C, MSGBASE.C, │
│ VARDEC.H, VARS.H, BBS.C │
│ WWIV Version : 4.23 │
│ Short Desc. : Gives WWIV the capability for 94 configurable colors, │
│ with the same ^P-character capability. Does not change │
│ the operation of the stock ^P0-9 color commands. │
└──────────────────────────────────────────────────────────────────────────┘
*** FIXED BY Pâpâ ßêâr (1@5079.wwivnet / 1@5050.sexnet) by popular demand ***
*** I'm responsible for STEPs 9a, 9b, and 9c ***
Long Desc. : Back when we were all running 4.21a, Gate Keeper came out
with a mod adding ^P 8 and 9, plus ^P A-Z. It worked fine,
and changing the colors around wasn't too difficult, since
the colors' ANSI definitions were contained in STATUS.DAT.
When 4.23 came around, GATECLR2 no longer would work without
more modification than I was up to. Also, the new 4.23
INIT didn't like the 50 or so bytes that were added to
STATUS.DAT, and I ended up recoding 4.23 before I could
install it. Anyway, this mod allows for 94 colors,
including the 0-9 that 4.23 includes, which can be
reconfigured at will. The color definitions are stored in
COLOR.DAT, rather than STATUS.DAT, where they won't get in
the way.
Purely as an aside, we're dealing with three banks of ASCII chars:
032-047 : ' ' to '/'
048-057 : '0' to '9'
058-126 : ':' to '~'
Key:
/*==*/ Existing Code
/*++*/ Add this Code
/*--*/ Subtract this Code
/*%%*/ Change this Code
Step 1:
Back up your source. If we added up all the costs of sending these step 1's
in all the mods every posted on the mod subs, how much have we spent?
Step 2:
Load VARDEC.H. Add this code after the structure defintion for .status:
/*==*/ last_bbslist; /* date last bbslist.net */
/*==*/ float net_req_free; /* net free factor def 3 */
/*==*/ char res[31]; /* RESERVED */
/*==*/} statusrec;
/*==*/
/*++*/typedef struct {
/*++*/ unsigned char resx[240]; /* Includes padding */
/*++*/} colorrec;
/*==*/
/*==*/
/*==*//* MESSAGE BASE INFORMATION */
/*==*/typedef struct {
/*==*/ char name[41], /* board name */
Declaring a type for the color information here is frankly redundant,
but it's simpler to allow it to be changed, and allows for updates or changes
to the mod.
Step 2:
Load UTILITY.C, and add this line:
/*==*/static int statusfile=-1;
/*++*/static int colorfile=-1;
And, somewhere below that, add these four voids:
void get_colordata(void)
{
char s[81];
if (colorfile<0) {
sprintf(s,"%sCOLOR.DAT",syscfg.datadir);
colorfile=sh_open1(s,O_RDWR | O_BINARY | O_CREAT);
read(colorfile,(void *)(&rescolor), sizeof(colorrec));
colorfile=sh_close(colorfile);
}
}
void save_colordata(void)
{
char s[81];
sprintf(s,"%sCOLOR.DAT",syscfg.datadir);
colorfile=sh_open1(s,O_RDWR | O_BINARY | O_CREAT);
sh_write(colorfile, (void *)(&rescolor), sizeof(colorrec));
colorfile=sh_close(colorfile);
}
void list_ext_colors(void)
{
goxy(40,7);
prt(7,"┌─────────────────────────┐");
goxy(40,8);
prt(7,"│ 2COLOR LIST7 │");
goxy(40,9);
prt(7,"├─────────────────────────┤");
goxy(40,10);
prt(7,"│ 0 !!0 \"\"0 ##0 $$0 %%0 &&0"
" ''0 ((0 ))0 **0 ++7 │");
goxy(40,11);
prt(7,"│ ,,0 --0 ..0 //0 000 110 220"
" 330 440 550 660 777 │");
goxy(40,12);
prt(7,"│ 880 990 ::0 ;;0 <<0 ==0 >>0"
" ??0 @@0 AA0 BB0 CC7 │");
goxy(40,13);
prt(7,"│ DD0 EE0 FF0 GG0 HH0 II0 JJ0"
" KK0 LL0 MM0 NN0 OO7 │");
goxy(40,14);
prt(7,"│ PP0 QQ0 RR0 SS0 TT0 UU0 VV0"
" WW0 XX0 YY0 ZZ0 [[7 │");
goxy(40,15);
prt(7,"│ \\\\0 ]]0 ^^0 __0 ``0 aa0 bb0"
" cc0 dd0 ee0 ff0 gg7 │");
goxy(40,16);
prt(7,"│ hh0 ii0 jj0 kk0 ll0 mm0 nn0"
" oo0 pp0 qq0 rr0 ss7 │");
goxy(40,17);
prt(7,"│ tt0 uu0 vv0 ww0 xx0 yy0 zz0"
" {{0 ||0 }}0 ~~0 [[7 │");
goxy(40,18);
prt(7,"├─────────────────────────┤");
goxy(40,19);
prt(7,"│ │");
goxy(40,20);
prt(7,"└─────────────────────────┘");
}
void color_config(void)
{
char s[81],ch,ch1;
unsigned c;
int i,done=0,n;
strcpy(s," SAMPLE COLOR ");
get_colordata();
do {
outchr(12);
pl("Extended Color Configuration - Enter Choice, ^Z to Quit, ^R to Relist");
outstr(": ");
list_ext_colors();
goxy(2,2);
ch=getkey();
if (ch==26)
done=1;
if (ch==18) {
list_ext_colors();
goxy(2,2);
}
if (ch>=32) {
outchr(ch);
n=ch-48;
nln(2);
color_list();
ansic(0);
nl();
prt(2,get_string(430));
ch1=onek("01234567");
c=ch1-'0';
goxy(41,19);
setc(c);
outstr(s);
ansic(0);
goxy(1,16);
prt(2,get_string(431));
ch1=onek("01234567");
c=c | ((ch1-'0') << 4);
goxy(41,19);
setc(c);
outstr(s);
ansic(0);
goxy(1,17);
nl();
prt(5,get_string(434));
if (yn())
c |= 0x08;
goxy(41,19);
setc(c);
outstr(s);
ansic(0);
goxy(1,18);
nl();
prt(5,get_string(437));
if (yn())
c |= 0x80;
nl();
goxy(41,19);
setc(c);
outstr(s);
ansic(0);
goxy(1,21);
setc(c);
outstr(describe(c));
ansic(0);
nln(2);
prt(5,get_string(438));
if (yn()) {
nl();
pl(get_string(439));
nl();
if ((n<=-1) && (n>=-16))
rescolor.resx[207+abs(n)]=c;
else if ((n>=0) && (n<=9))
thisuser.colors[n]=c;
else
rescolor.resx[n-10]=c;
} else {
nl();
pl(get_string(440));
nl();
}
}
} while ((!done) && (!hangup));
nln(2);
prt(5,"Save changes? ");
if (yn())
save_colordata();
else
get_colordata();
outchr(12);
nln(3);
}
void buildcolorfile(void)
{
int i,i1,colorfile;
char s[81],s1[81];
sprintf(s1,"%sCOLOR.DAT",syscfg.datadir);
colorfile=sh_open1(s1,O_RDWR | O_BINARY | O_CREAT);
nl();
for (i=0; i<240; i++)
rescolor.resx[i]=i+1;
sh_write(colorfile, (void *)(&rescolor), sizeof(colorrec));
colorfile=sh_close(colorfile);
}
Step 3:
Load COM.C, and make this change in void outchr():
/*==*/ int i, i1;
/*==*/
/*==*/ if (change_color) {
/*==*/ change_color = 0;
/*--*/ if ((c >= '0') && (c <= '9'))
/*--*/ ansic(c - '0');
/*++*/ if ((c>=32) && (c<=126))
/*++*/ ansic(c-48);
/*==*/ return;
/*==*/ }
/*==*/ if (c == 3) {
/*==*/ change_color = 1;
/*==*/ return;
Then, replace void ansic() with this one:
void ansic(int n)
{
char c;
if ((n<=-1) && (n>=-16))
c=((thisuser.sysstatus & sysstatus_color) ?
rescolor.resx[207+abs(n)] : thisuser.bwcolors[0]);
if ((n>=0) && (n<=9))
c=((thisuser.sysstatus & sysstatus_color) ?
thisuser.colors[n] : thisuser.bwcolors[n]);
if ((n>=10) && (n<=207))
c=((thisuser.sysstatus & sysstatus_color) ?
rescolor.resx[n-10] : thisuser.bwcolors[0]);
if (c==curatr)
return;
setc(c);
makeansi((thisuser.sysstatus & sysstatus_color) ?
thisuser.colors[0] : thisuser.bwcolors[0],endofline,0);
}
Step 4:
Load BBSUTL.C, and replace the Ctrl-P switch within int inli() with this:
/*==*/ s[cp++]=8;
/*==*/ }
/*==*/ break;
/*++*/ case 16: /* Ctrl-P */
/*++*/ if (cp<maxlen-1) {
/*++*/ ch=getkey();
/*++*/ if ((ch>=32) && (ch<=126)) {
/*++*/ s[cp++]=3;
/*++*/ s[cp++]=ch;
/*++*/ ansic(ch-48);
/*++*/ }
/*++*/ }
/*++*/ topscreen();
/*++*/ break;
/*==*/ case 9: /* Tab */
/*==*/ i=5-(cp % 5);
/*==*/ if (((cp+i)<maxlen) && ((wherex()+i)<thisuser.screenchars)) {
Step 5:
Load BBSOVL2.C, and replace the Ctrl-P switch in void two_way_chat() with
this one:
/*==*/ outchr(8);
/*==*/ side1[wherey()-13][cp1++]=8;
/*==*/ }
/*==*/ break;
/*++*/ case 16: /* Ctrl-P */
/*++*/ if (side==0) {
/*++*/ if (cp0<maxlen-1) {
/*++*/ ch=getkey();
/*++*/ if ((ch>=32) && (ch<=126)) {
/*++*/ side0[wherey()][cp0++]=3;
/*++*/ side0[wherey()][cp0++]=ch;
/*++*/ ansic(ch-48);
/*++*/ }
/*++*/ }
/*++*/ } else {
/*++*/ if (cp1<maxlen-1) {
/*++*/ ch=getkey();
/*++*/ if ((ch>=32) && (ch<=126)) {
/*++*/ side1[wherey()-13][cp1++]=3;
/*++*/ side1[wherey()-13][cp1++]=ch;
/*++*/ ansic(ch-48);
/*++*/ }
/*++*/ }
/*++*/ }
/*++*/ break;
/*==*/ case 9: /* Tab */
/*==*/ if (side==0) {
/*==*/ i=5-(cp0 % 5);
Step 6:
Load MSGBASE.C, and make these changes in void inmsg():
/*==*/ if (!fsed) {
/*==*/ outstr(get_string(627));
/*==*/ pln(maxli);
/*%%*/ outstr(get_string(628));
/*++*/ pl("Colors: ^P-0112233445566778899AABBCC"
/*++*/ "DDEEFFGGHHIIJJKKLLMMNNOOPPQQRRSS"
/*++*/ "TTUUVVWWXXYYZZ0");
/*==*/ strcpy(s,get_string(629));
/*==*/ s[thisuser.screenchars]=0;
Step 7:
Load BBS.C, and add the following two // command entries:
/*==*/ topscreen();
/*==*/ }
/*++*/ if ((strcmp(s,"COLOREDIT")==0) || (strcmp(s,"CLE")==0))
/*++*/ color_config();
/*++*/ if ((strcmp(s,"COLORINIT")==0) || (strcmp(s,"CI")==0))
/*++*/ buildcolorfile();
/*==*/ if ((strcmp(s,"CHUSER")==0) || (strcmp(s,"CU")==0)) {
Step 8:
Load FCNS.H, and add the following entries to the utility.c entry, or
just use MAKE FCNS, if you prefer.
/*==*/void win_pause(void);
/*++*/void get_colordata(void);
/*++*/void save_colordata(void);
/*++*/void list_ext_colors(void);
/*++*/void color_config(void);
/*==*/void get_status(int mode, int lock);
Step 9:
Recompile.
-----------------------------------------------------------------------------
STEP 9a: ADD this line to VARS.H:
== __EXTRN__ configoverrec syscfgovr;
== __EXTRN__ statusrec status;
++ __EXTRN__ colorrec rescolor; // AQUA25 94 COLORS
== __EXTRN__ smalrec huge *smallist;
== __EXTRN__ subboardrec *subboards;
-----------------------------------------------------------------------------
STEP 9b: ADD this line to XINIT.C, right above the final }
== if (!restoring_shrink)
== catsl();
==
== write_inst(INST_LOC_WFC,0,INST_FLAGS_NONE);
==
== get_colordata(); // AQUA25 94 COLORS
== }
-----------------------------------------------------------------------------
STEP 9c: ADD this line to NEWUSER.C, in function void newuser(void) :
== void newuser(void)
== {
== int i,ok;
== char s[255],s1[81],ch;
== userrec u;
== long l1;
==
++ get_colordata(); // AQUA25 94 COLORS
==
== memset(&thisuser, 0, sizeof(userrec));
== memset(qsc, 0, syscfg.qscn_len);
-----------------------------------------------------------------------------
Step 10:
This is my COLOR.DAT file, containing my recommended color scheme. It
includes Shift 1-0 as ANSI 01-10 (dark blue to intense green), '_', '+', '|'
as ANSI 11, 12 and 13, and '-' and '=' as ANSI 14 and 15, much like entering
colors in TheDraw, which most people are familiar with. ^P-M and N, O and P,
and so forth are first an intense color on its corresponding background,
followed by intense white on the same background. If you'd like to use this
configuration, either in its current form or as a basis from which to modify,
UUDECODE this and put it in your DATA directory.
section 1 of uuencode 5.22 of file color.dat by R.E.M.
begin 644 color.dat
M`0(##P4&`@@*#0P/@82(B8J-A1D?*B\[/TQ/75]N;W]X(B,D!@LG"`H-#`^!
MA(B)BHV%&1\J+SL_3$]=7VYO?WA"#6I%1D=(24I+3$U.3U!14E-4!E976%E:
M6UQ=7E]@86)C9&5F9VAI:FML;6YO<'%R<W1U=G=X>7I[?'U^?X"!@H.$A8:'
MB(F*BXR-CH^0D9*3E)66EYB9FIN<G9Z?H*&BHZ2EIJ>HJ:JKK*VNK["QLK.T
MM;:WN+FZN[R]OK_`P<+#Q,7&Q\C)RLO,S<[/T-'2#M0,"@H)B@<%!`/>`>#A
/XN/DY>;GZ.GJZ^SM[N_P
`
end
sum -r/size 62576/358 section (from "begin" to "end")
sum -r/size 14788/240 entire input file