From: Jonathan Campbell Date: Sat, 16 Apr 2016 01:52:21 +0000 (-0700) Subject: Merge remote-tracking branch 'upstream/master' X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=8d77030556e776f864e8e95bcbb5684ce2916d44;hp=7f10a2f8adaea4ec69576c0a8905fde6809ee27d;p=16.git Merge remote-tracking branch 'upstream/master' --- diff --git a/awoo.sh b/awoo.sh index 1f82d931..ba3e5435 100755 --- a/awoo.sh +++ b/awoo.sh @@ -13,4 +13,5 @@ fi ##echo "$pee" git add . . ./boop.sh "$pee" -. ./builq.sh +. ./wbuild.sh +##. ./builq.sh slow compile ww diff --git a/data/spri/PRSBACW0.VRL b/data/spri/PRSBACW0.VRL new file mode 100755 index 00000000..2c93df94 Binary files /dev/null and b/data/spri/PRSBACW0.VRL differ diff --git a/data/spri/PRSBACW1.VRL b/data/spri/PRSBACW1.VRL new file mode 100755 index 00000000..fb3c7cf2 Binary files /dev/null and b/data/spri/PRSBACW1.VRL differ diff --git a/data/spri/PRSBACW2.VRL b/data/spri/PRSBACW2.VRL new file mode 100755 index 00000000..65fc4bf6 Binary files /dev/null and b/data/spri/PRSBACW2.VRL differ diff --git a/data/spri/PRSBFCW0.VRL b/data/spri/PRSBFCW0.VRL new file mode 100755 index 00000000..e2d1e1ff Binary files /dev/null and b/data/spri/PRSBFCW0.VRL differ diff --git a/data/spri/PRSBFCW1.VRL b/data/spri/PRSBFCW1.VRL new file mode 100755 index 00000000..6473a169 Binary files /dev/null and b/data/spri/PRSBFCW1.VRL differ diff --git a/data/spri/PRSBFCW2.VRL b/data/spri/PRSBFCW2.VRL new file mode 100755 index 00000000..30f48d11 Binary files /dev/null and b/data/spri/PRSBFCW2.VRL differ diff --git a/data/spri/PRSBLCW0.VRL b/data/spri/PRSBLCW0.VRL new file mode 100755 index 00000000..161753b4 Binary files /dev/null and b/data/spri/PRSBLCW0.VRL differ diff --git a/data/spri/PRSBLCW1.VRL b/data/spri/PRSBLCW1.VRL new file mode 100755 index 00000000..fba1dc95 Binary files /dev/null and b/data/spri/PRSBLCW1.VRL differ diff --git a/data/spri/PRSBLCW2.VRL b/data/spri/PRSBLCW2.VRL new file mode 100755 index 00000000..7872c41a Binary files /dev/null and b/data/spri/PRSBLCW2.VRL differ diff --git a/data/spri/PRSBRCW0.VRL b/data/spri/PRSBRCW0.VRL new file mode 100755 index 00000000..b0a21ae5 Binary files /dev/null and b/data/spri/PRSBRCW0.VRL differ diff --git a/data/spri/PRSBRCW1.VRL b/data/spri/PRSBRCW1.VRL new file mode 100755 index 00000000..8c7267c5 Binary files /dev/null and b/data/spri/PRSBRCW1.VRL differ diff --git a/data/spri/PRSBRCW2.VRL b/data/spri/PRSBRCW2.VRL new file mode 100755 index 00000000..354fd6eb Binary files /dev/null and b/data/spri/PRSBRCW2.VRL differ diff --git a/data/spri/ptmp.h b/data/spri/ptmp.h new file mode 100755 index 00000000..a985b51d --- /dev/null +++ b/data/spri/ptmp.h @@ -0,0 +1,20 @@ +// header file for sprite sheet. AUTO GENERATED, do not edit +// +// source PCX: ../ptmp.pcx +// sheet script: ptmp.sht +// palette file: ptmp.pal + +#define _ptmp_PRSBFCW0 10U +#define _ptmp_PRSBFCW1 11U +#define _ptmp_PRSBFCW2 12U +#define _ptmp_PRSBLCW0 20U +#define _ptmp_PRSBLCW1 21U +#define _ptmp_PRSBLCW2 22U +#define _ptmp_PRSBRCW0 30U +#define _ptmp_PRSBRCW1 31U +#define _ptmp_PRSBRCW2 32U +#define _ptmp_PRSBACW0 40U +#define _ptmp_PRSBACW1 41U +#define _ptmp_PRSBACW2 42U + +// end list diff --git a/data/spri/ptmp.pal b/data/spri/ptmp.pal new file mode 100755 index 00000000..5227fbbd Binary files /dev/null and b/data/spri/ptmp.pal differ diff --git a/data/spri/ptmp.sht b/data/spri/ptmp.sht new file mode 100755 index 00000000..8d9e5761 --- /dev/null +++ b/data/spri/ptmp.sht @@ -0,0 +1,73 @@ +# player.PCX demo sprite sheet compiler script +# (C) 2016 Jonathan Campbell + +# *spritesheet declares the section used by the sprite sheet cutting tool +# +# Sprites are declared by name (which becomes the .VRL file) at the + in the form: +# +NAME@ID +# +# Sprite names are meant for temporary use when compiling the sprite sheet into VRLs. +# At some point a longer name might be provided for use in your code. +# This will fill the CURRENT WORKING DIRECTORY with .VRL files as directed when you +# run PCXSSCUT, make sure your makefile does this in a temporary directory when +# you integrate into your build and that your cleanup commands delete these files, +# and that your .gitignore does not attempt to commit these files. + +# this format is a bit crap, but we'll improve it as needed. be patient. + +# begin spritesheet section +*spritesheet + +# ---------------- player, walking, blue shirt with white cross. Frame 2/3 could be used for standing still + +# player, forward, frame 1/3 ++PRSBFCW0@10 +xy=0,0 +wh=24,32 +# player, forward, frame 2/3 ++PRSBFCW1@11 +xy=24,0 +wh=24,32 +# player, forward, frame 3/3 ++PRSBFCW2@12 +xy=48,0 +wh=24,32 + +# player, left, frame 1/3 ++PRSBLCW0@20 +xy=0,32 +wh=24,32 +# player, left, frame 2/3 ++PRSBLCW1@21 +xy=24,32 +wh=24,32 +# player, left, frame 3/3 ++PRSBLCW2@22 +xy=48,32 +wh=24,32 + +# player, right, frame 1/3 ++PRSBRCW0@30 +xy=0,64 +wh=24,32 +# player, right, frame 2/3 ++PRSBRCW1@31 +xy=24,64 +wh=24,32 +# player, right, frame 3/3 ++PRSBRCW2@32 +xy=48,64 +wh=24,32 + +# player, away, frame 1/3 ++PRSBACW0@40 +xy=0,96 +wh=24,32 +# player, away, frame 2/3 ++PRSBACW1@41 +xy=24,96 +wh=24,32 +# player, away, frame 3/3 ++PRSBACW2@42 +xy=48,96 +wh=24,32 diff --git a/data/spri/ptmp.vrs b/data/spri/ptmp.vrs new file mode 100755 index 00000000..3bff7ff6 Binary files /dev/null and b/data/spri/ptmp.vrs differ diff --git a/data/spri/ptmps.h b/data/spri/ptmps.h new file mode 100755 index 00000000..b9ae5996 --- /dev/null +++ b/data/spri/ptmps.h @@ -0,0 +1,20 @@ +// header file for sprite sheet. AUTO GENERATED, do not edit +// +// sheet script: ptmp.sht + +// sprite sheet (sprite IDs) +#define _ptmp_PRSBFCW0_sprite 10U +#define _ptmp_PRSBFCW1_sprite 11U +#define _ptmp_PRSBFCW2_sprite 12U +#define _ptmp_PRSBLCW0_sprite 20U +#define _ptmp_PRSBLCW1_sprite 21U +#define _ptmp_PRSBLCW2_sprite 22U +#define _ptmp_PRSBRCW0_sprite 30U +#define _ptmp_PRSBRCW1_sprite 31U +#define _ptmp_PRSBRCW2_sprite 32U +#define _ptmp_PRSBACW0_sprite 40U +#define _ptmp_PRSBACW1_sprite 41U +#define _ptmp_PRSBACW2_sprite 42U +// animation list (animation IDs) + +// end list diff --git a/design.txt b/design.txt index a7ff175f..a8c4c054 100755 --- a/design.txt +++ b/design.txt @@ -57,3 +57,18 @@ be used to turn off stack checking, so no stack checking routines get called. 00:20:21 joncampbell123 | yes. │ 00:20:29 sparky4_derpy4 | scroll16 needs a bunch of work │ 00:20:29 joncampbell123 | the less you declare on the stack, the less stack the function needs. + + + + + + +[15:03] joncampbell123m Think of it this way +[15:03] joncampbell123m If something moves or changes frame +[15:04] joncampbell123m then a rectangular region around the sprite needs to be redrawn +[15:05] joncampbell123m So you collect update regions together +[15:06] joncampbell123m based on performance vs overlap +[15:06] joncampbell123m combine the rectangles together and redraw the screen they cover +[15:07] joncampbell123m the simplest way is to compute a rectangle that covers them all +[15:07] joncampbell123m then redraw that. +[15:08] joncampbell123m Then optimize the code from there how you handle it diff --git a/makefile b/makefile index 9da99872..d29eb7c4 100755 --- a/makefile +++ b/makefile @@ -46,6 +46,8 @@ TARGET_OS = dos #EXMMTESTDIR=16$(DIRSEP)exmmtest$(DIRSEP) PDIR=..$(DIRSEP) SRC=src$(DIRSEP) +DATADIR=data$(DIRSEP) +SPRI=$(DATADIR)$(DIRSEP)spri$(DIRSEP) SRCLIB=$(SRC)lib$(DIRSEP) JSMNLIB=$(SRCLIB)jsmn$(DIRSEP) NYANLIB=$(SRCLIB)nyan$(DIRSEP) @@ -64,7 +66,7 @@ UPXQ=-qqq AFLAGS=-mh -0 -d1 16FLAGS=-fh=16.hed BAKAPIFLAGS=-fh=bakapi.hed -SFLAGS=-sg -st -of+ -zu -zdf -zff -zgf -k40000#55808#60000#32768 +SFLAGS=-sg -st -of+ -zu -zdf -zff -zgf -k32768#55808#60000 DFLAGS=-DTARGET_MSDOS=16 -DMSDOS=1 $(SFLAGS) ZFLAGS=-zk0 -zc -zp8 $(WCLQ) ## -zm CFLAGS=$(AFLAGS) $(IFLAGS)-lr -l=dos -wo -i$(DOSLIB)##wwww @@ -87,7 +89,7 @@ TESTEXEC = exmmtest.exe test.exe pcxtest.exe pcxtest2.exe test2.exe palettec.exe #testemm.exe testemm0.exe fonttes0.exe miditest.exe sega.exe sountest.exe EXEC = 16.exe bakapi.exe $(TESTEXEC) tesuto.exe -all: $(EXEC) joytest.exe +all: $(EXEC) joytest.exe vrs #$(16LIBOBJS) => 16.lib bug.... # @@ -433,9 +435,9 @@ clean: .symbolic @$(REMOVECOMMAND) *.MAP @$(REMOVECOMMAND) *.map @$(REMOVECOMMAND) *.err - @cd $(DOSLIB) + #@cd $(DOSLIB) #@./buildall.sh clean - @cd $(PDIR)$(PDIR)$(PDIR) + #@cd $(PDIR)$(PDIR)$(PDIR) # @$(COPYCOMMAND) $(SRC)exmmtest.c $(EXMMTESTDIR)$(SRC) # @$(COPYCOMMAND) $(SRCLIB)16_mm.* $(EXMMTESTDIR)$(SRCLIB) # @$(COPYCOMMAND) $(SRCLIB)16_head.* $(EXMMTESTDIR)$(SRCLIB) @@ -517,3 +519,13 @@ mx_: .symbolic @cd 16$(DIRSEP)xw_ @wmake -h -f makefile all @cd $(PDIR)$(PDIR) + +vrs: .symbolic + @cd $(DOSLIBDIR)$(DIRSEP)hw$(DIRSEP)vga + #@make clean + @make all + @mv pcx2vrl ../../../../../ + @mv pcxsscut ../../../../../ + @mv vrl2vrs ../../../../../ + @mv vrsdump ../../../../../ + @cd ../../../../../ diff --git a/pcx2vrl b/pcx2vrl new file mode 100755 index 00000000..bd947e55 Binary files /dev/null and b/pcx2vrl differ diff --git a/pcxsscut b/pcxsscut new file mode 100755 index 00000000..1deec74d Binary files /dev/null and b/pcxsscut differ diff --git a/spri.sh b/spri.sh new file mode 100755 index 00000000..f3446340 --- /dev/null +++ b/spri.sh @@ -0,0 +1,5 @@ +#! /bin/bash +cd data/spri +../../pcxsscut -s "$1".sht -hc "$1".h -hp _"$1"_ -i ../"$1".pcx -p "$1".pal -tc 0x"$2" -y +../../vrl2vrs -s "$1".sht -hc "$1"s.h -hp _"$1"_ -o "$1".vrs +cd ../../ diff --git a/src/inputest.c b/src/inputest.c index 44195363..199dc90b 100755 --- a/src/inputest.c +++ b/src/inputest.c @@ -30,9 +30,9 @@ main(int argc, char *argv[]) global_game_variables_t gvar; player_t player[MaxPlayers]; //extern struct inconfig inpu; - testkeyin=0; + testkeyin=1; testcontrolnoisy=0; - testctrltype=1; + testctrltype=0; IN_Startup(); IN_Default(0,&player,ctrl_Joystick1); //while(!IN_KeyDown(sc_Escape)) diff --git a/src/lib/16_in.c b/src/lib/16_in.c index 66c98dd6..aef50c68 100755 --- a/src/lib/16_in.c +++ b/src/lib/16_in.c @@ -235,7 +235,7 @@ static boolean special; if (INL_KeyHook && !special) INL_KeyHook(); //#ifdef TESTKEYIN - if(testkeyin > 0) printf("%c [0x%x %u] %u\n", c, k, k, inpu.Keyboard[k]); + if(testkeyin > 0) printf("%c %u [0x%x %u] %u\n", c, c, k, k, inpu.Keyboard[k]); //endif outp(0x20,0x20); } diff --git a/src/lib/doslib b/src/lib/doslib index 3c110fd2..05fc315e 160000 --- a/src/lib/doslib +++ b/src/lib/doslib @@ -1 +1 @@ -Subproject commit 3c110fd249406b11b5301568b7c69d961fb91e79 +Subproject commit 05fc315e3b435866873be945a61f672f62f9199d diff --git a/src/lib/modex16.c b/src/lib/modex16.c index a2152825..42d4f6c8 100755 --- a/src/lib/modex16.c +++ b/src/lib/modex16.c @@ -70,7 +70,7 @@ vgaSetMode(byte mode) // Use the bios to get the current video mode // -long/*FIXME: why long? "long" is 32-bit datatype, VGA modes are 8-bit numbers. */ +byte/*FIXME: why long? "long" is 32-bit datatype, VGA modes are 8-bit numbers. */ vgaGetMode() { return int10_getmode(); @@ -80,7 +80,7 @@ vgaGetMode() void modexEnter(sword vq, boolean cmem, global_game_variables_t *gv) { word i; - dword far*ptr=(dword far*)VGA; /* used for faster screen clearing */ + dword far*ptr=(dword far*)vga_state.vga_graphics_ram;//VGA; /* used for faster screen clearing */ struct vga_mode_params cm; int CRTParmCount; diff --git a/src/lib/modex16.h b/src/lib/modex16.h index 94a69ad5..3621466f 100755 --- a/src/lib/modex16.h +++ b/src/lib/modex16.h @@ -86,7 +86,7 @@ typedef union /* mode switching, page, and plane functions */ void VGAmodeX(sword vq, boolean cmem, global_game_variables_t *gv); void modexEnter(sword vq, boolean cmem, global_game_variables_t *gv); -long vgaGetMode(); +byte vgaGetMode(); void modexLeave(); void modexsetBaseXMode(); page_t modexDefaultPage(page_t *p); diff --git a/vrl2vrs b/vrl2vrs new file mode 100755 index 00000000..b67956b7 Binary files /dev/null and b/vrl2vrs differ diff --git a/vrsdump b/vrsdump new file mode 100755 index 00000000..dbaba30e Binary files /dev/null and b/vrsdump differ