]> 4ch.mooo.com Git - 16.git/commitdiff
Merge remote-tracking branch 'upstream/master'
authorJonathan Campbell <jonathan@castus.tv>
Sat, 16 Apr 2016 01:52:21 +0000 (18:52 -0700)
committerJonathan Campbell <jonathan@castus.tv>
Sat, 16 Apr 2016 01:52:21 +0000 (18:52 -0700)
30 files changed:
awoo.sh
data/spri/PRSBACW0.VRL [new file with mode: 0755]
data/spri/PRSBACW1.VRL [new file with mode: 0755]
data/spri/PRSBACW2.VRL [new file with mode: 0755]
data/spri/PRSBFCW0.VRL [new file with mode: 0755]
data/spri/PRSBFCW1.VRL [new file with mode: 0755]
data/spri/PRSBFCW2.VRL [new file with mode: 0755]
data/spri/PRSBLCW0.VRL [new file with mode: 0755]
data/spri/PRSBLCW1.VRL [new file with mode: 0755]
data/spri/PRSBLCW2.VRL [new file with mode: 0755]
data/spri/PRSBRCW0.VRL [new file with mode: 0755]
data/spri/PRSBRCW1.VRL [new file with mode: 0755]
data/spri/PRSBRCW2.VRL [new file with mode: 0755]
data/spri/ptmp.h [new file with mode: 0755]
data/spri/ptmp.pal [new file with mode: 0755]
data/spri/ptmp.sht [new file with mode: 0755]
data/spri/ptmp.vrs [new file with mode: 0755]
data/spri/ptmps.h [new file with mode: 0755]
design.txt
makefile
pcx2vrl [new file with mode: 0755]
pcxsscut [new file with mode: 0755]
spri.sh [new file with mode: 0755]
src/inputest.c
src/lib/16_in.c
src/lib/doslib
src/lib/modex16.c
src/lib/modex16.h
vrl2vrs [new file with mode: 0755]
vrsdump [new file with mode: 0755]

diff --git a/awoo.sh b/awoo.sh
index 1f82d9312b220484abf225f12a93f717f3e70c3c..ba3e5435c520f895886890404979ce5746fa1434 100755 (executable)
--- 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 (executable)
index 0000000..2c93df9
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 (executable)
index 0000000..fb3c7cf
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 (executable)
index 0000000..65fc4bf
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 (executable)
index 0000000..e2d1e1f
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 (executable)
index 0000000..6473a16
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 (executable)
index 0000000..30f48d1
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 (executable)
index 0000000..161753b
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 (executable)
index 0000000..fba1dc9
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 (executable)
index 0000000..7872c41
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 (executable)
index 0000000..b0a21ae
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 (executable)
index 0000000..8c7267c
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 (executable)
index 0000000..354fd6e
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 (executable)
index 0000000..a985b51
--- /dev/null
@@ -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 (executable)
index 0000000..5227fbb
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 (executable)
index 0000000..8d9e576
--- /dev/null
@@ -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 (executable)
index 0000000..3bff7ff
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 (executable)
index 0000000..b9ae599
--- /dev/null
@@ -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
index a7ff175facf2d5e489f701e4ac95e9076906444b..a8c4c0544fb7ae37dcc57196a13549ca6c5cf28c 100755 (executable)
@@ -57,3 +57,18 @@ be used to turn off stack checking, so no stack checking routines get called.
 00:20:21   joncampbell123 | yes.                                                                           │\r
 00:20:29   sparky4_derpy4 | scroll16 needs a bunch of work                                                 │\r
 00:20:29   joncampbell123 | the less you declare on the stack, the less stack the function needs.\r
