-/*\r
- * Functions for handling modex and doing other basic graphics stuff.\r
- */\r
-#ifndef MODEX16_H\r
-#define MODEX16_H\r
-#include <conio.h>\r
-#include "src\lib\types.h"\r
-#include "src\lib\bitmap.h"\r
-\r
-/* -========================== Types & Macros ==========================- */\r
-#define PAGE_OFFSET(x,y) (((y)<<6)+((y)<<4)+((x)>>2))\r
-#define PLANE(x) (1<< (x&3))\r
-#define SELECT_ALL_PLANES() outpw(0x03c4, 0xff02)\r
-\r
-typedef struct {\r
- byte far* data; /* the data for the page */\r
- word dx; /* col we are viewing on the virtual screen */\r
- word dy; /* row we are viewing on the virtual screen */\r
- word width; /* virtual width of the page */\r
- word height; /* virtual height of the page */\r
-} page_t;\r
-\r
-/* -============================ Functions =============================- */\r
-/* mode switching, page, and plane functions */\r
-void modexEnter();\r
-void modexLeave();\r
-page_t modexDefaultPage();\r
-page_t modexNextPage(page_t *p);\r
-void modexShowPage(page_t *page);\r
-void modexPanPage(page_t *page, int dx, int dy);\r
-void modexSelectPlane(byte plane);\r
+/* Project 16 Source Code~
+ * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669
+ *
+ * This file is part of Project 16.
+ *
+ * Project 16 is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Project 16 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>, or
+ * write to the Free Software Foundation, Inc., 51 Franklin Street,
+ * Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ */
+/*
+ * Functions for handling modex and doing other basic graphics stuff.
+ */
+#ifndef MODEX16_H
+#define MODEX16_H
+//#include <conio.h>
+
+#include "src/lib/types.h"
+#include "src/lib/bitmap.h"
+#include "src/lib/planar.h"
+#include "src/lib/lib_head.h"
+
+/* -========================== Types & Macros ==========================- */
+#define PAGE_OFFSET(x,y) (((y)<<6)+((y)<<4)+((x)>>2))
+#define PLANE(x) (1<< (x&3))
+#define SELECT_ALL_PLANES() outpw(0x03c4, 0xff02)
+
+typedef struct {
+ word id; /* the Identification number of the page~ For layering~ */
+ byte far* data; /* the data for the page */
+ word dx; /* col we are viewing on the virtual screen */
+ word dy; /* row we are viewing on the virtual screen */
+ word width; /* virtual width of the page */
+ word height; /* virtual height of the page */
+} page_t;
+
+typedef union
+{
+ byte red;
+ byte green;
+ byte blue;
+} rgb_t;
+
+/* -============================ Functions =============================- */
+/* mode switching, page, and plane functions */
+void modexEnter();
+void modexLeave();
+page_t modexDefaultPage();
+page_t modexNextPage(page_t *p);
+page_t modexNextPage0(page_t *p, word x, word y);
+void modexShowPage(page_t *page);
+void modexPanPage(page_t *page, int dx, int dy);
+void modexSelectPlane(byte plane);