1 /* Project 16 Source Code~
\r
2 * Copyright (C) 2012-2022 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover
\r
4 * This file is part of Project 16.
\r
6 * Project 16 is free software; you can redistribute it and/or modify
\r
7 * it under the terms of the GNU General Public License as published by
\r
8 * the Free Software Foundation; either version 3 of the License, or
\r
9 * (at your option) any later version.
\r
11 * Project 16 is distributed in the hope that it will be useful,
\r
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
14 * GNU General Public License for more details.
\r
16 * You should have received a copy of the GNU General Public License
\r
17 * along with this program. If not, see <http://www.gnu.org/licenses/>, or
\r
18 * write to the Free Software Foundation, Inc., 51 Franklin Street,
\r
19 * Fifth Floor, Boston, MA 02110-1301 USA.
\r
26 #include "src/lib/16_vl.h"
\r
28 #define PRINTTEXTBOXSTABLE
\r
30 void VL_modexPrintTextBox(global_game_variables_t *gvar)
\r
32 #define PRINTTEXTBOXW gvar->video.page[0].width
\r
33 #define PRINTTEXTBOXH gvar->video.page[0].height-96
\r
34 #define PRINTTEXTBOXY 160-48//112//184//gvar->video.page[0].height-100-16
\r
35 //#define PRINTTEXTBOXSIZE 20480//51200
\r
36 #define PRINTTEXTBOXHLINE 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD//, 0xCD, 0xCD, 0xCD, 0xCD
\r
37 #define PRINTTEXTBOXHLINETOP 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCB, 0xCD, PRINTTEXTBOXHLINE
\r
38 #define PRINTTEXTBOXHLINEBOTTOM 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCA, 0xCD, PRINTTEXTBOXHLINE
\r
39 #define PRINTTEXTBOXSLINE 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20//, 0x20, 0x20, 0x20, 0x20
\r
40 #define PRINTTEXTBOXSTRA2CHAR 0x20//07
\r
41 #define PRINTTEXTBOXSTRA2STR PRINTTEXTBOXSTRA2CHAR, PRINTTEXTBOXSTRA2CHAR, PRINTTEXTBOXSTRA2CHAR, PRINTTEXTBOXSTRA2CHAR, PRINTTEXTBOXSTRA2CHAR, PRINTTEXTBOXSTRA2CHAR, PRINTTEXTBOXSTRA2CHAR, PRINTTEXTBOXSTRA2CHAR
\r
42 byte str1[41] = { 0xC9, PRINTTEXTBOXHLINETOP, 0xBB, 0x00 };
\r
43 #ifdef PRINTTEXTBOXSTABLE
\r
44 byte str2[41] = { 0xBA, PRINTTEXTBOXSTRA2STR, 0xBA, PRINTTEXTBOXSLINE, 0xBA, 0x00 };
\r
46 byte str2[2] = { 0xBA, 0x00 },
\r
47 stra2[7] = { PRINTTEXTBOXSTRA2STR, 0x00 },
\r
48 strb2[] = { 0xBA, PRINTTEXTBOXSLINE, 0xBA, 0x00 };
\r
50 byte str3[41] = { 0xC8, PRINTTEXTBOXHLINEBOTTOM, 0xBC, 0x00 };
\r
51 word x = gvar->video.page[/*!*/(gvar->video.p)].dx; //(gv->video.page[(gv->video.p)].tlx) - // follow the screen
\r
52 word y = gvar->video.page[/*!*/(gvar->video.p)].dy; //(gv->video.page[(gv->video.p)].tly) - // follow the screen
\r
53 word col = 3, bgcol = 0, type = 1;//w = 64, h = 8,
\r
54 word v = PRINTTEXTBOXY; //vertical offset
\r
58 // word huge textboxbuff[PRINTTEXTBOXSIZE];
\r
59 #ifndef PRINTTEXTBOXSTABLE
\r
63 modexCopyPageRegion(&gvar->video.page[1], &gvar->video.page[0],
\r
68 PRINTTEXTBOXW, PRINTTEXTBOXH);
\r
69 // memcpy(&textboxbuff, gvar->video.page[0].data, PRINTTEXTBOXSIZE);
\r
70 // mxOutText(xpos+1, ypos+gvar.video.page[0].height-40, "| |Chikyuu:$line1");
\r
71 // mxOutText(xpos+1, ypos+gvar.video.page[0].height-32, "| |$line2");
\r
72 // mxOutText(xpos+1, ypos+gvar.video.page[0].height-24, "| |$line3");
\r
73 // mxOutText(xpos+1, ypos+gvar.video.page[0].height-16, "| |$line4");
\r
74 // mxOutText(xpos+1, ypos+gvar.video.page[0].height-8, "========================================");
\r
76 //modexprint(*page, x, y, type, tlsw, color, bgcolor, sw, *str)
\r
77 sprintf(global_temp_status_text, "%s", str1);
\r
78 modexprint(&(gvar->video.page[(gvar->video.p)]), x, y+gvar->video.page[0].height-v, type, 1, col, bgcol, 1, global_temp_status_text); v-=8;
\r
79 #ifdef PRINTTEXTBOXSTABLE
\r
80 sprintf(global_temp_status_text, "%s", str2); for(i=0;i<8;i++)
\r
81 { modexprint(&(gvar->video.page[(gvar->video.p)]), x, y+gvar->video.page[0].height-v, type, 1, col, bgcol, 1, global_temp_status_text); v-=8; }
\r
86 sprintf(global_temp_status_text, "%s", str2); modexprint(&(gvar->video.page[(gvar->video.p)]), x, y+gvar->video.page[0].height-v, type, 1, col, bgcol, 1, global_temp_status_text); q+=8;
\r
87 sprintf(global_temp_status_text, "%s", stra2); modexprint(&(gvar->video.page[(gvar->video.p)]), x+q, y+gvar->video.page[0].height-v, type, 1, col, 3, 1, global_temp_status_text); q+=40;
\r
88 sprintf(global_temp_status_text, "%s", strb2); modexprint(&(gvar->video.page[(gvar->video.p)]), x+q-8, y+gvar->video.page[0].height-v, type, 1, col, bgcol, 1, global_temp_status_text);
\r
92 sprintf(global_temp_status_text, "%s", str3);
\r
93 modexprint(&(gvar->video.page[(gvar->video.p)]), x, y+gvar->video.page[0].height-v, type, 1, col, bgcol, 1, global_temp_status_text);
\r
95 // sprintf(global_temp_status_text, "%c", 0x07); modexprint(&(gvar->video.page[(gvar->video.p)]), x, y+gvar->video.page[0].height-v, type, 1, col, bgcol, 1, global_temp_status_text);
\r
96 for (i = 0,done = false;!done;)
\r
98 while (!(scan = gvar->in.inst->LastScan))
\r
111 //PM_GetPage(i, gvar);
\r
116 modexCopyPageRegion(&gvar->video.page[0], &gvar->video.page[1],
\r
121 PRINTTEXTBOXW, PRINTTEXTBOXH);
\r
122 // memcpy(&gvar->video.page[0].data, &textboxbuff, PRINTTEXTBOXSIZE);
\r