From: sparky4 Date: Wed, 5 Aug 2015 07:41:44 +0000 (-0500) Subject: ==== Major release of EXMMTEST && EXMMBC ^^ it works!! yay!! ==== X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;ds=sidebyside;h=52faa857e77f0e19701f5b77fce7e3f8ba19e778;p=16.git ==== Major release of EXMMTEST && EXMMBC ^^ it works!! yay!! ==== modified: .gitignore deleted: 16/exmmtest/EXMMTEST.DSK deleted: 16/exmmtest/EXMMTEST.EXE deleted: 16/exmmtest/EXMMTEST.MAP deleted: 16/exmmtest/HEAP.16 deleted: 16/exmmtest/MMDUMP.16 deleted: 16/exmmtest/PROFILE.16 deleted: 16/exmmtest/TC0000.SWP deleted: 16/exmmtest/src/exmmtest.c deleted: 16/exmmtest/src/lib/16_ca.c deleted: 16/exmmtest/src/lib/16_ca.h deleted: 16/exmmtest/src/lib/16_hc.c deleted: 16/exmmtest/src/lib/16_hc.h deleted: 16/exmmtest/src/lib/16_head.c deleted: 16/exmmtest/src/lib/16_head.h deleted: 16/exmmtest/src/lib/16_mm.c deleted: 16/exmmtest/src/lib/16_mm.h deleted: 16/exmmtest/src/lib/nyan/kitten.c deleted: 16/exmmtest/src/lib/nyan/kitten.h deleted: 16/exmmtest/src/lib/types.h deleted: 16/exmmtest/wtf_this.wat new file: 16_CA.BCO new file: 16_HC.BCO new file: 16_HEAD.BCO new file: 16_MM.BCO modified: DEBUG.16 new file: EXMMBC.BCO new file: EXMMBC.DSK new file: EXMMBC.MAP modified: HEAP.16 new file: KITTEN.BCO modified: awoo.sh new file: exmmbc.exe renamed: 16/exmmtest/EXMMTEST.PRJ -> exmmbc.prj modified: exmmtest.exe modified: makefile modified: src/lib/16_hc.c modified: src/lib/16_head.h modified: src/lib/16_mm.c modified: src/lib/nyan/kitten.c modified: src/lib/nyan/kitten.h --- diff --git a/.gitignore b/.gitignore index cd8061bb..6ba73f4d 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ !proj16.bfproject *.obj *.OBJ +*.[O] *.*~ FUCK *.err diff --git a/16/exmmtest/EXMMTEST.DSK b/16/exmmtest/EXMMTEST.DSK deleted file mode 100644 index b6525f91..00000000 Binary files a/16/exmmtest/EXMMTEST.DSK and /dev/null differ diff --git a/16/exmmtest/EXMMTEST.EXE b/16/exmmtest/EXMMTEST.EXE deleted file mode 100644 index 2fbb356c..00000000 Binary files a/16/exmmtest/EXMMTEST.EXE and /dev/null differ diff --git a/16/exmmtest/EXMMTEST.MAP b/16/exmmtest/EXMMTEST.MAP deleted file mode 100644 index a909811a..00000000 --- a/16/exmmtest/EXMMTEST.MAP +++ /dev/null @@ -1,752 +0,0 @@ - - Start Stop Length Name Class - - 00000H 05941H 05942H _TEXT CODE - 05950H 05950H 00000H _FARDATA FAR_DATA - 05950H 05950H 00000H _FARBSS FAR_BSS - 05950H 05950H 00000H _OVERLAY_ OVRINFO - 05950H 05950H 00000H _1STUB_ STUBSEG - 05950H 069E3H 01094H _DATA DATA - 069E4H 069E5H 00002H _CVTSEG DATA - 069E6H 069EBH 00006H _SCNSEG DATA - 069ECH 069ECH 00000H _CONST CONST - 069ECH 06A03H 00018H _INIT_ INITDATA - 06A04H 06A04H 00000H _INITEND_ INITDATA - 06A04H 06A04H 00000H _EXIT_ EXITDATA - 06A04H 06A04H 00000H _EXITEND_ EXITDATA - 06A04H 06A6BH 00068H _BSS BSS - 06A6CH 06A6CH 00000H _BSSEND BSSEND - 06A70H 06AEFH 00080H _STACK STACK - - -Detailed map of segments - - 0000:0000 028F C=CODE S=_TEXT G=(none) M=c0.ASM ACBP=28 - 0000:028F 05F7 C=CODE S=_TEXT G=(none) M=SRC\LIB\NYAN\KITTEN.C ACBP=28 - 0000:0886 02A6 C=CODE S=_TEXT G=(none) M=SRC\LIB\16_HC.C ACBP=28 - 0000:0B2C 023A C=CODE S=_TEXT G=(none) M=SRC\EXMMTEST.C ACBP=28 - 0000:0D66 0232 C=CODE S=_TEXT G=(none) M=SRC\LIB\16_CA.C ACBP=28 - 0000:0F98 0242 C=CODE S=_TEXT G=(none) M=SRC\LIB\16_HEAD.C ACBP=28 - 0000:11DA 1A38 C=CODE S=_TEXT G=(none) M=SRC\LIB\16_MM.C ACBP=28 - 0000:2C12 0024 C=CODE S=_TEXT G=(none) M=ATEXIT ACBP=28 - 0000:2C36 0049 C=CODE S=_TEXT G=(none) M=CLOCK ACBP=28 - 0000:2C7F 0000 C=CODE S=_TEXT G=(none) M=CTYPE ACBP=28 - 0000:2C7F 003D C=CODE S=_TEXT G=(none) M=DOSFATTR ACBP=28 - 0000:2CBC 0089 C=CODE S=_TEXT G=(none) M=EXIT ACBP=28 - 0000:2D45 0000 C=CODE S=_TEXT G=(none) M=FILES ACBP=28 - 0000:2D45 0000 C=CODE S=_TEXT G=(none) M=FILES2 ACBP=28 - 0000:2D45 0000 C=CODE S=_TEXT G=(none) M=FMODE ACBP=28 - 0000:2D45 0021 C=CODE S=_TEXT G=(none) M=H_LLSH ACBP=28 - 0000:2D66 0021 C=CODE S=_TEXT G=(none) M=H_LURSH ACBP=28 - 0000:2D87 0060 C=CODE S=_TEXT G=(none) M=H_PADD ACBP=28 - 0000:2DE7 0028 C=CODE S=_TEXT G=(none) M=H_PSBP ACBP=28 - 0000:2E0F 004B C=CODE S=_TEXT G=(none) M=IOERROR ACBP=28 - 0000:2E5A 0011 C=CODE S=_TEXT G=(none) M=ISATTY ACBP=28 - 0000:2E6B 00A2 C=CODE S=_TEXT G=(none) M=LONGTOA ACBP=28 - 0000:2F0D 0029 C=CODE S=_TEXT G=(none) M=LSEEK ACBP=28 - 0000:2F36 00B0 C=CODE S=_TEXT G=(none) M=MKNAME ACBP=28 - 0000:2FE6 0021 C=CODE S=_TEXT G=(none) M=N_PCMP ACBP=28 - 0000:3007 002F C=CODE S=_TEXT G=(none) M=READA ACBP=28 - 0000:3036 00B2 C=CODE S=_TEXT G=(none) M=SETUPIO ACBP=28 - 0000:30E8 0000 C=CODE S=_TEXT G=(none) M=STKLEN ACBP=28 - 0000:30E8 002C C=CODE S=_TEXT G=(none) M=TOLOWER ACBP=28 - 0000:3114 0018 C=CODE S=_TEXT G=(none) M=UNLINK ACBP=28 - 0000:312C 04DB C=CODE S=_TEXT G=(none) M=VPRINTER ACBP=28 - 0000:3607 009F C=CODE S=_TEXT G=(none) M=VRAM ACBP=28 - 0000:36A6 0000 C=CODE S=_TEXT G=(none) M=WSCROLL ACBP=28 - 0000:36A6 0030 C=CODE S=_TEXT G=(none) M=_STPCPY ACBP=28 - 0000:36D6 0004 C=CODE S=_TEXT G=(none) M=CORELEFT ACBP=28 - 0000:36DA 014E C=CODE S=_TEXT G=(none) M=CPRINTF ACBP=28 - 0000:3828 01A5 C=CODE S=_TEXT G=(none) M=CRTINIT ACBP=28 - 0000:39CD 001F C=CODE S=_TEXT G=(none) M=CVTFAK ACBP=28 - 0000:39EC 042D C=CODE S=_TEXT G=(none) M=FARHEAP ACBP=28 - 0000:3E19 013E C=CODE S=_TEXT G=(none) M=FBRK ACBP=28 - 0000:3F57 0050 C=CODE S=_TEXT G=(none) M=FCORELFT ACBP=28 - 0000:3FA7 0054 C=CODE S=_TEXT G=(none) M=GETCH ACBP=28 - 0000:3FFB 00AC C=CODE S=_TEXT G=(none) M=GPTEXT ACBP=28 - 0000:40A7 0029 C=CODE S=_TEXT G=(none) M=IOCTL ACBP=28 - 0000:40D0 0012 C=CODE S=_TEXT G=(none) M=KBHIT ACBP=28 - 0000:40E2 009D C=CODE S=_TEXT G=(none) M=MOVETEXT ACBP=28 - 0000:417F 0017 C=CODE S=_TEXT G=(none) M=PUTCH ACBP=28 - 0000:4196 0004 C=CODE S=_TEXT G=(none) M=REALCVT ACBP=28 - 0000:419A 01C7 C=CODE S=_TEXT G=(none) M=SCREEN ACBP=28 - 0000:4361 0184 C=CODE S=_TEXT G=(none) M=SCROLL ACBP=28 - 0000:44E5 0129 C=CODE S=_TEXT G=(none) M=SETARGV ACBP=28 - 0000:460E 001C C=CODE S=_TEXT G=(none) M=SETBLOCK ACBP=28 - 0000:462A 0054 C=CODE S=_TEXT G=(none) M=SETENVP ACBP=28 - 0000:467E 002C C=CODE S=_TEXT G=(none) M=WHEREXY ACBP=28 - 0000:46AA 001D C=CODE S=_TEXT G=(none) M=CHMODA ACBP=28 - 0000:46C7 0026 C=CODE S=_TEXT G=(none) M=CLOSE ACBP=28 - 0000:46ED 001E C=CODE S=_TEXT G=(none) M=CLOSEA ACBP=28 - 0000:470B 00B0 C=CODE S=_TEXT G=(none) M=FCLOSE ACBP=28 - 0000:47BB 00C6 C=CODE S=_TEXT G=(none) M=FFLUSH ACBP=28 - 0000:4881 0041 C=CODE S=_TEXT G=(none) M=FLENGTH ACBP=28 - 0000:48C2 0040 C=CODE S=_TEXT G=(none) M=FLUSHALL ACBP=28 - 0000:4902 01FE C=CODE S=_TEXT G=(none) M=FOPEN ACBP=28 - 0000:4B00 001C C=CODE S=_TEXT G=(none) M=FPRINTF ACBP=28 - 0000:4B1C 01D8 C=CODE S=_TEXT G=(none) M=FSEEK ACBP=28 - 0000:4CF4 0070 C=CODE S=_TEXT G=(none) M=GETENV ACBP=28 - 0000:4D64 0070 C=CODE S=_TEXT G=(none) M=LTOA1 ACBP=28 - 0000:4DD4 0024 C=CODE S=_TEXT G=(none) M=MEMCPY ACBP=28 - 0000:4DF8 0022 C=CODE S=_TEXT G=(none) M=MOVEDATA ACBP=28 - 0000:4E1A 018D C=CODE S=_TEXT G=(none) M=OPEN ACBP=28 - 0000:4FA7 004F C=CODE S=_TEXT G=(none) M=OPENA ACBP=28 - 0000:4FF6 001B C=CODE S=_TEXT G=(none) M=PRINTF ACBP=28 - 0000:5011 03A4 C=CODE S=_TEXT G=(none) M=PUTC ACBP=28 - 0000:53B5 00CB C=CODE S=_TEXT G=(none) M=READ ACBP=28 - 0000:5480 0003 C=CODE S=_TEXT G=(none) M=READU ACBP=28 - 0000:5483 0111 C=CODE S=_TEXT G=(none) M=SETVBUF ACBP=28 - 0000:5594 0081 C=CODE S=_TEXT G=(none) M=SPRINTF ACBP=28 - 0000:5615 003F C=CODE S=_TEXT G=(none) M=STRCAT ACBP=28 - 0000:5654 003D C=CODE S=_TEXT G=(none) M=STRCHR ACBP=28 - 0000:5691 0030 C=CODE S=_TEXT G=(none) M=STRCMP ACBP=28 - 0000:56C1 0029 C=CODE S=_TEXT G=(none) M=STRCPY ACBP=28 - 0000:56EA 0040 C=CODE S=_TEXT G=(none) M=STRDUP ACBP=28 - 0000:572A 001F C=CODE S=_TEXT G=(none) M=STRLEN ACBP=28 - 0000:5749 0149 C=CODE S=_TEXT G=(none) M=WRITE ACBP=28 - 0000:5892 003C C=CODE S=_TEXT G=(none) M=WRITEA ACBP=28 - 0000:58CE 0003 C=CODE S=_TEXT G=(none) M=WRITEU ACBP=28 - 0000:58D1 003B C=CODE S=_TEXT G=(none) M=XFCLOSE ACBP=28 - 0000:590C 0036 C=CODE S=_TEXT G=(none) M=XFFLUSH ACBP=28 - 0595:0000 0000 C=FAR_DATA S=_FARDATA G=(none) M=c0.ASM ACBP=68 - 0595:0000 0000 C=FAR_BSS S=_FARBSS G=(none) M=c0.ASM ACBP=68 - 0595:0000 0000 C=OVRINFO S=_OVERLAY_ G=(none) M=c0.ASM ACBP=68 - 0595:0000 0000 C=STUBSEG S=_1STUB_ G=(none) M=c0.ASM ACBP=68 - 0595:0000 0093 C=DATA S=_DATA G=DGROUP M=c0.ASM ACBP=68 - 0595:0094 0045 C=DATA S=_DATA G=DGROUP M=SRC\LIB\NYAN\KITTEN.C ACBP=48 - 0595:00DA 0014 C=DATA S=_DATA G=DGROUP M=SRC\LIB\16_HC.C ACBP=48 - 0595:00EE 0187 C=DATA S=_DATA G=DGROUP M=SRC\EXMMTEST.C ACBP=48 - 0595:0276 002C C=DATA S=_DATA G=DGROUP M=SRC\LIB\16_CA.C ACBP=48 - 0595:02A2 0010 C=DATA S=_DATA G=DGROUP M=SRC\LIB\16_HEAD.C ACBP=48 - 0595:02B2 09E0 C=DATA S=_DATA G=DGROUP M=SRC\LIB\16_MM.C ACBP=48 - 0595:0C92 0002 C=DATA S=_DATA G=DGROUP M=ATEXIT ACBP=48 - 0595:0C94 0000 C=DATA S=_DATA G=DGROUP M=CLOCK ACBP=48 - 0595:0C94 0101 C=DATA S=_DATA G=DGROUP M=CTYPE ACBP=48 - 0595:0D96 0000 C=DATA S=_DATA G=DGROUP M=DOSFATTR ACBP=48 - 0595:0D96 0006 C=DATA S=_DATA G=DGROUP M=EXIT ACBP=48 - 0595:0D9C 0190 C=DATA S=_DATA G=DGROUP M=FILES ACBP=48 - 0595:0F2C 002A C=DATA S=_DATA G=DGROUP M=FILES2 ACBP=48 - 0595:0F56 0004 C=DATA S=_DATA G=DGROUP M=FMODE ACBP=48 - 0595:0F5A 0000 C=DATA S=_DATA G=DGROUP M=H_LLSH ACBP=48 - 0595:0F5A 0000 C=DATA S=_DATA G=DGROUP M=H_LURSH ACBP=48 - 0595:0F5A 0000 C=DATA S=_DATA G=DGROUP M=H_PADD ACBP=48 - 0595:0F5A 0000 C=DATA S=_DATA G=DGROUP M=H_PSBP ACBP=48 - 0595:0F5A 005B C=DATA S=_DATA G=DGROUP M=IOERROR ACBP=48 - 0595:0FB6 0000 C=DATA S=_DATA G=DGROUP M=ISATTY ACBP=48 - 0595:0FB6 0000 C=DATA S=_DATA G=DGROUP M=LONGTOA ACBP=48 - 0595:0FB6 0000 C=DATA S=_DATA G=DGROUP M=LSEEK ACBP=48 - 0595:0FB6 0009 C=DATA S=_DATA G=DGROUP M=MKNAME ACBP=48 - 0595:0FC0 0000 C=DATA S=_DATA G=DGROUP M=N_PCMP ACBP=48 - 0595:0FC0 0000 C=DATA S=_DATA G=DGROUP M=READA ACBP=48 - 0595:0FC0 0000 C=DATA S=_DATA G=DGROUP M=SETUPIO ACBP=48 - 0595:0FC0 0002 C=DATA S=_DATA G=DGROUP M=STKLEN ACBP=48 - 0595:0FC2 0000 C=DATA S=_DATA G=DGROUP M=TOLOWER ACBP=48 - 0595:0FC2 0000 C=DATA S=_DATA G=DGROUP M=UNLINK ACBP=48 - 0595:0FC2 0067 C=DATA S=_DATA G=DGROUP M=VPRINTER ACBP=48 - 0595:102A 0000 C=DATA S=_DATA G=DGROUP M=VRAM ACBP=48 - 0595:102A 0002 C=DATA S=_DATA G=DGROUP M=WSCROLL ACBP=48 - 0595:102C 0000 C=DATA S=_DATA G=DGROUP M=_STPCPY ACBP=48 - 0595:102C 0000 C=DATA S=_DATA G=DGROUP M=CORELEFT ACBP=48 - 0595:102C 0000 C=DATA S=_DATA G=DGROUP M=CPRINTF ACBP=48 - 0595:102C 0018 C=DATA S=_DATA G=DGROUP M=CRTINIT ACBP=48 - 0595:1044 0031 C=DATA S=_DATA G=DGROUP M=CVTFAK ACBP=48 - 0595:1076 0000 C=DATA S=_DATA G=DGROUP M=FARHEAP ACBP=48 - 0595:1076 0002 C=DATA S=_DATA G=DGROUP M=FBRK ACBP=48 - 0595:1078 0000 C=DATA S=_DATA G=DGROUP M=FCORELFT ACBP=48 - 0595:1078 0000 C=DATA S=_DATA G=DGROUP M=GETCH ACBP=48 - 0595:1078 0000 C=DATA S=_DATA G=DGROUP M=GPTEXT ACBP=48 - 0595:1078 0000 C=DATA S=_DATA G=DGROUP M=IOCTL ACBP=48 - 0595:1078 0002 C=DATA S=_DATA G=DGROUP M=KBHIT ACBP=48 - 0595:107A 0000 C=DATA S=_DATA G=DGROUP M=MOVETEXT ACBP=48 - 0595:107A 0000 C=DATA S=_DATA G=DGROUP M=PUTCH ACBP=48 - 0595:107A 0000 C=DATA S=_DATA G=DGROUP M=REALCVT ACBP=48 - 0595:107A 0000 C=DATA S=_DATA G=DGROUP M=SCREEN ACBP=48 - 0595:107A 0000 C=DATA S=_DATA G=DGROUP M=SCROLL ACBP=48 - 0595:107A 0010 C=DATA S=_DATA G=DGROUP M=SETARGV ACBP=48 - 0595:108A 0000 C=DATA S=_DATA G=DGROUP M=SETBLOCK ACBP=48 - 0595:108A 0004 C=DATA S=_DATA G=DGROUP M=SETENVP ACBP=48 - 0595:108E 0000 C=DATA S=_DATA G=DGROUP M=WHEREXY ACBP=48 - 0595:108E 0000 C=DATA S=_DATA G=DGROUP M=CHMODA ACBP=48 - 0595:108E 0000 C=DATA S=_DATA G=DGROUP M=CLOSE ACBP=48 - 0595:108E 0000 C=DATA S=_DATA G=DGROUP M=CLOSEA ACBP=48 - 0595:108E 0000 C=DATA S=_DATA G=DGROUP M=FCLOSE ACBP=48 - 0595:108E 0000 C=DATA S=_DATA G=DGROUP M=FFLUSH ACBP=48 - 0595:108E 0000 C=DATA S=_DATA G=DGROUP M=FLENGTH ACBP=48 - 0595:108E 0000 C=DATA S=_DATA G=DGROUP M=FLUSHALL ACBP=48 - 0595:108E 0000 C=DATA S=_DATA G=DGROUP M=FOPEN ACBP=48 - 0595:108E 0000 C=DATA S=_DATA G=DGROUP M=FPRINTF ACBP=48 - 0595:108E 0000 C=DATA S=_DATA G=DGROUP M=FSEEK ACBP=48 - 0595:108E 0000 C=DATA S=_DATA G=DGROUP M=GETENV ACBP=48 - 0595:108E 0000 C=DATA S=_DATA G=DGROUP M=LTOA1 ACBP=48 - 0595:108E 0000 C=DATA S=_DATA G=DGROUP M=MEMCPY ACBP=48 - 0595:108E 0000 C=DATA S=_DATA G=DGROUP M=MOVEDATA ACBP=48 - 0595:108E 0000 C=DATA S=_DATA G=DGROUP M=OPEN ACBP=48 - 0595:108E 0000 C=DATA S=_DATA G=DGROUP M=OPENA ACBP=48 - 0595:108E 0000 C=DATA S=_DATA G=DGROUP M=PRINTF ACBP=48 - 0595:108E 0001 C=DATA S=_DATA G=DGROUP M=PUTC ACBP=48 - 0595:1090 0000 C=DATA S=_DATA G=DGROUP M=READ ACBP=48 - 0595:1090 0000 C=DATA S=_DATA G=DGROUP M=READU ACBP=48 - 0595:1090 0004 C=DATA S=_DATA G=DGROUP M=SETVBUF ACBP=48 - 0595:1094 0000 C=DATA S=_DATA G=DGROUP M=SPRINTF ACBP=48 - 0595:1094 0000 C=DATA S=_DATA G=DGROUP M=STRCAT ACBP=48 - 0595:1094 0000 C=DATA S=_DATA G=DGROUP M=STRCHR ACBP=48 - 0595:1094 0000 C=DATA S=_DATA G=DGROUP M=STRCMP ACBP=48 - 0595:1094 0000 C=DATA S=_DATA G=DGROUP M=STRCPY ACBP=48 - 0595:1094 0000 C=DATA S=_DATA G=DGROUP M=STRDUP ACBP=48 - 0595:1094 0000 C=DATA S=_DATA G=DGROUP M=STRLEN ACBP=48 - 0595:1094 0000 C=DATA S=_DATA G=DGROUP M=WRITE ACBP=48 - 0595:1094 0000 C=DATA S=_DATA G=DGROUP M=WRITEA ACBP=48 - 0595:1094 0000 C=DATA S=_DATA G=DGROUP M=WRITEU ACBP=48 - 0595:1094 0000 C=DATA S=_DATA G=DGROUP M=XFCLOSE ACBP=48 - 0595:1094 0000 C=DATA S=_DATA G=DGROUP M=XFFLUSH ACBP=48 - 0595:1094 0000 C=DATA S=_CVTSEG G=DGROUP M=c0.ASM ACBP=48 - 0595:1094 0002 C=DATA S=_CVTSEG G=DGROUP M=CVTFAK ACBP=48 - 0595:1096 0000 C=DATA S=_CVTSEG G=DGROUP M=REALCVT ACBP=48 - 0595:1096 0000 C=DATA S=_SCNSEG G=DGROUP M=c0.ASM ACBP=48 - 0595:1096 0006 C=DATA S=_SCNSEG G=DGROUP M=CVTFAK ACBP=48 - 0595:109C 0000 C=CONST S=_CONST G=DGROUP M=c0.ASM ACBP=48 - 0595:109C 0000 C=INITDATA S=_INIT_ G=DGROUP M=c0.ASM ACBP=48 - 0595:109C 0006 C=INITDATA S=_INIT_ G=DGROUP M=SETUPIO ACBP=48 - 0595:10A2 0006 C=INITDATA S=_INIT_ G=DGROUP M=CRTINIT ACBP=48 - 0595:10A8 0006 C=INITDATA S=_INIT_ G=DGROUP M=SETARGV ACBP=48 - 0595:10AE 0006 C=INITDATA S=_INIT_ G=DGROUP M=SETENVP ACBP=48 - 0595:10B4 0000 C=INITDATA S=_INITEND_ G=DGROUP M=c0.ASM ACBP=28 - 0595:10B4 0000 C=EXITDATA S=_EXIT_ G=DGROUP M=c0.ASM ACBP=48 - 0595:10B4 0000 C=EXITDATA S=_EXITEND_ G=DGROUP M=c0.ASM ACBP=28 - 0595:10B4 0000 C=BSS S=_BSS G=DGROUP M=c0.ASM ACBP=48 - 0595:10B4 0004 C=BSS S=_BSS G=DGROUP M=SRC\LIB\NYAN\KITTEN.C ACBP=48 - 0595:10B8 0002 C=BSS S=_BSS G=DGROUP M=SRC\LIB\16_HC.C ACBP=48 - 0595:10BA 0000 C=BSS S=_BSS G=DGROUP M=SRC\EXMMTEST.C ACBP=48 - 0595:10BA 000A C=BSS S=_BSS G=DGROUP M=SRC\LIB\16_CA.C ACBP=48 - 0595:10C4 0000 C=BSS S=_BSS G=DGROUP M=SRC\LIB\16_HEAD.C ACBP=48 - 0595:10C4 0006 C=BSS S=_BSS G=DGROUP M=SRC\LIB\16_MM.C ACBP=48 - 0595:10CA 0040 C=BSS S=_BSS G=DGROUP M=ATEXIT ACBP=48 - 0595:110A 0001 C=BSS S=_BSS G=DGROUP M=CLOCK ACBP=48 - 0595:110C 0000 C=BSS S=_BSS G=DGROUP M=DOSFATTR ACBP=48 - 0595:110C 0000 C=BSS S=_BSS G=DGROUP M=IOERROR ACBP=48 - 0595:110C 0000 C=BSS S=_BSS G=DGROUP M=ISATTY ACBP=48 - 0595:110C 0000 C=BSS S=_BSS G=DGROUP M=LONGTOA ACBP=48 - 0595:110C 0000 C=BSS S=_BSS G=DGROUP M=LSEEK ACBP=48 - 0595:110C 000D C=BSS S=_BSS G=DGROUP M=MKNAME ACBP=48 - 0595:111A 0000 C=BSS S=_BSS G=DGROUP M=READA ACBP=48 - 0595:111A 0000 C=BSS S=_BSS G=DGROUP M=SETUPIO ACBP=48 - 0595:111A 0000 C=BSS S=_BSS G=DGROUP M=UNLINK ACBP=48 - 0595:111A 0000 C=BSS S=_BSS G=DGROUP M=VPRINTER ACBP=48 - 0595:111A 0000 C=BSS S=_BSS G=DGROUP M=VRAM ACBP=48 - 0595:111A 0000 C=BSS S=_BSS G=DGROUP M=CORELEFT ACBP=48 - 0595:111A 0000 C=BSS S=_BSS G=DGROUP M=CRTINIT ACBP=48 - 0595:111A 0000 C=BSS S=_BSS G=DGROUP M=GETCH ACBP=48 - 0595:111A 0000 C=BSS S=_BSS G=DGROUP M=IOCTL ACBP=48 - 0595:111A 0000 C=BSS S=_BSS G=DGROUP M=KBHIT ACBP=48 - 0595:111A 0000 C=BSS S=_BSS G=DGROUP M=SETBLOCK ACBP=48 - 0595:111A 0000 C=BSS S=_BSS G=DGROUP M=CHMODA ACBP=48 - 0595:111A 0000 C=BSS S=_BSS G=DGROUP M=CLOSEA ACBP=48 - 0595:111A 0000 C=BSS S=_BSS G=DGROUP M=FLENGTH ACBP=48 - 0595:111A 0000 C=BSS S=_BSS G=DGROUP M=GETENV ACBP=48 - 0595:111A 0000 C=BSS S=_BSS G=DGROUP M=MEMCPY ACBP=48 - 0595:111A 0000 C=BSS S=_BSS G=DGROUP M=MOVEDATA ACBP=48 - 0595:111A 0000 C=BSS S=_BSS G=DGROUP M=OPEN ACBP=48 - 0595:111A 0000 C=BSS S=_BSS G=DGROUP M=OPENA ACBP=48 - 0595:111A 0001 C=BSS S=_BSS G=DGROUP M=PUTC ACBP=48 - 0595:111C 0000 C=BSS S=_BSS G=DGROUP M=READ ACBP=48 - 0595:111C 0000 C=BSS S=_BSS G=DGROUP M=STRCAT ACBP=48 - 0595:111C 0000 C=BSS S=_BSS G=DGROUP M=STRCHR ACBP=48 - 0595:111C 0000 C=BSS S=_BSS G=DGROUP M=STRCMP ACBP=48 - 0595:111C 0000 C=BSS S=_BSS G=DGROUP M=STRCPY ACBP=48 - 0595:111C 0000 C=BSS S=_BSS G=DGROUP M=STRLEN ACBP=48 - 0595:111C 0000 C=BSS S=_BSS G=DGROUP M=WRITEA ACBP=48 - 0595:111C 0000 C=BSSEND S=_BSSEND G=DGROUP M=c0.ASM ACBP=28 - 06A7:0000 0080 C=STACK S=_STACK G=(none) M=c0.ASM ACBP=74 - - Address Publics by Name - - 0595:0000 idle DATASEG@ - 0000:028B idle DGROUP@ - 0000:2D48 idle F_LXLSH@ - 0000:2D69 idle F_LXURSH@ - 0000:2D8A idle F_PADD@ - 0000:2DEA idle F_PSBP@ - 0000:2DB9 idle F_PSUB@ - 0000:028F idle KITTENGETS - 0000:2D48 idle LXLSH@ - 0000:2D69 idle LXURSH@ - 0000:2D45 N_LXLSH@ - 0000:2D66 N_LXURSH@ - 0000:2D87 N_PADD@ - 0000:2FE6 N_PCMP@ - 0000:2DE7 N_PSBP@ - 0000:2DB6 idle N_PSUB@ - 0000:2D8A idle PADD@ - 0000:2DEA idle PSBP@ - 0000:2DB9 idle PSUB@ - 0000:0276 _abort - 0595:10C6 idle _aftersort - 0000:2C12 idle _atexit - 0595:10C8 idle _beforesort - 0000:0EFC idle _CAL_OptimizeNodes - 0000:04AF idle _catread - 0000:0D87 _CA_CloseDebug - 0000:0D94 idle _CA_FarRead - 0000:0DD2 idle _CA_FarWrite - 0000:0E77 _CA_LoadFile - 0000:0D66 _CA_OpenDebug - 0000:0E10 idle _CA_ReadFile - 0000:0F8B _CA_Shutdown - 0000:0F6A _CA_Startup - 0000:2C36 _clock - 0000:46C7 _close - 0000:36D6 _coreleft - 0000:380C idle _cprintf - 0000:078D idle _db_fetch - 0000:07DD idle _db_insert - 0595:10C0 _debughandle - 0595:103B _directvideo - 0595:10BE idle _drawcachebox - 0595:108A _environ - 0595:007F _errno - 0000:2D0A _exit - 0000:3F57 _farcoreleft - 0000:3B2C _farfree - 0000:3C40 _farmalloc - 0000:3DA1 idle _farrealloc - 0000:470B _fclose - 0000:47BB _fflush - 0000:4881 _filelength - 0000:0FD7 idle _filesize - 0595:10BA idle _finishcachebox - 0000:48C2 _flushall - 0000:4ACB _fopen - 0000:4B00 _fprintf - 0000:502B idle _fputc - 0000:51B4 idle _fputchar - 0000:3B2C _free - 0000:4B9E _fseek - 0000:4C1A _ftell - 0000:3FA7 _getch - 0000:3FC0 idle _getche - 0000:4CF4 _getenv - 0000:3FFB _gettext - 0000:0738 idle _get_line - 0000:0B1F idle _HC_CloseDebug - 0000:0AFE idle _HC_OpenDebug - 0595:10B8 idle _heaphandle - 0000:40A7 _ioctl - 0000:2E5A _isatty - 0000:4D64 idle _itoa - 0000:40D0 _kbhit - 0000:0546 idle _kittenclose - 0000:02DE idle _kittenopen - 0000:098F idle _LargestFarFreeBlock - 0000:0886 idle _LargestFreeBlock - 0000:2F0D _lseek - 0000:4DAC idle _ltoa - 0000:0B2C _main - 0000:3C36 _malloc - 0000:4DD4 _memcpy - 0000:11DA idle _MML_CheckForEMS - 0000:14A8 idle _MML_CheckForXMS - 0000:17E1 idle _MML_ClearBlock - 0000:121F idle _MML_SetupEMS - 0000:14DF idle _MML_SetupXMS - 0000:1325 idle _MML_ShutdownEMS - 0000:1585 idle _MML_ShutdownXMS - 0000:15B8 idle _MML_UseSpace - 0000:2BF2 idle _MM_BombOnError - 0000:269F _MM_DumpData - 0000:20B7 _MM_FreePtr - 0000:1CC5 _MM_GetPtr - 0000:1366 idle _MM_MapEMS - 0000:13FF idle _MM_MapXEMS - 0000:28E6 _MM_Report - 0000:2C0C idle _MM_segude - 0000:2C01 idle _MM_seguin - 0000:2284 idle _MM_SetLock - 0000:21BD idle _MM_SetPurge - 0000:24F3 _MM_ShowMemory - 0000:1C40 _MM_Shutdown - 0000:2350 idle _MM_SortMem - 0000:1847 _MM_Startup - 0000:284D idle _MM_TotalFree - 0000:27DB idle _MM_UnusedMemory - 0000:4DF8 _movedata - 0000:40E2 _movetext - 0000:0551 idle _mystrtoul - 0000:4E47 _open - 0000:4FF6 _printf - 0000:1036 idle _printmeminfoline - 0000:05DE idle _processEscChars - 0595:10C2 idle _profilehandle - 0000:417F _putch - 0000:4051 _puttext - 0000:5480 _read - 0000:3D9A idle _realloc - 0000:460E _setblock - 0000:5483 _setvbuf - 0000:55D2 _sprintf - 0000:5615 _strcat - 0000:5654 _strchr - 0000:5691 _strcmp - 0000:56C1 _strcpy - 0000:56EA _strdup - 0000:572A _strlen - 0000:30E8 _tolower - 0000:4D8F _ultoa - 0000:3FDD idle _ungetch - 0000:3114 _unlink - 0595:10BC idle _updatecachebox - 0000:1108 _US_CheckParm - 0000:55F4 idle _vsprintf - 0000:0F98 idle _wait - 0000:4688 idle _wherex - 0000:4697 idle _wherey - 0000:58CE _write - 0595:10C4 idle _XMSaddr - 0000:1000 idle __AHINCR - 0000:000C idle __AHSHIFT - 0595:107A __argc - 0595:107C __argv - 0595:0C92 __atexitcnt - 0595:10CA __atexittbl - 0000:3E8D __brk - 0595:008B __brklvl - 0595:006B __C0argc - 0595:006D __C0argv - 0000:38EE idle __c0crtinit - 0595:0071 __C0environ - 0595:1079 __cChar - 0000:2D2B idle __cexit - 0595:1078 __cFlag - 0000:0166 __checknull - 0000:46AA __chmod - 0000:0153 __cleanup - 0000:46ED __close - 0000:091C idle __coreleft - 0000:36DA __CPUTN - 0000:390B idle __crtinit - 0595:0C94 __ctype - 0000:0000 Abs __cvtfak - 0000:2D39 idle __c_exit - 0595:0F5A __doserrno - 0000:2E48 __DOSERROR - 0595:0F5C idle __dosErrorToSV - 0000:2C7F __dos_getfileattr - 0000:2C9F idle __dos_setfileattr - 0595:0075 __envLng - 0595:0077 __envseg - 0595:0079 __envSize - 0000:2D19 __exit - 0595:0D96 __exitbuf - 0595:0D98 __exitfopen - 0595:0D9A idle __exitopen - 0000:0A31 idle __farcoreleft - 0595:0F56 __fmode - 0000:5011 idle __fputc - 0000:51C7 __FPUTN - 0000:4A81 idle __GETFP - 0595:0087 __heapbase - 0595:008F __heaptop - 0595:005B idle __Int0Vector - 0595:005F idle __Int4Vector - 0595:0063 idle __Int5Vector - 0595:0067 idle __Int6Vector - 0000:2E0F __IOERROR - 0595:0094 idle __kitten_catalog - 0000:2E6B __LONGTOA - 0000:2F36 __MKNAME - 0000:028D idle __MMODEL - 0595:0F2C __nfile - 0000:3FC0 idle __Ngetche - 0595:0F58 __notUmask - 0000:3FDD idle __Nungetch - 0000:4FA7 __open - 0595:0F2E __openfd - 0000:49B8 idle __OPENFP - 0595:007D __osmajor - 0595:007E idle __osminor - 0595:007D idle __osversion - 0595:007B __psp - 0000:3007 __read - 0000:4196 __REALCVT - 0595:1094 __RealCvtVector - 0000:01BC __restorezero - 0000:3ECC __sbrk - 0595:1096 idle __ScanTodVector - 0000:42D0 __SCREENIO - 0000:4383 __SCROLL - 0000:0000 Abs __setargv__ - 0000:0000 idle __setenvp__ - 0000:3036 __setupio - 0595:0081 __StartTime - 0595:0FC0 __stklen - 0000:36A6 __stpcpy - 0595:0D9C __streams - 0000:0167 __terminate - 0000:2F8F idle __TMPNAM - 0000:0000 idle __turboCrt - 0000:2EED __UTOA - 0000:430C __VALIDATEXY - 0595:007D idle __version - 0595:102C __video - 0000:3863 __VideoInt - 0000:3144 __VPRINTER - 0000:3607 __VPTR - 0000:362C __VRAM - 0000:467E __wherexy - 0000:5892 __write - 0595:102A __wscroll - 0000:58D1 __xfclose - 0000:590C __xfflush - 0595:0085 idle ___brklvl - 0000:39EC idle ___first - 0000:39EE idle ___last - 0000:53B5 ___read - 0000:39F0 idle ___rover - 0000:5749 ___write - - Address Publics by Value - - 0000:0000 Abs __setargv__ - 0000:0000 idle __turboCrt - 0000:0000 Abs __cvtfak - 0000:0000 idle __setenvp__ - 0000:000C idle __AHSHIFT - 0000:0153 __cleanup - 0000:0166 __checknull - 0000:0167 __terminate - 0000:01BC __restorezero - 0000:0276 _abort - 0000:028B idle DGROUP@ - 0000:028D idle __MMODEL - 0000:028F idle KITTENGETS - 0000:02DE idle _kittenopen - 0000:04AF idle _catread - 0000:0546 idle _kittenclose - 0000:0551 idle _mystrtoul - 0000:05DE idle _processEscChars - 0000:0738 idle _get_line - 0000:078D idle _db_fetch - 0000:07DD idle _db_insert - 0000:0886 idle _LargestFreeBlock - 0000:091C idle __coreleft - 0000:098F idle _LargestFarFreeBlock - 0000:0A31 idle __farcoreleft - 0000:0AFE idle _HC_OpenDebug - 0000:0B1F idle _HC_CloseDebug - 0000:0B2C _main - 0000:0D66 _CA_OpenDebug - 0000:0D87 _CA_CloseDebug - 0000:0D94 idle _CA_FarRead - 0000:0DD2 idle _CA_FarWrite - 0000:0E10 idle _CA_ReadFile - 0000:0E77 _CA_LoadFile - 0000:0EFC idle _CAL_OptimizeNodes - 0000:0F6A _CA_Startup - 0000:0F8B _CA_Shutdown - 0000:0F98 idle _wait - 0000:0FD7 idle _filesize - 0000:1000 idle __AHINCR - 0000:1036 idle _printmeminfoline - 0000:1108 _US_CheckParm - 0000:11DA idle _MML_CheckForEMS - 0000:121F idle _MML_SetupEMS - 0000:1325 idle _MML_ShutdownEMS - 0000:1366 idle _MM_MapEMS - 0000:13FF idle _MM_MapXEMS - 0000:14A8 idle _MML_CheckForXMS - 0000:14DF idle _MML_SetupXMS - 0000:1585 idle _MML_ShutdownXMS - 0000:15B8 idle _MML_UseSpace - 0000:17E1 idle _MML_ClearBlock - 0000:1847 _MM_Startup - 0000:1C40 _MM_Shutdown - 0000:1CC5 _MM_GetPtr - 0000:20B7 _MM_FreePtr - 0000:21BD idle _MM_SetPurge - 0000:2284 idle _MM_SetLock - 0000:2350 idle _MM_SortMem - 0000:24F3 _MM_ShowMemory - 0000:269F _MM_DumpData - 0000:27DB idle _MM_UnusedMemory - 0000:284D idle _MM_TotalFree - 0000:28E6 _MM_Report - 0000:2BF2 idle _MM_BombOnError - 0000:2C01 idle _MM_seguin - 0000:2C0C idle _MM_segude - 0000:2C12 idle _atexit - 0000:2C36 _clock - 0000:2C7F __dos_getfileattr - 0000:2C9F idle __dos_setfileattr - 0000:2D0A _exit - 0000:2D19 __exit - 0000:2D2B idle __cexit - 0000:2D39 idle __c_exit - 0000:2D45 N_LXLSH@ - 0000:2D48 idle LXLSH@ - 0000:2D48 idle F_LXLSH@ - 0000:2D66 N_LXURSH@ - 0000:2D69 idle LXURSH@ - 0000:2D69 idle F_LXURSH@ - 0000:2D87 N_PADD@ - 0000:2D8A idle F_PADD@ - 0000:2D8A idle PADD@ - 0000:2DB6 idle N_PSUB@ - 0000:2DB9 idle F_PSUB@ - 0000:2DB9 idle PSUB@ - 0000:2DE7 N_PSBP@ - 0000:2DEA idle PSBP@ - 0000:2DEA idle F_PSBP@ - 0000:2E0F __IOERROR - 0000:2E48 __DOSERROR - 0000:2E5A _isatty - 0000:2E6B __LONGTOA - 0000:2EED __UTOA - 0000:2F0D _lseek - 0000:2F36 __MKNAME - 0000:2F8F idle __TMPNAM - 0000:2FE6 N_PCMP@ - 0000:3007 __read - 0000:3036 __setupio - 0000:30E8 _tolower - 0000:3114 _unlink - 0000:3144 __VPRINTER - 0000:3607 __VPTR - 0000:362C __VRAM - 0000:36A6 __stpcpy - 0000:36D6 _coreleft - 0000:36DA __CPUTN - 0000:380C idle _cprintf - 0000:3863 __VideoInt - 0000:38EE idle __c0crtinit - 0000:390B idle __crtinit - 0000:39EC idle ___first - 0000:39EE idle ___last - 0000:39F0 idle ___rover - 0000:3B2C _free - 0000:3B2C _farfree - 0000:3C36 _malloc - 0000:3C40 _farmalloc - 0000:3D9A idle _realloc - 0000:3DA1 idle _farrealloc - 0000:3E8D __brk - 0000:3ECC __sbrk - 0000:3F57 _farcoreleft - 0000:3FA7 _getch - 0000:3FC0 idle __Ngetche - 0000:3FC0 idle _getche - 0000:3FDD idle __Nungetch - 0000:3FDD idle _ungetch - 0000:3FFB _gettext - 0000:4051 _puttext - 0000:40A7 _ioctl - 0000:40D0 _kbhit - 0000:40E2 _movetext - 0000:417F _putch - 0000:4196 __REALCVT - 0000:42D0 __SCREENIO - 0000:430C __VALIDATEXY - 0000:4383 __SCROLL - 0000:460E _setblock - 0000:467E __wherexy - 0000:4688 idle _wherex - 0000:4697 idle _wherey - 0000:46AA __chmod - 0000:46C7 _close - 0000:46ED __close - 0000:470B _fclose - 0000:47BB _fflush - 0000:4881 _filelength - 0000:48C2 _flushall - 0000:49B8 idle __OPENFP - 0000:4A81 idle __GETFP - 0000:4ACB _fopen - 0000:4B00 _fprintf - 0000:4B9E _fseek - 0000:4C1A _ftell - 0000:4CF4 _getenv - 0000:4D64 idle _itoa - 0000:4D8F _ultoa - 0000:4DAC idle _ltoa - 0000:4DD4 _memcpy - 0000:4DF8 _movedata - 0000:4E47 _open - 0000:4FA7 __open - 0000:4FF6 _printf - 0000:5011 idle __fputc - 0000:502B idle _fputc - 0000:51B4 idle _fputchar - 0000:51C7 __FPUTN - 0000:53B5 ___read - 0000:5480 _read - 0000:5483 _setvbuf - 0000:55D2 _sprintf - 0000:55F4 idle _vsprintf - 0000:5615 _strcat - 0000:5654 _strchr - 0000:5691 _strcmp - 0000:56C1 _strcpy - 0000:56EA _strdup - 0000:572A _strlen - 0000:5749 ___write - 0000:5892 __write - 0000:58CE _write - 0000:58D1 __xfclose - 0000:590C __xfflush - 0595:0000 idle DATASEG@ - 0595:005B idle __Int0Vector - 0595:005F idle __Int4Vector - 0595:0063 idle __Int5Vector - 0595:0067 idle __Int6Vector - 0595:006B __C0argc - 0595:006D __C0argv - 0595:0071 __C0environ - 0595:0075 __envLng - 0595:0077 __envseg - 0595:0079 __envSize - 0595:007B __psp - 0595:007D idle __osversion - 0595:007D __osmajor - 0595:007D idle __version - 0595:007E idle __osminor - 0595:007F _errno - 0595:0081 __StartTime - 0595:0085 idle ___brklvl - 0595:0087 __heapbase - 0595:008B __brklvl - 0595:008F __heaptop - 0595:0094 idle __kitten_catalog - 0595:0C92 __atexitcnt - 0595:0C94 __ctype - 0595:0D96 __exitbuf - 0595:0D98 __exitfopen - 0595:0D9A idle __exitopen - 0595:0D9C __streams - 0595:0F2C __nfile - 0595:0F2E __openfd - 0595:0F56 __fmode - 0595:0F58 __notUmask - 0595:0F5A __doserrno - 0595:0F5C idle __dosErrorToSV - 0595:0FC0 __stklen - 0595:102A __wscroll - 0595:102C __video - 0595:103B _directvideo - 0595:1078 __cFlag - 0595:1079 __cChar - 0595:107A __argc - 0595:107C __argv - 0595:108A _environ - 0595:1094 __RealCvtVector - 0595:1096 idle __ScanTodVector - 0595:10B8 idle _heaphandle - 0595:10BA idle _finishcachebox - 0595:10BC idle _updatecachebox - 0595:10BE idle _drawcachebox - 0595:10C0 _debughandle - 0595:10C2 idle _profilehandle - 0595:10C4 idle _XMSaddr - 0595:10C6 idle _aftersort - 0595:10C8 idle _beforesort - 0595:10CA __atexittbl - -Program entry point at 0000:0000 - diff --git a/16/exmmtest/HEAP.16 b/16/exmmtest/HEAP.16 deleted file mode 100644 index 81a386d3..00000000 --- a/16/exmmtest/HEAP.16 +++ /dev/null @@ -1,45 +0,0 @@ - - == default == - - USED block at 1d280016 of size 136 - USED block at 1d28009e of size 66 - FREE block at 1d2800e0 of size 7966 - USED block at 1d281ffe of size 20 - FREE block at 1d282012 of size 8170 -OK - end of heap - - == near == - - USED block at 0 of size 0 - USED block at 0 of size 0 - USED block at 0 of size 0 - USED block at 0 of size 0 - USED block at 0 of size 0 - USED block at 0 of size 0 - USED block at 0 of size 0 - USED block at 0 of size 0 - USED block at 0 of size 0 -OK - end of heap - - == far == - - USED block at 0 of size 0 - USED block at 0 of size 0 - USED block at 0 of size 0 - USED block at 0 of size 0 - USED block at 0 of size 0 -OK - end of heap - -Memory Type Total Used Free ----------------- -------- -------- -------- -Default 16358 222 16136 -Near 31318 880 30438 -Far 16358 222 16136 ----------------- -------- -------- -------- -coreleft = 30434 -farcoreleft = 38182 -GetFreeSize = 7768 -GetNearFreeSize = 30438 -GetFarFreeSize = 7768 -memavl = 30434 -stackavail = 17108 diff --git a/16/exmmtest/MMDUMP.16 b/16/exmmtest/MMDUMP.16 deleted file mode 100644 index e69de29b..00000000 diff --git a/16/exmmtest/PROFILE.16 b/16/exmmtest/PROFILE.16 deleted file mode 100644 index e69de29b..00000000 diff --git a/16/exmmtest/TC0000.SWP b/16/exmmtest/TC0000.SWP deleted file mode 100644 index 200380e7..00000000 Binary files a/16/exmmtest/TC0000.SWP and /dev/null differ diff --git a/16/exmmtest/src/exmmtest.c b/16/exmmtest/src/exmmtest.c deleted file mode 100644 index 0c65a477..00000000 --- a/16/exmmtest/src/exmmtest.c +++ /dev/null @@ -1,162 +0,0 @@ -/* Project 16 Source Code~ - * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669 - * - * This file is part of Project 16. - * - * Project 16 is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * Project 16 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see , or - * write to the Free Software Foundation, Inc., 51 Franklin Street, - * Fifth Floor, Boston, MA 02110-1301 USA. - * - */ -/* - exmm test -*/ -//#include -//#include - -#include "src/lib/16_head.h" -#include "src/lib/16_ca.h" -#include "src/lib/16_mm.h" -#include "src/lib/16_hc.h" -//#include "src/lib/modex16.h" -#pragma hdrstop - -#pragma warn -pro -#pragma warn -use - -//file load or read definition -#define FILERL -//#define FILEREAD - -void -main(int argc, char *argv[]) -{ - mminfo_t mm; mminfotype mmi; -#ifdef __WATCOMC__ - __segment sega; - void __based(sega)* bigbuffer; -#endif -#ifdef __BORLANDC__ - memptr bigbuffer; -#endif -#ifdef FILERL - //static byte bakapee[64]; - char *bakapee; - word baka; -#endif - //static page_t screen; - -#ifdef __BORLANDC__ - argc=argc; -#endif - printf("&main()= %Fp\n", *argv[0]); - printf("bigbuffer= %Fp\n", bigbuffer); - printf("&bigbuffer= %Fp\n", &bigbuffer); - printf("bigbuffer= %04x\n", bigbuffer); - printf("&bigbuffer= %04x\n", &bigbuffer); - -#ifdef FILERL - bakapee = malloc(64); -#endif - mm.mmstarted=0; - -#ifdef FILERL -// printf("filename!: "); -// scanf("%[^\n]", &bakapee); - if(argv[1]) bakapee = argv[1]; - else bakapee = "data/koishi~.pcx"; -#endif - -// textInit(); - - // setup camera and screen~ - //bug!!! - //screen = modexDefaultPage(); - //screen.width += (16*2); - //screen.height += (16*2); - - printf("main()=%Fp start MM\n", *argv[0]); - MM_Startup(&mm, &mmi); - //PM_Startup(); - //PM_UnlockMainMem(); - CA_Startup(); - printf(" done!\n"); - printf("&main()= %Fp\n", *argv[0]); - printf("bigbuffer= %Fp\n", bigbuffer); - printf("&bigbuffer= %Fp\n", &bigbuffer); - printf("bigbuffer= %04x\n", bigbuffer); - printf("&bigbuffer= %04x\n", &bigbuffer); -// getch(); -#ifdef FILERL -// bakapeehandle = open(bakapee,O_RDONLY | O_BINARY, S_IREAD); -// printf("size of big buffer~=%u\n", _bmsize(segu, bigbuffer)); -// if(CA_FarRead(bakapeehandle,(void far *)&bigbuffer,sizeof(bigbuffer),&mm)) -#ifdef FILEREAD - printf(" read\n"); - if(CA_ReadFile(bakapee, &bigbuffer, &mm)) -#else - printf(" load\n"); - if(CA_LoadFile(bakapee, &bigbuffer, &mm, &mmi)) -#endif - baka=1; - else - baka=0; -// close(bakapeehandle); - //hmm functions in cache system use the buffered stuff -#ifdef __WATCOMC__ - printf("size of big buffer~=%u\n", _bmsize(sega, bigbuffer)); -#endif -#endif - printf("dark purple = purgable\n"); - printf("medium blue = non purgable\n"); - printf("red = locked\n"); - getch(); - //++++modexEnter(); - //++++modexShowPage(&screen); - MM_ShowMemory(&mm); - //getch(); - MM_DumpData(&mm); - //++++modexLeave(); - MM_Report(&mm, &mmi); - printf(" stop!\n"); -#ifdef FILERL - MM_FreePtr(&bigbuffer, &mm); -#endif - //PM_Shutdown(); - CA_Shutdown(); - MM_Shutdown(&mm); - printf(" done!\n"); -#ifdef FILERL - free(bakapee); - if(baka) printf("\nyay!\n"); - else printf("\npoo!\n"); -#endif - printf("bigbuffer= %Fp\n", bigbuffer); - printf("&bigbuffer= %Fp\n", &bigbuffer); - printf("bigbuffer= %04x\n", bigbuffer); - printf("&bigbuffer= %04x\n", &bigbuffer); - //printf("\n\n"); - //printf("Total free: %lu\n", (dword)(GetFreeSize())); - //printf("Total near free: %lu\n", (dword)(GetNearFreeSize())); - //printf("Total far free: %lu\n", (dword)(GetFarFreeSize())); - //getch(); - printf("\n"); -#ifdef __WATCOMC__ - heapdump(); -#endif - //printf("core left: %lu\n", (dword)_coreleft()); - //printf("far core left: %lu\n", (dword)_farcoreleft()); - //printf("based core left: %lu\n", (dword)_basedcoreleft()); - //printf("huge core left: %lu\n", (dword)_hugecoreleft()); -} diff --git a/16/exmmtest/src/lib/16_ca.c b/16/exmmtest/src/lib/16_ca.c deleted file mode 100644 index d1ab94a7..00000000 --- a/16/exmmtest/src/lib/16_ca.c +++ /dev/null @@ -1,2267 +0,0 @@ -/* Catacomb Apocalypse Source Code - * Copyright (C) 1993-2014 Flat Rock Software - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -// ID_CA.C - -/* -============================================================================= - -Id Software Caching Manager ---------------------------- - -Must be started BEFORE the memory manager, because it needs to get the headers -loaded into the data segment - -============================================================================= -*/ - -#include "src/lib/16_ca.h" -#pragma hdrstop - -#pragma warn -pro -#pragma warn -use - -//#define THREEBYTEGRSTARTS - -/* -============================================================================= - - LOCAL CONSTANTS - -============================================================================= -*/ - -typedef struct -{ - unsigned bit0,bit1; // 0-255 is a character, > is a pointer to a node -} huffnode; - - -/*typedef struct -{ - unsigned RLEWtag; - long headeroffsets[100]; - byte tileinfo[]; -} mapfiletype;*/ - - -/* -============================================================================= - - GLOBAL VARIABLES - -============================================================================= -*/ - -/*byte _seg *tinf; -int mapon; - -unsigned _seg *mapsegs[3]; -maptype _seg *mapheaderseg[NUMMAPS]; -byte _seg *audiosegs[NUMSNDCHUNKS]; -void _seg *grsegs[NUMCHUNKS]; - -byte far grneeded[NUMCHUNKS]; -byte ca_levelbit,ca_levelnum;*/ - -int profilehandle,debughandle; - -void (*drawcachebox) (char *title, unsigned numcache); -void (*updatecachebox) (void); -void (*finishcachebox) (void); - -/* -============================================================================= - - LOCAL VARIABLES - -============================================================================= -*/ - -/*extern long far CGAhead; -extern long far EGAhead; -extern byte CGAdict; -extern byte EGAdict; -extern byte far maphead; -extern byte mapdict; -extern byte far audiohead; -extern byte audiodict; - - -long _seg *grstarts; // array of offsets in egagraph, -1 for sparse -long _seg *audiostarts; // array of offsets in audio / audiot - -#ifdef GRHEADERLINKED -huffnode *grhuffman; -#else -huffnode grhuffman[255]; -#endif - -#ifdef AUDIOHEADERLINKED -huffnode *audiohuffman; -#else -huffnode audiohuffman[255]; -#endif - - -int grhandle; // handle to EGAGRAPH -int maphandle; // handle to MAPTEMP / GAMEMAPS -int audiohandle; // handle to AUDIOT / AUDIO - -long chunkcomplen,chunkexplen; - -SDMode oldsoundmode; - - - -void CAL_DialogDraw (char *title,unsigned numcache); -void CAL_DialogUpdate (void); -void CAL_DialogFinish (void);*/ -//void CAL_CarmackExpand (unsigned far *source, unsigned far *dest,unsigned length); - - -/*++++#ifdef THREEBYTEGRSTARTS -#define FILEPOSSIZE 3 -//#define GRFILEPOS(c) (*(long far *)(((byte far *)grstarts)+(c)*3)&0xffffff) -long GRFILEPOS(int c) -{ - long value; - int offset; - - offset = c*3; - - value = *(long far *)(((byte far *)grstarts)+offset); - - value &= 0x00ffffffl; - - if (value == 0xffffffl) - value = -1; - - return value; -}; -#else -#define FILEPOSSIZE 4 -#define GRFILEPOS(c) (grstarts[c]) -#endif*/ - -/* -============================================================================= - - LOW LEVEL ROUTINES - -============================================================================= -*/ - -/* -============================ -= -= CA_OpenDebug / CA_CloseDebug -= -= Opens a binary file with the handle "debughandle" -= -============================ -*/ -void CA_OpenDebug(void) -{ - unlink("debug.16"); - debughandle = open("debug.16", O_CREAT | O_WRONLY | O_TEXT); -} - -void CA_CloseDebug(void) -{ - close(debughandle); -} - - - -/* -============================ -= -= CAL_GetGrChunkLength -= -= Gets the length of an explicit length chunk (not tiles) -= The file pointer is positioned so the compressed data can be read in next. -= -============================ -*/ -/*++++ -void CAL_GetGrChunkLength (int chunk) -{ - lseek(grhandle,GRFILEPOS(chunk),SEEK_SET); - read(grhandle,&chunkexplen,sizeof(chunkexplen)); - chunkcomplen = GRFILEPOS(chunk+1)-GRFILEPOS(chunk)-4; -}*/ - - -/* -========================== -= -= CA_FarRead -= -= Read from a file to a far pointer -= -========================== -*/ - -boolean CA_FarRead(int handle, byte huge *dest, dword length, mminfo_t *mm) -{ - boolean flag; - /*dword fat=0; - word segm=0; - //if(mm->EMSVer<0x40) - if(length>0xfffflu) - { - printf("File is a fat bakapee\n"); - segm=(length%0xfffflu)-1; - fat=segm*0xfffflu; - length-=fat; -// printf("CA_FarRead doesn't support 64K reads yet!\n"); - } - - if(!fat&&!segm) - {*/ - __asm { - push ds - mov bx,[handle] - mov cx,[WORD PTR length] - mov dx,[WORD PTR dest] - mov ds,[WORD PTR dest+2] - mov ah,0x3f // READ w/handle - int 21h - pop ds - jnc good - mov errno,ax - mov flag,0 - jmp End -#ifdef __BORLANDC__ - } -#endif -good: -#ifdef __BORLANDC__ - __asm { -#endif - cmp ax,[WORD PTR length] - je done -// errno = EINVFMT; // user manager knows this is bad read - mov flag,0 - jmp End -#ifdef __BORLANDC__ - } -#endif -done: -#ifdef __BORLANDC__ - __asm { -#endif - mov flag,1 -#ifdef __BORLANDC__ - } -#endif -End: -#ifdef __WATCOMC__ - } -#endif - return flag; - //}else return 0;//todo: EXPAND!!! -} - - -/* -========================== -= -= CA_SegWrite -= -= Write from a file to a far pointer -= -========================== -*/ - -boolean CA_FarWrite(int handle, byte huge *source, dword length, mminfo_t *mm) -{ - boolean flag; - /*dword fat=0; - word segm=0; - //if(mm->EMSVer<0x40) - if(length>0xfffflu) - { - printf("File is a fat bakapee\n"); - segm=(length%0xfffflu)-1; - fat=segm*0xfffflu; - length-=fat; -// printf("CA_FarRead doesn't support 64K reads yet!\n"); - } - - if(!fat&&!segm) - {*/ - __asm { - push ds - mov bx,[handle] - mov cx,[WORD PTR length] - mov dx,[WORD PTR source] - mov ds,[WORD PTR source+2] - mov ah,0x40 // WRITE w/handle - int 21h - pop ds - jnc good - mov errno,ax - mov flag,0 - jmp End -#ifdef __BORLANDC__ - } -#endif -good: -#ifdef __BORLANDC__ - __asm { -#endif - cmp ax,[WORD PTR length] - je done - //errno = ENOMEM; // user manager knows this is bad write - mov flag,0 - jmp End -#ifdef __BORLANDC__ - } -#endif -done: -#ifdef __BORLANDC__ - __asm { -#endif - mov flag,1 -#ifdef __BORLANDC__ - } -#endif -End: -#ifdef __WATCOMC__ - } -#endif - return flag; - //}else return 0; -} - - -/* -========================== -= -= CA_ReadFile -= -= Reads a file into an allready allocated buffer -= -========================== -*/ - -boolean CA_ReadFile(char *filename, memptr *ptr, mminfo_t *mm) -{ - int handle; - dword size; - //long size; - - if((handle = open(filename,O_RDONLY | O_BINARY, S_IREAD)) == -1) - return false; - - size = filelength(handle); - if(!CA_FarRead(handle,*ptr,size, mm)) - { - close(handle); - return false; - } - close(handle); - return true; -} - - - -/* -========================== -= -= CA_LoadFile -= -= Allocate space for and load a file -= -========================== -*/ - -boolean CA_LoadFile(char *filename, memptr *ptr, mminfo_t *mm, mminfotype *mmi) -{ - int handle; - dword size; - //long size; - - if((handle = open(filename,O_RDONLY | O_BINARY, S_IREAD)) == -1) - return false; - - size = filelength (handle); - MM_GetPtr(ptr,size, mm, mmi); - if(!CA_FarRead(handle,*ptr,size, mm)) - { - close(handle); - return false; - } - close(handle); - return true; -} - -/* -============================================================================ - - COMPRESSION routines, see JHUFF.C for more - -============================================================================ -*/ - - - -/* -=============== -= -= CAL_OptimizeNodes -= -= Goes through a huffman table and changes the 256-511 node numbers to the -= actular address of the node. Must be called before CAL_HuffExpand -= -=============== -*/ - -void CAL_OptimizeNodes(huffnode *table) -{ - huffnode *node; - int i; - - node = table; - - for (i=0;i<255;i++) - { - if (node->bit0 >= 256) - node->bit0 = (unsigned)(table+(node->bit0-256)); - if (node->bit1 >= 256) - node->bit1 = (unsigned)(table+(node->bit1-256)); - node++; - } -} - - - -/* -====================== -= -= CAL_HuffExpand -= -= Length is the length of the EXPANDED data -= -====================== -*/ - -/*++++void CAL_HuffExpand (byte huge *source, byte huge *dest, - long length,huffnode *hufftable) -{ -// unsigned bit,byte,node,code; - unsigned sourceseg,sourceoff,destseg,destoff,endoff; - huffnode *headptr; -// huffnode *nodeon; - - headptr = hufftable+254; // head node is allways node 254 - - source++; // normalize - source--; - dest++; - dest--; - - sourceseg = FP_SEG(source); - sourceoff = FP_OFF(source); - destseg = FP_SEG(dest); - destoff = FP_OFF(dest); - endoff = destoff+length; - -// -// ds:si source -// es:di dest -// ss:bx node pointer -// - - if (length <0xfff0) - { - -//-------------------------- -// expand less than 64k of data -//-------------------------- - - __asm - { - mov bx,[headptr] - - mov si,[sourceoff] - mov di,[destoff] - mov es,[destseg] - mov ds,[sourceseg] - mov ax,[endoff] - - mov ch,[si] // load first byte - inc si - mov cl,1 - -expandshort: - test ch,cl // bit set? - jnz bit1short - mov dx,[ss:bx] // take bit0 path from node - shl cl,1 // advance to next bit position - jc newbyteshort - jnc sourceupshort - -bit1short: -asm mov dx,[ss:bx+2] // take bit1 path -asm shl cl,1 // advance to next bit position -asm jnc sourceupshort - -newbyteshort: -asm mov ch,[si] // load next byte -asm inc si -asm mov cl,1 // back to first bit - -sourceupshort: -asm or dh,dh // if dx<256 its a byte, else move node -asm jz storebyteshort -asm mov bx,dx // next node = (huffnode *)code -asm jmp expandshort - -storebyteshort: -asm mov [es:di],dl -asm inc di // write a decopmpressed byte out -asm mov bx,[headptr] // back to the head node for next bit - -asm cmp di,ax // done? -asm jne expandshort - } - } - else - { - -//-------------------------- -// expand more than 64k of data -//-------------------------- - - length--; - - __asm - { -asm mov bx,[headptr] -asm mov cl,1 - -asm mov si,[sourceoff] -asm mov di,[destoff] -asm mov es,[destseg] -asm mov ds,[sourceseg] - -asm lodsb // load first byte - -expand: -asm test al,cl // bit set? -asm jnz bit1 -asm mov dx,[ss:bx] // take bit0 path from node -asm jmp gotcode -bit1: -asm mov dx,[ss:bx+2] // take bit1 path - -gotcode: -asm shl cl,1 // advance to next bit position -asm jnc sourceup -asm lodsb -asm cmp si,0x10 // normalize ds:si -asm jb sinorm -asm mov cx,ds -asm inc cx -asm mov ds,cx -asm xor si,si -sinorm: -asm mov cl,1 // back to first bit - -sourceup: -asm or dh,dh // if dx<256 its a byte, else move node -asm jz storebyte -asm mov bx,dx // next node = (huffnode *)code -asm jmp expand - -storebyte: -asm mov [es:di],dl -asm inc di // write a decopmpressed byte out -asm mov bx,[headptr] // back to the head node for next bit - -asm cmp di,0x10 // normalize es:di -asm jb dinorm -asm mov dx,es -asm inc dx -asm mov es,dx -asm xor di,di -dinorm: - -asm sub [WORD PTR ss:length],1 -asm jnc expand -asm dec [WORD PTR ss:length+2] -asm jns expand // when length = ffff ffff, done - } - } - - __asm - { - mov ax,ss - mov ds,ax - } - -}*/ - - -/* -====================== -= -= CAL_CarmackExpand -= -= Length is the length of the EXPANDED data -= -====================== -*/ -/*++++ -#define NEARTAG 0xa7 -#define FARTAG 0xa8 - -void CAL_CarmackExpand (unsigned far *source, unsigned far *dest, unsigned length) -{ - unsigned ch,chhigh,count,offset; - unsigned far *copyptr, far *inptr, far *outptr; - - length/=2; - - inptr = source; - outptr = dest; - - while (length) - { - ch = *inptr++; - chhigh = ch>>8; - if (chhigh == NEARTAG) - { - count = ch&0xff; - if (!count) - { // have to insert a word containing the tag byte - ch |= *((unsigned char far *)inptr)++; - *outptr++ = ch; - length--; - } - else - { - offset = *((unsigned char far *)inptr)++; - copyptr = outptr - offset; - length -= count; - while (count--) - *outptr++ = *copyptr++; - } - } - else if (chhigh == FARTAG) - { - count = ch&0xff; - if (!count) - { // have to insert a word containing the tag byte - ch |= *((unsigned char far *)inptr)++; - *outptr++ = ch; - length --; - } - else - { - offset = *inptr++; - copyptr = dest + offset; - length -= count; - while (count--) - *outptr++ = *copyptr++; - } - } - else - { - *outptr++ = ch; - length --; - } - } -} -*/ - - -/* -====================== -= -= CA_RLEWcompress -= -====================== -*/ -/*++++ -long CA_RLEWCompress (unsigned huge *source, long length, unsigned huge *dest, - unsigned rlewtag) -{ - long complength; - unsigned value,count,i; - unsigned huge *start,huge *end; - - start = dest; - - end = source + (length+1)/2; - -// -// compress it -// - do - { - count = 1; - value = *source++; - while (*source == value && source3 || value == rlewtag) - { - // - // send a tag / count / value string - // - *dest++ = rlewtag; - *dest++ = count; - *dest++ = value; - } - else - { - // - // send word without compressing - // - for (i=1;i<=count;i++) - *dest++ = value; - } - - } while (source0 - MM_GetPtr(&(memptr)pictable,NUMPICS*sizeof(pictabletype)); - CAL_GetGrChunkLength(STRUCTPIC); // position file pointer - MM_GetPtr(&compseg,chunkcomplen); - CA_FarRead (grhandle,compseg,chunkcomplen); - CAL_HuffExpand (compseg, (byte huge *)pictable,NUMPICS*sizeof(pictabletype),grhuffman); - MM_FreePtr(&compseg); -#endif - -#if NUMPICM>0 - MM_GetPtr(&(memptr)picmtable,NUMPICM*sizeof(pictabletype)); - CAL_GetGrChunkLength(STRUCTPICM); // position file pointer - MM_GetPtr(&compseg,chunkcomplen); - CA_FarRead (grhandle,compseg,chunkcomplen); - CAL_HuffExpand (compseg, (byte huge *)picmtable,NUMPICS*sizeof(pictabletype),grhuffman); - MM_FreePtr(&compseg); -#endif - -#if NUMSPRITES>0 - MM_GetPtr(&(memptr)spritetable,NUMSPRITES*sizeof(spritetabletype)); - CAL_GetGrChunkLength(STRUCTSPRITE); // position file pointer - MM_GetPtr(&compseg,chunkcomplen); - CA_FarRead (grhandle,compseg,chunkcomplen); - CAL_HuffExpand (compseg, (byte huge *)spritetable,NUMSPRITES*sizeof(spritetabletype),grhuffman); - MM_FreePtr(&compseg); -#endif - -}*/ - -//========================================================================== - - -/* -====================== -= -= CAL_SetupMapFile -= -====================== -*/ - -/*void CAL_SetupMapFile (void) -{ - int handle; - long length; - -// -// load maphead.ext (offsets and tileinfo for map file) -// -#ifndef MAPHEADERLINKED - if ((handle = open("MAPHEAD."EXT, - O_RDONLY | O_BINARY, S_IREAD)) == -1) - Quit ("Can't open MAPHEAD."EXT"!"); - length = filelength(handle); - MM_GetPtr (&(memptr)tinf,length); - CA_FarRead(handle, tinf, length); - close(handle); -#else - - tinf = (byte _seg *)FP_SEG(&maphead); - -#endif - -// -// open the data file -// -#ifdef MAPHEADERLINKED - if ((maphandle = open("GAMEMAPS."EXT, - O_RDONLY | O_BINARY, S_IREAD)) == -1) - Quit ("Can't open GAMEMAPS."EXT"!"); -#else - if ((maphandle = open("MAPTEMP."EXT, - O_RDONLY | O_BINARY, S_IREAD)) == -1) - Quit ("Can't open MAPTEMP."EXT"!"); -#endif -}*/ - -//========================================================================== - - -/* -====================== -= -= CAL_SetupAudioFile -= -====================== -*/ - -/*void CAL_SetupAudioFile (void) -{ - int handle; - long length; - -// -// load maphead.ext (offsets and tileinfo for map file) -// -#ifndef AUDIOHEADERLINKED - if ((handle = open("AUDIOHED."EXT, - O_RDONLY | O_BINARY, S_IREAD)) == -1) - Quit ("Can't open AUDIOHED."EXT"!"); - length = filelength(handle); - MM_GetPtr (&(memptr)audiostarts,length); - CA_FarRead(handle, (byte far *)audiostarts, length); - close(handle); -#else - audiohuffman = (huffnode *)&audiodict; - CAL_OptimizeNodes (audiohuffman); - audiostarts = (long _seg *)FP_SEG(&audiohead); -#endif - -// -// open the data file -// -#ifndef AUDIOHEADERLINKED - if ((audiohandle = open("AUDIOT."EXT, - O_RDONLY | O_BINARY, S_IREAD)) == -1) - Quit ("Can't open AUDIOT."EXT"!"); -#else - if ((audiohandle = open("AUDIO."EXT, - O_RDONLY | O_BINARY, S_IREAD)) == -1) - Quit ("Can't open AUDIO."EXT"!"); -#endif -}*/ - -//========================================================================== - - -/* -====================== -= -= CA_Startup -= -= Open all files and load in headers -= -====================== -*/ - -void CA_Startup(void) -{ -#ifdef PROFILE - unlink("profile.16"); - profilehandle = open("profile.16", O_CREAT | O_WRONLY | O_TEXT); -#endif -/*++++ -// MDM begin - (GAMERS EDGE) -// - if(!FindFile("AUDIO."EXT,NULL,2)) - Quit("CA_Startup(): Can't find audio files."); -// -// MDM end - -#ifndef NOAUDIO - CAL_SetupAudioFile(); -#endif - -// MDM begin - (GAMERS EDGE) -// - if (!FindFile("GAMEMAPS."EXT,NULL,1)) - Quit("CA_Startup(): Can't find level files."); -// -// MDM end - -#ifndef NOMAPS - CAL_SetupMapFile (); -#endif - -// MDM begin - (GAMERS EDGE) -// - if (!FindFile("EGAGRAPH."EXT,NULL,2)) - Quit("CA_Startup(): Can't find graphics files."); -// -// MDM end - -#ifndef NOGRAPHICS - CAL_SetupGrFile (); -#endif - - mapon = -1; - ca_levelbit = 1; - ca_levelnum = 0; - - drawcachebox = CAL_DialogDraw; - updatecachebox = CAL_DialogUpdate; - finishcachebox = CAL_DialogFinish;*/ -} - -//========================================================================== - - -/* -====================== -= -= CA_Shutdown -= -= Closes all files -= -====================== -*/ - -void CA_Shutdown(void) -{ -#ifdef PROFILE - close(profilehandle); -#endif -/*++++ - close(maphandle); - close(grhandle); - close(audiohandle);*/ -} - -//=========================================================================== - -/* -====================== -= -= CA_CacheAudioChunk -= -====================== -*/ -/*++++ -void CA_CacheAudioChunk (int chunk) -{ - long pos,compressed; -#ifdef AUDIOHEADERLINKED - long expanded; - memptr bigbufferseg; - byte far *source; -#endif - - if (audiosegs[chunk]) - { - MM_SetPurge (&(memptr)audiosegs[chunk],0); - return; // allready in memory - } - -// MDM begin - (GAMERS EDGE) -// - if (!FindFile("AUDIO."EXT,NULL,2)) - Quit("CA_CacheAudioChunk(): Can't find audio files."); -// -// MDM end - -// -// load the chunk into a buffer, either the miscbuffer if it fits, or allocate -// a larger buffer -// - pos = audiostarts[chunk]; - compressed = audiostarts[chunk+1]-pos; - - lseek(audiohandle,pos,SEEK_SET); - -#ifndef AUDIOHEADERLINKED - - MM_GetPtr (&(memptr)audiosegs[chunk],compressed); - if (mmerror) - return; - - CA_FarRead(audiohandle,audiosegs[chunk],compressed); - -#else - - if (compressed<=BUFFERSIZE) - { - CA_FarRead(audiohandle,bufferseg,compressed); - source = bufferseg; - } - else - { - MM_GetPtr(&bigbufferseg,compressed); - if (mmerror) - return; - MM_SetLock (&bigbufferseg,true); - CA_FarRead(audiohandle,bigbufferseg,compressed); - source = bigbufferseg; - } - - expanded = *(long far *)source; - source += 4; // skip over length - MM_GetPtr (&(memptr)audiosegs[chunk],expanded); - if (mmerror) - goto done; - CAL_HuffExpand (source,audiosegs[chunk],expanded,audiohuffman); - -done: - if (compressed>BUFFERSIZE) - MM_FreePtr(&bigbufferseg); -#endif -}*/ - -//=========================================================================== - -/* -====================== -= -= CA_LoadAllSounds -= -= Purges all sounds, then loads all new ones (mode switch) -= -====================== -*/ -/*++++ -void CA_LoadAllSounds (void) -{ - unsigned start,i; - - switch (oldsoundmode) - { - case sdm_Off: - goto cachein; - case sdm_PC: - start = STARTPCSOUNDS; - break; - case sdm_AdLib: - start = STARTADLIBSOUNDS; - break; - } - - for (i=0;iwidth*spr->height; - MM_GetPtr (&grsegs[chunk],smallplane*2+MAXSHIFTS*6); - if (mmerror) - return; - dest = (spritetype _seg *)grsegs[chunk]; - dest->sourceoffset[0] = MAXSHIFTS*6; // start data after 3 unsigned tables - dest->planesize[0] = smallplane; - dest->width[0] = spr->width; - -// -// expand the unshifted shape -// - CAL_HuffExpand (compressed, &dest->data[0],smallplane*2,grhuffman); - -#endif - - -#if GRMODE == EGAGR - -// -// calculate sizes -// - spr = &spritetable[chunk-STARTSPRITES]; - smallplane = spr->width*spr->height; - bigplane = (spr->width+1)*spr->height; - - shiftstarts[0] = MAXSHIFTS*6; // start data after 3 unsigned tables - shiftstarts[1] = shiftstarts[0] + smallplane*5; // 5 planes in a sprite - shiftstarts[2] = shiftstarts[1] + bigplane*5; - shiftstarts[3] = shiftstarts[2] + bigplane*5; - shiftstarts[4] = shiftstarts[3] + bigplane*5; // nothing ever put here - - expanded = shiftstarts[spr->shifts]; - MM_GetPtr (&grsegs[chunk],expanded); - if (mmerror) - return; - dest = (spritetype _seg *)grsegs[chunk]; - -// -// expand the unshifted shape -// - CAL_HuffExpand (compressed, &dest->data[0],smallplane*5,grhuffman); - -// -// make the shifts! -// - switch (spr->shifts) - { - case 1: - for (i=0;i<4;i++) - { - dest->sourceoffset[i] = shiftstarts[0]; - dest->planesize[i] = smallplane; - dest->width[i] = spr->width; - } - break; - - case 2: - for (i=0;i<2;i++) - { - dest->sourceoffset[i] = shiftstarts[0]; - dest->planesize[i] = smallplane; - dest->width[i] = spr->width; - } - for (i=2;i<4;i++) - { - dest->sourceoffset[i] = shiftstarts[1]; - dest->planesize[i] = bigplane; - dest->width[i] = spr->width+1; - } - CAL_ShiftSprite ((unsigned)grsegs[chunk],dest->sourceoffset[0], - dest->sourceoffset[2],spr->width,spr->height,4,true); - break; - - case 4: - dest->sourceoffset[0] = shiftstarts[0]; - dest->planesize[0] = smallplane; - dest->width[0] = spr->width; - - dest->sourceoffset[1] = shiftstarts[1]; - dest->planesize[1] = bigplane; - dest->width[1] = spr->width+1; - CAL_ShiftSprite ((unsigned)grsegs[chunk],dest->sourceoffset[0], - dest->sourceoffset[1],spr->width,spr->height,2,true); - - dest->sourceoffset[2] = shiftstarts[2]; - dest->planesize[2] = bigplane; - dest->width[2] = spr->width+1; - CAL_ShiftSprite ((unsigned)grsegs[chunk],dest->sourceoffset[0], - dest->sourceoffset[2],spr->width,spr->height,4,true); - - dest->sourceoffset[3] = shiftstarts[3]; - dest->planesize[3] = bigplane; - dest->width[3] = spr->width+1; - CAL_ShiftSprite ((unsigned)grsegs[chunk],dest->sourceoffset[0], - dest->sourceoffset[3],spr->width,spr->height,6,true); - - break; - - default: - Quit ("CAL_CacheSprite: Bad shifts number!"); - } - -#endif -}*/ - -//=========================================================================== - - -/* -====================== -= -= CAL_ExpandGrChunk -= -= Does whatever is needed with a pointer to a compressed chunk -= -====================== -*/ -/*++++ -void CAL_ExpandGrChunk (int chunk, byte far *source) -{ - long expanded; - - - if (chunk >= STARTTILE8 && chunk < STARTEXTERNS) - { - // - // expanded sizes of tile8/16/32 are implicit - // - -#if GRMODE == EGAGR -#define BLOCK 32 -#define MASKBLOCK 40 -#endif - -#if GRMODE == CGAGR -#define BLOCK 16 -#define MASKBLOCK 32 -#endif - - if (chunk=STARTSPRITES && chunk< STARTTILE8) - CAL_CacheSprite(chunk,source); - else - { - MM_GetPtr (&grsegs[chunk],expanded); - if (mmerror) - return; - CAL_HuffExpand (source,grsegs[chunk],expanded,grhuffman); - } -} -*/ - -/* -====================== -= -= CAL_ReadGrChunk -= -= Gets a chunk off disk, optimizing reads to general buffer -= -====================== -*/ -/*++++ -void CAL_ReadGrChunk (int chunk) -{ - long pos,compressed; - memptr bigbufferseg; - byte far *source; - int next; - -// -// load the chunk into a buffer, either the miscbuffer if it fits, or allocate -// a larger buffer -// - pos = GRFILEPOS(chunk); - if (pos<0) // $FFFFFFFF start is a sparse tile - return; - - next = chunk +1; - while (GRFILEPOS(next) == -1) // skip past any sparse tiles - next++; - - compressed = GRFILEPOS(next)-pos; - - lseek(grhandle,pos,SEEK_SET); - - if (compressed<=BUFFERSIZE) - { - CA_FarRead(grhandle,bufferseg,compressed); - source = bufferseg; - } - else - { - MM_GetPtr(&bigbufferseg,compressed); - if (mmerror) - return; - MM_SetLock (&bigbufferseg,true); - CA_FarRead(grhandle,bigbufferseg,compressed); - source = bigbufferseg; - } - - CAL_ExpandGrChunk (chunk,source); - - if (compressed>BUFFERSIZE) - MM_FreePtr(&bigbufferseg); -} -*/ -/* -====================== -= -= CA_CacheGrChunk -= -= Makes sure a given chunk is in memory, loadiing it if needed -= -====================== -*/ -/*++++ -void CA_CacheGrChunk (int chunk) -{ - long pos,compressed; - memptr bigbufferseg; - byte far *source; - int next; - - grneeded[chunk] |= ca_levelbit; // make sure it doesn't get removed - if (grsegs[chunk]) - { - MM_SetPurge (&grsegs[chunk],0); - return; // allready in memory - } - -// MDM begin - (GAMERS EDGE) -// - if (!FindFile("EGAGRAPH."EXT,NULL,2)) - Quit("CA_CacheGrChunk(): Can't find graphics files."); -// -// MDM end - -// -// load the chunk into a buffer, either the miscbuffer if it fits, or allocate -// a larger buffer -// - pos = GRFILEPOS(chunk); - if (pos<0) // $FFFFFFFF start is a sparse tile - return; - - next = chunk +1; - while (GRFILEPOS(next) == -1) // skip past any sparse tiles - next++; - - compressed = GRFILEPOS(next)-pos; - - lseek(grhandle,pos,SEEK_SET); - - if (compressed<=BUFFERSIZE) - { - CA_FarRead(grhandle,bufferseg,compressed); - source = bufferseg; - } - else - { - MM_GetPtr(&bigbufferseg,compressed); - MM_SetLock (&bigbufferseg,true); - CA_FarRead(grhandle,bigbufferseg,compressed); - source = bigbufferseg; - } - - CAL_ExpandGrChunk (chunk,source); - - if (compressed>BUFFERSIZE) - MM_FreePtr(&bigbufferseg); -} -*/ - - -//========================================================================== - -/* -====================== -= -= CA_CacheMap -= -====================== -*/ -/*++++ -void CA_CacheMap (int mapnum) -{ - long pos,compressed; - int plane; - memptr *dest,bigbufferseg; - unsigned size; - unsigned far *source; -#ifdef MAPHEADERLINKED - memptr buffer2seg; - long expanded; -#endif - - -// MDM begin - (GAMERS EDGE) -// - if (!FindFile("GAMEMAPS."EXT,NULL,1)) - Quit("CA_CacheMap(): Can't find level files."); -// -// MDM end - - -// -// free up memory from last map -// - if (mapon>-1 && mapheaderseg[mapon]) - MM_SetPurge (&(memptr)mapheaderseg[mapon],3); - for (plane=0;planeheaderoffsets[mapnum]; - if (pos<0) // $FFFFFFFF start is a sparse map - Quit ("CA_CacheMap: Tried to load a non existent map!"); - - MM_GetPtr(&(memptr)mapheaderseg[mapnum],sizeof(maptype)); - lseek(maphandle,pos,SEEK_SET); - CA_FarRead (maphandle,(memptr)mapheaderseg[mapnum],sizeof(maptype)); - } - else - MM_SetPurge (&(memptr)mapheaderseg[mapnum],0); - -// -// load the planes in -// If a plane's pointer still exists it will be overwritten (levels are -// allways reloaded, never cached) -// - - size = mapheaderseg[mapnum]->width * mapheaderseg[mapnum]->height * 2; - - for (plane = 0; planeplanestart[plane]; - compressed = mapheaderseg[mapnum]->planelength[plane]; - - if (!compressed) - continue; // the plane is not used in this game - - dest = &(memptr)mapsegs[plane]; - MM_GetPtr(dest,size); - - lseek(maphandle,pos,SEEK_SET); - if (compressed<=BUFFERSIZE) - source = bufferseg; - else - { - MM_GetPtr(&bigbufferseg,compressed); - MM_SetLock (&bigbufferseg,true); - source = bigbufferseg; - } - - CA_FarRead(maphandle,(byte far *)source,compressed); -#ifdef MAPHEADERLINKED - // - // unhuffman, then unRLEW - // The huffman'd chunk has a two byte expanded length first - // The resulting RLEW chunk also does, even though it's not really - // needed - // - expanded = *source; - source++; - MM_GetPtr (&buffer2seg,expanded); - CAL_CarmackExpand (source, (unsigned far *)buffer2seg,expanded); - CA_RLEWexpand (((unsigned far *)buffer2seg)+1,*dest,size, - ((mapfiletype _seg *)tinf)->RLEWtag); - MM_FreePtr (&buffer2seg); - -#else - // - // unRLEW, skipping expanded length - // - CA_RLEWexpand (source+1, *dest,size, - ((mapfiletype _seg *)tinf)->RLEWtag); -#endif - - if (compressed>BUFFERSIZE) - MM_FreePtr(&bigbufferseg); - } -}*/ - -//=========================================================================== - -/* -====================== -= -= CA_UpLevel -= -= Goes up a bit level in the needed lists and clears it out. -= Everything is made purgable -= -====================== -*/ -/*++++ -void CA_UpLevel (void) -{ - if (ca_levelnum==7) - Quit ("CA_UpLevel: Up past level 7!"); - - ca_levelbit<<=1; - ca_levelnum++; -}*/ - -//=========================================================================== - -/* -====================== -= -= CA_DownLevel -= -= Goes down a bit level in the needed lists and recaches -= everything from the lower level -= -====================== -*/ -/*++ -void CA_DownLevel (void) -{ - if (!ca_levelnum) - Quit ("CA_DownLevel: Down past level 0!"); - ca_levelbit>>=1; - ca_levelnum--; - CA_CacheMarks(NULL); -}*/ - -//=========================================================================== - -/* -====================== -= -= CA_ClearMarks -= -= Clears out all the marks at the current level -= -====================== -*/ -/* -void CA_ClearMarks (void) -{ - int i; - - for (i=0;i>16; - if (xh - lastx > BARSTEP) - { - for (x=lastx;x<=xh;x++) -#if GRMODE == EGAGR - VWB_Vlin (thy,thy+13,x,14); -#endif -#if GRMODE == CGAGR - VWB_Vlin (thy,thy+13,x,SECONDCOLOR); -#endif - lastx = xh; - VW_UpdateScreen(); - } -}*/ - -/* -====================== -= -= CAL_DialogFinish -= -====================== -*/ -/* -void CAL_DialogFinish (void) -{ - unsigned x,xh; - - xh = thx + NUMBARS; - for (x=lastx;x<=xh;x++) -#if GRMODE == EGAGR - VWB_Vlin (thy,thy+13,x,14); -#endif -#if GRMODE == CGAGR - VWB_Vlin (thy,thy+13,x,SECONDCOLOR); -#endif - VW_UpdateScreen(); - -}*/ - -//=========================================================================== - -/* -====================== -= -= CA_CacheMarks -= -====================== -*//* -#define MAXEMPTYREAD 1024 - -void CA_CacheMarks (char *title) -{ - boolean dialog; - int i,next,numcache; - long pos,endpos,nextpos,nextendpos,compressed; - long bufferstart,bufferend; // file position of general buffer - byte far *source; - memptr bigbufferseg; - - dialog = (title!=NULL); - - numcache = 0; -// -// go through and make everything not needed purgable -// - for (i=0;i= endpos) - { - // data is allready in buffer - source = (byte _seg *)bufferseg+(pos-bufferstart); - } - else - { - // load buffer with a new block from disk - // try to get as many of the needed blocks in as possible - while ( next < NUMCHUNKS ) - { - while (next < NUMCHUNKS && - !(grneeded[next]&ca_levelbit && !grsegs[next])) - next++; - if (next == NUMCHUNKS) - continue; - - nextpos = GRFILEPOS(next); - while (GRFILEPOS(++next) == -1) // skip past any sparse tiles - ; - nextendpos = GRFILEPOS(next); - if (nextpos - endpos <= MAXEMPTYREAD - && nextendpos-pos <= BUFFERSIZE) - endpos = nextendpos; - else - next = NUMCHUNKS; // read pos to posend - } - - lseek(grhandle,pos,SEEK_SET); - CA_FarRead(grhandle,bufferseg,endpos-pos); - bufferstart = pos; - bufferend = endpos; - source = bufferseg; - } - } - else - { - // big chunk, allocate temporary buffer - MM_GetPtr(&bigbufferseg,compressed); - if (mmerror) - return; - MM_SetLock (&bigbufferseg,true); - lseek(grhandle,pos,SEEK_SET); - CA_FarRead(grhandle,bigbufferseg,compressed); - source = bigbufferseg; - } - - CAL_ExpandGrChunk (i,source); - if (mmerror) - return; - - if (compressed>BUFFERSIZE) - MM_FreePtr(&bigbufferseg); - - } - -// -// finish up any thermometer remnants -// - if (dialog && finishcachebox) - finishcachebox(); -}*/ diff --git a/16/exmmtest/src/lib/16_ca.h b/16/exmmtest/src/lib/16_ca.h deleted file mode 100644 index 77809387..00000000 --- a/16/exmmtest/src/lib/16_ca.h +++ /dev/null @@ -1,116 +0,0 @@ -/* Catacomb Apocalypse Source Code - * Copyright (C) 1993-2014 Flat Rock Software - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -// ID_CA.H -#ifndef __16_CA__ -#define __16_CA__ - -#ifndef __16_MM__ -#include "src/lib/16_head.h" -#include "src/lib/16_mm.h" -#endif - -//=========================================================================== - -//#define NOMAPS -//#define NOGRAPHICS -//#define NOAUDIO - -//#define MAPHEADERLINKED -//#define GRHEADERLINKED -//#define AUDIOHEADERLINKED - -//#define NUMMAPS 39 -//#define MAPPLANES 3 -#define PROFILE - -//=========================================================================== - -/*typedef struct -{ - long planestart[3]; - unsigned planelength[3]; - unsigned width,height; - char name[16]; -} maptype;*/ - -//=========================================================================== - -/*extern byte _seg *tinf; -extern int mapon; - -extern unsigned _seg *mapsegs[3]; -extern maptype _seg *mapheaderseg[NUMMAPS]; -extern byte _seg *audiosegs[NUMSNDCHUNKS]; -extern void _seg *grsegs[NUMCHUNKS]; - -extern byte far grneeded[NUMCHUNKS]; -extern byte ca_levelbit,ca_levelnum; - -extern char *titleptr[8];*/ - -extern int profilehandle,debughandle; - -// -// hooks for custom cache dialogs -// -extern void (*drawcachebox) (char *title, unsigned numcache); -extern void (*updatecachebox) (void); -extern void (*finishcachebox) (void); - -//=========================================================================== - -// just for the score box reshifting - -//void CAL_ShiftSprite (unsigned segment,unsigned source,unsigned dest,unsigned width, unsigned height, unsigned pixshift, boolean domask); - -//=========================================================================== - -void CA_OpenDebug (void); -void CA_CloseDebug (void); -boolean CA_FarRead (int handle, byte huge *dest, dword length, mminfo_t *mm); -boolean CA_FarWrite (int handle, byte huge *source, dword length, mminfo_t *mm); - -boolean CA_ReadFile (char *filename, memptr *ptr, mminfo_t *mm); -boolean CA_LoadFile (char *filename, memptr *ptr, mminfo_t *mm, mminfotype *mmi); - -//long CA_RLEWCompress (unsigned huge *source, long length, unsigned huge *dest,unsigned rlewtag); - -//void CA_RLEWexpand (unsigned huge *source, unsigned huge *dest,long length,unsigned rlewtag); - -void CA_Startup (void); -void CA_Shutdown (void); - -//void CA_CacheAudioChunk (int chunk); -//void CA_LoadAllSounds (void); - -/*void CA_UpLevel (void); -void CA_DownLevel (void); - -void CA_SetAllPurge (void); - -void CA_ClearMarks (void); -void CA_ClearAllMarks (void); - -#define CA_MarkGrChunk(chunk) grneeded[chunk]|=ca_levelbit - -void CA_CacheGrChunk (int chunk); -void CA_CacheMap (int mapnum); - -void CA_CacheMarks (char *title);*/ -#endif diff --git a/16/exmmtest/src/lib/16_hc.c b/16/exmmtest/src/lib/16_hc.c deleted file mode 100644 index 00524447..00000000 --- a/16/exmmtest/src/lib/16_hc.c +++ /dev/null @@ -1,538 +0,0 @@ -/* Project 16 Source Code~ - * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669 - * - * This file is part of Project 16. - * - * Project 16 is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * Project 16 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see , or - * write to the Free Software Foundation, Inc., 51 Franklin Street, - * Fifth Floor, Boston, MA 02110-1301 USA. - * - */ -/* - heap test stuff -*/ - -#include "src/lib/16_hc.h" -#pragma hdrstop - -#pragma warn -pro -#pragma warn -use - -int heaphandle; - -#ifdef __BORLANDC__ -void * LargestFreeBlock(size_t* Size) -#endif -#ifdef __WATCOMC__ -void __near* LargestFreeBlock(size_t* Size) -#endif -{ - size_t s0, s1; -#ifdef __BORLANDC__ - void * p; -#endif -#ifdef __WATCOMC__ - void __near* p; -#endif - - s0 = ~(size_t)0 ^ (~(size_t)0 >> 1); -#ifdef __BORLANDC__ - while (s0 && (p = malloc(s0)) == NULL) -#endif -#ifdef __WATCOMC__ - while (s0 && (p = _nmalloc(s0)) == NULL) -#endif - s0 >>= 1; - - if (p) -#ifdef __BORLANDC__ - free(p); -#endif -#ifdef __WATCOMC__ - _nfree(p); -#endif - - s1 = s0 >> 1; - while (s1) - { -#ifdef __BORLANDC__ - if ((p = malloc(s0 + s1)) != NULL) -#endif -#ifdef __WATCOMC__ - if ((p = _nmalloc(s0 + s1)) != NULL) -#endif - { - s0 += s1; -#ifdef __BORLANDC__ - free(p); -#endif -#ifdef __WATCOMC__ - _nfree(p); -#endif - } - s1 >>= 1; - } -#ifdef __BORLANDC__ - while (s0 && (p = malloc(s0)) == NULL) -#endif -#ifdef __WATCOMC__ - while (s0 && (p = _nmalloc(s0)) == NULL) -#endif - s0 ^= s0 & -s0; - - *Size = s0; - return p; -} - -size_t _coreleft(void) -{ - size_t total = 0; - void __near* pFirst = NULL; - void __near* pLast = NULL; - for(;;) - { - size_t largest; - void __near* p = (void __near *)LargestFreeBlock(&largest); - if (largest < sizeof(void __near*)) - { - if (p != NULL) -#ifdef __BORLANDC__ - free(p); -#endif -#ifdef __WATCOMC__ - _nfree(p); -#endif - break; - } - *(void __near* __near*)p = NULL; - total += largest; - if (pFirst == NULL) - pFirst = p; - - if (pLast != NULL) - *(void __near* __near*)pLast = p; - pLast = p; - } - - while (pFirst != NULL) - { - void __near* p = *(void __near* __near*)pFirst; -#ifdef __BORLANDC__ - free(pFirst); -#endif -#ifdef __WATCOMC__ - _nfree(pFirst); -#endif - pFirst = p; - } - return total; -} - -void far* LargestFarFreeBlock(size_t* Size) -{ - size_t s0, s1; - void far* p; - - s0 = ~(size_t)0 ^ (~(size_t)0 >> 1); - while (s0 && (p = _fmalloc(s0)) == NULL) - s0 >>= 1; - - if (p) - _ffree(p); - - s1 = s0 >> 1; - while (s1) - { - if ((p = _fmalloc(s0 + s1)) != NULL) - { - s0 += s1; - _ffree(p); - } - s1 >>= 1; - } - while (s0 && (p = _fmalloc(s0)) == NULL) - s0 ^= s0 & -s0; - - *Size = s0; - return p; -} - -size_t _farcoreleft(void) -{ - size_t total = 0; - void far* pFirst = NULL; - void far* pLast = NULL; - for(;;) - { - size_t largest; - void far* p = LargestFarFreeBlock(&largest); - if (largest < sizeof(void far*)) - { - if (p != NULL) - _ffree(p); - break; - } - *(void far* far*)p = NULL; - total += largest; - if (pFirst == NULL) - pFirst = p; - - if (pLast != NULL) - *(void far* far*)pLast = p; - pLast = p; - } - - while (pFirst != NULL) - { - void far* p = *(void far* far*)pFirst; - _ffree(pFirst); - pFirst = p; - } - return total; -} - -#ifdef __WATCOMC__ -void huge* LargestHugeFreeBlock(size_t* Size) -{ - size_t s0, s1; - void huge* p; - - s0 = ~(size_t)0 ^ (~(size_t)0 >> 1); - while (s0 && (p = halloc((dword)s0, 1)) == NULL) - s0 >>= 1; - - if (p) - hfree(p); - - s1 = s0 >> 1; - while (s1) - { - if ((p = halloc((dword)(s0 + s1), 1)) != NULL) - { - s0 += s1; - hfree(p); - } - s1 >>= 1; - } - while (s0 && (p = halloc((dword)s0, 1)) == NULL) - s0 ^= s0 & -s0; - - *Size = s0; - return p; -} - -size_t _hugecoreleft(void) -{ - size_t total = 0; - void huge* pFirst = NULL; - void huge* pLast = NULL; - for(;;) - { - size_t largest; - void huge* p = LargestHugeFreeBlock(&largest); - if (largest < sizeof(void huge*)) - { - if (p != NULL) - hfree(p); - break; - } - *(void huge* huge*)p = NULL; - total += largest; - if (pFirst == NULL) - pFirst = p; - - if (pLast != NULL) - *(void huge* huge*)pLast = p; - pLast = p; - } - - while (pFirst != NULL) - { - void huge* p = *(void huge* huge*)pFirst; - hfree(pFirst); - pFirst = p; - } - return total; -} - -/*void __based(__self)* LargestBasedFreeBlock(size_t* Size) -{ - __segment segu; - size_t s0, s1; - void __based(__self)* p; - - s0 = ~(size_t)0 ^ (~(size_t)0 >> 1); - while (s0 && (p = _bmalloc(segu, s0)) == NULL) - s0 >>= 1; - - if (p) - _ffree(p); - - s1 = s0 >> 1; - while (s1) - { - if ((p = _bmalloc(segu, s0 + s1)) != NULL) - { - s0 += s1; - _ffree(p); - } - s1 >>= 1; - } - while (s0 && (p = _bmalloc(segu, s0)) == NULL) - s0 ^= s0 & -s0; - - *Size = s0; - return p; -} - -size_t _basedcoreleft(void) -{ - __segment segu; - size_t total = 0; - void __based(segu)* pFirst = NULL; - void __based(segu)* pLast = NULL; - // allocate based heap - segu = _bheapseg( 1024 ); - if( segu == _NULLSEG ) { - printf( "Unable to allocate based heap\n" ); - return 0; - //exit( 1 ); - } - else - - for(;;) - { - size_t largest; - void __based(segu)* p = LargestBasedFreeBlock(&largest); - if (largest < sizeof(void far*)) - { - if (p != NULL) - _ffree(p); - break; - } - *(void far* far*)p = NULL; - total += largest; - if (pFirst == NULL) - pFirst = p; - - if (pLast != NULL) - *(void far* far*)pLast = p; - pLast = p; - } - - while (pFirst != NULL) - { - void far* p = *(void far* far*)pFirst; - _ffree(pFirst); - pFirst = p; - } - return total; -}*/ - -size_t GetFreeSize(void) -{ - struct _heapinfo h_info; - int heap_status; - size_t h_free=0, h_total=0, h_used=0; - - h_info._pentry = NULL; - for(;;) { - heap_status = _heapwalk( &h_info ); - if( heap_status != _HEAPOK ) break; - if((h_info._useflag == _USEDENTRY ? "USED" : "FREE")=="FREE") h_free += h_info._size; - if((h_info._useflag == _USEDENTRY ? "USED" : "FREE")=="USED") h_used += h_info._size; - h_total += h_info._size; - } - heapstat0(heap_status); - return h_free; -} - -size_t GetFarFreeSize(void) -{ - struct _heapinfo fh_info; - int heap_status; - size_t fh_free=0, fh_total=0, fh_used=0; - - fh_info._pentry = NULL; - for(;;) { - heap_status = _fheapwalk( &fh_info ); - if( heap_status != _HEAPOK ) break; - if((fh_info._useflag == _USEDENTRY ? "USED" : "FREE")=="FREE") fh_free += fh_info._size; - if((fh_info._useflag == _USEDENTRY ? "USED" : "FREE")=="USED") fh_used += fh_info._size; - fh_total += fh_info._size; - } - heapstat0(heap_status); - return fh_free; -} - -size_t GetNearFreeSize(void) -{ - struct _heapinfo nh_info; - int heap_status; - size_t nh_free=0, nh_total=0, nh_used=0; - - nh_info._pentry = NULL; - for(;;) { - heap_status = _nheapwalk( &nh_info ); - if( heap_status != _HEAPOK ) break; - if((nh_info._useflag == _USEDENTRY ? "USED" : "FREE")=="FREE") nh_free += nh_info._size; - if((nh_info._useflag == _USEDENTRY ? "USED" : "FREE")=="USED") nh_used += nh_info._size; - nh_total += nh_info._size; - } - heapstat0(heap_status); - return nh_free; -} - -void heapdump(void) -{ - struct _heapinfo fh_info, nh_info, h_info; - int heap_status; - size_t h_free, nh_free, fh_free, h_total, nh_total, fh_total, h_used, nh_used, fh_used; - byte scratch[1024],str[16]; - - HC_OpenDebug(); - - strcpy(scratch,"\n == default ==\n\n"); - write(heaphandle,scratch,strlen(scratch)); - h_info._pentry = NULL; - h_free=0; h_total=0; h_used=0; - for(;;) { - heap_status = _heapwalk( &h_info ); - if( heap_status != _HEAPOK ) break; - strcpy(scratch," "); strcat(scratch,(h_info._useflag == _USEDENTRY ? "USED" : "FREE")); strcat(scratch," block at "); ultoa((dword)h_info._pentry,str,16); strcat(scratch,str); strcat(scratch," of size "); ultoa(h_info._size,str,10); strcat(scratch,str); strcat(scratch,"\n"); - if((h_info._useflag == _USEDENTRY ? "USED" : "FREE")=="FREE") h_free += h_info._size; - if((h_info._useflag == _USEDENTRY ? "USED" : "FREE")=="USED") h_used += h_info._size; - h_total += h_info._size; - write(heaphandle,scratch,strlen(scratch)); - } - heapstat(heap_status, &scratch); - - //near - strcpy(scratch,"\n == near ==\n\n"); - write(heaphandle,scratch,strlen(scratch)); - nh_info._pentry = NULL; - nh_free=0; nh_total=0; nh_used=0; - for(;;) { - heap_status = _nheapwalk( &nh_info ); - if( heap_status != _HEAPOK ) break; - strcpy(scratch," "); strcat(scratch,(h_info._useflag == _USEDENTRY ? "USED" : "FREE")); strcat(scratch," block at "); ultoa((dword)h_info._pentry,str,16); strcat(scratch,str); strcat(scratch," of size "); ultoa(h_info._size,str,10); strcat(scratch,str); strcat(scratch,"\n"); -/* printf( " %s block at %Fp of size %4.4X\n", -(nh_info._useflag == _USEDENTRY ? "USED" : "FREE"), -nh_info._pentry, nh_info._size );*/ - if((nh_info._useflag == _USEDENTRY ? "USED" : "FREE")=="FREE") nh_free += nh_info._size; - if((nh_info._useflag == _USEDENTRY ? "USED" : "FREE")=="USED") nh_used += nh_info._size; - nh_total += nh_info._size; - write(heaphandle,scratch,strlen(scratch)); - } - heapstat(heap_status, &scratch); - - //far - strcpy(scratch,"\n == far ==\n\n"); - write(heaphandle,scratch,strlen(scratch)); - fh_info._pentry = NULL; - fh_free=0; fh_total=0; fh_used=0; - for(;;) { - heap_status = _fheapwalk( &fh_info ); - if( heap_status != _HEAPOK ) break; - strcpy(scratch," "); strcat(scratch,(h_info._useflag == _USEDENTRY ? "USED" : "FREE")); strcat(scratch," block at "); ultoa((dword)h_info._pentry,str,16); strcat(scratch,str); strcat(scratch," of size "); ultoa(h_info._size,str,10); strcat(scratch,str); strcat(scratch,"\n"); - /*printf( " %s block at %Fp of size %4.4X\n", -(fh_info._useflag == _USEDENTRY ? "USED" : "FREE"), -fh_info._pentry, fh_info._size );*/ - if((fh_info._useflag == _USEDENTRY ? "USED" : "FREE")=="FREE") fh_free += fh_info._size; - if((fh_info._useflag == _USEDENTRY ? "USED" : "FREE")=="USED") fh_used += fh_info._size; - fh_total += fh_info._size; - write(heaphandle,scratch,strlen(scratch)); - } - heapstat(heap_status, &scratch); - - strcpy(scratch,"\n"); - strcat(scratch,kittengets(2,0,"Memory Type Total Used Free\n")); - strcat(scratch,"---------------- -------- -------- --------\n"); - printmeminfoline(&scratch, "Default", h_total, h_used, h_free); - printmeminfoline(&scratch, "Near", nh_total, nh_used, nh_free); - printmeminfoline(&scratch, "Far", fh_total, fh_used, fh_free); - strcat(scratch,"---------------- -------- -------- --------\n"); - strcat(scratch,"coreleft = "); ultoa((dword)_coreleft(),str,10); strcat(scratch,str); strcat(scratch,"\n"); - strcat(scratch,"farcoreleft = "); ultoa((dword)_farcoreleft(),str,10); strcat(scratch,str); strcat(scratch,"\n"); - strcat(scratch,"GetFreeSize = "); ultoa((dword)GetFreeSize(),str,10); strcat(scratch,str); strcat(scratch,"\n"); - strcat(scratch,"GetNearFreeSize = "); ultoa((dword)GetNearFreeSize(),str,10); strcat(scratch,str); strcat(scratch,"\n"); - strcat(scratch,"GetFarFreeSize = "); ultoa((dword)GetFarFreeSize(),str,10); strcat(scratch,str); strcat(scratch,"\n"); - strcat(scratch,"memavl = "); ultoa((dword)_memavl(),str,10); strcat(scratch,str); strcat(scratch,"\n"); - strcat(scratch,"stackavail = "); ultoa((dword)stackavail(),str,10); strcat(scratch,str); strcat(scratch,"\n"); - write(heaphandle,scratch,strlen(scratch)); - HC_CloseDebug(); -} - -void heapstat(int heap_status, byte *str) -{ - switch( heap_status ) { - case _HEAPEND: - strcpy((str),"OK - end of heap\n"); - break; - case _HEAPEMPTY: - strcpy((str),"OK - heap is empty\n"); - - break; - case _HEAPBADBEGIN: - strcpy((str),"ERROR - heap is damaged\n"); - break; - case _HEAPBADPTR: - strcpy((str),"ERROR - bad pointer to heap\n"); - break; - case _HEAPBADNODE: - strcpy((str),"ERROR - bad node in heap\n"); - } - write(heaphandle,(str),strlen((str))); -} - -void heapstat0(int heap_status) -{ - switch( heap_status ) { - case _HEAPEND: - //printf("OK - end of heap\n"); - break; - case _HEAPEMPTY: - //printf("OK - heap is empty\n"); - - break; - case _HEAPBADBEGIN: - printf("ERROR - heap is damaged\n"); - break; - case _HEAPBADPTR: - printf("ERROR - bad pointer to heap\n"); - break; - case _HEAPBADNODE: - printf("ERROR - bad node in heap\n"); - } -} -#endif -/* -============================ -= -= HC_OpenDebug / HC_CloseDebug -= -= Opens a binary file with the handle "heaphandle" -= -============================ -*/ -void HC_OpenDebug() -{ - unlink("heap.16"); - heaphandle = open("heap.16", O_CREAT | O_WRONLY | O_TEXT); -} - -void HC_CloseDebug() -{ - close(heaphandle); -} diff --git a/16/exmmtest/src/lib/16_hc.h b/16/exmmtest/src/lib/16_hc.h deleted file mode 100644 index db0265a8..00000000 --- a/16/exmmtest/src/lib/16_hc.h +++ /dev/null @@ -1,56 +0,0 @@ -/* Project 16 Source Code~ - * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669 - * - * This file is part of Project 16. - * - * Project 16 is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * Project 16 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see , or - * write to the Free Software Foundation, Inc., 51 Franklin Street, - * Fifth Floor, Boston, MA 02110-1301 USA. - * - */ -/* - heap test stuff -*/ - -#ifndef __16HC__ -#define __16HC__ - -#include "src/lib/16_head.h" - -extern int heaphandle; - -#ifdef __BORLANDC__ -void * LargestFreeBlock(size_t* Size); -#endif -#ifdef __WATCOMC__ -void __near* LargestFreeBlock(size_t* Size); -#endif -size_t _coreleft(void); -void far* LargestFarFreeBlock(size_t* Size); -size_t _farcoreleft(void); -void huge* LargestHugeFreeBlock(size_t* Size); -size_t _hugecoreleft(void); -//void __based(__self)* LargestBasedFreeBlock(size_t* Size); -//size_t _basedcoreleft(void); -size_t GetFreeSize(void); -size_t GetFarFreeSize(void); -size_t GetNearFreeSize(void); -void heapdump(void); -void heapstat(int heap_status, byte *str); -void heapstat0(int heap_status); - -void HC_OpenDebug(); -void HC_CloseDebug(); - -#endif /* __16HC__ */ diff --git a/16/exmmtest/src/lib/16_head.c b/16/exmmtest/src/lib/16_head.c deleted file mode 100644 index 7dd53866..00000000 --- a/16/exmmtest/src/lib/16_head.c +++ /dev/null @@ -1,156 +0,0 @@ -/* Project 16 Source Code~ - * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669 - * - * This file is part of Project 16. - * - * Project 16 is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * Project 16 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see , or - * write to the Free Software Foundation, Inc., 51 Franklin Street, - * Fifth Floor, Boston, MA 02110-1301 USA. - * - */ - -#include "src/lib/16_head.h" - -/* Function: Wait ********************************************************** -* -* Parameters: wait - time in microseconds -* -* Description: pauses for a specified number of microseconds. -* -*/ -void wait(clock_t wait){ - clock_t goal; - - if(!wait) return; - - goal = wait + clock(); - while((goal > clock()) && !kbhit()) ; -} /* End of wait */ - -long int -filesize(FILE *fp) -{ - long int save_pos, size_of_file; - - save_pos = ftell(fp); - fseek(fp, 0L, SEEK_END); - size_of_file = ftell(fp); - fseek(fp, save_pos, SEEK_SET); - return(size_of_file); -} - -void printmeminfoline(byte *strc, const byte *pee, size_t h_total, size_t h_used, size_t h_free) -{ - byte str[64]; - strcat(strc,pee); strcat(strc," "); ultoa((dword)h_total,str,10); strcat(strc,str); strcat(strc," "); ultoa((dword)h_used,str,10); strcat(strc,str); strcat(strc," "); ultoa((dword)h_free,str,10); strcat(strc,str); - strcat(strc,"\n"); -} - -/////////////////////////////////////////////////////////////////////////// -// -// US_CheckParm() - checks to see if a string matches one of a set of -// strings. The check is case insensitive. The routine returns the -// index of the string that matched, or -1 if no matches were found -// -/////////////////////////////////////////////////////////////////////////// -int -US_CheckParm(char *parm,char **strings) -{ - char cp,cs, - *p,*s; - int i; - - while (!isalpha(*parm)) // Skip non-alphas - parm++; - - for (i = 0;*strings && **strings;i++) - { - for (s = *strings++,p = parm,cs = cp = 0;cs == cp;) - { - cs = *s++; - if (!cs) - return(i); - cp = *p++; - - if (isupper(cs)) - cs = tolower(cs); - if (isupper(cp)) - cp = tolower(cp); - } - } - return(-1); -} - -/* -========================== -= -= Quit -= -========================== -*/ - -/*void Quit(char *error, ...) -{ - short exit_code=0; - unsigned finscreen; - - va_list ap; - - va_start(ap,error); - -#ifndef CATALOG - if (!error) - { - CA_SetAllPurge (); - CA_CacheGrChunk (PIRACY); - finscreen = (unsigned)grsegs[PIRACY]; - } -#endif - - //ShutdownId (); - - if (error && *error) - { - vprintf(error,ap); - exit_code = 1; - } -#ifndef CATALOG - else - if (!NoWait) - { - movedata (finscreen,0,0xb800,0,4000); - bioskey (0); - } -#endif - - va_end(ap); - -#ifndef CATALOG - if (!error) - { - _argc = 2; - _argv[1] = "LAST.SHL"; - _argv[2] = "ENDSCN.SCN"; - _argv[3] = NULL; - if (execv("LOADSCN.EXE", _argv) == -1) - { - clrscr(); - puts("Couldn't find executable LOADSCN.EXE.\n"); - exit(1); - } - } -#endif - - exit(exit_code); -}*/ diff --git a/16/exmmtest/src/lib/16_head.h b/16/exmmtest/src/lib/16_head.h deleted file mode 100644 index e6e590b4..00000000 --- a/16/exmmtest/src/lib/16_head.h +++ /dev/null @@ -1,196 +0,0 @@ -/* Project 16 Source Code~ - * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669 - * - * This file is part of Project 16. - * - * Project 16 is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * Project 16 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see , or - * write to the Free Software Foundation, Inc., 51 Franklin Street, - * Fifth Floor, Boston, MA 02110-1301 USA. - * - */ - -#if !defined(__LARGE__) && !defined(__COMPACT__) && !defined(__HUGE__) -#error Invalid memory model for compiling project 16 -#endif - -#if !defined(__i86__) && defined(__i386__) -#error i8088 only -#endif - -#ifndef _LIBHEAD_H_ -#define _LIBHEAD_H_ -#include -#include -#include -#include // just for wait -#include // just for wait -#include -#include -#include -#include -#include -#include -#include -#ifdef __WATCOMC__ -#include -#include -#include -#endif -#include "src/lib/nyan/kitten.h" -#include "src/lib/types.h" - -//0000 test type def wwww -/*struct list { - struct list __based(__self) *next; - int value; -};*/ - -/* Control codes for all keys on the keyboard */ -//here temperarly -/* -#define KEY_A (0x1E) -#define KEY_B (0x30) -#define KEY_C (0x2E) -#define KEY_D (0x20) -#define KEY_E (0x12) -#define KEY_F (0x21) -#define KEY_G (0x22) -#define KEY_H (0x23) -#define KEY_I (0x17) -#define KEY_J (0x24) -#define KEY_K (0x25) -#define KEY_L (0x26) -#define KEY_M (0x32) -#define KEY_N (0x31) -#define KEY_O (0x18) -#define KEY_P (0x19) -#define KEY_Q (0x10) -#define KEY_R (0x13) -#define KEY_S (0x1F) -#define KEY_T (0x14) -#define KEY_U (0x16) -#define KEY_V (0x2F) -#define KEY_W (0x11) -#define KEY_X (0x2D) -#define KEY_Y (0x15) -#define KEY_Z (0x2C) -#define KEY_1 (0x02) -#define KEY_2 (0x03) -#define KEY_3 (0x04) -#define KEY_4 (0x05) -#define KEY_5 (0x06) -#define KEY_6 (0x07) -#define KEY_7 (0x08) -#define KEY_8 (0x09) -#define KEY_9 (0x0A) -#define KEY_0 (0x0B) -#define KEY_DASH (0x0C) // -_ -#define KEY_EQUAL (0x0D) // =+ -#define KEY_LBRACKET (0x1A) // [{ -#define KEY_RBRACKET (0x1B) // ]} -#define KEY_SEMICOLON (0x27) // ;: -#define KEY_RQUOTE (0x28) // '" -#define KEY_LQUOTE (0x29) // `~ -#define KEY_PERIOD (0x33) // .> -#define KEY_COMMA (0x34) // ,< -#define KEY_SLASH (0x35) // /? -#define KEY_BACKSLASH (0x2B) // \| -#define KEY_F1 (0x3B) -#define KEY_F2 (0x3C) -#define KEY_F3 (0x3D) -#define KEY_F4 (0x3E) -#define KEY_F5 (0x3F) -#define KEY_F6 (0x40) -#define KEY_F7 (0x41) -#define KEY_F8 (0x42) -#define KEY_F9 (0x43) -#define KEY_F10 (0x44) -#define KEY_ESC (0x01) -#define KEY_BACKSPACE (0x0E) -#define KEY_TAB (0x0F) -#define KEY_ENTER (0x1C) -#define KEY_CONTROL (0x1D) -#define KEY_LSHIFT (0x2A) -#define KEY_RSHIFT (0x36) -#define KEY_PRTSC (0x37) -#define KEY_ALT (0x38) -#define KEY_SPACE (0x39) -#define KEY_CAPSLOCK (0x3A) -#define KEY_NUMLOCK (0x45) -#define KEY_SCROLLLOCK (0x46) -#define KEY_HOME (0x47) -#define KEY_UP (0x48) -#define KEY_PGUP (0x49) -#define KEY_MINUS (0x4A) -#define KEY_LEFT (0x4B) -#define KEY_CENTER (0x4C) -#define KEY_RIGHT (0x4D) -#define KEY_PLUS (0x4E) -#define KEY_END (0x4F) -#define KEY_DOWN (0x50) -#define KEY_PGDOWN (0x51) -#define KEY_INS (0x52) -#define KEY_DEL (0x53) - -#define KEY_LWIN (0x73) -#define KEY_RWIN (0x74) -#define KEY_MENU (0x75) -*/ - -static dword far* clockdw= (dword far*) 0x046C; /* 18.2hz clock */ -extern int profilehandle,debughandle; //make it into game global - -#define __DEBUG__ - -#define nil ((void *)0) - -#ifdef __WATCOMC__ -#define peekb(segm,ofs) (*(byte far*)MK_FP((segm),(ofs))) -#define peekw(segm,ofs) (*(word far*)MK_FP((segm),(ofs))) -#define pokeb(segm,ofs,value) (peekb((segm),(ofs)) = (byte)(value)) -#define pokew(segm,ofs,value) (peekw((segm),(ofs)) = (word)(value)) - -typedef union REGPACK regs_t; -#endif - -typedef enum {false,true} boolean; - -#ifdef __WATCOMC__ -typedef void __based(__self) * memptr; -#endif -#ifdef __BORLANDC__ -typedef void _seg * memptr; -#endif -typedef struct -{ - int old_mode; //old video mode before game! - word frames_per_second; - clock_t t; - dword tiku; - word far* clock; - //handles for log files of the game gose here if wwww - //int heaphandle; -} global_game_variables_t; - -/* local function */ -void wait(clock_t wait); - -long int filesize(FILE *fp); -void printmeminfoline(byte *strc, const byte *pee, size_t h_total, size_t h_used, size_t h_free); -int US_CheckParm(char *parm,char **strings); - -extern void CA_OpenDebug (void); -extern void CA_CloseDebug (void); - -#endif/*_LIBHEAD_H_*/ diff --git a/16/exmmtest/src/lib/16_mm.c b/16/exmmtest/src/lib/16_mm.c deleted file mode 100644 index d3ed8c23..00000000 --- a/16/exmmtest/src/lib/16_mm.c +++ /dev/null @@ -1,1728 +0,0 @@ -/* Catacomb Apocalypse Source Code - * Copyright (C) 1993-2014 Flat Rock Software - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -// NEWMM.C - -/* -============================================================================= - - ID software memory manager - -------------------------- - -Primary coder: John Carmack - -RELIES ON ---------- -Quit (char *error) function - - -WORK TO DO ----------- -MM_SizePtr to change the size of a given pointer - -Multiple purge levels utilized - -EMS / XMS unmanaged routines - -============================================================================= -*/ -/* - -Open Watcom port by sparky4 - -*/ -#include "src/lib/16_mm.h" -#pragma hdrstop - -#pragma warn -pro -#pragma warn -use - -/* -============================================================================= - - GLOBAL VARIABLES - -============================================================================= -*/ - -void (* beforesort) (void); -void (* aftersort) (void); -void (* XMSaddr) (void); // far pointer to XMS driver - -/* -============================================================================= - - LOCAL VARIABLES - -============================================================================= -*/ - -static char *ParmStringsexmm[] = {"noems","noxms",""}; - -/* -====================== -= -= MML_CheckForEMS -= -= Routine from p36 of Extending DOS -= -======================= -*/ - -boolean MML_CheckForEMS(void) -{ - boolean emmcfems; - static char emmname[] = "EMMXXXX0"; //fix by andrius4669 -// mov dx,OFFSET emmname - __asm { - //LEA DX, emmname //fix by andrius4669 - mov dx,OFFSET emmname //fix by andrius4669 - mov ax,0x3d00 - int 0x21 // try to open EMMXXXX0 device - jc error - - mov bx,ax - mov ax,0x4400 - - int 0x21 // get device info - jc error - - and dx,0x80 - jz error - - mov ax,0x4407 - - int 0x21 // get status - jc error - or al,al - jz error - - mov ah,0x3e - int 0x21 // close handle - jc error - // - // EMS is good - // - mov emmcfems,1 - jmp End -#ifdef __BORLANDC__ - } -#endif - error: -#ifdef __BORLANDC__ - __asm { -#endif - // - // EMS is bad - // - mov emmcfems,0 -#ifdef __BORLANDC__ - } -#endif - End: -#ifdef __WATCOMC__ - } -#endif - return(emmcfems); -} - - -/* -====================== -= -= MML_SetupEMS -= -======================= -*/ - -byte MML_SetupEMS(mminfo_t *mm) -{ - byte str[160]; - byte err; - boolean errorflag=false; - - unsigned int EMSVer = 0; - //byte EMS_status; - unsigned totalEMSpages,freeEMSpages,EMSpageframe,EMSpagesmapped,EMShandle; - totalEMSpages = freeEMSpages = EMSpageframe = EMSpagesmapped = 0; - - __asm { - mov ah,EMS_STATUS - int EMS_INT // make sure EMS hardware is present - or ah,ah - //mov [EMS_status],ah - jnz error - - mov ah,EMS_VERSION - int EMS_INT - or ah,ah - jnz error - mov [EMSVer],ax // set EMSVer - cmp al,0x32 // only work on ems 3.2 or greater - jb error - - mov ah,EMS_GETFRAME - int EMS_INT // find the page frame address - or ah,ah - jnz error - mov [EMSpageframe],bx - - mov ah,EMS_GETPAGES - int EMS_INT // find out how much EMS is there - or ah,ah - jnz error - mov [totalEMSpages],dx - mov [freeEMSpages],bx - or bx,bx - jz noEMS // no EMS at all to allocate - //EXPAND DONG!!!! - cmp [EMSVer],0x40 - jb low - cmp bx,[freeEMSpages] - jle getpages - mov bx,[freeEMSpages] - jmp getpages -#ifdef __BORLANDC__ - } -#endif - low: -#ifdef __BORLANDC__ - __asm { -#endif - cmp bx,4 - jle getpages // there is only 1,2,3,or 4 pages - mov bx,4 // we can't use more than 4 pages -#ifdef __BORLANDC__ - } -#endif - getpages: -#ifdef __BORLANDC__ - __asm { -#endif - mov [EMSpagesmapped],bx - mov ah,EMS_ALLOCPAGES // allocate up to 64k of EMS - int EMS_INT - or ah,ah - jnz error - mov [EMShandle],dx - jmp End -#ifdef __BORLANDC__ - } -#endif - error: -#ifdef __BORLANDC__ - __asm { -#endif - mov err,ah - mov errorflag,1 - jmp End -#ifdef __BORLANDC__ - } -#endif -noEMS: -End: -#ifdef __WATCOMC__ - } -#endif - if(errorflag==true) - { - //err = CPURegs.h.ah; - strcpy(str,"MM_SetupEMS: EMS error "); - //itoa(err,str2,16); - MM_EMSerr(str, err); - printf("%s\n",str); - return err; - } - mm->totalEMSpages=totalEMSpages; - mm->freeEMSpages=freeEMSpages; - mm->EMSpageframe=EMSpageframe; - mm->EMSpagesmapped=EMSpagesmapped; - mm->EMShandle=EMShandle; - mm->EMSVer=EMSVer; - return 0; -} - - -/* -====================== -= -= MML_ShutdownEMS -= -======================= -*/ - -void MML_ShutdownEMS(mminfo_t *mm) -{ - boolean errorflag=false; - unsigned EMShandle=mm->EMShandle; - - if(!EMShandle) - return; - __asm { - mov ah,EMS_FREEPAGES - mov dx,[EMShandle] - int EMS_INT - or ah,ah - jz ok - mov errorflag,1 -#ifdef __BORLANDC__ - } -#endif - ok: -#ifdef __WATCOMC__ - } -#endif - if(errorflag==true) printf("MML_ShutdownEMS: Error freeing EMS!\n"); //++++ add something -} - -/* -==================== -= -= MM_MapEMS -= -= Maps the 64k of EMS used by memory manager into the page frame -= for general use. This only needs to be called if you are keeping -= other things in EMS. -= -==================== -*/ - -byte MM_MapEMS(mminfo_t *mm, mminfotype *mmi) -{ - byte str[160]; - unsigned EMShandle; - byte err; - boolean errorflag=false; - int i; - EMShandle=mm->EMShandle; - - for (i=0;i<4/*MAPPAGES*/;i++) - { - __asm { - mov ah,EMS_MAPPAGE - mov bx,[i] // logical page - mov al,bl // physical page - mov dx,[EMShandle] // handle - int EMS_INT - or ah,ah - jnz error - jmp End -#ifdef __BORLANDC__ - } -#endif - error: -#ifdef __BORLANDC__ - __asm { -#endif - mov err,ah - mov errorflag,1 -#ifdef __BORLANDC__ - } -#endif - End: -#ifdef __WATCOMC__ - } -#endif - if(errorflag==true) - { - //err = CPURegs.h.ah; - strcpy(str,"MM_MapEMS: EMS error "); - //itoa(err,str2,16); - MM_EMSerr(str, err); - printf("%s\n",str); - //printf("FACK! %x\n", err); - return err; - } - } - mmi->EMSmem = (i)*0x4000lu; - return 0; -} - -byte MM_MapXEMS(mminfo_t *mm, mminfotype *mmi) -{ -//SUB EMS.MapXPages (PhysicalStart, LogicalStart, NumPages, Handle) - - //Maps up to 4 logical EMS pages to physical pages in the page frame, where: - //PhysicalStart = Physical page first logical page is mapped to - //LogicalStart = First logical page to map - //NumPages = Number of pages to map (1 to 4) - //Handle = EMS handle logical pages are allocated to - - /*//Create a buffer containing the page information -// FOR x = 0 TO NumPages - 1 -// MapInfo$ = MapInfo$ + MKI$(LogicalStart + x) + MKI$(PhysicalStart + x) -// NEXT*/ - -// Regs.ax = 0x5000 //Map the pages in the buffer -// Regs.cx = NumPages //to the pageframe -// Regs.dx = Handle -// Regs.ds = VARSEG(MapInfo$) -// Regs.si = SADD(MapInfo$) -// InterruptX 0x67, Regs, Regs -// EMS.Error = (Regs.ax AND 0xFF00&) \ 0x100 //Store the status code - -//END SUB - byte str[160]; - byte err; - word EMShandle; - boolean errorflag=false; - int i; - EMShandle=mm->EMShandle; - - if(mm->EMSVer<0x40) - return 5; - - for (i=0;iEMSmem = (i)*0x4000lu; - return 0; -} - -//========================================================================== - -/* -====================== -= -= MML_CheckForXMS -= -= Check for XMM driver -= -======================= -*/ - -boolean MML_CheckForXMS(mminfo_t *mm) -{ - boolean errorflag=false; - mm->numUMBs = 0; - - __asm { - mov ax,0x4300 - int 0x2f // query status of installed diver - cmp al,0x80 - je good - mov errorflag,1 -#ifdef __BORLANDC__ - } -#endif - good: -#ifdef __WATCOMC__ - } -#endif - if(errorflag==true) return false; - else return true; -} - - -/* -====================== -= -= MML_SetupXMS -= -= Try to allocate all upper memory block -= -======================= -*/ - -void MML_SetupXMS(mminfo_t *mm, mminfotype *mmi) -{ - unsigned base,size; - -getmemory: - __asm { - mov ax,0x4310 - int 0x2f - mov [WORD PTR XMSaddr],bx - mov [WORD PTR XMSaddr+2],es // function pointer to XMS driver - - mov ah,XMS_ALLOCUMB - mov dx,0xffff // try for largest block possible - //mov ax,dx // Set available Kbytes. - call [DWORD PTR XMSaddr] - or ax,ax - jnz gotone - - cmp bl,0xb0 // error: smaller UMB is available - jne done; - - mov ah,XMS_ALLOCUMB - call [DWORD PTR XMSaddr] // DX holds largest available UMB - or ax,ax - jz done // another error... -#ifdef __BORLANDC__ - } -#endif - gotone: -#ifdef __BORLANDC__ - __asm { -#endif - mov [base],bx - mov [size],dx -#ifdef __BORLANDC__ - } -#endif - done: -#ifdef __WATCOMC__ - } -#endif - printf("base=%u ", base); printf("size=%u\n", size); - MML_UseSpace(base,size, mm); - mmi->XMSmem += size*16; - mm->UMBbase[mm->numUMBs] = base; - mm->numUMBs++; - if(mm->numUMBs < MAXUMBS) - goto getmemory; -} - - -/* -====================== -= -= MML_ShutdownXMS -= -====================== -*/ - -void MML_ShutdownXMS(mminfo_t *mm) -{ - int i; - unsigned base; - - for (i=0;inumUMBs;i++) - { - base = mm->UMBbase[i]; - __asm { - mov ah,XMS_FREEUMB - mov dx,[base] - call [DWORD PTR XMSaddr] - } - } -} - -//========================================================================== - -/* -====================== -= -= MML_UseSpace -= -= Marks a range of paragraphs as usable by the memory manager -= This is used to mark space for the near heap, far heap, ems page frame, -= and upper memory blocks -= -====================== -*/ - -void MML_UseSpace(/*d*/word segstart, dword seglength, mminfo_t *mm) -{ - mmblocktype huge *scan,huge *last; - word segm; - dword oldend; - dword extra; - - scan = last = mm->mmhead; - mm->mmrover = mm->mmhead; // reset rover to start of memory - -// -// search for the block that contains the range of segments -// - while(scan->start+scan->length < segstart) - { - last = scan; - scan = scan->next; - } - - //find out how many blocks it spans! - if(seglength>0xffffu) - { -// segm=seglength/0x4000u; - segm=(word)seglength/0xffffu; - } - else segm=1; - - //++++emsver stuff! - if(segm>1/*extra>0xfffflu*/) - { - /*__asm - { - push ds - mov ax,ds - inc ax - mov ds,ax - }*/ - - -//MML_UseSpace(?segstart?, ?length?, mm); - - /*__asm - { - pop ds - }*/ - //printf("MML_UseSpace: Segment spans two blocks!\n"); - } - -// -// take the given range out of the block -// - oldend = scan->start + scan->length; - extra = oldend - (segstart+seglength); -/* -printf("segm=%u ", segm); -printf("ex=%lu ", extra); -printf("start+seglen=%lu ", segstart+seglength); -printf("len=%u ", scan->length); -printf("segsta=%x ", segstart); -printf("seglen=%lu\n", seglength); -*/ -//segu: -//++++todo: linked list of segment! -//printf("segm=%lu\n", segm); - if(segstart == scan->start) - { - last->next = scan->next; // unlink block - FREEBLOCK(scan); - scan = last; - } - else - scan->length = segstart-scan->start; // shorten block - -// segm--; - - if(extra > 0) - { - //MM_GetNewBlock(mm); - GETNEWBLOCK; - mm->mmnew->next = scan->next; - scan->next = mm->mmnew; - mm->mmnew->start = segstart+seglength; - mm->mmnew->length = extra; - mm->mmnew->attributes = LOCKBIT; - }//else if(segm>0) goto segu; - -} - -//========================================================================== - -/* -==================== -= -= MML_ClearBlock -= -= We are out of blocks, so free a purgable block -= -==================== -*/ - -void MML_ClearBlock(mminfo_t *mm) -{ - mmblocktype huge *scan,huge *last; - - scan = mm->mmhead->next; - - while(scan) - { - if(!(scan->attributes&LOCKBIT) && (scan->attributes&PURGEBITS)) - { - MM_FreePtr(scan->useptr, mm); - return; - } - scan = scan->next; - } - - printf("MM_ClearBlock: No purgable blocks!\n"); -} - - -//========================================================================== - -/* -=================== -= -= MM_Startup -= -= Grabs all space from turbo with malloc/farmalloc -= Allocates bufferseg misc buffer -= -=================== -*/ - -void MM_Startup(mminfo_t *mm, mminfotype *mmi) -{ - int i; - dword length,seglength; - //dword length; word seglength; - void huge *start; - word segstart;//,endfree; - -// if(mm->mmstarted) -// MM_Shutdown(mm); - - mm->mmstarted = true; - mm->bombonerror = true; - mm->endid=0; - -// -// set up the linked list (everything in the free list; -// - //printf(" linked list making!\n"); - mm->mmhead = NULL; - mm->mmfree = &(mm->mmblocks[0]); - for(i=0;immblocks[i].next = &(mm->mmblocks[i+1]); - } - mm->mmblocks[i].next = NULL; - -// -// locked block of all memory until we punch out free space -// - //printf(" newblock making!\n"); - //MM_GetNewBlock(mm); - GETNEWBLOCK; - mm->mmhead = mm->mmnew; // this will allways be the first node - mm->mmnew->start = 0; - mm->mmnew->length = 0xffff; - mm->mmnew->attributes = LOCKBIT; - mm->mmnew->next = NULL; - mm->mmrover = mm->mmhead; - -// -// get all available near conventional memory segments -// -// printf(" nearheap making!\n"); -#ifdef __WATCOMC__ - _nheapgrow(); - length=(dword)_memavl();//(dword)GetFreeSize(); - start = (void huge *)(mm->nearheap = _nmalloc(length)); -#endif -#ifdef __BORLANDC__ - length=coreleft(); - start = (void huge *)(mm->nearheap = malloc(length)); -#endif - length -= 16-(FP_OFF(start)&15); - length -= SAVENEARHEAP; - seglength = length / 16; // now in paragraphs - segstart = FP_SEG(start)+(FP_OFF(start)+15)/16; - MML_UseSpace(segstart,seglength, mm); - mmi->nearheap = length; - printf("start=%Fp segstart=%x seglen=%lu len=%lu\n", start, segstart, seglength, length); - //heapdump(); - -// -// get all available far conventional memory segments -// -// printf(" farheap making!\n"); -#ifdef __WATCOMC__ - _fheapgrow(); - length=(dword)GetFarFreeSize();//0xffffUL*4UL; -#endif -#ifdef __BORLANDC__ - length=farcoreleft(); -#endif - start = mm->farheap = _fmalloc(length); - //start = mm->farheap = halloc(length, 1); - length -= 16-(FP_OFF(start)&15); - length -= SAVEFARHEAP; - seglength = length / 16; // now in paragraphs - segstart = FP_SEG(start)+(FP_OFF(start)+15)/16; - MML_UseSpace(segstart,seglength, mm); - mmi->farheap = length; - printf("start=%Fp segstart=%x seglen=%lu len=%lu\n", start, segstart, seglength, length); - //heapdump(); - - mmi->mainmem = mmi->nearheap + mmi->farheap; - -// getch(); - -//goto xmsskip; - -// -// detect EMS and allocate up to 64K at page frame -// -//printf(" EMS1\n"); -//printf("\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"); //bug! - mmi->EMSmem = 0; - for(i = 1;i < -#ifdef __WATCOMC__ - __argc -#endif -#ifdef __BORLANDC__ - _argc -#endif - ;i++) - { - if(US_CheckParm( -#ifdef __WATCOMC__ - __argv[i] -#endif -#ifdef __BORLANDC__ - _argv[i] -#endif - ,ParmStringsexmm) == 0) - goto emsskip; // param NOEMS - } -//printf("\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"); //bug! - if(MML_CheckForEMS()) - { -//printf(" EMS2\n"); -//printf("\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"); //bug! - MML_SetupEMS(mm); // allocate space -//printf(" EMS3\n"); -//printf("\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"); //bug! - //TODO: EMS4! AND EMS 3.2 MASSIVE DATA HANDLMENT! - MML_UseSpace(mm->EMSpageframe,(MAPPAGES)*0x4000lu, mm); -//printf("\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"); //bug! -//printf(" EMS4\n"); - //if(mm->EMSVer<0x40) - MM_MapEMS(mm, mmi); // map in used pages - //else - //MM_MapXEMS(mm, mmi); // map in used pages - } - -mmi->XMSmem=0; -goto xmsskip; - -// -// detect XMS and get upper memory blocks -// -emsskip: - mmi->XMSmem = 0; - for(i = 1;i < -#ifdef __WATCOMC__ - __argc -#endif -#ifdef __BORLANDC__ - _argc -#endif - ;i++) - { - if(US_CheckParm( -#ifdef __WATCOMC__ - __argv[i] -#endif -#ifdef __BORLANDC__ - _argv[i] -#endif - ,ParmStringsexmm) == 0) - goto xmsskip; // param NOXMS - } -//printf("\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"); //bug! - if(MML_CheckForXMS(mm)) - { -//printf("\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"); //bug! -//printf(" XMS!\n"); - MML_SetupXMS(mm, mmi); // allocate as many UMBs as possible - } - -// -// allocate the misc buffer -// -xmsskip: - mm->mmrover = mm->mmhead; // start looking for space after low block - - MM_GetPtr(&(mm->bufferseg),BUFFERSIZE, mm, mmi); -} - -//========================================================================== - -/* -==================== -= -= MM_Shutdown -= -= Frees all conventional, EMS, and XMS allocated -= -==================== -*/ - -void MM_Shutdown(mminfo_t *mm) -{ - if(!(mm->mmstarted)) - return; - - _ffree(mm->farheap); printf(" far freed\n"); -#ifdef __WATCOMC__ - _nfree(mm->nearheap); printf(" near freed\n"); -#endif -#ifdef __BORLANDC__ - free(mm->nearheap); printf(" near freed\n"); -#endif - if(MML_CheckForEMS()){ MML_ShutdownEMS(mm); printf(" EMS freed\n"); } - if(MML_CheckForXMS(mm)){ MML_ShutdownXMS(mm); printf(" XMS freed\n"); } -} - -//========================================================================== - -/* -==================== -= -= MM_GetPtr -= -= Allocates an unlocked, unpurgable block -= -==================== -*/ - -void MM_GetPtr(memptr *baseptr,dword size, mminfo_t *mm, mminfotype *mmi) -{ - mmblocktype huge *scan,huge *lastscan,huge *endscan,huge *purge,huge *next; - int search; - dword needed; - word startseg; - - needed = (size+15)/16; // convert size from bytes to paragraphs -printf("."); //0000 - //MM_GetNewBlock(mm); - GETNEWBLOCK; // fill in start and next after a spot is found - mm->mmnew->length = needed; - mm->mmnew->useptr = baseptr; - mm->mmnew->attributes = BASEATTRIBUTES; -printf("."); //0000 - for(search = 0; searchendid; search++) - { -printf(" [case]"); //0000 - // - // first search: try to allocate right after the rover, then on up - // second search: search from the head pointer up to the rover - // third search: compress memory, then scan from start - if(search == 1 && mm->mmrover == mm->mmhead) - search++; - - switch(search) - { - case 0: -printf("0 "); //0000 - lastscan = mm->mmrover; - scan = mm->mmrover->next; - endscan = NULL; - break; - case 1: -printf("1 "); //0000 - lastscan = mm->mmhead; - scan = mm->mmhead->next; - endscan = mm->mmrover; - break; - case 2: -printf("2 "); //0000 - MM_SortMem(mm); - lastscan = mm->mmhead; - scan = mm->mmhead->next; - endscan = NULL; - break; - } - - startseg = lastscan->start + (word)lastscan->length; - - while(scan != endscan) - { -//printf(","); //0000 - if(scan->start - startseg >= needed) - { -printf("."); //0000 - // - // got enough space between the end of lastscan and - // the start of scan, so throw out anything in the middle - // and allocate the new block - // - purge = lastscan->next; - lastscan->next = mm->mmnew; - mm->mmnew->start = *(word *)baseptr = startseg; - mm->mmnew->next = scan; - while(purge != scan) - { // free the purgable block -printf(" freeing block~\n"); //0000 - next = purge->next; - FREEBLOCK(purge); - //MM_FreeBlock(purge, mm); - purge = next; // purge another if not at scan - } - mm->mmrover = mm->mmnew; - return; // good allocation! - } - - // - // if this block is purge level zero or locked, skip past it - // - if((scan->attributes & LOCKBIT) - || !(scan->attributes & PURGEBITS) ) - { -printf(" [lock] "); //0000 -printf("len=%lu ", scan->length); - lastscan = scan; - startseg = lastscan->start + (word)lastscan->length; - } - -printf("\n"); - scan=scan->next; // look at next line - } - } - - if (mm->bombonerror) - { -#ifdef __WATCOMC__ - heapdump(); -#endif - printf(OUT_OF_MEM_MSG,(size-mmi->nearheap)); - printf("for stability reasons the program will shut down! wwww\n"); - printf(" endid=%u\n",(mm->endid)); - MM_Shutdown(mm); - exit(-1); - } - else - mm->mmerror = true; -} - -//========================================================================== - -/* -==================== -= -= MM_FreePtr -= -= Allocates an unlocked, unpurgable block -= -==================== -*/ - -void MM_FreePtr(memptr *baseptr, mminfo_t *mm) -{ - mmblocktype huge *scan,huge *last; - - last = mm->mmhead; - scan = last->next; - - if(baseptr == mm->mmrover->useptr) // removed the last allocated block - mm->mmrover = mm->mmhead; - - while(scan->useptr != baseptr && scan) - { - last = scan; - scan = scan->next; - } - - if(!scan) - { - printf("MM_FreePtr: Block not found!\n"); - return; - } - - last->next = scan->next; - - FREEBLOCK(scan); - //MM_FreeBlock(scan, mm); -} -//========================================================================== - -/* -===================== -= -= MM_SetPurge -= -= Sets the purge level for a block (locked blocks cannot be made purgable) -= -===================== -*/ - -void MM_SetPurge(memptr *baseptr, int purge, mminfo_t *mm) -{ - mmblocktype huge *start; - - start = mm->mmrover; - - do - { - if(mm->mmrover->useptr == baseptr) - break; - - mm->mmrover = mm->mmrover->next; - - if(!mm->mmrover) - mm->mmrover = mm->mmhead; - else if(mm->mmrover == start) - { - printf("MM_SetPurge: Block not found!"); - return; - } - - } while(1); - - mm->mmrover->attributes &= ~PURGEBITS; - mm->mmrover->attributes |= purge; -} - -//========================================================================== - -/* -===================== -= -= MM_SetLock -= -= Locks / unlocks the block -= -===================== -*/ - -void MM_SetLock(memptr *baseptr, boolean locked, mminfo_t *mm) -{ - mmblocktype huge *start; - - start = mm->mmrover; - - do - { - if(mm->mmrover->useptr == baseptr) - break; - - mm->mmrover = mm->mmrover->next; - - if(!mm->mmrover) - mm->mmrover = mm->mmhead; - else if(mm->mmrover == start) - { - printf("MM_SetLock: Block not found!"); - return; - } - - } while(1); - - mm->mmrover->attributes &= ~LOCKBIT; - mm->mmrover->attributes |= locked*LOCKBIT; -} - -//========================================================================== - -/* -===================== -= -= MM_SortMem -= -= Throws out all purgable stuff and compresses movable blocks -= -===================== -*/ - -void MM_SortMem(mminfo_t *mm) -{ - mmblocktype huge *scan,huge *last,huge *next; - unsigned start,length,source,dest,oldborder; - int playing; - - // - // lock down a currently playing sound - // -/*++++ playing = SD_SoundPlaying (); - if(playing) - { - switch (SoundMode) - { - case sdm_PC: - playing += STARTPCSOUNDS; - break; - case sdm_AdLib: - playing += STARTADLIBSOUNDS; - break; - } - MM_SetLock(&(memptr)audiosegs[playing],true); - } - - - SD_StopSound();*/ -// oldborder = bordercolor; -// VW_ColorBorder (15); - - if(beforesort) - beforesort(); - - scan = mm->mmhead; - - last = NULL; // shut up compiler warning - - while(scan) - { - if(scan->attributes & LOCKBIT) - { - // - // block is locked, so try to pile later blocks right after it - // - start = scan->start + scan->length; - } - else - { - if(scan->attributes & PURGEBITS) - { - // - // throw out the purgable block - // - next = scan->next; - FREEBLOCK(scan); - //MM_FreeBlock(scan, mm); - last->next = next; - scan = next; - continue; - } - else - { - // - // push the non purgable block on top of the last moved block - // - if(scan->start != start) - { - length = scan->length; - source = scan->start; - dest = start; - while(length > 0xf00) - { - movedata(source,0,dest,0,0xf00*16); - length -= 0xf00; - source += 0xf00; - dest += 0xf00; - } - movedata(source,0,dest,0,length*16); - - scan->start = start; - *(unsigned *)scan->useptr = start; - } - start = scan->start + scan->length; - } - } - - last = scan; - scan = scan->next; // go to next block - } - - mm->mmrover = mm->mmhead; - - if(aftersort) - aftersort(); - -// VW_ColorBorder (oldborder); - -/*++++ if(playing) - MM_SetLock(&(memptr)audiosegs[playing],false);*/ -} - - -//========================================================================== - -//****#if 0 -/* -===================== -= -= MM_ShowMemory -= -===================== -*/ - -void MM_ShowMemory(/*page_t *page, */mminfo_t *mm) -{ - mmblocktype huge *scan; -//++++ word color; - word temp; - long end,owner; -//++++ word chx,chy; - byte scratch[160],str[16]; - -//**** VW_SetDefaultColors(); -//**** VW_SetLineWidth(40); -//++++mh temp = bufferofs; -//++++mh bufferofs = 0; -//**** VW_SetScreen (0,0); - - scan = mm->mmhead; - - end = -1; - -CA_OpenDebug (); - -//++++ chx=0; -//++++ chy=0; - - while(scan) - { -/*++++ if(scan->attributes & PURGEBITS) - color = 5; // dark purple = purgable - else - color = 9; // medium blue = non purgable - if(scan->attributes & LOCKBIT) - color = 12; // red = locked*/ - if(scan->start<=end) - { - //printf("); - write(debughandle,"\nMM_ShowMemory: Memory block order currupted!\n",strlen("\nMM_ShowMemory: Memory block order currupted!\n")); - //modexprint(&page, chx, chy, 1, 0, 24, "\nMM_ShowMemory: Memory block order currupted!\n"); - return; - } - end = scan->start+scan->length-1; -//++++ chy = scan->start/320; -//++++ chx = scan->start%320; - //modexhlin(page, scan->start, (unsigned)end, chy, color); - //for(chx=scan->start;chx+4>=(word)end;chx+=4) - //{ -//++++ modexClearRegion(page, chx, chy, 4, 4, color); - //} - -//++++ VW_Hlin(scan->start,(unsigned)end,0,color); - -//++++ VW_Plot(scan->start,0,15); -//++++ modexClearRegion(page, chx, chy, 4, 4, 15); - if(scan->next->start > end+1) -//++++ VW_Hlin(end+1,scan->next->start,0,0); // black = free - //for(chx=scan->next->start;chx+4>=(word)end+1;chx+=4) - //{ -//++++ chx+=scan->next->start; -//++++ modexClearRegion(page, chx, chy, 4, 4, 2); - //} - //modexhlin(page, end+1,scan->next->start, chy, 0); - -/* - end = scan->length-1; - y = scan->start/320; - x = scan->start%320; - VW_Hlin(x,x+end,y,color); - VW_Plot(x,y,15); - if (scan->next && scan->next->start > end+1) - VW_Hlin(x+end+1,x+(scan->next->start-scan->start),y,0); // black = free -*/ - -//****#if 0 -//printf("\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"); //bug! -strcpy(scratch,"Seg:"); -ultoa (scan->start,str,16); -strcat (scratch,str); -strcat (scratch,"\tSize:"); -ultoa ((dword)scan->length,str,10); -strcat (scratch,str); -strcat (scratch,"\tOwner:0x"); -owner = (unsigned)scan->useptr; -ultoa (owner,str,16); -strcat (scratch,str); -strcat (scratch,"\n"); -write(debughandle,scratch,strlen(scratch)); -//modexprint(page, chx, chy, 1, 0, 24, &scratch); -//++++chy+=4; -//fprintf(stdout, "%s", scratch); -//****#endif - - scan = scan->next; - } - -CA_CloseDebug (); - -//++++mh IN_Ack(); -//**** VW_SetLineWidth(64); -//++++mh bufferofs = temp; -} -//****#endif - -//========================================================================== - -/* -===================== -= -= MM_DumpData -= -===================== -*/ - -void MM_DumpData(mminfo_t *mm) -{ - mmblocktype huge *scan,huge *best; - long lowest,oldlowest; - word owner; - byte lock,purge; - FILE *dumpfile; - - - //++++free(mm->nearheap); - dumpfile = fopen ("mmdump.16","w"); - if (!dumpfile){ - printf("MM_DumpData: Couldn't open MMDUMP.16!\n"); - return; - } - - lowest = -1; - do - { - oldlowest = lowest; - lowest = 0xffff; - - scan = mm->mmhead; - while (scan) - { - owner = (word)scan->useptr; - - if (owner && owner oldlowest) - { - best = scan; - lowest = owner; - } - - scan = scan->next; - } - - if (lowest != 0xffff) - { - if (best->attributes & PURGEBITS) - purge = 'P'; - else - purge = '-'; - if (best->attributes & LOCKBIT) - lock = 'L'; - else - lock = '-'; - fprintf (dumpfile,"0x%p (%c%c) = %u\n" - ,(word)lowest,lock,purge,best->length); - } - - } while (lowest != 0xffff); - - fclose(dumpfile); - printf("MMDUMP.16 created.\n"); -} - -//========================================================================== - - -/* -====================== -= -= MM_UnusedMemory -= -= Returns the total free space without purging -= -====================== -*/ - -dword MM_UnusedMemory(mminfo_t *mm) -{ - dword free; - mmblocktype huge *scan; - - free = 0; - scan = mm->mmhead; - - while(scan->next) - { - free += scan->next->start - (scan->start + scan->length); - scan = scan->next; - } - -// return free*16l; - return free; -} - -//========================================================================== - - -/* -====================== -= -= MM_TotalFree -= -= Returns the total free space with purging -= -====================== -*/ - -dword MM_TotalFree(mminfo_t *mm) -{ - dword free; - mmblocktype huge *scan; - - free = 0; - scan = mm->mmhead; - - while(scan->next) - { - if((scan->attributes&PURGEBITS) && !(scan->attributes&LOCKBIT)) - free += scan->length; - free += scan->next->start - (scan->start + scan->length); - scan = scan->next; - } - -// return free*16l; - return free; -} - -//========================================================================== - -/* -===================== -= -= MM_Report -= -===================== -*/ - -void MM_Report(/*page_t *page, */mminfo_t *mm, mminfotype *mmi) -{ - if(MML_CheckForEMS()) - { - printf("EMM v%x.%x available\n", mm->EMSVer>>4,mm->EMSVer&0x0F); - printf("totalEMSpages=%u\n", mm->totalEMSpages); - printf("freeEMSpages=%u\n", mm->freeEMSpages); - printf("EMSpageframe=%x\n", mm->EMSpageframe); - } - if(MML_CheckForXMS(mm)) printf("XMSaddr=%X\n", *XMSaddr); - printf("near=%lu\n", mmi->nearheap); - printf("far=%lu\n", mmi->farheap); - printf("EMSmem=%lu\n", mmi->EMSmem); - printf("XMSmem=%lu\n", mmi->XMSmem); - printf("mainmem=%lu\n", mmi->mainmem); - printf("UnusedMemory=%lu\n", MM_UnusedMemory(mm)); - printf("TotalFree=%lu\n", MM_TotalFree(mm)); - //mmi->nearheap+mmi->farheap+ - printf("TotalUsed=%lu\n", mmi->mainmem+mmi->EMSmem+mmi->XMSmem);//+); -// printf("\n"); -// printf("UnusedMemory=%lu kb\n", MM_UnusedMemory()/10248); -// printf("TotalFree=%lu kb\n", MM_TotalFree()/10248); -} - -//========================================================================== - -/* -===================== -= -= MM_EMSerr -= -===================== -*/ - -void MM_EMSerr(byte *stri, byte err) -{ - //Returns a text string describing the error code in EMS.Error. - switch(err) - { - case 0x0: - strcat(stri, "successful"); - break; - case 0x80: - strcat(stri, "internal error"); - break; - case 0x81: - strcat(stri, "hardware malfunction"); - break; - case 0x82: - strcat(stri, "busy .. retry later"); - break; - case 0x83: - strcat(stri, "invalid handle"); - break; - case 0x84: - strcat(stri, "undefined function requested by application"); - break; - case 0x85: - strcat(stri, "no more handles available"); - break; - case 0x86: - strcat(stri, "error in save or restore of mapping context"); - break; - case 0x87: - strcat(stri, "insufficient memory pages in system"); - break; - case 0x88: - strcat(stri, "insufficient memory pages available"); - break; - case 0x89: - strcat(stri, "zero pages requested"); - break; - case 0x8A: - strcat(stri, "invalid logical page number encountered"); - break; - case 0x8B: - strcat(stri, "invalid physical page number encountered"); - break; - case 0x8C: - strcat(stri, "page-mapping hardware state save area is full"); - break; - case 0x8D: - strcat(stri, "save of mapping context failed"); - break; - case 0x8E: - strcat(stri, "restore of mapping context failed"); - break; - case 0x8F: - strcat(stri, "undefined subfunction"); - break; - case 0x90: - strcat(stri, "undefined attribute type"); - break; - case 0x91: - strcat(stri, "feature not supported"); - break; - case 0x92: - strcat(stri, "successful, but a portion of the source region has been overwritten"); - break; - case 0x93: - strcat(stri, "length of source or destination region exceeds length of region allocated to either source or destination handle"); - break; - case 0x94: - strcat(stri, "conventional and expanded memory regions overlap"); - break; - case 0x95: - strcat(stri, "offset within logical page exceeds size of logical page"); - break; - case 0x96: - strcat(stri, "region length exceeds 1 MB"); - break; - case 0x97: - strcat(stri, "source and destination EMS regions have same handle and overlap"); - break; - case 0x98: - strcat(stri, "memory source or destination type undefined"); - break; - case 0x9A: - strcat(stri, "specified alternate map register or DMA register set not supported"); - break; - case 0x9B: - strcat(stri, "all alternate map register or DMA register sets currently allocated"); - break; - case 0x9C: - strcat(stri, "alternate map register or DMA register sets not supported"); - break; - case 0x9D: - strcat(stri, "undefined or unallocated alternate map register or DMA register set"); - break; - case 0x9E: - strcat(stri, "dedicated DMA channels not supported"); - break; - case 0x9F: - strcat(stri, "specified dedicated DMA channel not supported"); - break; - case 0xA0: - strcat(stri, "no such handle name"); - break; - case 0xA1: - strcat(stri, "a handle found had no name, or duplicate handle name"); - break; - case 0xA2: - strcat(stri, "attempted to wrap around 1M conventional address space"); - break; - case 0xA3: - strcat(stri, "source array corrupted"); - break; - case 0xA4: - strcat(stri, "operating system denied access"); - break; - default: - strcat(stri, "undefined error"); - } -} - -//========================================================================== - -/* -===================== -= -= MM_BombOnError -= -===================== -*/ - -void MM_BombOnError(boolean bomb, mminfo_t *mm) -{ - mm->bombonerror = bomb; -} - -/*void MM_GetNewBlock(mminfo_t *mm) -{ - if(!mm->mmfree) - MML_ClearBlock(mm); - mm->mmnew=mm->mmfree; - mm->mmfree=mm->mmfree->next; - if(!(mm->mmnew=mm->mmfree)) - { - printf("MM_GETNEWBLOCK: No free blocks!\n"); - return; - } - mm->mmfree=mm->mmfree->next; - mm->endid++; //end of list -} - -void MM_FreeBlock(mmblocktype *x, mminfo_t *mm) -{ - x->useptr=NULL; - x->next=mm->mmfree; - mm->mmfree=x; - mm->endid--; //end of list -}*/ - -void MM_seguin(void) -{ - __asm { - push ds - mov ax,ds - inc ax - mov ds,ax - } -} - -void MM_segude(void) -{ - __asm { - pop ds - } -} - -/* -pull data from far and put it into ds var -mov ax,es:si -mov x,ax -*/ -/* -ss stack segment -sp top of stack -bp bottem of stack -*/ diff --git a/16/exmmtest/src/lib/16_mm.h b/16/exmmtest/src/lib/16_mm.h deleted file mode 100644 index 9a01862a..00000000 --- a/16/exmmtest/src/lib/16_mm.h +++ /dev/null @@ -1,202 +0,0 @@ -/* Catacomb Apocalypse Source Code - * Copyright (C) 1993-2014 Flat Rock Software - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -// ID_MM.H - -#ifndef __16_EXMM__ -#define __16_EXMM__ - -#include -#include -#include "src/lib/16_head.h" -#include "src/lib/16_hc.h" -//#include "src/lib/modex16.h" -//#include "src/lib/16_ca.h" -//++++mh #include "src/lib/16_in.h" - -#ifdef __DEBUG__ // 1 == Debug/Dev ; 0 == Production/final -#define OUT_OF_MEM_MSG "MM_GetPtr: Out of memory!\nYou were short :%lu bytes\n" -#else -#define OUT_OF_MEM_MSG "\npee\n" -#endif - -//#define GETNEWBLOCK {if(!(mmnew=mmfree))Quit("MM_GETNEWBLOCK: No free blocks!") ;mmfree=mmfree->next;} -#define GETNEWBLOCK {if(!mm->mmfree)MML_ClearBlock(mm);mm->mmnew=mm->mmfree;mm->mmfree=mm->mmfree->next;mm->endid++;} - -#define FREEBLOCK(x) {*x->useptr=NULL;x->next=mm->mmfree;mm->mmfree=x;mm->endid--;} - - -#define SAVENEARHEAP 0x200 // space to leave in data segment -#define SAVEFARHEAP 0//x400 // space to leave in far heap - -#define BUFFERSIZE 0x1000 // miscelanious, allways available buffer - -#define MAXBLOCKS 720 - - - -//-------- - -#define EMS_INT 0x67 - -#define EMS_STATUS 0x40 -#define EMS_GETFRAME 0x41 -#define EMS_GETPAGES 0x42 -#define EMS_ALLOCPAGES 0x43 -#define EMS_MAPPAGE 0x44 -#define EMS_MAPXPAGE 0x50 -#define EMS_FREEPAGES 0x45 -#define EMS_VERSION 0x46 - -//-------- - -#define XMS_VERSION 0x00 - -#define XMS_ALLOCHMA 0x01 -#define XMS_FREEHMA 0x02 - -#define XMS_GENABLEA20 0x03 -#define XMS_GDISABLEA20 0x04 -#define XMS_LENABLEA20 0x05 -#define XMS_LDISABLEA20 0x06 -#define XMS_QUERYA20 0x07 - -#define XMS_QUERYREE 0x08 -#define XMS_ALLOC 0x09 -#define XMS_FREE 0x0A -#define XMS_MOVE 0x0B -#define XMS_LOCK 0x0C -#define XMS_UNLOCK 0x0D -#define XMS_GETINFO 0x0E -#define XMS_RESIZE 0x0F - -#define XMS_ALLOCUMB 0x10 -#define XMS_FREEUMB 0x11 - -//========================================================================== - -typedef struct -{ - dword nearheap,farheap,EMSmem,XMSmem,mainmem; -} mminfotype; - -//========================================================================== - -extern void (* beforesort) (void); -extern void (* aftersort) (void); -extern void (* XMSaddr) (void); // far pointer to XMS driver - -//========================================================================== - -/* -============================================================================= - - LOCAL INFO - -============================================================================= -*/ - -#define LOCKBIT 0x80 // if set in attributes, block cannot be moved -#define PURGEBITS 3 // 0-3 level, 0= unpurgable, 3= purge first -#define PURGEMASK 0xfffc -#define BASEATTRIBUTES 0 // unlocked, non purgable - -#define MAXUMBS 12 -#define MAPPAGES 4//mm->EMSpagesmapped - -typedef struct mmblockstruct -{ - //word start,length; - word start; dword length; - unsigned attributes; - memptr *useptr; // pointer to the segment start - struct mmblockstruct huge *next; -} mmblocktype; - - -typedef struct -{ - memptr bufferseg; - boolean mmstarted, bombonerror, mmerror; - void huge *farheap; -#ifdef __BORLANDC__ - void *nearheap; -#endif -#ifdef __WATCOMC__ - void __near *nearheap; -#endif - //byte EMS_status; - unsigned totalEMSpages,freeEMSpages,EMSpageframe,EMSpagesmapped,EMShandle; - unsigned int EMSVer; - word numUMBs,UMBbase[MAXUMBS]; - word endid; //end of list - //dword numUMBs,UMBbase[MAXUMBS]; - mmblocktype huge mmblocks[MAXBLOCKS],huge *mmhead,huge *mmfree,huge *mmrover,huge *mmnew; -} mminfo_t; - -/* -============================================================================= - - GLOBAL VARIABLES - -============================================================================= -*/ - - -/* -============================================================================= - - LOCAL VARIABLES - -============================================================================= -*/ - -//========================================================================== - -boolean MML_CheckForEMS(void); -byte MML_SetupEMS(mminfo_t *mm); -void MML_ShutdownEMS(mminfo_t *mm); -byte MM_MapEMS(mminfo_t *mm, mminfotype *mmi); -byte MM_MapXEMS(mminfo_t *mm, mminfotype *mmi); -boolean MML_CheckForXMS(mminfo_t *mm); -void MML_SetupXMS(mminfo_t *mm, mminfotype *mmi); -void MML_ShutdownXMS(mminfo_t *mm); -void MML_UseSpace(/*d*/word segstart, dword seglength, mminfo_t *mm); -void MML_ClearBlock(mminfo_t *mm); - -void MM_Startup(mminfo_t *mm, mminfotype *mmi); -void MM_Shutdown(mminfo_t *mm); - -void MM_GetPtr(memptr *baseptr,dword size, mminfo_t *mm, mminfotype *mmi); -void MM_FreePtr(memptr *baseptr, mminfo_t *mm); -void MM_SetPurge(memptr *baseptr, int purge, mminfo_t *mm); -void MM_SetLock(memptr *baseptr, boolean locked, mminfo_t *mm); -void MM_SortMem(mminfo_t *mm); -void MM_ShowMemory(/*page_t *page, */mminfo_t *mm); -void MM_DumpData(mminfo_t *mm); -dword MM_UnusedMemory(mminfo_t *mm); -dword MM_TotalFree(mminfo_t *mm); -void MM_Report(/*page_t *page, */mminfo_t *mm, mminfotype *mmi); -static void MM_EMSerr(byte *stri, byte err); -void MM_BombOnError(boolean bomb, mminfo_t *mm); -//void MM_GetNewBlock(mminfo_t *mm); -//void MM_FreeBlock(mmblocktype *x, mminfo_t *mm); - -//========================================================================== - -#endif diff --git a/16/exmmtest/src/lib/nyan/kitten.c b/16/exmmtest/src/lib/nyan/kitten.c deleted file mode 100644 index 4e501dec..00000000 --- a/16/exmmtest/src/lib/nyan/kitten.c +++ /dev/null @@ -1,615 +0,0 @@ - -/* Functions that emulate UNIX catgets */ - -/* Copyright (C) 1999,2000,2001 Jim Hall */ - -/* - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -#include /* sprintf */ -#include /* getenv */ -#include /* strchr */ -#include -#include -#include - -#include "src/lib/nyan/kitten.h" - - -/* DB stuff */ - -struct db_list{ - struct db_list *next; - char *key; - char *value; -}; - -typedef struct db_list db_t; - -db_t *db_insert (char *key, char *value); -db_t *db_fetch (char *key); - - -/* External functions */ - -int get_line (int file, char *buffer, int size); - - -/* Local prototypes */ - -int catread (char *catfile); /* Reads a catfile into the hash */ -char *processEscChars(char *line); /* Converts c escape sequences to chars */ - -/* Globals */ - -nl_catd _kitten_catalog = 0; /* _kitten_catalog descriptor, either 0 or 1 */ - - - -#if defined(__SMALL__) /* it's not very portable ;) */ - -#include -/* assert we are running in small model */ -/* else pointer below has to be done correctly */ -char verify_small_pointers[sizeof(void*) == 2 ? 1 : -1]; - - -int dos_open(char *filename, int mode); -#define open(filename,mode) dos_open(filename,mode) - -int dos_read(int file, void *ptr, unsigned count); -#define read(file, ptr, count) dos_read(file,ptr,count) - -void dos_close(int file); -#define close(file) dos_close(file) - -#ifdef __WATCOMC__ - -#pragma aux dos_open = \ -"mov ax, 0x3d00" \ -"int 0x21" \ -"jnc noerror" \ -"mov ax, 0xffff" \ -"noerror:" \ -parm [dx] [ax] value [ax]; - -#pragma aux dos_read = \ -"mov ah, 0x3f" \ -"int 0x21" \ -"jnc noerror" \ -"xor ax, ax" \ -"noerror:" \ -parm [bx] [dx] [cx] value [ax]; - -#pragma aux dos_close = \ -"mov ah, 0x3e" \ -"int 0x21" \ -parm [bx]; - -#else - -int dos_open(char *filename, int mode) -{ - union REGS r; - - if (mode); /* mode ignored - readonly supported */ - - r.h.ah = 0x3d; - r.h.al = 0; /* read mode only supoported now !! */ - r.x.dx = (unsigned)filename; - intdos(&r,&r); - - if (r.x.cflag) - return -1; - return r.x.ax; -} - -int dos_read(int file, void *ptr, unsigned count) -{ - union REGS r; - - r.h.ah = 0x3f; - r.x.bx = file; - r.x.cx = count; - r.x.dx = (unsigned)ptr; - intdos(&r,&r); - - if (r.x.cflag) - return 0; - return r.x.ax; -} - -void dos_close(int file) -{ - union REGS r; - - r.h.ah = 0x3e; - r.x.bx = file; - intdos(&r,&r); -} - -#endif -#endif - -#ifndef NOCATS - -/* Functions */ - -char * -pascal kittengets(int set_number, int message_number, char *message) -{ - /* get message from a message _kitten_catalog */ - - /* 'message' should really be const, but not when it is returned */ - - /* On success, catgets() returns a pointer to an internal buffer - area containing the null-terminated message string. On failure, - catgets() returns the value 'message'. */ - - char key[10]; - db_t *ptr; - - - /* fetch the message that goes with the set/message number */ - - sprintf (key, "%d.%d", set_number, message_number); - ptr = db_fetch (key); - - /* printf("\ncatgets %s\n",message); */ - - if (ptr) - { - /* printf("------> %s\n",ptr->value); */ - - return (ptr->value); - } - - /* else */ - - return (message); -} - -nl_catd -kittenopen(char *name) -{ - /* catopen() returns a message _kitten_catalog descriptor of type nl_catd on - success. On failure, it returns -1. */ - - /* 'flag' is completely ignored here. */ - - char catfile[256]; /* full path to the msg _kitten_catalog */ - char *nlsptr; /* ptr to NLSPATH */ - char *lang; /* ptr to LANG */ - - - - /* Open the _kitten_catalog file */ - - /* The value of `_kitten_catalog' will be set based on catread */ - - if (_kitten_catalog) - { - /* Already one open */ - - printf("cat already open\n"); - return (-1); - } - - /* If the message _kitten_catalog file name contains a directory separator, - assume that this is a real path to the _kitten_catalog file. Note that - catread will return a true or false value based on its ability - to read the catfile. */ - - if (strchr (name, '\\')) - { - /* first approximation: 'name' is a filename */ - - printf("found \\\n"); - - _kitten_catalog = catread (name); - return (_kitten_catalog); - } - - /* If the message _kitten_catalog file name does not contain a directory - separator, then we need to try to locate the message _kitten_catalog on - our own. We will use several methods to find it. */ - - /* We will need the value of LANG, and may need a 2-letter abbrev of - LANG later on, so get it now. */ - - lang = getenv ("LANG"); - - if (lang == NULL) - { - /* printf("no lang= found\n"); */ - - /* Return failure - we won't be able to locate the cat file */ - return (-1); - } - - - /* step through NLSPATH */ - - nlsptr = getenv ("NLSPATH"); - - - if (nlsptr == NULL) - { - /* printf("no NLSPATH= found\n"); */ - - /* Return failure - we won't be able to locate the cat file */ - return (-1); - } - - /* printf("nlsptr:%s\n",nlsptr); */ - - while (*nlsptr) - { - char *tok = strchr(nlsptr, ';'); - int toklen; - - - if (tok == NULL) tok = nlsptr + strlen(nlsptr); - toklen=tok-nlsptr; - /* Try to find the _kitten_catalog file in each path from NLSPATH */ - - /* Rule #1: %NLSPATH%\%LANG%\cat */ - - memcpy(catfile,nlsptr,toklen); - sprintf(catfile+toklen,"\\%s\\%s",lang,name); - - _kitten_catalog = catread (catfile); - if (_kitten_catalog) - { - return (_kitten_catalog); - } - - /* Rule #2: %NLSPATH%\cat.%LANG% */ - - sprintf(catfile+toklen,"\\%s.%s",name, lang); - - _kitten_catalog = catread (catfile); - - if (_kitten_catalog) - { - return (_kitten_catalog); - } - - /* Rule #3: if LANG looks to be in format "en-UK" then - %NLSPATH%\cat.EN */ - - if (lang[2] == '-') - { - lang[2] = 0; - sprintf(catfile+toklen,"\\%s.%s",name,lang); - lang[2] = '-'; - - _kitten_catalog = catread (catfile); - if (_kitten_catalog) - { - return (_kitten_catalog); - } - } - - /* Grab next tok for the next while iteration */ - nlsptr = tok; - if (*nlsptr) nlsptr++; - - } /* while tok */ - - /* We could not find it. Return failure. */ - - return (0); -} - -int -catread (char *catfile) -{ - int file; /* pointer to the catfile */ - char *key; /* part of key-value for hash */ - char *value; /* part of key-value for hash */ - char inBuffer[256]; /* the string read from the file */ - - /* Open the catfile for reading */ - - /*printf("catread %s\n",catfile); */ - - file = open (catfile, O_RDONLY | O_TEXT); - if (file < 0) - { - /* Cannot open the file. Return failure */ - /* printf("catread: cant read %s\n",catfile); */ - return (0); - } - - /*printf("catread %s success\n",catfile);*/ - - /* Read the file into memory */ - - while (get_line (file, inBuffer, sizeof(inBuffer))) - { - /* Break into parts. Entries should be of the form: - "1.2:This is a message" */ - - /* A line that starts with '#' is considered a comment, and will - be thrown away without reading it. */ - - if (inBuffer[0] == '#') /* comment */ - continue; - - if ((key = strchr (inBuffer, ':')) != NULL) - { - *key = 0; - - value = processEscChars(key+1); - - db_insert (inBuffer, value); - } - - } /* while */ - - close (file); - - /* Return success */ - - return (1); -} - -void -kittenclose (void) -{ - /* close a message _kitten_catalog */ - - _kitten_catalog = 0; -} - - - -/** - * Process strings, converting \n, \t, \v, \b, \r, \f, \\, \ddd, \xdd and \x0dd - * to actual chars. (Note: \x is an extension to support hexadecimal) - * This method is used to allow the message _kitten_catalog to use c escape sequences. - * Modifies the line in-place (always same size or shorter). - * Returns a pointer to input string. - */ - -int mystrtoul(char *src, int base, int size, int *error) -{ - int ret = 0; - - *error = 1; - - for (; size > 0; size--) - { - int digit; - int ch = *src++; - - if (ch >= '0' && ch <= '9') digit = ch - '0'; - else if (ch >= 'A' && ch <= 'Z') digit = ch - 'A' + 10; - else if (ch >= 'a' && ch <= 'z') digit = ch - 'a' + 10; - else - { - return 0; - } - - if (digit >= base) - { - return 0; - } - - ret = ret * base + digit; - } - - *error = 0; - - return ret; -} - - -char *processEscChars(char *line) -{ - register char *src = line, *dst = line; - - /* used when converting \xdd and \ddd (hex or octal) characters */ - char ch; - - if (line == NULL) return NULL; - - /* cycle through copying characters, except when a \ is encountered. */ - for ( ; *src != '\0'; src++, dst++) - { - ch = *src; - - if (ch == '\\') - { - src++; /* point to char following slash */ - switch (ch = *src) - { - case '\\': /* a single slash */ - ch = '\\'; - break; - case 'n': /* a newline (linefeed) */ - ch = '\n'; - break; - case 'r': /* a carriage return */ - ch = '\r'; - break; - case 't': /* a horizontal tab */ - ch = '\t'; - break; - case 'v': /* a vertical tab */ - ch = '\v'; - break; - case 'b': /* a backspace */ - ch = '\b'; - break; - case 'a': /* alert */ - ch = '\a'; - break; - case 'f': /* formfeed */ - ch = '\f'; - break; - case 'x': /* extension supporting hex numbers \xdd or \x0dd */ - { - int error; - ch = mystrtoul(src+1,16,2, &error); /* get value */ - if (!error) /* store character */ - { - src += 2; - } - else /* error so just store x (loose slash) */ - { - ch = *src; - } - } - - break; - default: /* just store letter (loose slash) or handle octal */ - - { - int error; - ch = mystrtoul(src,8,3, &error); /* get value */ - if (!error) /* store character */ - { - src += 3; - } - else - ch = *src; - } - - break; - } - } - - *dst = ch; - } - - /* ensure '\0' terminated */ - *dst = '\0'; - - return line; -} - - - -int -get_line (int file, char *str, int size) -{ - int success = 0; - - /* now, read the string */ - - for ( ; size > 0; ) - { - if (read(file,str,1) <= 0) - break; - - success = 1; - - if (*str == '\r') - continue; - - if (*str == '\n') - break; - - str++; - size--; - - } /* while */ - - *str = 0; - - return success; -} - -/* Function prototypes */ - - -/* Global variables */ - -static db_t *hashtab[1]; - - -/* Functions */ - - -/* db_fetch() - Query the hash and return a struct that contains the - key and the pointer. The calling function should not look beyond - that. */ - -db_t * -db_fetch (char *s) -{ - db_t *db_ptr; - - for (db_ptr = hashtab[0]; db_ptr != NULL; db_ptr = db_ptr->next) - { - if (strcmp (s, db_ptr->key) == 0) - { - break; - - } - } - - - return (db_ptr); -} - -/* db_insert() - Inserts a key,value pair into the hash. If the key - already exists in the hash, the new value is NOT inserted. */ - -db_t * -db_insert (char *key, char *value) -{ - db_t *db_ptr; - - if ((db_ptr = db_fetch (key)) == NULL) - { - /* not found */ - - db_ptr = (db_t *) malloc (sizeof (*db_ptr)); - - if (db_ptr == NULL || (db_ptr->key = strdup (key)) == NULL) - { - return (NULL); - } - - /* insert the key,value into the hash. */ - - db_ptr->next = hashtab[0]; - hashtab[0] = db_ptr; - } - - else - { - /* already there */ - - free ((void *) db_ptr->value); - } - - if ((db_ptr ->value = strdup (value)) == NULL) - { - return (NULL); - } - - /* else */ - - return (db_ptr); -} - - - -#endif /* NOCATS */ diff --git a/16/exmmtest/src/lib/nyan/kitten.h b/16/exmmtest/src/lib/nyan/kitten.h deleted file mode 100644 index 2cec22fe..00000000 --- a/16/exmmtest/src/lib/nyan/kitten.h +++ /dev/null @@ -1,73 +0,0 @@ -/* $Id: kitten.h,v 1.1 2004/09/19 10:01:26 bartoldeman Exp $ */ - -/* Functions that emulate UNIX catgets */ - -/* Copyright (C) 1999,2000 Jim Hall */ - -/* - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - - -#ifndef _CATGETS_H -#define _CATGETS_H - -#ifdef NOCATS - -/* #define NOCATS to disable that stuff completely */ -#define nl_catd int -#define catopen(x,y) 1 -#define catclose(x) -#define catgets(c,x,y,s) s - -#else - - - - -#ifdef __cplusplus -extern "C" { -#endif - - /* Data types */ - - typedef int nl_catd; - - /* Symbolic constants */ - -#define MCLoadBySet 0 /* not implemented */ -#define MCLoadAll 0 /* not implemented */ - - - /* Functions */ - -#define catgets(catalog, set,message_number,message) kittengets(set,message_number,message) -#define catopen(name,flag) kittenopen(name) -#define catclose(catalog) kittenclose() - - - char * pascal kittengets( int set_number, int message_number,char *message); - nl_catd kittenopen(char *name); - void kittenclose (void); - - - -#ifdef __cplusplus -} -#endif - -#endif /* NOCATS */ - -#endif /* _CATGETS_H */ diff --git a/16/exmmtest/src/lib/types.h b/16/exmmtest/src/lib/types.h deleted file mode 100644 index 2055c20c..00000000 --- a/16/exmmtest/src/lib/types.h +++ /dev/null @@ -1,37 +0,0 @@ -/* Project 16 Source Code~ - * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669 - * - * This file is part of Project 16. - * - * Project 16 is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * Project 16 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see , 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; - -#endif/*_TYPE_H_*/ diff --git a/16/exmmtest/wtf_this.wat b/16/exmmtest/wtf_this.wat deleted file mode 100644 index 3f027eef..00000000 --- a/16/exmmtest/wtf_this.wat +++ /dev/null @@ -1 +0,0 @@ -MORE FUCKING BORLAND C BEHAVIOR TESTING!! wwww \ No newline at end of file diff --git a/16_CA.BCO b/16_CA.BCO new file mode 100644 index 00000000..aef7def2 Binary files /dev/null and b/16_CA.BCO differ diff --git a/16_HC.BCO b/16_HC.BCO new file mode 100644 index 00000000..67bd315e Binary files /dev/null and b/16_HC.BCO differ diff --git a/16_HEAD.BCO b/16_HEAD.BCO new file mode 100644 index 00000000..6d4ac374 Binary files /dev/null and b/16_HEAD.BCO differ diff --git a/16_MM.BCO b/16_MM.BCO new file mode 100644 index 00000000..0d82784b Binary files /dev/null and b/16_MM.BCO differ diff --git a/DEBUG.16 b/DEBUG.16 index 93afd7e6..bf99e259 100644 --- a/DEBUG.16 +++ b/DEBUG.16 @@ -1,8 +1,8 @@ -0 Size:5558 Owner:0x0 -0 Size:5558 Owner:0x0 -15b6 Size:256 Owner:0x4cde -Seg:16b6 Size:273 Owner:0x857a -Seg:1d04 Size:49 Owner:0x0 -Seg:1d04 Size:49 Owner:0x0 -1f25 Size:49371 Owner:0x0 +0 Size:5562 Owner:0x0 +0 Size:5562 Owner:0x0 +15ba Size:256 Owner:0x4cde +Seg:16ba Size:273 Owner:0x857a +Seg:1d08 Size:49 Owner:0x0 +Seg:1d08 Size:49 Owner:0x0 +ad39 Size:12999 Owner:0x0 Seg:e000 Size:4294909951 Owner:0x0 diff --git a/EXMMBC.BCO b/EXMMBC.BCO new file mode 100644 index 00000000..3bd64eea Binary files /dev/null and b/EXMMBC.BCO differ diff --git a/EXMMBC.DSK b/EXMMBC.DSK new file mode 100644 index 00000000..c164eab0 Binary files /dev/null and b/EXMMBC.DSK differ diff --git a/EXMMBC.MAP b/EXMMBC.MAP new file mode 100644 index 00000000..bee59e80 --- /dev/null +++ b/EXMMBC.MAP @@ -0,0 +1,737 @@ + + Start Stop Length Name Class + + 00000H 05CA0H 05CA1H _TEXT CODE + 05CB0H 05CB0H 00000H _FARDATA FAR_DATA + 05CB0H 05CB0H 00000H _FARBSS FAR_BSS + 05CB0H 05CB0H 00000H _OVERLAY_ OVRINFO + 05CB0H 05CB0H 00000H _1STUB_ STUBSEG + 05CB0H 06D69H 010BAH _DATA DATA + 06D6AH 06D6BH 00002H _CVTSEG DATA + 06D6CH 06D71H 00006H _SCNSEG DATA + 06D72H 06D72H 00000H _CONST CONST + 06D72H 06D89H 00018H _INIT_ INITDATA + 06D8AH 06D8AH 00000H _INITEND_ INITDATA + 06D8AH 06D8AH 00000H _EXIT_ EXITDATA + 06D8AH 06D8AH 00000H _EXITEND_ EXITDATA + 06D8AH 06DF1H 00068H _BSS BSS + 06DF2H 06DF2H 00000H _BSSEND BSSEND + 06E00H 06E7FH 00080H _STACK STACK + + +Detailed map of segments + + 0000:0000 028F C=CODE S=_TEXT G=(none) M=c0.ASM ACBP=28 + 0000:028F 067F C=CODE S=_TEXT G=(none) M=SRC\LIB\NYAN\KITTEN.C ACBP=28 + 0000:090E 02EE C=CODE S=_TEXT G=(none) M=SRC\LIB\16_HC.C ACBP=28 + 0000:0BFC 024D C=CODE S=_TEXT G=(none) M=SRC\EXMMTEST.C ACBP=28 + 0000:0E49 0241 C=CODE S=_TEXT G=(none) M=SRC\LIB\16_CA.C ACBP=28 + 0000:108A 02C8 C=CODE S=_TEXT G=(none) M=SRC\LIB\16_HEAD.C ACBP=28 + 0000:1352 1CB5 C=CODE S=_TEXT G=(none) M=SRC\LIB\16_MM.C ACBP=28 + 0000:3007 0024 C=CODE S=_TEXT G=(none) M=ATEXIT ACBP=28 + 0000:302B 0049 C=CODE S=_TEXT G=(none) M=CLOCK ACBP=28 + 0000:3074 0000 C=CODE S=_TEXT G=(none) M=CTYPE ACBP=28 + 0000:3074 003D C=CODE S=_TEXT G=(none) M=DOSFATTR ACBP=28 + 0000:30B1 0089 C=CODE S=_TEXT G=(none) M=EXIT ACBP=28 + 0000:313A 0000 C=CODE S=_TEXT G=(none) M=FILES ACBP=28 + 0000:313A 0000 C=CODE S=_TEXT G=(none) M=FILES2 ACBP=28 + 0000:313A 0000 C=CODE S=_TEXT G=(none) M=FMODE ACBP=28 + 0000:313A 0021 C=CODE S=_TEXT G=(none) M=H_LLSH ACBP=28 + 0000:315B 0021 C=CODE S=_TEXT G=(none) M=H_LURSH ACBP=28 + 0000:317C 0060 C=CODE S=_TEXT G=(none) M=H_PADD ACBP=28 + 0000:31DC 0028 C=CODE S=_TEXT G=(none) M=H_PSBP ACBP=28 + 0000:3204 004B C=CODE S=_TEXT G=(none) M=IOERROR ACBP=28 + 0000:324F 0011 C=CODE S=_TEXT G=(none) M=ISATTY ACBP=28 + 0000:3260 00A2 C=CODE S=_TEXT G=(none) M=LONGTOA ACBP=28 + 0000:3302 0029 C=CODE S=_TEXT G=(none) M=LSEEK ACBP=28 + 0000:332B 00B0 C=CODE S=_TEXT G=(none) M=MKNAME ACBP=28 + 0000:33DB 0021 C=CODE S=_TEXT G=(none) M=N_PCMP ACBP=28 + 0000:33FC 002F C=CODE S=_TEXT G=(none) M=READA ACBP=28 + 0000:342B 00B2 C=CODE S=_TEXT G=(none) M=SETUPIO ACBP=28 + 0000:34DD 0000 C=CODE S=_TEXT G=(none) M=STKLEN ACBP=28 + 0000:34DD 002C C=CODE S=_TEXT G=(none) M=TOLOWER ACBP=28 + 0000:3509 0018 C=CODE S=_TEXT G=(none) M=UNLINK ACBP=28 + 0000:3521 04DB C=CODE S=_TEXT G=(none) M=VPRINTER ACBP=28 + 0000:39FC 009F C=CODE S=_TEXT G=(none) M=VRAM ACBP=28 + 0000:3A9B 0000 C=CODE S=_TEXT G=(none) M=WSCROLL ACBP=28 + 0000:3A9B 0030 C=CODE S=_TEXT G=(none) M=_STPCPY ACBP=28 + 0000:3ACB 0004 C=CODE S=_TEXT G=(none) M=CORELEFT ACBP=28 + 0000:3ACF 014E C=CODE S=_TEXT G=(none) M=CPRINTF ACBP=28 + 0000:3C1D 01A5 C=CODE S=_TEXT G=(none) M=CRTINIT ACBP=28 + 0000:3DC2 001F C=CODE S=_TEXT G=(none) M=CVTFAK ACBP=28 + 0000:3DE1 042D C=CODE S=_TEXT G=(none) M=FARHEAP ACBP=28 + 0000:420E 013E C=CODE S=_TEXT G=(none) M=FBRK ACBP=28 + 0000:434C 0050 C=CODE S=_TEXT G=(none) M=FCORELFT ACBP=28 + 0000:439C 0054 C=CODE S=_TEXT G=(none) M=GETCH ACBP=28 + 0000:43F0 00AC C=CODE S=_TEXT G=(none) M=GPTEXT ACBP=28 + 0000:449C 0029 C=CODE S=_TEXT G=(none) M=IOCTL ACBP=28 + 0000:44C5 0012 C=CODE S=_TEXT G=(none) M=KBHIT ACBP=28 + 0000:44D7 009D C=CODE S=_TEXT G=(none) M=MOVETEXT ACBP=28 + 0000:4574 0017 C=CODE S=_TEXT G=(none) M=PUTCH ACBP=28 + 0000:458B 0004 C=CODE S=_TEXT G=(none) M=REALCVT ACBP=28 + 0000:458F 01C7 C=CODE S=_TEXT G=(none) M=SCREEN ACBP=28 + 0000:4756 0184 C=CODE S=_TEXT G=(none) M=SCROLL ACBP=28 + 0000:48DA 0129 C=CODE S=_TEXT G=(none) M=SETARGV ACBP=28 + 0000:4A03 001C C=CODE S=_TEXT G=(none) M=SETBLOCK ACBP=28 + 0000:4A1F 0054 C=CODE S=_TEXT G=(none) M=SETENVP ACBP=28 + 0000:4A73 002C C=CODE S=_TEXT G=(none) M=WHEREXY ACBP=28 + 0000:4A9F 001D C=CODE S=_TEXT G=(none) M=CHMODA ACBP=28 + 0000:4ABC 0026 C=CODE S=_TEXT G=(none) M=CLOSE ACBP=28 + 0000:4AE2 001E C=CODE S=_TEXT G=(none) M=CLOSEA ACBP=28 + 0000:4B00 00B0 C=CODE S=_TEXT G=(none) M=FCLOSE ACBP=28 + 0000:4BB0 00C6 C=CODE S=_TEXT G=(none) M=FFLUSH ACBP=28 + 0000:4C76 0041 C=CODE S=_TEXT G=(none) M=FLENGTH ACBP=28 + 0000:4CB7 0040 C=CODE S=_TEXT G=(none) M=FLUSHALL ACBP=28 + 0000:4CF7 01FE C=CODE S=_TEXT G=(none) M=FOPEN ACBP=28 + 0000:4EF5 001C C=CODE S=_TEXT G=(none) M=FPRINTF ACBP=28 + 0000:4F11 01D8 C=CODE S=_TEXT G=(none) M=FSEEK ACBP=28 + 0000:50E9 0070 C=CODE S=_TEXT G=(none) M=GETENV ACBP=28 + 0000:5159 0070 C=CODE S=_TEXT G=(none) M=LTOA1 ACBP=28 + 0000:51C9 0024 C=CODE S=_TEXT G=(none) M=MEMCPY ACBP=28 + 0000:51ED 0022 C=CODE S=_TEXT G=(none) M=MOVEDATA ACBP=28 + 0000:520F 018D C=CODE S=_TEXT G=(none) M=OPEN ACBP=28 + 0000:539C 004F C=CODE S=_TEXT G=(none) M=OPENA ACBP=28 + 0000:53EB 001B C=CODE S=_TEXT G=(none) M=PRINTF ACBP=28 + 0000:5406 03A4 C=CODE S=_TEXT G=(none) M=PUTC ACBP=28 + 0000:57AA 00CB C=CODE S=_TEXT G=(none) M=READ ACBP=28 + 0000:5875 0003 C=CODE S=_TEXT G=(none) M=READU ACBP=28 + 0000:5878 0111 C=CODE S=_TEXT G=(none) M=SETVBUF ACBP=28 + 0000:5989 0081 C=CODE S=_TEXT G=(none) M=SPRINTF ACBP=28 + 0000:5A0A 003F C=CODE S=_TEXT G=(none) M=STRCAT ACBP=28 + 0000:5A49 0040 C=CODE S=_TEXT G=(none) M=STRDUP ACBP=28 + 0000:5A89 001F C=CODE S=_TEXT G=(none) M=STRLEN ACBP=28 + 0000:5AA8 0149 C=CODE S=_TEXT G=(none) M=WRITE ACBP=28 + 0000:5BF1 003C C=CODE S=_TEXT G=(none) M=WRITEA ACBP=28 + 0000:5C2D 0003 C=CODE S=_TEXT G=(none) M=WRITEU ACBP=28 + 0000:5C30 003B C=CODE S=_TEXT G=(none) M=XFCLOSE ACBP=28 + 0000:5C6B 0036 C=CODE S=_TEXT G=(none) M=XFFLUSH ACBP=28 + 05CB:0000 0000 C=FAR_DATA S=_FARDATA G=(none) M=c0.ASM ACBP=68 + 05CB:0000 0000 C=FAR_BSS S=_FARBSS G=(none) M=c0.ASM ACBP=68 + 05CB:0000 0000 C=OVRINFO S=_OVERLAY_ G=(none) M=c0.ASM ACBP=68 + 05CB:0000 0000 C=STUBSEG S=_1STUB_ G=(none) M=c0.ASM ACBP=68 + 05CB:0000 0093 C=DATA S=_DATA G=DGROUP M=c0.ASM ACBP=68 + 05CB:0094 0045 C=DATA S=_DATA G=DGROUP M=SRC\LIB\NYAN\KITTEN.C ACBP=48 + 05CB:00DA 0014 C=DATA S=_DATA G=DGROUP M=SRC\LIB\16_HC.C ACBP=48 + 05CB:00EE 0187 C=DATA S=_DATA G=DGROUP M=SRC\EXMMTEST.C ACBP=48 + 05CB:0276 002C C=DATA S=_DATA G=DGROUP M=SRC\LIB\16_CA.C ACBP=48 + 05CB:02A2 0010 C=DATA S=_DATA G=DGROUP M=SRC\LIB\16_HEAD.C ACBP=48 + 05CB:02B2 0A06 C=DATA S=_DATA G=DGROUP M=SRC\LIB\16_MM.C ACBP=48 + 05CB:0CB8 0002 C=DATA S=_DATA G=DGROUP M=ATEXIT ACBP=48 + 05CB:0CBA 0000 C=DATA S=_DATA G=DGROUP M=CLOCK ACBP=48 + 05CB:0CBA 0101 C=DATA S=_DATA G=DGROUP M=CTYPE ACBP=48 + 05CB:0DBC 0000 C=DATA S=_DATA G=DGROUP M=DOSFATTR ACBP=48 + 05CB:0DBC 0006 C=DATA S=_DATA G=DGROUP M=EXIT ACBP=48 + 05CB:0DC2 0190 C=DATA S=_DATA G=DGROUP M=FILES ACBP=48 + 05CB:0F52 002A C=DATA S=_DATA G=DGROUP M=FILES2 ACBP=48 + 05CB:0F7C 0004 C=DATA S=_DATA G=DGROUP M=FMODE ACBP=48 + 05CB:0F80 0000 C=DATA S=_DATA G=DGROUP M=H_LLSH ACBP=48 + 05CB:0F80 0000 C=DATA S=_DATA G=DGROUP M=H_LURSH ACBP=48 + 05CB:0F80 0000 C=DATA S=_DATA G=DGROUP M=H_PADD ACBP=48 + 05CB:0F80 0000 C=DATA S=_DATA G=DGROUP M=H_PSBP ACBP=48 + 05CB:0F80 005B C=DATA S=_DATA G=DGROUP M=IOERROR ACBP=48 + 05CB:0FDC 0000 C=DATA S=_DATA G=DGROUP M=ISATTY ACBP=48 + 05CB:0FDC 0000 C=DATA S=_DATA G=DGROUP M=LONGTOA ACBP=48 + 05CB:0FDC 0000 C=DATA S=_DATA G=DGROUP M=LSEEK ACBP=48 + 05CB:0FDC 0009 C=DATA S=_DATA G=DGROUP M=MKNAME ACBP=48 + 05CB:0FE6 0000 C=DATA S=_DATA G=DGROUP M=N_PCMP ACBP=48 + 05CB:0FE6 0000 C=DATA S=_DATA G=DGROUP M=READA ACBP=48 + 05CB:0FE6 0000 C=DATA S=_DATA G=DGROUP M=SETUPIO ACBP=48 + 05CB:0FE6 0002 C=DATA S=_DATA G=DGROUP M=STKLEN ACBP=48 + 05CB:0FE8 0000 C=DATA S=_DATA G=DGROUP M=TOLOWER ACBP=48 + 05CB:0FE8 0000 C=DATA S=_DATA G=DGROUP M=UNLINK ACBP=48 + 05CB:0FE8 0067 C=DATA S=_DATA G=DGROUP M=VPRINTER ACBP=48 + 05CB:1050 0000 C=DATA S=_DATA G=DGROUP M=VRAM ACBP=48 + 05CB:1050 0002 C=DATA S=_DATA G=DGROUP M=WSCROLL ACBP=48 + 05CB:1052 0000 C=DATA S=_DATA G=DGROUP M=_STPCPY ACBP=48 + 05CB:1052 0000 C=DATA S=_DATA G=DGROUP M=CORELEFT ACBP=48 + 05CB:1052 0000 C=DATA S=_DATA G=DGROUP M=CPRINTF ACBP=48 + 05CB:1052 0018 C=DATA S=_DATA G=DGROUP M=CRTINIT ACBP=48 + 05CB:106A 0031 C=DATA S=_DATA G=DGROUP M=CVTFAK ACBP=48 + 05CB:109C 0000 C=DATA S=_DATA G=DGROUP M=FARHEAP ACBP=48 + 05CB:109C 0002 C=DATA S=_DATA G=DGROUP M=FBRK ACBP=48 + 05CB:109E 0000 C=DATA S=_DATA G=DGROUP M=FCORELFT ACBP=48 + 05CB:109E 0000 C=DATA S=_DATA G=DGROUP M=GETCH ACBP=48 + 05CB:109E 0000 C=DATA S=_DATA G=DGROUP M=GPTEXT ACBP=48 + 05CB:109E 0000 C=DATA S=_DATA G=DGROUP M=IOCTL ACBP=48 + 05CB:109E 0002 C=DATA S=_DATA G=DGROUP M=KBHIT ACBP=48 + 05CB:10A0 0000 C=DATA S=_DATA G=DGROUP M=MOVETEXT ACBP=48 + 05CB:10A0 0000 C=DATA S=_DATA G=DGROUP M=PUTCH ACBP=48 + 05CB:10A0 0000 C=DATA S=_DATA G=DGROUP M=REALCVT ACBP=48 + 05CB:10A0 0000 C=DATA S=_DATA G=DGROUP M=SCREEN ACBP=48 + 05CB:10A0 0000 C=DATA S=_DATA G=DGROUP M=SCROLL ACBP=48 + 05CB:10A0 0010 C=DATA S=_DATA G=DGROUP M=SETARGV ACBP=48 + 05CB:10B0 0000 C=DATA S=_DATA G=DGROUP M=SETBLOCK ACBP=48 + 05CB:10B0 0004 C=DATA S=_DATA G=DGROUP M=SETENVP ACBP=48 + 05CB:10B4 0000 C=DATA S=_DATA G=DGROUP M=WHEREXY ACBP=48 + 05CB:10B4 0000 C=DATA S=_DATA G=DGROUP M=CHMODA ACBP=48 + 05CB:10B4 0000 C=DATA S=_DATA G=DGROUP M=CLOSE ACBP=48 + 05CB:10B4 0000 C=DATA S=_DATA G=DGROUP M=CLOSEA ACBP=48 + 05CB:10B4 0000 C=DATA S=_DATA G=DGROUP M=FCLOSE ACBP=48 + 05CB:10B4 0000 C=DATA S=_DATA G=DGROUP M=FFLUSH ACBP=48 + 05CB:10B4 0000 C=DATA S=_DATA G=DGROUP M=FLENGTH ACBP=48 + 05CB:10B4 0000 C=DATA S=_DATA G=DGROUP M=FLUSHALL ACBP=48 + 05CB:10B4 0000 C=DATA S=_DATA G=DGROUP M=FOPEN ACBP=48 + 05CB:10B4 0000 C=DATA S=_DATA G=DGROUP M=FPRINTF ACBP=48 + 05CB:10B4 0000 C=DATA S=_DATA G=DGROUP M=FSEEK ACBP=48 + 05CB:10B4 0000 C=DATA S=_DATA G=DGROUP M=GETENV ACBP=48 + 05CB:10B4 0000 C=DATA S=_DATA G=DGROUP M=LTOA1 ACBP=48 + 05CB:10B4 0000 C=DATA S=_DATA G=DGROUP M=MEMCPY ACBP=48 + 05CB:10B4 0000 C=DATA S=_DATA G=DGROUP M=MOVEDATA ACBP=48 + 05CB:10B4 0000 C=DATA S=_DATA G=DGROUP M=OPEN ACBP=48 + 05CB:10B4 0000 C=DATA S=_DATA G=DGROUP M=OPENA ACBP=48 + 05CB:10B4 0000 C=DATA S=_DATA G=DGROUP M=PRINTF ACBP=48 + 05CB:10B4 0001 C=DATA S=_DATA G=DGROUP M=PUTC ACBP=48 + 05CB:10B6 0000 C=DATA S=_DATA G=DGROUP M=READ ACBP=48 + 05CB:10B6 0000 C=DATA S=_DATA G=DGROUP M=READU ACBP=48 + 05CB:10B6 0004 C=DATA S=_DATA G=DGROUP M=SETVBUF ACBP=48 + 05CB:10BA 0000 C=DATA S=_DATA G=DGROUP M=SPRINTF ACBP=48 + 05CB:10BA 0000 C=DATA S=_DATA G=DGROUP M=STRCAT ACBP=48 + 05CB:10BA 0000 C=DATA S=_DATA G=DGROUP M=STRDUP ACBP=48 + 05CB:10BA 0000 C=DATA S=_DATA G=DGROUP M=STRLEN ACBP=48 + 05CB:10BA 0000 C=DATA S=_DATA G=DGROUP M=WRITE ACBP=48 + 05CB:10BA 0000 C=DATA S=_DATA G=DGROUP M=WRITEA ACBP=48 + 05CB:10BA 0000 C=DATA S=_DATA G=DGROUP M=WRITEU ACBP=48 + 05CB:10BA 0000 C=DATA S=_DATA G=DGROUP M=XFCLOSE ACBP=48 + 05CB:10BA 0000 C=DATA S=_DATA G=DGROUP M=XFFLUSH ACBP=48 + 05CB:10BA 0000 C=DATA S=_CVTSEG G=DGROUP M=c0.ASM ACBP=48 + 05CB:10BA 0002 C=DATA S=_CVTSEG G=DGROUP M=CVTFAK ACBP=48 + 05CB:10BC 0000 C=DATA S=_CVTSEG G=DGROUP M=REALCVT ACBP=48 + 05CB:10BC 0000 C=DATA S=_SCNSEG G=DGROUP M=c0.ASM ACBP=48 + 05CB:10BC 0006 C=DATA S=_SCNSEG G=DGROUP M=CVTFAK ACBP=48 + 05CB:10C2 0000 C=CONST S=_CONST G=DGROUP M=c0.ASM ACBP=48 + 05CB:10C2 0000 C=INITDATA S=_INIT_ G=DGROUP M=c0.ASM ACBP=48 + 05CB:10C2 0006 C=INITDATA S=_INIT_ G=DGROUP M=SETUPIO ACBP=48 + 05CB:10C8 0006 C=INITDATA S=_INIT_ G=DGROUP M=CRTINIT ACBP=48 + 05CB:10CE 0006 C=INITDATA S=_INIT_ G=DGROUP M=SETARGV ACBP=48 + 05CB:10D4 0006 C=INITDATA S=_INIT_ G=DGROUP M=SETENVP ACBP=48 + 05CB:10DA 0000 C=INITDATA S=_INITEND_ G=DGROUP M=c0.ASM ACBP=28 + 05CB:10DA 0000 C=EXITDATA S=_EXIT_ G=DGROUP M=c0.ASM ACBP=48 + 05CB:10DA 0000 C=EXITDATA S=_EXITEND_ G=DGROUP M=c0.ASM ACBP=28 + 05CB:10DA 0000 C=BSS S=_BSS G=DGROUP M=c0.ASM ACBP=48 + 05CB:10DA 0004 C=BSS S=_BSS G=DGROUP M=SRC\LIB\NYAN\KITTEN.C ACBP=48 + 05CB:10DE 0002 C=BSS S=_BSS G=DGROUP M=SRC\LIB\16_HC.C ACBP=48 + 05CB:10E0 0000 C=BSS S=_BSS G=DGROUP M=SRC\EXMMTEST.C ACBP=48 + 05CB:10E0 000A C=BSS S=_BSS G=DGROUP M=SRC\LIB\16_CA.C ACBP=48 + 05CB:10EA 0000 C=BSS S=_BSS G=DGROUP M=SRC\LIB\16_HEAD.C ACBP=48 + 05CB:10EA 0006 C=BSS S=_BSS G=DGROUP M=SRC\LIB\16_MM.C ACBP=48 + 05CB:10F0 0040 C=BSS S=_BSS G=DGROUP M=ATEXIT ACBP=48 + 05CB:1130 0001 C=BSS S=_BSS G=DGROUP M=CLOCK ACBP=48 + 05CB:1132 0000 C=BSS S=_BSS G=DGROUP M=DOSFATTR ACBP=48 + 05CB:1132 0000 C=BSS S=_BSS G=DGROUP M=IOERROR ACBP=48 + 05CB:1132 0000 C=BSS S=_BSS G=DGROUP M=ISATTY ACBP=48 + 05CB:1132 0000 C=BSS S=_BSS G=DGROUP M=LONGTOA ACBP=48 + 05CB:1132 0000 C=BSS S=_BSS G=DGROUP M=LSEEK ACBP=48 + 05CB:1132 000D C=BSS S=_BSS G=DGROUP M=MKNAME ACBP=48 + 05CB:1140 0000 C=BSS S=_BSS G=DGROUP M=READA ACBP=48 + 05CB:1140 0000 C=BSS S=_BSS G=DGROUP M=SETUPIO ACBP=48 + 05CB:1140 0000 C=BSS S=_BSS G=DGROUP M=UNLINK ACBP=48 + 05CB:1140 0000 C=BSS S=_BSS G=DGROUP M=VPRINTER ACBP=48 + 05CB:1140 0000 C=BSS S=_BSS G=DGROUP M=VRAM ACBP=48 + 05CB:1140 0000 C=BSS S=_BSS G=DGROUP M=CORELEFT ACBP=48 + 05CB:1140 0000 C=BSS S=_BSS G=DGROUP M=CRTINIT ACBP=48 + 05CB:1140 0000 C=BSS S=_BSS G=DGROUP M=GETCH ACBP=48 + 05CB:1140 0000 C=BSS S=_BSS G=DGROUP M=IOCTL ACBP=48 + 05CB:1140 0000 C=BSS S=_BSS G=DGROUP M=KBHIT ACBP=48 + 05CB:1140 0000 C=BSS S=_BSS G=DGROUP M=SETBLOCK ACBP=48 + 05CB:1140 0000 C=BSS S=_BSS G=DGROUP M=CHMODA ACBP=48 + 05CB:1140 0000 C=BSS S=_BSS G=DGROUP M=CLOSEA ACBP=48 + 05CB:1140 0000 C=BSS S=_BSS G=DGROUP M=FLENGTH ACBP=48 + 05CB:1140 0000 C=BSS S=_BSS G=DGROUP M=GETENV ACBP=48 + 05CB:1140 0000 C=BSS S=_BSS G=DGROUP M=MEMCPY ACBP=48 + 05CB:1140 0000 C=BSS S=_BSS G=DGROUP M=MOVEDATA ACBP=48 + 05CB:1140 0000 C=BSS S=_BSS G=DGROUP M=OPEN ACBP=48 + 05CB:1140 0000 C=BSS S=_BSS G=DGROUP M=OPENA ACBP=48 + 05CB:1140 0001 C=BSS S=_BSS G=DGROUP M=PUTC ACBP=48 + 05CB:1142 0000 C=BSS S=_BSS G=DGROUP M=READ ACBP=48 + 05CB:1142 0000 C=BSS S=_BSS G=DGROUP M=STRCAT ACBP=48 + 05CB:1142 0000 C=BSS S=_BSS G=DGROUP M=STRLEN ACBP=48 + 05CB:1142 0000 C=BSS S=_BSS G=DGROUP M=WRITEA ACBP=48 + 05CB:1142 0000 C=BSSEND S=_BSSEND G=DGROUP M=c0.ASM ACBP=28 + 06E0:0000 0080 C=STACK S=_STACK G=(none) M=c0.ASM ACBP=74 + + Address Publics by Name + + 05CB:0000 idle DATASEG@ + 0000:028B idle DGROUP@ + 0000:313D idle F_LXLSH@ + 0000:315E idle F_LXURSH@ + 0000:317F idle F_PADD@ + 0000:31DF idle F_PSBP@ + 0000:31AE idle F_PSUB@ + 0000:028F idle KITTENGETS + 0000:313D idle LXLSH@ + 0000:315E idle LXURSH@ + 0000:313A N_LXLSH@ + 0000:315B N_LXURSH@ + 0000:317C N_PADD@ + 0000:33DB N_PCMP@ + 0000:31DC N_PSBP@ + 0000:31AB idle N_PSUB@ + 0000:317F idle PADD@ + 0000:31DF idle PSBP@ + 0000:31AE idle PSUB@ + 0000:0276 _abort + 05CB:10EC idle _aftersort + 0000:3007 idle _atexit + 05CB:10EE idle _beforesort + 0000:0FF0 idle _CAL_OptimizeNodes + 0000:04F2 idle _catread + 0000:0E67 _CA_CloseDebug + 0000:0E72 idle _CA_FarRead + 0000:0EAE idle _CA_FarWrite + 0000:0F5E _CA_LoadFile + 0000:0E49 _CA_OpenDebug + 0000:0EEA idle _CA_ReadFile + 0000:107F _CA_Shutdown + 0000:1061 _CA_Startup + 0000:302B _clock + 0000:4ABC _close + 0000:3ACB _coreleft + 0000:3C01 idle _cprintf + 0000:07F4 idle _db_fetch + 0000:085C idle _db_insert + 05CB:10E6 _debughandle + 05CB:1061 _directvideo + 05CB:10E4 idle _drawcachebox + 05CB:10B0 _environ + 05CB:007F _errno + 0000:30FF _exit + 0000:434C _farcoreleft + 0000:3F21 _farfree + 0000:4035 _farmalloc + 0000:4196 idle _farrealloc + 0000:4B00 _fclose + 0000:4BB0 _fflush + 0000:4C76 _filelength + 0000:10C5 idle _filesize + 05CB:10E0 idle _finishcachebox + 0000:4CB7 _flushall + 0000:4EC0 _fopen + 0000:4EF5 _fprintf + 0000:5420 idle _fputc + 0000:55A9 idle _fputchar + 0000:3F21 _free + 0000:4F93 _fseek + 0000:500F _ftell + 0000:439C _getch + 0000:43B5 idle _getche + 0000:50E9 _getenv + 0000:43F0 _gettext + 0000:079F idle _get_line + 0000:0BF1 idle _HC_CloseDebug + 0000:0BD3 idle _HC_OpenDebug + 05CB:10DE idle _heaphandle + 0000:449C _ioctl + 0000:324F _isatty + 0000:5159 idle _itoa + 0000:44C5 _kbhit + 0000:05A0 idle _kittenclose + 0000:02DE idle _kittenopen + 0000:0A4B idle _LargestFarFreeBlock + 0000:090E idle _LargestFreeBlock + 0000:3302 _lseek + 0000:51A1 idle _ltoa + 0000:0BFC _main + 0000:402B _malloc + 0000:51C9 _memcpy + 0000:1352 idle _MML_CheckForEMS + 0000:1613 idle _MML_CheckForXMS + 0000:1929 idle _MML_ClearBlock + 0000:1395 idle _MML_SetupEMS + 0000:1648 idle _MML_SetupXMS + 0000:148F idle _MML_ShutdownEMS + 0000:16E8 idle _MML_ShutdownXMS + 0000:172A idle _MML_UseSpace + 0000:2FEF idle _MM_BombOnError + 0000:2821 _MM_DumpData + 0000:220B _MM_FreePtr + 0000:1E17 _MM_GetPtr + 0000:14CF idle _MM_MapEMS + 0000:1569 idle _MM_MapXEMS + 0000:2A74 _MM_Report + 0000:3005 idle _MM_segude + 0000:2FFE idle _MM_seguin + 0000:23C2 idle _MM_SetLock + 0000:230E idle _MM_SetPurge + 0000:260B _MM_ShowMemory + 0000:1D8B _MM_Shutdown + 0000:247B idle _MM_SortMem + 0000:199A _MM_Startup + 0000:29E3 idle _MM_TotalFree + 0000:2973 idle _MM_UnusedMemory + 0000:51ED _movedata + 0000:44D7 _movetext + 0000:05A7 idle _mystrtoul + 0000:523C _open + 0000:53EB _printf + 0000:1124 idle _printmeminfoline + 0000:0643 idle _processEscChars + 05CB:10E8 idle _profilehandle + 0000:4574 _putch + 0000:4446 _puttext + 0000:5875 _read + 0000:418F idle _realloc + 0000:4A03 _setblock + 0000:5878 _setvbuf + 0000:59C7 _sprintf + 0000:5A0A _strcat + 0000:5A49 _strdup + 0000:5A89 _strlen + 0000:34DD _tolower + 0000:5184 _ultoa + 0000:43D2 idle _ungetch + 0000:3509 _unlink + 05CB:10E2 idle _updatecachebox + 0000:1283 _US_CheckParm + 0000:59E9 idle _vsprintf + 0000:108A idle _wait + 0000:4A7D idle _wherex + 0000:4A8C idle _wherey + 0000:5C2D _write + 05CB:10EA idle _XMSaddr + 0000:1000 idle __AHINCR + 0000:000C idle __AHSHIFT + 05CB:10A0 __argc + 05CB:10A2 __argv + 05CB:0CB8 __atexitcnt + 05CB:10F0 __atexittbl + 0000:4282 __brk + 05CB:008B __brklvl + 05CB:006B __C0argc + 05CB:006D __C0argv + 0000:3CE3 idle __c0crtinit + 05CB:0071 __C0environ + 05CB:109F __cChar + 0000:3120 idle __cexit + 05CB:109E __cFlag + 0000:0166 __checknull + 0000:4A9F __chmod + 0000:0153 __cleanup + 0000:4AE2 __close + 0000:09C0 idle __coreleft + 0000:3ACF __CPUTN + 0000:3D00 idle __crtinit + 05CB:0CBA __ctype + 0000:0000 Abs __cvtfak + 0000:312E idle __c_exit + 05CB:0F80 __doserrno + 0000:323D __DOSERROR + 05CB:0F82 idle __dosErrorToSV + 0000:3074 __dos_getfileattr + 0000:3094 idle __dos_setfileattr + 05CB:0075 __envLng + 05CB:0077 __envseg + 05CB:0079 __envSize + 0000:310E __exit + 05CB:0DBC __exitbuf + 05CB:0DBE __exitfopen + 05CB:0DC0 idle __exitopen + 0000:0B06 idle __farcoreleft + 05CB:0F7C __fmode + 0000:5406 idle __fputc + 0000:55BC __FPUTN + 0000:4E76 idle __GETFP + 05CB:0087 __heapbase + 05CB:008F __heaptop + 05CB:005B idle __Int0Vector + 05CB:005F idle __Int4Vector + 05CB:0063 idle __Int5Vector + 05CB:0067 idle __Int6Vector + 0000:3204 __IOERROR + 05CB:0094 idle __kitten_catalog + 0000:3260 __LONGTOA + 0000:332B __MKNAME + 0000:028D idle __MMODEL + 05CB:0F52 __nfile + 0000:43B5 idle __Ngetche + 05CB:0F7E __notUmask + 0000:43D2 idle __Nungetch + 0000:539C __open + 05CB:0F54 __openfd + 0000:4DAD idle __OPENFP + 05CB:007D __osmajor + 05CB:007E idle __osminor + 05CB:007D idle __osversion + 05CB:007B __psp + 0000:33FC __read + 0000:458B __REALCVT + 05CB:10BA __RealCvtVector + 0000:01BC __restorezero + 0000:42C1 __sbrk + 05CB:10BC idle __ScanTodVector + 0000:46C5 __SCREENIO + 0000:4778 __SCROLL + 0000:0000 Abs __setargv__ + 0000:0000 idle __setenvp__ + 0000:342B __setupio + 05CB:0081 __StartTime + 05CB:0FE6 __stklen + 0000:3A9B __stpcpy + 05CB:0DC2 __streams + 0000:0167 __terminate + 0000:3384 idle __TMPNAM + 0000:0000 idle __turboCrt + 0000:32E2 __UTOA + 0000:4701 __VALIDATEXY + 05CB:007D idle __version + 05CB:1052 __video + 0000:3C58 __VideoInt + 0000:3539 __VPRINTER + 0000:39FC __VPTR + 0000:3A21 __VRAM + 0000:4A73 __wherexy + 0000:5BF1 __write + 05CB:1050 __wscroll + 0000:5C30 __xfclose + 0000:5C6B __xfflush + 05CB:0085 idle ___brklvl + 0000:3DE1 idle ___first + 0000:3DE3 idle ___last + 0000:57AA ___read + 0000:3DE5 idle ___rover + 0000:5AA8 ___write + + Address Publics by Value + + 0000:0000 Abs __setargv__ + 0000:0000 idle __turboCrt + 0000:0000 Abs __cvtfak + 0000:0000 idle __setenvp__ + 0000:000C idle __AHSHIFT + 0000:0153 __cleanup + 0000:0166 __checknull + 0000:0167 __terminate + 0000:01BC __restorezero + 0000:0276 _abort + 0000:028B idle DGROUP@ + 0000:028D idle __MMODEL + 0000:028F idle KITTENGETS + 0000:02DE idle _kittenopen + 0000:04F2 idle _catread + 0000:05A0 idle _kittenclose + 0000:05A7 idle _mystrtoul + 0000:0643 idle _processEscChars + 0000:079F idle _get_line + 0000:07F4 idle _db_fetch + 0000:085C idle _db_insert + 0000:090E idle _LargestFreeBlock + 0000:09C0 idle __coreleft + 0000:0A4B idle _LargestFarFreeBlock + 0000:0B06 idle __farcoreleft + 0000:0BD3 idle _HC_OpenDebug + 0000:0BF1 idle _HC_CloseDebug + 0000:0BFC _main + 0000:0E49 _CA_OpenDebug + 0000:0E67 _CA_CloseDebug + 0000:0E72 idle _CA_FarRead + 0000:0EAE idle _CA_FarWrite + 0000:0EEA idle _CA_ReadFile + 0000:0F5E _CA_LoadFile + 0000:0FF0 idle _CAL_OptimizeNodes + 0000:1000 idle __AHINCR + 0000:1061 _CA_Startup + 0000:107F _CA_Shutdown + 0000:108A idle _wait + 0000:10C5 idle _filesize + 0000:1124 idle _printmeminfoline + 0000:1283 _US_CheckParm + 0000:1352 idle _MML_CheckForEMS + 0000:1395 idle _MML_SetupEMS + 0000:148F idle _MML_ShutdownEMS + 0000:14CF idle _MM_MapEMS + 0000:1569 idle _MM_MapXEMS + 0000:1613 idle _MML_CheckForXMS + 0000:1648 idle _MML_SetupXMS + 0000:16E8 idle _MML_ShutdownXMS + 0000:172A idle _MML_UseSpace + 0000:1929 idle _MML_ClearBlock + 0000:199A _MM_Startup + 0000:1D8B _MM_Shutdown + 0000:1E17 _MM_GetPtr + 0000:220B _MM_FreePtr + 0000:230E idle _MM_SetPurge + 0000:23C2 idle _MM_SetLock + 0000:247B idle _MM_SortMem + 0000:260B _MM_ShowMemory + 0000:2821 _MM_DumpData + 0000:2973 idle _MM_UnusedMemory + 0000:29E3 idle _MM_TotalFree + 0000:2A74 _MM_Report + 0000:2FEF idle _MM_BombOnError + 0000:2FFE idle _MM_seguin + 0000:3005 idle _MM_segude + 0000:3007 idle _atexit + 0000:302B _clock + 0000:3074 __dos_getfileattr + 0000:3094 idle __dos_setfileattr + 0000:30FF _exit + 0000:310E __exit + 0000:3120 idle __cexit + 0000:312E idle __c_exit + 0000:313A N_LXLSH@ + 0000:313D idle LXLSH@ + 0000:313D idle F_LXLSH@ + 0000:315B N_LXURSH@ + 0000:315E idle LXURSH@ + 0000:315E idle F_LXURSH@ + 0000:317C N_PADD@ + 0000:317F idle F_PADD@ + 0000:317F idle PADD@ + 0000:31AB idle N_PSUB@ + 0000:31AE idle F_PSUB@ + 0000:31AE idle PSUB@ + 0000:31DC N_PSBP@ + 0000:31DF idle PSBP@ + 0000:31DF idle F_PSBP@ + 0000:3204 __IOERROR + 0000:323D __DOSERROR + 0000:324F _isatty + 0000:3260 __LONGTOA + 0000:32E2 __UTOA + 0000:3302 _lseek + 0000:332B __MKNAME + 0000:3384 idle __TMPNAM + 0000:33DB N_PCMP@ + 0000:33FC __read + 0000:342B __setupio + 0000:34DD _tolower + 0000:3509 _unlink + 0000:3539 __VPRINTER + 0000:39FC __VPTR + 0000:3A21 __VRAM + 0000:3A9B __stpcpy + 0000:3ACB _coreleft + 0000:3ACF __CPUTN + 0000:3C01 idle _cprintf + 0000:3C58 __VideoInt + 0000:3CE3 idle __c0crtinit + 0000:3D00 idle __crtinit + 0000:3DE1 idle ___first + 0000:3DE3 idle ___last + 0000:3DE5 idle ___rover + 0000:3F21 _free + 0000:3F21 _farfree + 0000:402B _malloc + 0000:4035 _farmalloc + 0000:418F idle _realloc + 0000:4196 idle _farrealloc + 0000:4282 __brk + 0000:42C1 __sbrk + 0000:434C _farcoreleft + 0000:439C _getch + 0000:43B5 idle __Ngetche + 0000:43B5 idle _getche + 0000:43D2 idle __Nungetch + 0000:43D2 idle _ungetch + 0000:43F0 _gettext + 0000:4446 _puttext + 0000:449C _ioctl + 0000:44C5 _kbhit + 0000:44D7 _movetext + 0000:4574 _putch + 0000:458B __REALCVT + 0000:46C5 __SCREENIO + 0000:4701 __VALIDATEXY + 0000:4778 __SCROLL + 0000:4A03 _setblock + 0000:4A73 __wherexy + 0000:4A7D idle _wherex + 0000:4A8C idle _wherey + 0000:4A9F __chmod + 0000:4ABC _close + 0000:4AE2 __close + 0000:4B00 _fclose + 0000:4BB0 _fflush + 0000:4C76 _filelength + 0000:4CB7 _flushall + 0000:4DAD idle __OPENFP + 0000:4E76 idle __GETFP + 0000:4EC0 _fopen + 0000:4EF5 _fprintf + 0000:4F93 _fseek + 0000:500F _ftell + 0000:50E9 _getenv + 0000:5159 idle _itoa + 0000:5184 _ultoa + 0000:51A1 idle _ltoa + 0000:51C9 _memcpy + 0000:51ED _movedata + 0000:523C _open + 0000:539C __open + 0000:53EB _printf + 0000:5406 idle __fputc + 0000:5420 idle _fputc + 0000:55A9 idle _fputchar + 0000:55BC __FPUTN + 0000:57AA ___read + 0000:5875 _read + 0000:5878 _setvbuf + 0000:59C7 _sprintf + 0000:59E9 idle _vsprintf + 0000:5A0A _strcat + 0000:5A49 _strdup + 0000:5A89 _strlen + 0000:5AA8 ___write + 0000:5BF1 __write + 0000:5C2D _write + 0000:5C30 __xfclose + 0000:5C6B __xfflush + 05CB:0000 idle DATASEG@ + 05CB:005B idle __Int0Vector + 05CB:005F idle __Int4Vector + 05CB:0063 idle __Int5Vector + 05CB:0067 idle __Int6Vector + 05CB:006B __C0argc + 05CB:006D __C0argv + 05CB:0071 __C0environ + 05CB:0075 __envLng + 05CB:0077 __envseg + 05CB:0079 __envSize + 05CB:007B __psp + 05CB:007D idle __osversion + 05CB:007D __osmajor + 05CB:007D idle __version + 05CB:007E idle __osminor + 05CB:007F _errno + 05CB:0081 __StartTime + 05CB:0085 idle ___brklvl + 05CB:0087 __heapbase + 05CB:008B __brklvl + 05CB:008F __heaptop + 05CB:0094 idle __kitten_catalog + 05CB:0CB8 __atexitcnt + 05CB:0CBA __ctype + 05CB:0DBC __exitbuf + 05CB:0DBE __exitfopen + 05CB:0DC0 idle __exitopen + 05CB:0DC2 __streams + 05CB:0F52 __nfile + 05CB:0F54 __openfd + 05CB:0F7C __fmode + 05CB:0F7E __notUmask + 05CB:0F80 __doserrno + 05CB:0F82 idle __dosErrorToSV + 05CB:0FE6 __stklen + 05CB:1050 __wscroll + 05CB:1052 __video + 05CB:1061 _directvideo + 05CB:109E __cFlag + 05CB:109F __cChar + 05CB:10A0 __argc + 05CB:10A2 __argv + 05CB:10B0 _environ + 05CB:10BA __RealCvtVector + 05CB:10BC idle __ScanTodVector + 05CB:10DE idle _heaphandle + 05CB:10E0 idle _finishcachebox + 05CB:10E2 idle _updatecachebox + 05CB:10E4 idle _drawcachebox + 05CB:10E6 _debughandle + 05CB:10E8 idle _profilehandle + 05CB:10EA idle _XMSaddr + 05CB:10EC idle _aftersort + 05CB:10EE idle _beforesort + 05CB:10F0 __atexittbl + +Program entry point at 0000:0000 + diff --git a/HEAP.16 b/HEAP.16 index 13e04944..a55c85ea 100644 --- a/HEAP.16 +++ b/HEAP.16 @@ -1,11 +1,11 @@ == default == - USED block at 1d260016 of size 136 - USED block at 1d26009e of size 66 - FREE block at 1d2600e0 of size 7966 - USED block at 1d261ffe of size 20 - FREE block at 1d262012 of size 8170 + USED block at 1d2a0016 of size 136 + USED block at 1d2a009e of size 66 + FREE block at 1d2a00e0 of size 18 + USED block at 1d2a00f2 of size 20 + FREE block at 1d2a0106 of size 7926 OK - end of heap == near == @@ -32,9 +32,9 @@ OK - end of heap Memory Type Total Used Free ---------------- -------- -------- -------- -Default 16358 222 16136 +Default 8166 222 7944 Near 31318 862 30456 -Far 16358 222 16136 +Far 8166 222 7944 ---------------- -------- -------- -------- coreleft = 30454 farcoreleft = 38202 diff --git a/KITTEN.BCO b/KITTEN.BCO new file mode 100644 index 00000000..03320082 Binary files /dev/null and b/KITTEN.BCO differ diff --git a/awoo.sh b/awoo.sh index 0751007b..0d6a1dc3 100644 --- a/awoo.sh +++ b/awoo.sh @@ -2,4 +2,3 @@ git add . bash ./boop.sh cp -fp *.exe /var/www/html/ -cp -fp 16/exmmtest/EXMMTEST.EXE /var/www/html/exmmbc.exe diff --git a/exmmbc.exe b/exmmbc.exe new file mode 100644 index 00000000..de53fdb3 Binary files /dev/null and b/exmmbc.exe differ diff --git a/16/exmmtest/EXMMTEST.PRJ b/exmmbc.prj similarity index 64% rename from 16/exmmtest/EXMMTEST.PRJ rename to exmmbc.prj index b2402dc4..7849060c 100644 Binary files a/16/exmmtest/EXMMTEST.PRJ and b/exmmbc.prj differ diff --git a/exmmtest.exe b/exmmtest.exe index 7a075278..9499bf14 100644 Binary files a/exmmtest.exe and b/exmmtest.exe differ diff --git a/makefile b/makefile index f470820e..a8d1ec1e 100644 --- a/makefile +++ b/makefile @@ -14,7 +14,7 @@ TARGET_OS = dos #-zk0 = kanji support~ #-zkl = current codepage -EXMMTESTDIR=16$(DIRSEP)exmmtest$(DIRSEP) +#EXMMTESTDIR=16$(DIRSEP)exmmtest$(DIRSEP) SRC=src$(DIRSEP) SRCLIB=$(SRC)lib$(DIRSEP) JSMNLIB=$(SRCLIB)jsmn$(DIRSEP) @@ -297,16 +297,17 @@ clean: .symbolic @wlib -n doslib.lib @$(REMOVECOMMAND) *.16 @$(REMOVECOMMAND) *.OBJ + @$(REMOVECOMMAND) *.BCO @$(REMOVECOMMAND) makefi~1 @$(REMOVECOMMAND) makefile~ @$(REMOVECOMMAND) __WCL__.LNK # @$(REMOVECOMMAND) *.smp @$(REMOVECOMMAND) *.SMP @$(REMOVECOMMAND) *.hed - @$(COPYCOMMAND) $(SRC)exmmtest.c $(EXMMTESTDIR)$(SRC) - @$(COPYCOMMAND) $(SRCLIB)16_mm.* $(EXMMTESTDIR)$(SRCLIB) - @$(COPYCOMMAND) $(SRCLIB)16_head.* $(EXMMTESTDIR)$(SRCLIB) - @$(COPYCOMMAND) $(SRCLIB)16_ca.* $(EXMMTESTDIR)$(SRCLIB) - @$(COPYCOMMAND) $(SRCLIB)16_hc.* $(EXMMTESTDIR)$(SRCLIB) - @$(COPYCOMMAND) $(SRCLIB)types.h $(EXMMTESTDIR)$(SRCLIB) - @$(COPYCOMMAND) $(NYANLIB)* $(EXMMTESTDIR)$(NYANLIB) +# @$(COPYCOMMAND) $(SRC)exmmtest.c $(EXMMTESTDIR)$(SRC) +# @$(COPYCOMMAND) $(SRCLIB)16_mm.* $(EXMMTESTDIR)$(SRCLIB) +# @$(COPYCOMMAND) $(SRCLIB)16_head.* $(EXMMTESTDIR)$(SRCLIB) +# @$(COPYCOMMAND) $(SRCLIB)16_ca.* $(EXMMTESTDIR)$(SRCLIB) +# @$(COPYCOMMAND) $(SRCLIB)16_hc.* $(EXMMTESTDIR)$(SRCLIB) +# @$(COPYCOMMAND) $(SRCLIB)types.h $(EXMMTESTDIR)$(SRCLIB) +# @$(COPYCOMMAND) $(NYANLIB)* $(EXMMTESTDIR)$(NYANLIB) diff --git a/src/lib/16_hc.c b/src/lib/16_hc.c index 00524447..d72b334d 100644 --- a/src/lib/16_hc.c +++ b/src/lib/16_hc.c @@ -24,10 +24,6 @@ */ #include "src/lib/16_hc.h" -#pragma hdrstop - -#pragma warn -pro -#pragma warn -use int heaphandle; diff --git a/src/lib/16_head.h b/src/lib/16_head.h index e6e590b4..39f16ae8 100644 --- a/src/lib/16_head.h +++ b/src/lib/16_head.h @@ -154,8 +154,12 @@ extern int profilehandle,debughandle; //make it into game global #define __DEBUG__ #define nil ((void *)0) - +#ifdef __BORLANDC__ +#define _FCORELEFT 0x90000UL-16UL +#endif #ifdef __WATCOMC__ +#define _FCORELEFT 0x90000UL+16UL + #define peekb(segm,ofs) (*(byte far*)MK_FP((segm),(ofs))) #define peekw(segm,ofs) (*(word far*)MK_FP((segm),(ofs))) #define pokeb(segm,ofs,value) (peekb((segm),(ofs)) = (byte)(value)) diff --git a/src/lib/16_mm.c b/src/lib/16_mm.c index d3ed8c23..fda606f2 100644 --- a/src/lib/16_mm.c +++ b/src/lib/16_mm.c @@ -764,13 +764,15 @@ void MM_Startup(mminfo_t *mm, mminfotype *mmi) // get all available far conventional memory segments // // printf(" farheap making!\n"); + printf("_FARCORELEFT %lu\n", _FCORELEFT); #ifdef __WATCOMC__ _fheapgrow(); - length=(dword)GetFarFreeSize();//0xffffUL*4UL; #endif #ifdef __BORLANDC__ - length=farcoreleft(); + printf(" %lu\n", farcoreleft()); + printf(" %d\n", (sword)((farcoreleft()+32)-_FCORELEFT)); #endif + length=_FCORELEFT;//_fcoreleft();//(dword)GetFarFreeSize();//0xffffUL*4UL; start = mm->farheap = _fmalloc(length); //start = mm->farheap = halloc(length, 1); length -= 16-(FP_OFF(start)&15); diff --git a/src/lib/nyan/kitten.c b/src/lib/nyan/kitten.c index 4e501dec..2e6e87ba 100644 --- a/src/lib/nyan/kitten.c +++ b/src/lib/nyan/kitten.c @@ -149,7 +149,7 @@ void dos_close(int file) /* Functions */ char * -pascal kittengets(int set_number, int message_number, char *message) +__pascal kittengets(int set_number, int message_number, char *message) { /* get message from a message _kitten_catalog */ diff --git a/src/lib/nyan/kitten.h b/src/lib/nyan/kitten.h index 2cec22fe..990eca5b 100644 --- a/src/lib/nyan/kitten.h +++ b/src/lib/nyan/kitten.h @@ -24,6 +24,8 @@ #ifndef _CATGETS_H #define _CATGETS_H +#include + #ifdef NOCATS /* #define NOCATS to disable that stuff completely */ @@ -58,7 +60,7 @@ extern "C" { #define catclose(catalog) kittenclose() - char * pascal kittengets( int set_number, int message_number,char *message); + char * __pascal kittengets( int set_number, int message_number,char *message); nl_catd kittenopen(char *name); void kittenclose (void);