+\r
+\r
+\r
+\r
+\r
+\r
+[15:03]        joncampbell123m Think of it this way\r
+[15:03]        joncampbell123m If something moves or changes frame\r
+[15:04]        joncampbell123m then a rectangular region around the sprite needs to be redrawn\r
+[15:05]        joncampbell123m So you collect update regions together\r
+[15:06]        joncampbell123m based on performance vs overlap\r
+[15:06]        joncampbell123m combine the rectangles together and redraw the screen they cover\r
+[15:07]        joncampbell123m the simplest way is to compute a rectangle that covers them all\r
+[15:07]        joncampbell123m then redraw that.\r
+[15:08]        joncampbell123m Then optimize the code from there how you handle it\r
index 9da998721726f9f8cdfa147f2b5c809ce592721b..d29eb7c4cffad77c5c85d086ca5be7d9d96cd5ec 100755 (executable)
--- 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 (executable)
index 0000000..bd947e5
Binary files /dev/null and b/pcx2vrl differ
diff --git a/pcxsscut b/pcxsscut
new file mode 100755 (executable)
index 0000000..1deec74
Binary files /dev/null and b/pcxsscut differ
diff --git a/spri.sh b/spri.sh
new file mode 100755 (executable)
index 0000000..f344634
--- /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 ../../
index 44195363d18a91232ebb1e41742158bd04dd4e4b..199dc90b2c152d9f5e94e7e52da2bc07c04bf7c5 100755 (executable)
@@ -30,9 +30,9 @@ main(int argc, char *argv[])
        global_game_variables_t gvar;\r
        player_t player[MaxPlayers];\r
        //extern struct inconfig inpu;\r
-       testkeyin=0;\r
+       testkeyin=1;\r
        testcontrolnoisy=0;\r
-       testctrltype=1;\r
+       testctrltype=0;\r
        IN_Startup();\r
        IN_Default(0,&player,ctrl_Joystick1);\r
        //while(!IN_KeyDown(sc_Escape))\r
index 66c98dd6936b55fa262243f7951c830bf3b5db67..aef50c68b5f0ba4542446d4eff06da65921d11cf 100755 (executable)
@@ -235,7 +235,7 @@ static      boolean special;
        if (INL_KeyHook && !special)\r
                INL_KeyHook();\r
 //#ifdef TESTKEYIN\r
-       if(testkeyin > 0) printf("%c    [0x%x %u]       %u\n", c, k, k, inpu.Keyboard[k]);\r
+       if(testkeyin > 0) printf("%c    %u      [0x%x %u]       %u\n", c, c, k, k, inpu.Keyboard[k]);\r
 //endif\r
        outp(0x20,0x20);\r
 }\r
index 3c110fd249406b11b5301568b7c69d961fb91e79..05fc315e3b435866873be945a61f672f62f9199d 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 3c110fd249406b11b5301568b7c69d961fb91e79
+Subproject commit 05fc315e3b435866873be945a61f672f62f9199d
index a2152825ee9638110111f011c051bdc1ff646a99..42d4f6c8be8bd193845ae388e26e42403ba6cd5d 100755 (executable)
@@ -70,7 +70,7 @@ vgaSetMode(byte mode)
 // Use the bios to get the current video mode\r
 //\r
 \r
-long/*FIXME: why long? "long" is 32-bit datatype, VGA modes are 8-bit numbers. */\r
+byte/*FIXME: why long? "long" is 32-bit datatype, VGA modes are 8-bit numbers. */\r
 vgaGetMode()\r
 {\r
     return int10_getmode();\r
@@ -80,7 +80,7 @@ vgaGetMode()
 void modexEnter(sword vq, boolean cmem, global_game_variables_t *gv)\r
 {\r
        word i;\r
-       dword far*ptr=(dword far*)VGA;      /* used for faster screen clearing */\r
+       dword far*ptr=(dword far*)vga_state.vga_graphics_ram;//VGA;      /* used for faster screen clearing */\r
        struct vga_mode_params cm;\r
        int CRTParmCount;\r
 \r
index 94a69ad59a38cefabb9fb0b8b6c5c7fd25f16116..3621466f0e3a496cfbbb7bd64c893c92b920533b 100755 (executable)
@@ -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 (executable)
index 0000000..b67956b
Binary files /dev/null and b/vrl2vrs differ
diff --git a/vrsdump b/vrsdump
new file mode 100755 (executable)
index 0000000..dbaba30
Binary files /dev/null and b/vrsdump differ