From 76f1de9c221ab0399316bdd84f2d29bdc0605195 Mon Sep 17 00:00:00 2001 From: sparky4 Date: Wed, 3 Aug 2016 11:11:29 -0500 Subject: [PATCH] cd ..cd .. --- plz.o | Bin 5374 -> 3400 bytes {plzpart => plzpart-gl}/vga.c | 10 +- plzpart/Makefile | 136 +++++++++++++++++-- plzpart/asmyt.c | 30 ++++- plzpart/asmyt.h | 18 +++ plzpart/common.h | 32 +++-- plzpart/copper.c | 246 ++++++---------------------------- plzpart/copper.h | 8 ++ plzpart/main.c | 21 ++- plzpart/opengl.c | 153 --------------------- plzpart/opengl.h | 4 - plzpart/plz.c | 165 ++++++++++++----------- plzpart/plz.h | 19 +++ plzpart/plzfill.c | 4 - plzpart/plzpart.c | 13 ++ plzpart/plzpart.exe | Bin 0 -> 25453 bytes plzpart/plzpart.h | 8 ++ plzpart/ptau.pre | 2 +- plzpart/tweak.c | 65 ++++++--- plzpart/tweak.h | 27 ++-- plzpart/types.h | 42 ++++++ plzpart/vect.c | 9 +- 22 files changed, 483 insertions(+), 529 deletions(-) rename {plzpart => plzpart-gl}/vga.c (97%) create mode 100755 plzpart/asmyt.h create mode 100755 plzpart/copper.h delete mode 100755 plzpart/opengl.c delete mode 100755 plzpart/opengl.h create mode 100755 plzpart/plz.h create mode 100755 plzpart/plzpart.c create mode 100755 plzpart/plzpart.exe create mode 100755 plzpart/plzpart.h create mode 100755 plzpart/types.h diff --git a/plz.o b/plz.o index 0e39801dfb938a4a2c3679d8adebaca0fbad1f47..2227ec0440b87fc8069076f22efc6ade78f6e8c2 100755 GIT binary patch literal 3400 zcma)94NP0t6+X}J`Pmp7^Am_6g#2Mbl40;q14&89A0Zu4S-`nj(kyQ#I5oq7Wjl?! zSt}8y!7FyHfZrQGUh;Y(;{Z@S)V&#@l5rvO4!Rw z(>&Sj^SS*N&mE>3IlDyljN8>=@r*OoU%pj;AYIiLbe*>N{B9GCY(YP?4nWx3w69*+ zx7)d!-_z2SLClW z6|O2SS+j0KY1zi|&08ug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q%xE1)n z%;aO-kLh8Jw#!5~GcE^LdczWfZhl=#XlXu!R|9|n4I+;^1YPIMh=jT@1n9M|Z*C*P zhJ#gFD{YrUAa1@~AMKPbYzWk8@5TH^*j6o%MV|71at0k_HUc$u#8PvRhB04f%s z1_IEp@Lz@h!vMPj(flNUGg{Ch)`wB8mh6UPM0q&tIUa-3EcSQCO}Vq&mNN)DFE4V2GBvBG7+T{yMx&tigLiX_bj8o+~QOU0*g~ V{5zVkKF66iVSL_)+Yt25e*>|^b!q?r 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 0000000000000000000000000000000000000000..153da2218fd33f974c6ed47e8cd968021c5b3531 GIT binary patch literal 25453 zcmc(Idq5ONws*~RGcy8?#CM{>F&ccJ27DURXys_v}Y5=06}OVT3%7=?kPwNW;ew^2Zs3+%uDqh;YaQ>HXQjI|np9LPZD5M+rFwmFuHVngLH*@6!N8 zZbf(h_^^s9)?>%H3SM`kLObHdF><)HdY&?`>L{_@eC^n$T*YW|qhj3U8x_OwJ1XLa zA9)l{e1(A+z@;ha>9r*u|{mHc-K(eA_8QTXN)L&DZ+qi;@G){(x%9& zm%teLM1Ze1-}{@gd` zY9qUgu68Jq-Nn`7P4Sjd-ezQSuhbHWkE{=S>3OZ#VU$-Rx2Ci@vL5t=N%~42Bo()W zy>ysCXAFYs+|U;pG-wdi;D)};px1{F#2n~`{+U5f4}u1}p+^|>twB(u8~Q4P{+dBs zimN4kY0FEmYpE(}18+#iKWL@U-)p6@ztg_(ACTV5hO(pNaO8RMq}XJXCmPD^HCp?J z!9};nYxX&z22cRwzoW{ts8XhVp;QZ<&oxv+yLE@vID$^)m zHBcMye{YMo#M@%8*dgHQ0}ZrzT`<#!K58VW))#01M)?K7 zR3X9+=_9U)Jf*rS>~Mi5vOeMpMn$X^2*g-k>{xA-gH#N5W%<5ipye)1&Y*t@(|V)) zVGyImt|-=Hk&3rbN&%YmQCM7Ulz)S=Ok+V}aZAJ%A3-tllR?z9QGzP#glk|AEa<@A zZ61;)G!(0qglnF%#nr39iEvgHV`X4NO58Q0JisBmHuS~J+P~DW$ZCe5vpy9>fO7j9M<3t3!H!Eyy3{(SpBuL^DzqO^m#m!3MXn zg3-)c_yL_C=j*{S^Z?`+g9LOyzGEm8g;p`?V&CzURyV4_?KB(QA{$~j#mJQg58dzi zF$W_H-1(D16fTKLR|aGJg$HBAmB@OLmr^cKt_T>beoVm#GlM!dG!*N*e#jZ;R|5A{ zF-i85x|DKNs8(N!-W~=x$fH{Pt8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IAHyRVWrWzAI6G!9^}q0PK(ek>+~`WH*Ebx(`T_< zE1HJ^)H#Bt-EUi|WO`Du1>{8mmsZP)0>bEk5g8MnF9AK!<@pWx;ld}O%Dafbbi4F?TBF;w7o!eT?R!Dg`G_M!QP zy>DuJNaoZdWvIWO^=Qt&)FV&C)7>Y;Ia!~K8cz2FH+=ncj-MCF@#Eb8Mva@nanm?{ z62~o#=6LNPjfUf&-~tSbxPa3fw|c=gZp1Ifg9JK1d*&*JnwZod_g|`KT5Pq^fSHNq zon?Osd5zP#?-1hVJh${$#kmyY6FUU>t2)H=SH0)})RH3%PQ&h4iUuMEir?3mhElx8 zxh6muULL!JewRwoZnVg2X|xv~6Gutn;7s%f*I!xfgA9*{8|sJDRXF{ta^pCx z2(P7~NqpCb{_$Qa+{NHDj!3uH{4W(A4)na1h6(XOa(^(kQz@NU3{H0z)En%~ zQsD}N(_M|@+)RJ4n`Z}y(e`O52d6-XfWOb+ENDY|hk&Pp3B0z-%M)J_wf%Air?C;r zLH|pI(~rjUS{ec&*u3_?RJZ``!_Z>zp=7e3!C6p(%!htfGfIXkIX{?UqLBb>k0M?C zUYZZGlAls`@erinrP9>M;FpG|uS!15_72jR?fH0T$Jt4+x7{h%JZ^B99u2bz#`L%@H};MD%T#c79-SR;c|H<;k4hySIvuZOH*hZ+1M zf3SND$1^x}V+oFa_+M)MV+^iC%WrW**}beW6#pCsA4*GKVQ}Wt5jq*X$aqE>Mfo<^ zuBoyO28h>E4~-sY!Q3$me+Duan-6K}+pRmPtD57vPu;#fFTKF?M0XcG_t;X*-kF|H X=H&09tH9LlWaFAdik@AmlL`5M0|C0B literal 0 HcmV?d00001 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] -- 2.39.5