c2e.convert_special: 0
e2c.convert_num: 0
openfiles: /dos/z/16/doc/project.txt:60:0:0:
-openfiles: /dos/z/16/scroll.c:3046:2949:1:
+openfiles: /dos/z/16/scroll.c:10823:10140:1:
openfiles: /dos/z/16/modex16.c:6838:6141:0:
openfiles: /dos/z/16/modex16.h:1057:344:0:
openfiles: /dos/z/16/pcxtest.c:753:655:0:
-openfiles: /dos/z/16/dos_kb.c:3759:2440:0:
+openfiles: /dos/z/16/dos_kb.c:3759:0:0:
openfiles: /dos/z/16/dos_kb.h:464:0:0:
-openfiles: /dos/z/16/lib/lib_head.h:1738:1347:0:
+openfiles: /dos/z/16/lib/lib_head.h:2536:0:0:
openfiles: /dos/z/16/makefile:181:0:0:
openfiles: /dos/z/keen-src/id_mm.c:1835:14248:0:
openfiles: /dos/z/keen-src/id_mm.h:0:1024:0:
snr_casesens: 1
view_blocks: 1
name: project 16
+replacelist: wPage(spri
replacelist: 34);
replacelist: bg
replacelist: dest
replacelist: player.tx == player.ty
replacelist: TRIGGY
replacelist: TRIGGX
-replacelist: play->
fb_show_hidden_f: 0
editor_tab_width: 4
show_visible_spacing: 1
recent_files: file:///dos/z/16/16/modex16/dos_kb.h
recent_files: file:///dos/z/16/doc/16.16
recent_files: file:///dos/z/16/doc/16story.txt
+recent_files: file:///dos/z/16/README
recent_files: file:///dos/z/16/scroll.c
recent_files: file:///dos/z/16/doc/project.txt
-recent_files: file:///dos/z/16/lib/lib_head.h
recent_files: file:///dos/z/16/dos_kb.h
recent_files: file:///dos/z/16/dos_kb.c
-recent_files: file:///dos/z/16/modex16.h
-recent_files: file:///dos/z/16/pcxtest.c
-recent_files: file:///dos/z/16/README
+recent_files: file:///dos/z/16/lib/lib_head.h
recent_files: file:///dos/z/16/modex16.c
-recent_files: file:///dos/z/16/makefile
+recent_files: file:///dos/z/16/modex16.h
+recent_files: file:///dos/z/keen-src/id_rf.h
recent_files: file:///dos/z/16/types.h
recent_files: file:///dos/z/keen-src/id_mm.h
-recent_files: file:///dos/z/keen-src/id_mm.c
+recent_files: file:///dos/z/16/makefile
+recent_files: file:///dos/z/16/pcxtest.c
recent_files: file:///dos/z/keen-src/id_rf_a.asm
+recent_files: file:///dos/z/keen-src/id_mm.c
recent_files: file:///dos/z/keen-src/id_rf.c
-recent_files: file:///dos/z/keen-src/id_rf.h
snr_replacetype: 0
savedir: file:///dos/z/16
spell_check_default: 1
htmlbar_view: 0
spell_lang: en
ssearch_dotmatchall: 0
+searchlist: return
searchlist: enter
searchlist: bg->tx == bg->ty
searchlist: data
searchlist: MAPX/2
searchlist: mapDrawTile
searchlist: dxThresh
-searchlist: player.
autocomplete: 1
outputb_show_all_output: 0
bookmarks_show_mode: 0
--- /dev/null
+CFLAGS=-0
+
+all: wtest.exe
+
+wtest.exe: wtest.obj
+ wcl $(CFLAGS) $<
+
+wtest.obj: wtest.c
+ wcl $(CFLAGS) -c $<
+
+.NOCHECK
+clean:
+ del *.exe
+ del *.obj
--- /dev/null
+/* tab size = 8 */
+
+#include "lib\wtest\wtest.h"
+
+static unsigned char detectcpu()
+{
+ unsigned char cputype;
+ __asm
+ {
+ PUSHF ; we gonna modify flags, so back them up
+ ; first check if its 8086/8088 or 80186/80188
+ PUSHF ; FLAGS -> STACK
+ POP AX ; STACK -> AX
+ AND AX, 00FFFh ; clear 12-15 bits (they are always 1 on 8086/8088 and 80186/80188)
+ PUSH AX ; AX -> STACK
+ POPF ; STACK -> FLAGS
+ ; this is where magic happen
+ PUSHF ; FLAGS -> STACK
+ POP AX ; STACK -> AX
+ AND AX, 0F000h ; 0-11 bits aren't important to us
+ CMP AX, 0F000h ; check if all 12-15 bits are set (simple comparision)
+ JNE _286p ; if no, 286+ CPU
+ MOV cputype, 0 ; if yes, we are done, set cputype to 0 and end this
+ JMP _done
+ _286p:
+ ; now check if its 286 or newer
+ PUSHF ; FLAGS -> STACK
+ POP AX ; STACK -> AX
+ OR AX, 07000h ; set 12-14 bits (they are always cleared by 286 if its real mode)
+ PUSH AX ; AX -> STACK
+ POPF ; STACK -> FLAGS
+ ; this is where magic happen
+ PUSHF ; FLAGS -> STACK
+ POP AX ; STACK -> AX
+ TEST AX, 07000h ; check if at least 1 bit in 12-14 bits range is set (15th won't be set anyway)
+ JNZ _386p ; not all bits clear, its 386+
+ MOV cputype, 1 ; all bits clear, its 286, we are done
+ JMP _done
+ _386p:
+ MOV cputype, 2 ; its 386 or newer, but we don't care if its newer at this point
+ _done:
+ POPF ; restore flags we backed up earlier
+ }
+ return cputype;
+}
+
+/*int main(int argc, char **argv)
+{
+ const char *cpus;
+ unsigned char cput;
+
+ cput = detectcpu();
+ switch(cput)
+ {
+ case 0: cpus = "8086/8088 or 186/88"; break;
+ case 1: cpus = "286"; break;
+ case 2: cpus = "386 or newer"; break;
+ default: cpus = "internal error"; break;
+ }
+ printf("detected CPU type: %s\n", cpus);
+ return 0;
+}*/
+
--- /dev/null
+#ifndef _WTEST_H_
+#define _WTEST_H_
+#include <stdio.h>
+
+static unsigned char detectcpu(void);
+
+#endif/*_WTEST_H_*/
#include <stdio.h>
#include <stdlib.h>
#include "dos_kb.h"
+#include "lib\wtest\wtest.c"
//word far *clock= (word far*) 0x046C; /* 18.2hz clock */
void main() {
bitmap_t ptmp; // player sprite
word q=1;
+ const char *cpus;
static int persist_aniframe = 0; /* gonna be increased to 1 before being used, so 0 is ok for default */
page_t screen, screen2, screen3;
map_t map;
printf("player.triggy: %d\n", player.triggery);
printf("dxThresh: %d\n", bg->dxThresh);
printf("dyThresh: %d\n", bg->dyThresh);
- printf("temporary player sprite http://www.pixiv.net/member_illust.php?mode=medium&illust_id=45556867");
+ printf("temporary player sprite http://www.pixiv.net/member_illust.php?mode=medium&illust_id=45556867\n");
+ switch(detectcpu())
+ {
+ case 0: cpus = "8086/8088 or 186/88"; break;
+ case 1: cpus = "286"; break;
+ case 2: cpus = "386 or newer"; break;
+ default: cpus = "internal error"; break;
+ }
+ printf("detected CPU type: %s\n", cpus);
}
//modexClearRegion(top->page, 66, 66, 2, 40, 0);
//modexCopyPageRegion(dest->page, top->page, 66, 66, 66, 66, 2, 40);
//turn this off if XT
- modexWaitBorder();
+ if(detectcpu() > 0) modexWaitBorder();
}