TARGET_OS = dos
+BUILD_ROOT=$+$(%__CWD__)
#EXMMTESTDIR=16$(DIRSEP)exmmtest$(DIRSEP)
PDIR=..$(DIRSEP)
SRC=src$(DIRSEP)
# library deps 16-bit huge
$(DOSLIBDIR)$(DIRSEP)hw$(DIRSEP)cpu$(DIRSEP)dos86h$(DIRSEP)cpu.lib:
cd $(DOSLIBDIR)$(DIRSEP)hw$(DIRSEP)cpu && .$(DIRSEP)make.sh
+ cd $(BUILD_ROOT)
$(DOSLIBDIR)$(DIRSEP)hw$(DIRSEP)dos$(DIRSEP)dos86h$(DIRSEP)dos.lib:
cd $(DOSLIBDIR)$(DIRSEP)hw$(DIRSEP)dos && .$(DIRSEP)make.sh
+ cd $(BUILD_ROOT)
$(DOSLIBDIR)$(DIRSEP)hw$(DIRSEP)vga$(DIRSEP)dos86h$(DIRSEP)vgatty.lib:
cd $(DOSLIBDIR)$(DIRSEP)hw$(DIRSEP)vga && .$(DIRSEP)make.sh
+ cd $(BUILD_ROOT)
$(DOSLIBDIR)$(DIRSEP)hw$(DIRSEP)vga$(DIRSEP)dos86h$(DIRSEP)vga.lib:
cd $(DOSLIBDIR)$(DIRSEP)hw$(DIRSEP)vga && .$(DIRSEP)make.sh
+ cd $(BUILD_ROOT)
$(DOSLIBDIR)$(DIRSEP)hw$(DIRSEP)8250$(DIRSEP)dos86h$(DIRSEP)8250.lib:
cd $(DOSLIBDIR)$(DIRSEP)hw$(DIRSEP)8250 && .$(DIRSEP)make.sh
+ cd $(BUILD_ROOT)
joytest.exe:
- cd $(DOSLIBDIR)$(DIRSEP)hw$(DIRSEP)joystick && .$(DIRSEP)make.sh && $(COPYCOMMAND) dos86h$(DIRSEP)test.exe $(PDIR)$(PDIR)$(PDIR)$(PDIR)$(PDIR)joytest.exe
+ cd $(DOSLIBDIR)$(DIRSEP)hw$(DIRSEP)joystick && .$(DIRSEP)make.sh && $(COPYCOMMAND) dos86h$(DIRSEP)test.exe $(BUILD_ROOT)$(DIRSEP)joytest.exe
+ cd $(BUILD_ROOT)
#$(DOSLIBLIBS): .symbolic
# @cd $(DOSLIB)
# @.$(DIRSEP)buildall.sh
-# @cd $(PDIR)$(PDIR)$(PDIR)
+# @cd $(BUILD_ROOT)
modex16.$(OBJ): $(SRCLIB)modex16.c $(SRCLIB)modex16.h
bakapee.$(OBJ): $(SRCLIB)bakapee.c $(SRCLIB)bakapee.h
@echo $(OBJ)
#@cd $(DOSLIB)
#@./buildall.sh clean
- #@cd $(PDIR)$(PDIR)$(PDIR)
+ #@cd $(BUILD_ROOT)
# @$(COPYCOMMAND) $(SRC)exmmtest.c $(EXMMTESTDIR)$(SRC)
# @$(COPYCOMMAND) $(SRCLIB)16_mm.* $(EXMMTESTDIR)$(SRCLIB)
# @$(COPYCOMMAND) $(SRCLIB)16_head.* $(EXMMTESTDIR)$(SRCLIB)
mkdl: .symbolic
@cd $(DOSLIB)
@./buildall.sh
- @cd $(PDIR)$(PDIR)$(PDIR)
+ @cd $(BUILD_ROOT)
uplibs: .symbolic
@cd $(JSMNLIB)
@git pull
- @cd $(PDIR)$(PDIR)$(PDIR)
+ @cd $(BUILD_ROOT)
@cd $(DOSLIB)
@git pull
- @cd $(PDIR)$(PDIR)$(PDIR)
+ @cd $(BUILD_ROOT)
reinitlibs: .symbolic
@rm -rf $(SRCLIB)doslib
@cd $(SRCLIB)
@git clone https://github.com/joncampbell123/doslib.git
@git clone https://github.com/zserge/jsmn.git
- @cd $(PDIR)$(PDIR)
+ @cd $(BUILD_ROOT)
@cd 16
@git clone https://github.com/FlatRockSoft/CatacombApocalypse.git
@git clone https://github.com/id-Software/wolf3d.git
@git clone https://github.com/keendreams/keen.git
- @cd $(PDIR)
+ @cd $(BUILD_ROOT)
@cp $(SRCLIB)doslib/make-lowercase .
##
@cd 16$(DIRSEP)xlib
@wmake -h clean
@wmake -h all
- @cd $(PDIR)$(PDIR)
+ @cd $(BUILD_ROOT)
mx: .symbolic
@cd 16$(DIRSEP)xw
# @wmake clean
@wmake -h all
- @cd $(PDIR)$(PDIR)
+ @cd $(BUILD_ROOT)
mx_: .symbolic
@cd 16$(DIRSEP)xw_
@wmake -h -f makefile all
- @cd $(PDIR)$(PDIR)
+ @cd $(BUILD_ROOT)
vrs: .symbolic
@cd $(DOSLIBDIR)$(DIRSEP)hw$(DIRSEP)vga
#@make clean
@make all
- @mv pcx2vrl ../../../../../
- @mv pcxsscut ../../../../../
- @mv vrl2vrs ../../../../../
- @mv vrsdump ../../../../../
- @cd ../../../../../
+ @mv pcx2vrl $(BUILD_ROOT)$(DIRSEP)
+ @mv pcxsscut $(BUILD_ROOT)$(DIRSEP)
+ @mv vrl2vrs $(BUILD_ROOT)$(DIRSEP)
+ @mv vrsdump $(BUILD_ROOT)$(DIRSEP)
+ @cd $(BUILD_ROOT)
\r
size = filelength(handle);\r
if(!CA_FarRead(handle,*ptr,size, mm))\r
+ {\r
+ close (handle);\r
+ return false;\r
+ }\r
+ close (handle);\r
+ return true;\r
+}\r
+\r
+\r
+/*\r
+==========================\r
+=\r
+= CA_WriteFile\r
+=\r
+= Writes a file from a memory buffer\r
+=\r
+==========================\r
+*/\r
+\r
+boolean CA_WriteFile (char *filename, void far *ptr, long length, mminfo_t *mm)\r
+{\r
+ int handle;\r
+ sdword size;\r
+ //long size;\r
+\r
+ handle = open(filename,O_CREAT | O_BINARY | O_WRONLY,\r
+ S_IREAD | S_IWRITE | S_IFREG);\r
+\r
+ if (handle == -1)\r
+ return false;\r
+\r
+ if (!CA_FarWrite (handle,ptr,length, mm))\r
{\r
close(handle);\r
return false;\r
======================\r
*/\r
/*++++\r
-void CA_FreeGraphics (void)\r
+void CA_SetGrPurge (void)\r
{\r
- int i;\r
+ int i;\r
+\r
+//\r
+// free graphics\r
+//\r
+ CA_ClearMarks ();\r
\r
for (i=0;i<NUMCHUNKS;i++)\r
if (grsegs[i])\r
boolean CA_FarWrite (int handle, byte huge *source, dword length, mminfo_t *mm);\r
\r
boolean CA_ReadFile (char *filename, memptr *ptr, mminfo_t *mm);\r
+boolean CA_WriteFile (char *filename, void far *ptr, long length, mminfo_t *mm);\r
boolean CA_LoadFile (char *filename, memptr *ptr, mminfo_t *mm, mminfotype *mmi);\r
\r
//long CA_RLEWCompress (unsigned huge *source, long length, unsigned huge *dest,unsigned rlewtag);\r
/*void CA_UpLevel (void);\r
void CA_DownLevel (void);\r
\r
+void CA_SetGrPurge (void);\r
void CA_SetAllPurge (void);\r
\r
void CA_ClearMarks (void);\r