From: sparky4 Date: Wed, 3 Aug 2016 16:11:29 +0000 (-0500) Subject: cd ..cd .. X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=76f1de9c221ab0399316bdd84f2d29bdc0605195;p=plz.git cd ..cd .. --- diff --git a/plz.o b/plz.o index 0e39801..2227ec0 100755 Binary files a/plz.o and b/plz.o differ diff --git a/plzpart/vga.c b/plzpart-gl/vga.c similarity index 97% rename from plzpart/vga.c rename to plzpart-gl/vga.c index 28b91b6..f817e25 100755 --- a/plzpart/vga.c +++ b/plzpart-gl/vga.c @@ -84,17 +84,17 @@ void vga_show_framebuffer() { int x, y; + int nFirstLineIndex = line_compare + 1; + + // Plot the palettised frame buffer. + unsigned int *ptr = fb; + // Clear the screen. memset(image, 0, FRAME_BUFFER_WIDTH * FRAME_BUFFER_HEIGHT * 3); copper1(); copper2(); - int nFirstLineIndex = (line_compare + 1); - - // Plot the palettised frame buffer. - uint8_t *ptr = fb; - for (y = nFirstLineIndex; y < SCREEN_HEIGHT; y++) { for (x = 0; x < SCREEN_WIDTH; x++) { //ASSERT(x + hscroll_offset < FRAME_BUFFER_WIDTH); diff --git a/plzpart/Makefile b/plzpart/Makefile index ab5b059..e70bb5b 100755 --- a/plzpart/Makefile +++ b/plzpart/Makefile @@ -1,21 +1,133 @@ +# +# Higanbana Project makefile +# +# +# Possible optimizations for 8088 class processors +# +# -oa Relax alias checking +# -ob Try to generate straight line code +# -oe - expand user functions inline (-oe=20 is default, adds lots of code) +# -oh Enable repeated optimizations +# -oi generate certain lib funcs inline +# -oi+ Set max inline depth (C++ only, use -oi for C) +# -ok Flowing of register save into function flow graph +# -ol loop optimizations +# -ol+ loop optimizations plus unrolling +# -or Reorder for pipelined (486+ procs); not sure if good to use +# -os Favor space over time +# -ot Favor time over space +# -ei Allocate an "int" for all enum types +# -zp2 Allow compiler to add padding to structs +# -zpw Use with above; make sure you are warning free! +# -0 8088/8086 class code generation +# -s disable stack overflow checking -PLZPART_OBJS = plz.o copper.o asmyt.o tweak.o vect.o vga.o opengl.o \ - plza.o plzfill.o sinit.o spline.o main.o +# -zk0u translate kanji to unicode... wwww +# -zk0 kanji support~ +# -zkl current codepage -PLZPART_PATH = plzpart +#%.C +#192x144 +#wwww will add these +!ifdef __LINUX__ +REMOVECOMMAND=rm -f +COPYCOMMAND=cp -f +DIRSEP=/ +OBJ=o +!else +REMOVECOMMAND=del +COPYCOMMAND=copy /y +DIRSEP=\ +OBJ=obj +!endif +#!ifndef INCLUDE +#IN=..$(DIRSEP)..$(DIRSEP)fdos$(DIRSEP)watcom2$(DIRSEP)h +#IFLAGS=-i=$(IN) +#!endif -PLZPART_PATH_OBJS = $(addprefix $(PLZPART_PATH)/,$(PLZPART_OBJS)) +TARGET_OS = dos -PLZPART_BIN = plzpart +#EXMMTESTDIR=16$(DIRSEP)exmmtest$(DIRSEP) +SRC=src$(DIRSEP) +SRCLIB=$(SRC)lib$(DIRSEP) -OBJS += $(PLZPART_PATH_OBJS) +AFLAGS=-mh -0 -d1 -e=65536 +PLZFLAGS=-fh=plzpart.hed +SFLAGS=-sg -st -of+ -zu -zdf -zff -zgf -k32768 +DFLAGS=-DTARGET_MSDOS=16 -DMSDOS=1 $(SFLAGS) +ZFLAGS=-zk0 -zq -zc -zp8# -zm +CFLAGS=$(AFLAGS) $(IFLAGS)-lr -l=dos -wo##wwww +OFLAGS=-obmiler -out -oh -ei -zp8 -fpi87 -onac -ol+ -ok####x +FLAGS=$(CFLAGS) $(OFLAGS) $(DFLAGS) $(ZFLAGS) -default-plzpart: - $(MAKE) -C .. plzpart-all -plzpart-all: $(PLZPART_PATH)/$(PLZPART_BIN) +EXEC = plzpart.exe +OBJS = copper.$(OBJ) tweak.$(OBJ) plz.$(OBJ) asmyt.$(OBJ) -$(PLZPART_PATH)/$(PLZPART_BIN): $(PLZPART_PATH_OBJS) - $(LD) -o $@ $(LDFLAGS) $(PLZPART_PATH_OBJS) $(LIBS) +all: $(EXEC) -plz.c: tweak.h ptau.pre +# +#game and bakapi executables +# +plzpart.exe: plzpart.$(OBJ) $(OBJS) + wcl $(FLAGS) $(PLZFLAGS) plzpart.$(OBJ) $(OBJS) -fm=plzpart.map + + +# +#executable's objects +# +plzpart.$(OBJ): plzpart.h plzpart.c + wcl $(FLAGS) -c plzpart.c + +# +#non executable objects libraries +# +plz.$(OBJ): plz.h plz.c + wcl $(FLAGS) -c plz.c +tweak.$(OBJ): tweak.h tweak.c + wcl $(FLAGS) -c tweak.c +asmyt.$(OBJ): asmyt.h asmyt.c + wcl $(FLAGS) -c asmyt.c +copper.$(OBJ): copper.h copper.c + wcl $(FLAGS) -c copper.c + + +# +#other~ +# +clean: .symbolic + @$(REMOVECOMMAND) $(EXEC) +# @$(REMOVECOMMAND) *.$(OBJ) + @$(REMOVECOMMAND) *.o + +# +# PLZPART_OBJS = plz.o copper.o asmyt.o tweak.o vect.o vga.o opengl.o \ +# plza.o plzfill.o sinit.o spline.o main.o +# +# PLZPART_PATH = plzpart +# +# PLZPART_PATH_OBJS = $(addprefix $(PLZPART_PATH)/,$(PLZPART_OBJS)) +# +# PLZPART_BIN = plzpart +# +# OBJS += $(PLZPART_PATH_OBJS) +# +# default-plzpart: +# $(MAKE) -C .. plzpart-all +# +# plzpart-all: $(PLZPART_PATH)/$(PLZPART_BIN) +# +# $(PLZPART_PATH)/$(PLZPART_BIN): $(PLZPART_PATH_OBJS) +# $(LD) -o $@ $(LDFLAGS) $(PLZPART_PATH_OBJS) $(LIBS) +# +# plz.c: tweak.h ptau.pre +asmyt.c +copper.c +main.c +plza.c +plz.c +plzfill.c +sinit.c +spline.c +tweak.c +vect.c diff --git a/plzpart/asmyt.c b/plzpart/asmyt.c index 041eb79..d844747 100755 --- a/plzpart/asmyt.c +++ b/plzpart/asmyt.c @@ -28,7 +28,7 @@ int plzline(int y, int vseg) }; uint8_t ah = 0; uint8_t al = 0; - uint32_t eax = 0; + uint16_t eax = 0; int i; for (i = 0; i < 84; i++) { @@ -68,12 +68,15 @@ int plzline(int y, int vseg) if ((ccc & 3) == 2) { eax = (ah << 8) | al; - eax <<= 16; + eax <<= 8; } if ((ccc & 3) == 0) { eax |= (ah << 8) | al; - vga_write32(nVgaYOffset + ccc, eax); +// vga_write32(nVgaYOffset + ccc, eax); + __asm { + mov [es:ccc], ax + } } } @@ -103,9 +106,22 @@ int setplzparas(int c1, int c2, int c3, int c4) return 0; } -int set_plzstart(int y) +word set_plzstart(word start) { - vga_set_line_compare(y); - - return 0; +__asm{ + mov dx, 3d4h + mov al, 18h ; linecompare + mov ah, [Byte PTR start] + out dx, ax + mov al, 07h + mov ah, [Byte PTR start+1] + shl ah, 1d + shl ah, 1d + shl ah, 1d + shl ah, 1d + and ah, 10h + or ah, 0fh + out dx, ax ; 8th bit +} + return start; } diff --git a/plzpart/asmyt.h b/plzpart/asmyt.h new file mode 100755 index 0000000..2f6065a --- /dev/null +++ b/plzpart/asmyt.h @@ -0,0 +1,18 @@ +#ifndef _ASMYT_H_ +#define _ASMYT_H_ +#include "types.h" +word anSelfModifyOffsets_ReadWord(word nOffset); +void anSelfModifyOffsets_WriteWord(word nOffset, word nValue); +int plzline(int y, int vseg); +int setplzparas(int c1, int c2, int c3, int c4); +word set_plzstart(word start); +inline word lsini16_GetOffset() +{ + return 16384 + (8192 * 2); +} + +inline word lsini4_GetOffset() +{ + return 16384; +} +#endif diff --git a/plzpart/common.h b/plzpart/common.h index 7603c7e..1ddb500 100755 --- a/plzpart/common.h +++ b/plzpart/common.h @@ -1,21 +1,30 @@ - +#ifndef _C_H_ +#define _C_H_ +#include #include - +#include +#include +#include +#include +#include +#include +#include +#include "types.h" uint16_t psini_read16(int); uint8_t psini_read8(int); void psini_write16(int, uint16_t); void psini_write8(int, uint8_t); -void vga_select_bitplanes_02(void); -void vga_select_bitplanes_13(void); -void vga_select_bitplanes_0123(void); -void vga_write32(int, int); -void vga_set_line_compare(int); -void vga_set_palette_entry(int, int, int, int); -void vga_show_framebuffer(void); -void vga_set_hscroll_offset(int); -void vga_upload_palette(uint8_t *); +// void vga_select_bitplanes_02(void); +// void vga_select_bitplanes_13(void); +// void vga_select_bitplanes_0123(void); +// void vga_write32(int, int); +// void vga_set_line_compare(int); +// void vga_set_palette_entry(int, int, int, int); +// void vga_show_framebuffer(void); +// void vga_set_hscroll_offset(int); +// void vga_upload_palette(uint8_t *); void initvect(void); @@ -23,3 +32,4 @@ int init_copper(void); int close_copper(void); void copper1(void); void copper2(void); +#endif diff --git a/plzpart/copper.c b/plzpart/copper.c index 836fa7e..9cb3c39 100755 --- a/plzpart/copper.c +++ b/plzpart/copper.c @@ -1,204 +1,42 @@ -/* - * Written by Nick Kovac with minor changes by Claudio Matsuoka - */ - -#include "common.h" - -int frame_count = 0; -int cop_drop = 0; -uint8_t *cop_pal; -int do_pal = 0; -int cop_start = 0; -int cop_scrl = 0; -int cop_plz = 1; - -static int dtau[65]; - -uint8_t fadepal[768 * 2]; -uint8_t *cop_fadepal; - -extern int l1, l2, l3, l4; -extern int k1, k2, k3, k4; -extern int il1, il2, il3, il4; -extern int ik1, ik2, ik3, ik4; -extern int ttptr; - - -void pompota(void); -void moveplz(void); -void do_drop(void); -void initpparas(void); - - -int init_copper() -{ - int ccc; - - for (ccc = 0; ccc < 65; ccc++) { - dtau[ccc] = ccc * ccc / 4 * 43 / 128 + 60; - } - - return 0; -} - -int close_copper() -{ - return 0; -} - -// [nk] just before retrace -void copper1() -{ - // There is also assembly code to set the first pixel of - // display memory here, but it may not be necessary. - - vga_set_hscroll_offset(cop_scrl); -} - -// [nk] in retrace -void copper2() -{ - // [nk] Don't think this is used. - frame_count++; - - if (do_pal != 0) { - do_pal = 0; - vga_upload_palette(cop_pal); - } - - pompota(); - moveplz(); - - if (cop_drop != 0) - { - do_drop(); - } -} - -void pompota() -{ - - // [NK 18/1/2014] Disable this for now, as it looks a bit jittery. - return; - -#if 0 - // [NK] This function toggles the horizontal split point every frame - // [NK] between line 60 and 61, and toggles the horizontal offset between 0 and 4. - // [NK] I think the original intention of this code was to give more variation - // [NK] cheaply, almost like a cheap alpha blend between two plasmas, but - // [NK] it seems to cause a lot of flicker in the port. Perhaps more precise timing is - // [NK] required to give the original effect? In any case I disabled this code - // [NK] temporarily. - - vga_set_line_compare(60); - cop_scrl = 4; - - pompi++; - - if ((pompi & 1) != 0) - { - // [NK 12/1/2014] Moving the starting line up and down each alternate frame - // [NK 12/1/2014] doesn't look good in windowed mode. - // [NK 13/1/2014] Seems to work okay in fullscreen mode though. - vga_set_line_compare(61); - cop_scrl = 0; - } -#endif -} - -void moveplz() -{ - k1 += -3; - k1 &= 4095; - k2 += -2; - k2 &= 4095; - k3 += 1; - k3 &= 4095; - k4 += 2; - k4 &= 4095; - - l1 += -1; - l1 &= 4095; - l2 += -2; - l2 &= 4095; - l3 += 2; - l3 &= 4095; - l4 += 3; - l4 &= 4095; -} - -void do_drop() -{ - cop_drop++; - - if (cop_drop <= 64) { - vga_set_line_compare(dtau[cop_drop]); - } else { - //@@over - - int bShouldFade = 0; - - if (cop_drop >= 256) { - } else if (cop_drop >= 128) { - bShouldFade = 1; - } else if (cop_drop > 96) { - } else /*if (cop_drop > 64) */{ - bShouldFade = 1; - } - - if (bShouldFade) { - cop_pal = fadepal; - do_pal = 1; - - if (cop_drop == 65) { - vga_set_line_compare(400); - initpparas(); - } else { - int i, ccc; - - vga_set_line_compare(60); - - // [NK 9/1/2014] Fade the palette using 8.8 fixed point numbers. - - uint8_t* pcop_fadepal = cop_fadepal; - uint8_t* pfadepal = fadepal; - - for (i = 0; i < (768 / 16); i++) { - for (ccc = 0; ccc < 16; ccc++) { - uint8_t al = pcop_fadepal[ccc*2]; - uint8_t ah = pcop_fadepal[(ccc*2) + 1]; - - uint8_t oldval = pfadepal[ccc + 768]; - pfadepal[ccc + 768] += al; - uint8_t newval = pfadepal[ccc + 768]; - uint8_t carry = 0; - if (newval < oldval) { - carry = 1; - } - - pfadepal[ccc] += ah + carry; - } - - pcop_fadepal += 32; - pfadepal += 16; - } - } - } else { - cop_drop = 0; - } - } -} - -void initpparas() -{ - l1 = il1; - l2 = il2; - l3 = il3; - l4 = il4; - - k1 = ik1; - k2 = ik2; - k3 = ik3; - k4 = ik4; -} - +#include "copper.h" + +int far cop_drop; +int far cop_plz; +int far cop_start; +char far * cop_fadepal; +char fadepal[768]; +char far *cop_pal; + +word dtau[66]; + +int init_copper() +{ + word ccc; + for (ccc = 0; ccc < 65; ccc++) + { + dtau[ccc] = floor(ccc * ccc / 4 * 43 / 128 + 60); + } + return 0; +} + +int close_copper() +{ +__asm{ + mov bx,7 + mov ax,0 + mov cx,0 + mov dx,0 + int 0fcH + mov bx,7 + mov ax,1 + mov cx,0 + mov dx,0 + int 0fcH + mov bx,7 + mov ax,2 + mov cx,0 + mov dx,0 + int 0fcH +} + return 0; +} diff --git a/plzpart/copper.h b/plzpart/copper.h new file mode 100755 index 0000000..13a745e --- /dev/null +++ b/plzpart/copper.h @@ -0,0 +1,8 @@ +#ifndef _COPPER_H_ +#define _COPPER_H_ +#include +#include "types.h" + +int init_copper(); +int close_copper(); +#endif diff --git a/plzpart/main.c b/plzpart/main.c index 5bf875e..b9d9709 100755 --- a/plzpart/main.c +++ b/plzpart/main.c @@ -1,22 +1,21 @@ -#include -#include "../dis/dis.h" -#include "graphics.h" -#include "opengl.h" +//#include "../dis/dis.h" +//#include "graphics.h" +//#include "opengl.h" #include "common.h" extern void plz(); extern void vect(); int main(int argc, char **argv) { - int a = adjust_framerate(); - dis_partstart(); +// int a = adjust_framerate(); +// dis_partstart(); - if (init_graphics("Plzpart", argc, argv) < 0) { - fprintf(stderr, "Can't init graphics\n"); - return -1; - }; +// if (init_graphics("Plzpart", argc, argv) < 0) { +// fprintf(stderr, "Can't init graphics\n"); +// return -1; +// }; - init_opengl(); +// init_opengl(); init_copper(); initvect(); plz(); diff --git a/plzpart/opengl.c b/plzpart/opengl.c deleted file mode 100755 index f8eca9b..0000000 --- a/plzpart/opengl.c +++ /dev/null @@ -1,153 +0,0 @@ -#include -#include -#include -#include -#include -#include "u2gl.h" -#include "opengl.h" - -static int view_width; -static int view_height; - -static struct u2gl_program bg_program; - -float obj[9]; - -float bg_obj[12] = { - 0.0f, 0.0f, 0.0f, - 320.0f, 0.0f, 0.0f, - 0.0f, 200.0f, 0.0f, - 320.0f, 200.0f, 0.0f -}; - -static const char vertex_shader_texture[] = -"uniform mat4 pMatrix;\n" -"uniform mat4 uMatrix;\n" -"attribute vec4 aPosition;\n" -"varying vec3 vPosition;\n" -"attribute vec2 aTexPosition;\n" -"varying vec2 vTexPosition;\n" -"\n" -"void main() {\n" -" mat4 Matrix = pMatrix * uMatrix;\n" -" vec4 position = Matrix * aPosition;\n" -" gl_Position = position;\n" -" vTexPosition = aTexPosition;\n" -" vPosition = vec3(position);\n" -"}\n"; - -static const char fragment_shader_texture[] = -"precision mediump float;\n" -"uniform sampler2D uTexture;\n" -"uniform vec4 uColor;\n" -"varying vec3 vPosition;\n" -"varying vec2 vTexPosition;\n" -"\n" -"void main() {\n" -" gl_FragColor = texture2D(uTexture, vTexPosition);\n" -"}\n"; - - -int uTime_location; -int uPos_location; -int uTexPos_location; -int uRadius_location; -int uLensTex_location; -int uRotTex_location; - -static float tex_coords[] = { - 0.0f, 1.0f, - 1.0f, 1.0f, - 0.0f, 0.0f, - 1.0f, 0.0f -}; - -static float color[256][4]; - -unsigned char *image; - - -#define CC 32 - -void setrgb(int c, int r, int g, int b) -{ - float alpha = 0.5f; - - color[c][0] = (float)r / CC; - color[c][1] = (float)g / CC; - color[c][2] = (float)b / CC; - color[c][3] = alpha; -} - -void getrgb(int c, char *p) -{ - p[0] = color[c][0] * CC; - p[1] = color[c][1] * CC; - p[2] = color[c][2] * CC; -} - -void draw_bg() -{ - //glActiveTexture(GL_TEXTURE0); - glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 320, 400, GL_RGB, - GL_UNSIGNED_BYTE, image); - glUseProgram(bg_program.program); - u2gl_draw_textured_triangle_strip(&bg_program, bg_obj, 4); -} - -static void init_texture() -{ - GLuint tex[3]; - - u2gl_set_tex_coords(tex_coords); - - glGenTextures(1, tex); - glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D, tex[0]); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - - image = calloc(3, 320 * 400); - - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 320, 400, 0, GL_RGB, - GL_UNSIGNED_BYTE, image); - glGenerateMipmap(GL_TEXTURE_2D); - u2gl_check_error("init_texture 1"); -} - - -int init_opengl() -{ - GLuint v, f; - - view_width = 320; - view_height = 200; - - v = u2gl_compile_vertex_shader(vertex_shader_texture); - f = u2gl_compile_fragment_shader(fragment_shader_texture); - u2gl_create_program(&bg_program, f, v); - u2gl_check_error("create program bg"); - - glDisable(GL_DEPTH_TEST); - glEnable(GL_BLEND); - - //glBlendFunc(GL_SRC_ALPHA, GL_ONE); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - - glClearColor(.0, .0, .0, 0); - u2gl_check_error("init_opengl"); - - init_texture(); - u2gl_check_error("init_texture"); - - u2gl_projection(0, view_width, 0, view_height, &bg_program); - - return 0; -} - -void clear_screen() -{ - glClear(GL_COLOR_BUFFER_BIT); -} diff --git a/plzpart/opengl.h b/plzpart/opengl.h deleted file mode 100755 index 1ee399c..0000000 --- a/plzpart/opengl.h +++ /dev/null @@ -1,4 +0,0 @@ - -int init_opengl(void); -void clear_screen(void); -void draw_bg(void); diff --git a/plzpart/plz.c b/plzpart/plz.c index 085fa8d..e6a2b9c 100755 --- a/plzpart/plz.c +++ b/plzpart/plz.c @@ -1,17 +1,12 @@ #include -#include -#include #include -//#include -//#include -#include "tweak.h" -#include "../dis/dis.h" -#include "opengl.h" -#include "graphics.h" -#include "common.h" +#include +#include +#include "plz.h" +//#include "tweak.h" -#define DO_TABLES -#define DPII (3.1415926535*2.0) +//#define DO_TABLES +//#define DPII (3.1415926535*2.0) #define LINELEN 41 #define MAXY 280 @@ -20,27 +15,24 @@ #define SINMASK 4095 #define PLZSINI(p1,p2,p3,p4) *ptr++ = (psini[x*32+lsini[y*2+p2]*16+p1] + psini[y*4+lsini[x*64+p4]*4+p3]) + (psini[x*32+16+lsini[y*2+p2]*16+p1] + psini[y*4+lsini[x*64+32+p4]*4+p3])*256; -extern int init_copper(); -extern int close_copper(); -extern int far frame_count; +// extern int init_copper(); +// extern int close_copper(); +//extern int far frame_count; +int far frame_count; extern int far cop_drop; extern int far cop_plz; extern int far cop_start; -extern char far * far cop_fadepal; -extern char far fadepal[768]; -extern far char * far cop_pal; -extern far int do_pal; - -extern int plzline(int y, int vseg); -extern int setplzparas(int c1, int c2, int c3, int c4); -extern int set_plzstart(int y); -//extern char far psini[16384]; -//extern int far lsini4[8192]; -//extern int far lsini16[8192]; - -unsigned char *psini; -short *lsini4; -short *lsini16; +extern char far * cop_fadepal; +extern char fadepal[768]; +extern char far *cop_pal; +extern int do_pal; + +//extern int plzline(int y, int vseg); +//extern int setplzparas(int c1, int c2, int c3, int c4); +//extern int set_plzstart(int y); +extern char far psini[16384]; +extern int far lsini4[8192]; +extern int far lsini16[8192]; //int (* vmem)[LINELEN]=MK_FP(0x0a000,0); //char psini[16384]= @@ -48,12 +40,10 @@ short *lsini16; //char lsini[16384]= //#include "lsini.pre" -void init_plz(void); - char ptau[256]= #include "ptau.pre" -int16_t pals[6][768]; +int pals[6][768]; int curpal=0; int timetable[10]={64*6*2-45,64*6*4-45,64*6*5-45,64*6*6-45,64*6*7+90,0}; int ttptr=0; @@ -71,35 +61,28 @@ int inittable[10][8]={{1000,2000,3000,4000,3500,2300,3900,3670}, {1000,2000,3000,4000,3500,2300,3900,3670}, {1000,2000,3000,4000,3500,2300,3900,3670}}; -int fixme_dis_getmframe() -{ - static int s_nResult = 0; - s_nResult++; - return s_nResult; -} - void plz(){ - register int /*x,*/y; - //int *ptr; + register int x,y; + int *ptr; long tim=0,count=0; - //int ch=0,sync=2; + int ch=0,sync=2; - while(dis_musplus()<0 && !dis_exit()); - dis_setmframe(0); + //while(dis_musplus()<0 && !dis_exit()); + //dis_setmframe(0); init_plz(); cop_drop=128; - cop_fadepal=(char *)pals[curpal++]; + cop_fadepal=(char far *)pals[curpal++]; frame_count=0; - while(!dis_exit()) + while(!kbhit()) { tim+=frame_count; frame_count=0; count++; - if(fixme_dis_getmframe()>timetable[ttptr]) - { + //if(dis_getmframe()>timetable[ttptr]) + // { memset(fadepal,0,768); cop_drop=1; - cop_fadepal=(char *)pals[curpal++]; + cop_fadepal=(char far *)pals[curpal++]; ttptr++; il1=inittable[ttptr][0]; il2=inittable[ttptr][1]; @@ -109,40 +92,37 @@ void plz(){ ik2=inittable[ttptr][5]; ik3=inittable[ttptr][6]; ik4=inittable[ttptr][7]; - } + // } if(curpal==5 && cop_drop>64) break; - // [nk] VGA: select bit planes 0,2 (?) - //asm mov dx, 3c4h - //asm mov ax, 0a02h - //asm out dx, ax - - vga_select_bitplanes_02(); + __asm + { + mov dx, 3c4h + mov ax, 0a02h + out dx, ax + } setplzparas(k1,k2,k3,k4); for(y=0;y -//#include -//#include -#include #include "tweak.h" extern far void do_line(char far *to, int dx, int dy, int cnt, char far *from, long txx1, long txy1, long txx2, long txy2, int dseg); diff --git a/plzpart/plzpart.c b/plzpart/plzpart.c new file mode 100755 index 0000000..0f79e63 --- /dev/null +++ b/plzpart/plzpart.c @@ -0,0 +1,13 @@ +//#include "..\dis\dis.h" +#include "plzpart.h" + +//extern vect(); + +void main() { +// dis_partstart(); + init_copper(); +// initvect(); + plz(); +// vect(); + close_copper(); + } diff --git a/plzpart/plzpart.exe b/plzpart/plzpart.exe new file mode 100755 index 0000000..153da22 Binary files /dev/null and b/plzpart/plzpart.exe differ diff --git a/plzpart/plzpart.h b/plzpart/plzpart.h new file mode 100755 index 0000000..09eda26 --- /dev/null +++ b/plzpart/plzpart.h @@ -0,0 +1,8 @@ +#ifndef _PLZPART_H_ +#define _PLZPART_H_ +#include "asmyt.h" +#include "tweak.h" +#include "copper.h" +#include "plz.h" + +#endif diff --git a/plzpart/ptau.pre b/plzpart/ptau.pre index b499506..daf5b1d 100755 --- a/plzpart/ptau.pre +++ b/plzpart/ptau.pre @@ -7,4 +7,4 @@ , 52, 51, 50, 49, 47, 46, 45, 43, 42, 40, 39, 38, 36, 35, 33, 32 , 30, 28, 27, 25, 24, 23, 21, 20, 18, 17, 16, 14, 13, 12, 11, 10 , 9, 8, 7, 6, 5, 4, 3, 3, 2, 2, 1, 1, 1, 1, 1, 1 -}; \ No newline at end of file +}; diff --git a/plzpart/tweak.c b/plzpart/tweak.c index de1808e..1bf6fad 100755 --- a/plzpart/tweak.c +++ b/plzpart/tweak.c @@ -1,15 +1,50 @@ -#include "common.h" -#include "tweak.h" - -void tw_opengraph() -{ -} - -void tw_opengraph2() -{ -} - -void tw_setrgbpalette(int pal, int r, int g, int b) -{ - vga_set_palette_entry(pal, r, g, b); -} +#include "tweak.h" + +void tw_opengraph2() +{ +__asm{ + mov dx, 03c4h + mov ax, 0604h + out dx, ax ; chain4 off + + mov ax, 0f02h + out dx, ax + mov dx, 0a000h + mov es, dx + xor di, di + xor ax, ax + mov cx, 8000h + rep stosw ; clear vmem + + mov dx, 03d4h + mov ax, 0014h + out dx, ax ; crtc long off + + mov ax, 0e317h + out dx, ax ; crtc byte on + + mov ax, 0009h + out dx, ax ; 400 + + mov ax, 3013h + out dx, ax ; 384 wide +} +} + +void tw_setrgbpalette(int a, int r, int g, int b) +{ + int i; +// modexWaitBorder(); + outp(PAL_WRITE_REG, a); /* start at the beginning of palette */ +// for(i=0; i, or + * write to the Free Software Foundation, Inc., 51 Franklin Street, + * Fifth Floor, Boston, MA 02110-1301 USA. + * + */ +/* + * Just some handy typedefs that make it easier to think about the low + * level code + */ + +#ifndef _TYPE_H_ +#define _TYPE_H_ + +typedef unsigned char byte; +typedef unsigned short word; +typedef unsigned long dword; +typedef signed char sbyte; +typedef signed short sword; +typedef signed long sdword; + +typedef unsigned int iword; +typedef signed int siword; + +typedef enum {false,true} boolean; + +#endif/*_TYPE_H_*/ diff --git a/plzpart/vect.c b/plzpart/vect.c index 5a581f4..690605d 100755 --- a/plzpart/vect.c +++ b/plzpart/vect.c @@ -1,11 +1,6 @@ -#include -//#include -//#include -#include -//#include -#include +#include "common.h" #include "tweak.h" -#include "../dis/dis.h" +//#include "../dis/dis.h" #define SX sinit[kx] #define SY sinit[ky]