From: sparky4 Date: Thu, 4 Sep 2014 00:45:52 +0000 (-0500) Subject: deleted: 16/modex16/ED.PCX X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=2d527c547173edff234815d495f298e07bc24a18;p=16.git deleted: 16/modex16/ED.PCX deleted: 16/modex16/GFX.PAL deleted: 16/modex16/MAKEFILE deleted: 16/modex16/MODEX16.C deleted: 16/modex16/MODEX16.H deleted: 16/modex16/PALETTEC.C deleted: 16/modex16/PCXTEST.C deleted: 16/modex16/PCXTEST.EXE deleted: 16/modex16/TEST.C deleted: 16/modex16/TEST.EXE deleted: 16/modex16/TEST.TXT deleted: 16/modex16/TEST2.EXE deleted: 16/modex16/TYPES.H renamed: 16/modex16/286@12.LOG -> 16/mx16/286@12.LOG renamed: 16/modex16/286@8.LOG -> 16/mx16/286@8.LOG renamed: 16/modex16/COMPUTER.PCX -> 16/mx16/COMPUTER.PCX renamed: 16/modex16/EDw.PCX -> 16/mx16/EDw.PCX renamed: 16/modex16/PALVIEW.EXE -> 16/mx16/PALVIEW.EXE renamed: 16/modex16/chikyuu.pcx -> 16/mx16/chikyuu.pcx renamed: 16/modex16/ed.pcx -> 16/mx16/ed.pcx renamed: 16/modex16/ed2.pcx -> 16/mx16/ed2.pcx renamed: 16/modex16/gfx.pal -> 16/mx16/gfx.pal renamed: 16/modex16/koishi.pcx -> 16/mx16/koishi.pcx renamed: 16/modex16/koishi^^.pcx -> 16/mx16/koishi^^.pcx renamed: 16/modex16/koishi~.pcx -> 16/mx16/koishi~.pcx renamed: 16/modex16/makefile -> 16/mx16/makefile renamed: 16/modex16/modex16.c -> 16/mx16/modex16.c renamed: 16/modex16/modex16.h -> 16/mx16/modex16.h renamed: 16/modex16/palettec.c -> 16/mx16/palettec.c renamed: 16/modex16/pcxtest.c -> 16/mx16/pcxtest.c renamed: 16/modex16/pcxtest.exe -> 16/mx16/pcxtest.exe renamed: 16/modex16/q.pcx -> 16/mx16/q.pcx renamed: 16/modex16/scroll.c -> 16/mx16/scroll.c renamed: 16/modex16/scroll.exe -> 16/mx16/scroll.exe renamed: 16/modex16/test.c -> 16/mx16/test.c renamed: 16/modex16/test.exe -> 16/mx16/test.exe renamed: 16/modex16/test.txt -> 16/mx16/test.txt renamed: 16/modex16/test2.c -> 16/mx16/test2.c renamed: 16/modex16/test2.exe -> 16/mx16/test2.exe renamed: 16/modex16/types.h -> 16/mx16/types.h renamed: 16/modex16/w.pcx -> 16/mx16/w.pcx --- diff --git a/16/modex16/ED.PCX b/16/modex16/ED.PCX deleted file mode 100644 index 41e56317..00000000 Binary files a/16/modex16/ED.PCX and /dev/null differ diff --git a/16/modex16/GFX.PAL b/16/modex16/GFX.PAL deleted file mode 100644 index e98ae60e..00000000 Binary files a/16/modex16/GFX.PAL and /dev/null differ diff --git a/16/modex16/MAKEFILE b/16/modex16/MAKEFILE deleted file mode 100644 index e0a07cc4..00000000 --- a/16/modex16/MAKEFILE +++ /dev/null @@ -1,31 +0,0 @@ -FLAGS=-0 -all: test.exe pcxtest.exe test2.exe scroll.exe - -scroll.exe: scroll.obj modex16.obj - wcl $(FLAGS) scroll.obj modex16.obj -scroll.obj: scroll.c - wcl $(FLAGS) -c scroll.c -test.exe: test.obj modex16.obj - wcl $(FLAGS) test.obj modex16.obj - -test2.exe: test2.obj modex16.obj - wcl $(FLAGS) test2.obj modex16.obj - -pcxtest.exe: pcxtest.obj modex16.obj - wcl $(FLAGS) pcxtest.obj modex16.obj - -test.obj: test.c modex16.h - wcl $(FLAGS) -c test.c - -test2.obj: test2.c modex16.h - wcl $(FLAGS) -c test2.c - -pcxtest.obj: pcxtest.c modex16.h - wcl $(FLAGS) -c pcxtest.c - -modex16.obj: modex16.h modex16.c - wcl $(FLAGS) -c modex16.c - -clean: - del *.obj - del *.exe diff --git a/16/modex16/MODEX16.C b/16/modex16/MODEX16.C deleted file mode 100644 index 71537b66..00000000 --- a/16/modex16/MODEX16.C +++ /dev/null @@ -1,704 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "modex16.h" - - -byte far* VGA=(byte far*) 0xA0000000; /* this points to video memory. */ - -static void fadePalette(sbyte fade, sbyte start, word iter, byte *palette); -static byte tmppal[PAL_SIZE]; -static struct pcxHeader { - byte id; - byte version; - byte encoding; - byte bpp; - word xmin; - word ymin; - word xmax; - word ymax; - word hres; - word vres; - byte pal16[48]; - byte res1; - word bpplane; - word palType; - word hScreenSize; - word vScreenSize; - byte padding[54]; -}; - - -static void -vgaSetMode(byte mode) -{ - union REGS regs; - - regs.h.ah = SET_MODE; - regs.h.al = mode; - int86(VIDEO_INT, ®s, ®s); -} - - -/* -========================= Entry Points ==========================- */ -void -modexEnter() { - word i; - dword far*ptr=(dword far*)VGA; /* used for faster screen clearing */ - word CRTParms[] = { - 0x0d06, /* vertical total */ - 0x3e07, /* overflow (bit 8 of vertical counts) */ - 0x4109, /* cell height (2 to double-scan */ - 0xea10, /* v sync start */ - 0xac11, /* v sync end and protect cr0-cr7 */ - 0xdf12, /* vertical displayed */ - 0x0014, /* turn off dword mode */ - 0xe715, /* v blank start */ - 0x0616, /* v blank end */ - 0xe317 /* turn on byte mode */ - }; - int CRTParmCount = sizeof(CRTParms) / sizeof(CRTParms[0]); - - /* TODO save current video mode and palette */ - vgaSetMode(VGA_256_COLOR_MODE); - - /* disable chain4 mode */ - outpw(SC_INDEX, 0x0604); - - /* synchronous reset while setting Misc Output */ - outpw(SC_INDEX, 0x0100); - - /* select 25 MHz dot clock & 60 Hz scanning rate */ - outp(MISC_OUTPUT, 0xe3); - - /* undo reset (restart sequencer) */ - outpw(SC_INDEX, 0x0300); - - /* reprogram the CRT controller */ - outp(CRTC_INDEX, 0x11); /* VSync End reg contains register write prot */ - outp(CRTC_DATA, 0x7f); /* get current write protect on varios regs */ - - /* send the CRTParms */ - for(i=0; idata + (p->width/4)*p->height; /* compute the offset */ - result.dx = 0; - result.dy = 0; - result.width = p->width; - result.height = p->height; - - return result; -} - - -void -modexShowPage(page_t *page) { - word high_address; - word low_address; - word offset; - byte crtcOffset; - - /* calculate offset */ - offset = (word) page->data; - offset += page->dy * (page->width >> 2 ); - offset += page->dx >> 2; - - /* calculate crtcOffset according to virtual width */ - crtcOffset = page->width >> 3; - - high_address = HIGH_ADDRESS | (offset & 0xff00); - low_address = LOW_ADDRESS | (offset << 8); - - /* wait for appropriate timing and then program CRTC */ - while ((inp(INPUT_STATUS_1) & DISPLAY_ENABLE)); - outpw(CRTC_INDEX, high_address); - outpw(CRTC_INDEX, low_address); - outp(CRTC_INDEX, 0x13); - outp(CRTC_DATA, crtcOffset); - - /* wait for one retrace */ - while (!(inp(INPUT_STATUS_1) & VRETRACE)); - - /* do PEL panning here */ - outp(AC_INDEX, 0x33); - outp(AC_INDEX, (page->dx & 0x03) << 1); -} - - -void -modexPanPage(page_t *page, int dx, int dy) { - page->dx = dx; - page->dy = dy; -} - - -void -modexSelectPlane(byte plane) { - outp(SC_INDEX, MAP_MASK); /* select plane */ - outp(SC_DATA, plane); -} - - -void -modexClearRegion(page_t *page, int x, int y, int w, int h, byte color) { - word pageOff = (word) page->data; - word xoff=x/4; /* xoffset that begins each row */ - word scanCount=w/4; /* number of iterations per row (excluding right clip)*/ - word poffset = pageOff + y*(page->width/4) + xoff; /* starting offset */ - word nextRow = page->width/4-scanCount-1; /* loc of next row */ - byte lclip[] = {0x0f, 0x0e, 0x0c, 0x08}; /* clips for rectangles not on 4s */ - byte rclip[] = {0x00, 0x01, 0x03, 0x07}; - byte left = lclip[x&0x03]; - byte right = rclip[(x+w)&0x03]; - - /* handle the case which requires an extra group */ - if((x & 0x03) && !((x+w) & 0x03)) { - right=0x0f; - } - - __asm { - MOV AX, SCREEN_SEG ; go to the VGA memory - MOV ES, AX - MOV DI, poffset ; go to the first pixel - MOV DX, SC_INDEX ; point to the map mask - MOV AL, MAP_MASK - OUT DX, AL - INC DX - MOV AL, color ; get ready to write colors - SCAN_START: - MOV CX, scanCount ; count the line - MOV BL, AL ; remember color - MOV AL, left ; do the left clip - OUT DX, AL ; set the left clip - MOV AL, BL ; restore color - STOSB ; write the color - DEC CX - JZ SCAN_DONE ; handle 1 group stuff - - ;-- write the main body of the scanline - MOV BL, AL ; remember color - MOV AL, 0x0f ; write to all pixels - OUT DX, AL - MOV AL, BL ; restore color - REP STOSB ; write the color - SCAN_DONE: - MOV BL, AL ; remeber color - MOV AL, right - OUT DX, AL ; do the right clip - MOV AL, BL ; restore color - STOSB ; write pixel - ADD DI, nextRow ; go to the next row - DEC h - JNZ SCAN_START - } -} - - -void -modexDrawBmp(page_t *page, int x, int y, bitmap_t *bmp) { - /* draw the region (the entire freakin bitmap) */ - modexDrawBmpRegion(page, x, y, 0, 0, bmp->width, bmp->height, bmp); -} - - -void -modexDrawBmpRegion(page_t *page, int x, int y, - int rx, int ry, int rw, int rh, bitmap_t *bmp) { - word poffset = (word) page->data + y*(page->width/4) + x/4; - byte *data = bmp->data; - word bmpOffset = (word) data + ry * bmp->width + rx; - word width = rw; - word height = rh; - byte plane = 1 << ((byte) x & 0x03); - word scanCount = width/4 + (width%4 ? 1 :0); - word nextPageRow = page->width/4 - scanCount; - word nextBmpRow = (word) bmp->width - width; - word rowCounter; - byte planeCounter = 4; - - __asm { - MOV AX, SCREEN_SEG ; go to the VGA memory - MOV ES, AX - - MOV DX, SC_INDEX ; point at the map mask register - MOV AL, MAP_MASK ; - OUT DX, AL ; - - PLANE_LOOP: - MOV DX, SC_DATA ; select the current plane - MOV AL, plane ; - OUT DX, AL ; - - ;-- begin plane painting - MOV AX, height ; start the row counter - MOV rowCounter, AX ; - MOV DI, poffset ; go to the first pixel - MOV SI, bmpOffset ; go to the bmp pixel - ROW_LOOP: - MOV CX, width ; count the columns - SCAN_LOOP: - MOVSB ; copy the pixel - SUB CX, 3 ; we skip the next 3 - ADD SI, 3 ; skip the bmp pixels - LOOP SCAN_LOOP ; finish the scan - - MOV AX, nextPageRow - ADD DI, AX ; go to the next row on screen - MOV AX, nextBmpRow - ADD SI, AX ; go to the next row on bmp - - DEC rowCounter - JNZ ROW_LOOP ; do all the rows - ;-- end plane painting - - MOV AL, plane ; advance to the next plane - SHL AL, 1 ; - AND AL, 0x0f ; mask the plane properly - MOV plane, AL ; store the plane - - INC bmpOffset ; start bmp at the right spot - - DEC planeCounter - JNZ PLANE_LOOP ; do all 4 planes - } -} - - -void -modexDrawSprite(page_t *page, int x, int y, bitmap_t *bmp) { - /* draw the whole sprite */ - modexDrawSpriteRegion(page, x, y, 0, 0, bmp->width, bmp->height, bmp); -} - -void -modexDrawSpriteRegion(page_t *page, int x, int y, - int rx, int ry, int rw, int rh, bitmap_t *bmp) { - word poffset = (word)page->data + y*(page->width/4) + x/4; - byte *data = bmp->data; - word bmpOffset = (word) data + ry * bmp->width + rx; - word width = rw; - word height = rh; - byte plane = 1 << ((byte) x & 0x03); - word scanCount = width/4 + (width%4 ? 1 :0); - word nextPageRow = page->width/4 - scanCount; - word nextBmpRow = (word) bmp->width - width; - word rowCounter; - byte planeCounter = 4; - - __asm { - MOV AX, SCREEN_SEG ; go to the VGA memory - MOV ES, AX - - MOV DX, SC_INDEX ; point at the map mask register - MOV AL, MAP_MASK ; - OUT DX, AL ; - - PLANE_LOOP: - MOV DX, SC_DATA ; select the current plane - MOV AL, plane ; - OUT DX, AL ; - - ;-- begin plane painting - MOV AX, height ; start the row counter - MOV rowCounter, AX ; - MOV DI, poffset ; go to the first pixel - MOV SI, bmpOffset ; go to the bmp pixel - ROW_LOOP: - MOV CX, width ; count the columns - SCAN_LOOP: - LODSB - DEC SI - CMP AL, 0 - JNE DRAW_PIXEL ; draw non-zero pixels - - INC DI ; skip the transparent pixel - ADD SI, 1 - JMP NEXT_PIXEL - DRAW_PIXEL: - MOVSB ; copy the pixel - NEXT_PIXEL: - SUB CX, 3 ; we skip the next 3 - ADD SI, 3 ; skip the bmp pixels - LOOP SCAN_LOOP ; finish the scan - - MOV AX, nextPageRow - ADD DI, AX ; go to the next row on screen - MOV AX, nextBmpRow - ADD SI, AX ; go to the next row on bmp - - DEC rowCounter - JNZ ROW_LOOP ; do all the rows - ;-- end plane painting - - MOV AL, plane ; advance to the next plane - SHL AL, 1 ; - AND AL, 0x0f ; mask the plane properly - MOV plane, AL ; store the plane - - INC bmpOffset ; start bmp at the right spot - - DEC planeCounter - JNZ PLANE_LOOP ; do all 4 planes - } -} - - -/* copy a region of video memory from one page to another. - * It assumes that the left edge of the tile is the same on both - * regions and the memory areas do not overlap. - */ -void -modexCopyPageRegion(page_t *dest, page_t *src, - word sx, word sy, - word dx, word dy, - word width, word height) -{ - word doffset = (word)dest->data + dy*(dest->width/4) + dx/4; - word soffset = (word)src->data + sy*(src->width/4) + sx/4; - word scans = width/4; - word nextSrcRow = src->width/4 - scans - 1; - word nextDestRow = dest->width/4 - scans - 1; - byte lclip[] = {0x0f, 0x0e, 0x0c, 0x08}; /* clips for rectangles not on 4s */ - byte rclip[] = {0x0f, 0x01, 0x03, 0x07}; - byte left = lclip[sx&0x03]; - byte right = rclip[(sx+width)&0x03]; - - __asm { - MOV AX, SCREEN_SEG ; work in the vga space - MOV ES, AX ; - MOV DI, doffset ; - MOV SI, soffset ; - - MOV DX, GC_INDEX ; turn off cpu bits - MOV AX, 0008h ; - OUT DX, AX - - MOV AX, SC_INDEX ; point to the mask register - MOV DX, AX ; - MOV AL, MAP_MASK ; - OUT DX, AL ; - INC DX ; - - ROW_START: - PUSH DS - MOV AX, ES - MOV DS, AX - MOV CX, scans ; the number of latches - - MOV AL, left ; do the left column - OUT DX, AL ; - MOVSB ; - DEC CX ; - - MOV AL, 0fh ; do the inner columns - OUT DX, AL - REP MOVSB ; copy the pixels - - MOV AL, right ; do the right column - OUT DX, AL - MOVSB - POP DS - - MOV AX, SI ; go the start of the next row - ADD AX, nextSrcRow ; - MOV SI, AX ; - MOV AX, DI ; - ADD AX, nextDestRow ; - MOV DI, AX ; - - DEC height ; do the rest of the actions - JNZ ROW_START ; - - MOV DX, GC_INDEX+1 ; go back to CPU data - MOV AL, 0ffh ; none from latches - OUT DX, AL ; - } -} - - -/* fade and flash */ -void -modexFadeOn(word fade, byte *palette) { - fadePalette(-fade, 64, 64/fade+1, palette); -} - - -void -modexFadeOff(word fade, byte *palette) { - fadePalette(fade, 0, 64/fade+1, palette); -} - - -void -modexFlashOn(word fade, byte *palette) { - fadePalette(fade, -64, 64/fade+1, palette); -} - - -void -modexFlashOff(word fade, byte *palette) { - fadePalette(-fade, 0, 64/fade+1, palette); -} - - -static void -fadePalette(sbyte fade, sbyte start, word iter, byte *palette) { - word i; - byte dim = start; - - /* handle the case where we just update */ - if(iter == 0) { - modexPalUpdate(palette); - return; - } - - while(iter > 0) { /* FadeLoop */ - for(i=0; i 127) { - tmppal[i] = 0; - } else if(tmppal[i] > 63) { - tmppal[i] = 63; - } - } - modexPalUpdate(tmppal); - iter--; - dim += fade; - } -} - - -/* save and load */ -void -modexPalSave(byte *palette) { - int i; - - outp(PAL_READ_REG, 0); /* start at palette entry 0 */ - for(i=0; i> 2; - } - } else { - /* use the 16 color palette */ - for(index=0; index<48; index++) { - result.palette[index] = head.pal16[index]; - } - } - - fclose(file); - - return result; -} diff --git a/16/modex16/MODEX16.H b/16/modex16/MODEX16.H deleted file mode 100644 index 08e7b360..00000000 --- a/16/modex16/MODEX16.H +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Functions for handling modex and doing other basic graphics stuff. - */ -#ifndef MODEX16_H -#define MODEX16_H -#include -#include "types.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 { - byte *data; - word width; - word height; - byte *palette; -} bitmap_t; - -typedef struct { - 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; - -/* -============================ Functions =============================- */ -/* mode switching, page, and plane functions */ -void modexEnter(); -void modexLeave(); -page_t modexDefaultPage(); -page_t modexNextPage(page_t *p); -void modexShowPage(page_t *page); -void modexPanPage(page_t *page, int dx, int dy); -void modexSelectPlane(byte plane); -void modexClearRegion(page_t *page, int x, int y, int w, int h, byte color); -void modexDrawBmp(page_t *page, int x, int y, bitmap_t *bmp); -void modexDrawBmpRegion(page_t *page, int x, int y, int rx, int ry, int rw, int rh, bitmap_t *bmp); -void modexDrawSprite(page_t *page, int x, int y, bitmap_t *bmp); -void modexDrawSpriteRegion(page_t *page, int x, int y, int rx, int ry, int rw, int rh, bitmap_t *bmp); - -/* Palette fade and flash effects */ -void modexFadeOn(word fade, byte *palette); -void modexFadeOff(word fade, byte *palette); -void modexFlashOn(word fade, byte *palette); -void modexFlashOff(word fade, byte *palette); - -/* palette loading and saving */ -void modexPalSave(byte *palette); -byte *modexNewPal(); -void modexLoadPalFile(char *filename, byte **palette); -void modexSavePalFile(char *filename, byte *palette); - -/* fixed palette functions */ -void modexPalBlack(); -void modexPalWhite(); - -/* utility functions */ -void modexPalUpdate(byte *p); -void modexWaitBorder(); - -/* bitmap functions */ -bitmap_t modexLoadPcx(char *filename); - -/* -======================= Constants & Vars ==========================- */ -extern byte far* VGA; /* The VGA Memory */ -#define SCREEN_SEG 0xa000 -#define VIDEO_INT 0x10 -#define SET_MODE 0x00 -#define VGA_256_COLOR_MODE 0x13 -#define TEXT_MODE 0x03 -#define SCREEN_WIDTH 320 -#define SCREEN_HEIGHT 240 -#define PAGE_SIZE (word)(SCREEN_WIDTH/4 * SCREEN_HEIGHT) - -#define AC_INDEX 0x03c0 -#define SC_INDEX 0x03c4 -#define SC_DATA 0x03c5 -#define CRTC_INDEX 0x03d4 -#define CRTC_DATA 0x03d5 -#define GC_INDEX 0x03ce -#define MISC_OUTPUT 0x03c2 -#define HIGH_ADDRESS 0x0C -#define LOW_ADDRESS 0x0D -#define VRETRACE 0x08 -#define INPUT_STATUS_1 0x03da -#define DISPLAY_ENABLE 0x01 -#define MAP_MASK 0x02 -#define PAL_READ_REG 0x03C7 /* Color register, read address */ -#define PAL_WRITE_REG 0x03C8 /* Color register, write address */ -#define PAL_DATA_REG 0x03C9 /* Color register, data port */ -#define PAL_SIZE (256 * 3) -#endif diff --git a/16/modex16/PALETTEC.C b/16/modex16/PALETTEC.C deleted file mode 100644 index 340a9303..00000000 --- a/16/modex16/PALETTEC.C +++ /dev/null @@ -1,16 +0,0 @@ -#include "modex16.h" - -void -main() { - byte *pal; - - modexEnter(); - - pal = modexNewPal(); - modexPalSave(pal); - - modexSavePalFile("gfx.pal", pal); - - modexLeave(); - -} diff --git a/16/modex16/PCXTEST.C b/16/modex16/PCXTEST.C deleted file mode 100644 index 9cd1903d..00000000 --- a/16/modex16/PCXTEST.C +++ /dev/null @@ -1,78 +0,0 @@ -#include -#include "modex16.h" - -word far* clock= (word far*) 0x046C; /* 18.2hz clock */ - -void -oldDrawBmp(byte far* page, int x, int y, bitmap_t *bmp, byte sprite) { - byte plane; - word px, py; - word offset; - - /* TODO Make this fast. It's SLOOOOOOW */ - for(plane=0; plane < 4; plane++) { - modexSelectPlane(PLANE(plane+x)); - for(px = plane; px < bmp->width; px+=4) { - offset=px; - for(py=0; pyheight; py++) { - if(!sprite || bmp->data[offset]) - page[PAGE_OFFSET(x+px, y+py)] = bmp->data[offset]; - offset+=bmp->width; - } - } - } -} - -void main() { - bitmap_t bmp; - int i; - page_t page; - word start; - float t1, t2; - - page=modexDefaultPage(); - - bmp = modexLoadPcx("ed.pcx"); - modexEnter(); - - /* fix up the palette and everything */ - modexPalUpdate(bmp.palette); - - /* clear and draw one sprite and one bitmap */ - modexClearRegion(&page, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 1); - - /* non sprite comparison */ - start = *clock; - for(i=0; i<100 ;i++) { - oldDrawBmp(VGA, 20, 20, &bmp, 0); - } - - start = *clock; - for(i=0; i<100 ;i++) { - modexDrawBmp(&page, 20, 20, &bmp); - } - t1 = (*clock-start) /18.2; - - start = *clock; - for(i=0; i<100; i++) { - modexCopyPageRegion(&page, &page, 20, 20, 128, 20, 64, 64); - } - t2 = (*clock-start)/18.2; - - - start = *clock; - for(i=0; i<100 ;i++) { - oldDrawBmp(VGA, 20, 20, &bmp, 1); - } - - - start = *clock; - for(i=0; i<100 ;i++) { - modexDrawSprite(&page, 20, 20, &bmp); - } - modexLeave(); - - printf("CPU to VGA: %f\n", t1); - printf("VGA to VGA: %f\n", t2); - return; -} diff --git a/16/modex16/PCXTEST.EXE b/16/modex16/PCXTEST.EXE deleted file mode 100644 index 4ab5474e..00000000 Binary files a/16/modex16/PCXTEST.EXE and /dev/null differ diff --git a/16/modex16/TEST.C b/16/modex16/TEST.C deleted file mode 100644 index c5b9d7dc..00000000 --- a/16/modex16/TEST.C +++ /dev/null @@ -1,75 +0,0 @@ -#include "modex16.h" -#include - -word far* clock= (word far*) 0x046C; /* 18.2hz clock */ - -void main() { - int i, j; - word start, end; - page_t page, page2; - byte *pal, *pal2=NULL; - - /* load our palette */ - modexLoadPalFile("gfx.pal", &pal2); - - /* save the palette */ - pal = modexNewPal(); - modexPalSave(pal); - modexFadeOff(1, pal); - modexPalBlack(); - - modexEnter(); - modexPalBlack(); - - /* set up the page, but with 16 pixels on all borders in offscreen mem */ - page=modexDefaultPage(); - page2 = modexNextPage(&page); - page.width += 32; - page.height += 32; - - - /* fill the page with one color, but with a black border */ - modexShowPage(&page2); - modexClearRegion(&page, 16, 16, SCREEN_WIDTH, SCREEN_HEIGHT, 128); - modexClearRegion(&page, 32, 32, SCREEN_WIDTH-32, SCREEN_HEIGHT-32, 42); - modexClearRegion(&page, 48, 48, SCREEN_WIDTH-64, SCREEN_HEIGHT-64, 128); - modexShowPage(&page); - - /* fade in */ - modexFadeOn(1, pal2); - - - start = *clock; - for(i=0; i<5; i++) { - /* go right */ - for(j=0; j<32; j++) { - page.dx++; - modexShowPage(&page); - } - /* go left */ - for(j=0; j<32; j++) { - page.dx--; - modexShowPage(&page); - } - /* go up */ - for(j=0; j<32; j++) { - page.dy++; - modexShowPage(&page); - } - - /* go down */ - for(j=0; j<32; j++) { - page.dy--; - modexShowPage(&page); - } - } - - end = *clock; - - /* fade back to text mode */ - modexFadeOff(1, pal2); - modexPalBlack(); - modexLeave(); - modexPalBlack(); - modexFadeOn(1, pal); -} diff --git a/16/modex16/TEST.EXE b/16/modex16/TEST.EXE deleted file mode 100644 index b0247b18..00000000 Binary files a/16/modex16/TEST.EXE and /dev/null differ diff --git a/16/modex16/TEST.TXT b/16/modex16/TEST.TXT deleted file mode 100644 index 05adc9ec..00000000 --- a/16/modex16/TEST.TXT +++ /dev/null @@ -1,258 +0,0 @@ -64 x 64 Pixels - -0 0 0 -20 0 0 -0 20 0 -20 20 0 -0 0 20 -20 0 20 -0 20 20 -30 30 30 -30 37 30 -29 32 3c -3f 3f 33 -3f 3f 26 -3f 3f 19 -3f 3f c -3f 33 3f -3f 33 33 -3f 33 26 -3f 33 19 -3f 33 c -3f 33 0 -3f 26 3f -3f 26 33 -3f 26 26 -3f 26 19 -3f 26 c -3f 26 0 -3f 19 3f -3f 19 33 -3f 19 26 -3f 19 19 -3f 19 c -3f 19 0 -3f c 3f -3f c 33 -3f c 26 -3f c 19 -3f c c -3f c 0 -3f 0 33 -3f 0 26 -3f 0 19 -3f 0 c -33 3f 3f -33 3f 33 -33 3f 26 -33 3f 19 -33 3f c -33 3f 0 -33 33 3f -33 33 33 -33 33 26 -33 33 19 -33 33 c -33 33 0 -33 26 3f -33 26 33 -33 26 26 -33 26 19 -33 26 c -33 26 0 -33 19 3f -33 19 33 -33 19 26 -33 19 19 -33 19 c -33 19 0 -33 c 3f -33 c 33 -33 c 26 -33 c 19 -33 c c -33 c 0 -33 0 3f -33 0 33 -33 0 26 -33 0 19 -33 0 c -33 0 0 -26 3f 3f -26 3f 33 -26 3f 26 -26 3f 19 -26 3f c -26 3f 0 -26 33 3f -26 33 33 -26 33 26 -26 33 19 -26 33 c -26 33 0 -26 26 3f -26 26 33 -26 26 26 -26 26 19 -26 26 c -26 26 0 -26 19 3f -26 19 33 -26 19 26 -26 19 19 -26 19 c -26 19 0 -26 c 3f -26 c 33 -26 c 26 -26 c 19 -26 c c -26 c 0 -26 0 3f -26 0 33 -26 0 26 -26 0 19 -26 0 c -26 0 0 -19 3f 3f -19 3f 33 -19 3f 26 -19 3f 19 -19 3f c -19 3f 0 -19 33 3f -19 33 33 -19 33 26 -19 33 19 -19 33 c -19 33 0 -19 26 3f -19 26 33 -19 26 26 -19 26 19 -19 26 c -19 26 0 -19 19 3f -19 19 33 -19 19 26 -19 19 19 -19 19 c -19 19 0 -19 c 3f -19 c 33 -19 c 26 -19 c 19 -19 c c -19 c 0 -19 0 3f -19 0 33 -19 0 26 -19 0 19 -19 0 c -19 0 0 -c 3f 3f -c 3f 33 -c 3f 26 -c 3f 19 -c 3f c -c 3f 0 -c 33 3f -c 33 33 -c 33 26 -c 33 19 -c 33 c -c 33 0 -c 26 3f -c 26 33 -c 26 26 -c 26 19 -c 26 c -c 26 0 -c 19 3f -c 19 33 -c 19 26 -c 19 19 -c 19 c -c 19 0 -c c 3f -c c 33 -c c 26 -c c 19 -c c c -c c 0 -c 0 3f -c 0 33 -c 0 26 -c 0 19 -c 0 c -c 0 0 -0 3f 33 -0 3f 26 -0 3f 19 -0 3f c -0 33 3f -0 33 33 -0 33 26 -0 33 19 -0 33 c -0 33 0 -0 26 3f -0 26 33 -0 26 26 -0 26 19 -0 26 c -0 26 0 -0 19 3f -0 19 33 -0 19 26 -0 19 19 -0 19 c -0 19 0 -0 c 3f -0 c 33 -0 c 26 -0 c 19 -0 c c -0 c 0 -0 0 33 -0 0 26 -0 0 19 -0 0 c -20 3f 3f -10 20 20 -20 3f 0 -10 10 0 -3f 3f 20 -3f 20 0 -3f 20 20 -20 10 0 -20 0 3f -20 0 10 -10 20 3f -0 10 20 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -3f 3e 3c -28 28 29 -20 20 20 -3f 0 0 -0 3f 0 -3f 3f 0 -0 0 3f -3f 0 3f -0 3f 3f -3f 3f 3f \ No newline at end of file diff --git a/16/modex16/TEST2.EXE b/16/modex16/TEST2.EXE deleted file mode 100644 index 23ca0df0..00000000 Binary files a/16/modex16/TEST2.EXE and /dev/null differ diff --git a/16/modex16/TYPES.H b/16/modex16/TYPES.H deleted file mode 100644 index 039653f2..00000000 --- a/16/modex16/TYPES.H +++ /dev/null @@ -1,11 +0,0 @@ -/* - * Just some handy typedefs that make it easier to think about the low - * level code - */ - -typedef unsigned char byte; -typedef unsigned short word; -typedef unsigned long dword; -typedef signed char sbyte; -typedef signed short sword; -typedef signed long sdword; diff --git a/16/modex16/286@12.LOG b/16/mx16/286@12.LOG similarity index 100% rename from 16/modex16/286@12.LOG rename to 16/mx16/286@12.LOG diff --git a/16/modex16/286@8.LOG b/16/mx16/286@8.LOG similarity index 100% rename from 16/modex16/286@8.LOG rename to 16/mx16/286@8.LOG diff --git a/16/modex16/COMPUTER.PCX b/16/mx16/COMPUTER.PCX similarity index 100% rename from 16/modex16/COMPUTER.PCX rename to 16/mx16/COMPUTER.PCX diff --git a/16/modex16/EDw.PCX b/16/mx16/EDw.PCX similarity index 100% rename from 16/modex16/EDw.PCX rename to 16/mx16/EDw.PCX diff --git a/16/modex16/PALVIEW.EXE b/16/mx16/PALVIEW.EXE similarity index 100% rename from 16/modex16/PALVIEW.EXE rename to 16/mx16/PALVIEW.EXE diff --git a/16/modex16/chikyuu.pcx b/16/mx16/chikyuu.pcx similarity index 100% rename from 16/modex16/chikyuu.pcx rename to 16/mx16/chikyuu.pcx diff --git a/16/modex16/ed.pcx b/16/mx16/ed.pcx similarity index 100% rename from 16/modex16/ed.pcx rename to 16/mx16/ed.pcx diff --git a/16/modex16/ed2.pcx b/16/mx16/ed2.pcx similarity index 100% rename from 16/modex16/ed2.pcx rename to 16/mx16/ed2.pcx diff --git a/16/modex16/gfx.pal b/16/mx16/gfx.pal similarity index 100% rename from 16/modex16/gfx.pal rename to 16/mx16/gfx.pal diff --git a/16/modex16/koishi.pcx b/16/mx16/koishi.pcx similarity index 100% rename from 16/modex16/koishi.pcx rename to 16/mx16/koishi.pcx diff --git a/16/modex16/koishi^^.pcx b/16/mx16/koishi^^.pcx similarity index 100% rename from 16/modex16/koishi^^.pcx rename to 16/mx16/koishi^^.pcx diff --git a/16/modex16/koishi~.pcx b/16/mx16/koishi~.pcx similarity index 100% rename from 16/modex16/koishi~.pcx rename to 16/mx16/koishi~.pcx diff --git a/16/modex16/makefile b/16/mx16/makefile similarity index 100% rename from 16/modex16/makefile rename to 16/mx16/makefile diff --git a/16/modex16/modex16.c b/16/mx16/modex16.c similarity index 100% rename from 16/modex16/modex16.c rename to 16/mx16/modex16.c diff --git a/16/modex16/modex16.h b/16/mx16/modex16.h similarity index 100% rename from 16/modex16/modex16.h rename to 16/mx16/modex16.h diff --git a/16/modex16/palettec.c b/16/mx16/palettec.c similarity index 100% rename from 16/modex16/palettec.c rename to 16/mx16/palettec.c diff --git a/16/modex16/pcxtest.c b/16/mx16/pcxtest.c similarity index 100% rename from 16/modex16/pcxtest.c rename to 16/mx16/pcxtest.c diff --git a/16/modex16/pcxtest.exe b/16/mx16/pcxtest.exe similarity index 100% rename from 16/modex16/pcxtest.exe rename to 16/mx16/pcxtest.exe diff --git a/16/modex16/q.pcx b/16/mx16/q.pcx similarity index 100% rename from 16/modex16/q.pcx rename to 16/mx16/q.pcx diff --git a/16/modex16/scroll.c b/16/mx16/scroll.c similarity index 94% rename from 16/modex16/scroll.c rename to 16/mx16/scroll.c index e2a342d4..1a637919 100644 --- a/16/modex16/scroll.c +++ b/16/mx16/scroll.c @@ -73,7 +73,7 @@ void main() { modexShowPage(mv.page); }*/ - for(x=0; x<((40)*16-SCREEN_WIDTH); x++) { + for(x=0; x<((20)*16-SCREEN_WIDTH); x++) { mapScrollRight(&mv, 1); modexShowPage(mv.page); } diff --git a/16/modex16/scroll.exe b/16/mx16/scroll.exe similarity index 77% rename from 16/modex16/scroll.exe rename to 16/mx16/scroll.exe index bfe86fcf..90af5276 100644 Binary files a/16/modex16/scroll.exe and b/16/mx16/scroll.exe differ diff --git a/16/modex16/test.c b/16/mx16/test.c similarity index 100% rename from 16/modex16/test.c rename to 16/mx16/test.c diff --git a/16/modex16/test.exe b/16/mx16/test.exe similarity index 100% rename from 16/modex16/test.exe rename to 16/mx16/test.exe diff --git a/16/modex16/test.txt b/16/mx16/test.txt similarity index 100% rename from 16/modex16/test.txt rename to 16/mx16/test.txt diff --git a/16/modex16/test2.c b/16/mx16/test2.c similarity index 100% rename from 16/modex16/test2.c rename to 16/mx16/test2.c diff --git a/16/modex16/test2.exe b/16/mx16/test2.exe similarity index 100% rename from 16/modex16/test2.exe rename to 16/mx16/test2.exe diff --git a/16/modex16/types.h b/16/mx16/types.h similarity index 100% rename from 16/modex16/types.h rename to 16/mx16/types.h diff --git a/16/modex16/w.pcx b/16/mx16/w.pcx similarity index 100% rename from 16/modex16/w.pcx rename to 16/mx16/w.pcx