From: sparky4 Date: Mon, 19 May 2014 12:05:13 +0000 (-0500) Subject: modified: 16/Project 16.bfproject X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=0dde01d5cf8929d8f9faadef139c2e0f77b307ba;p=16.git modified: 16/Project 16.bfproject modified: 16/dos_gfx.cpp modified: 16/dos_gfx.h modified: 16/lib/lib_com.h --- diff --git a/16/Project 16.bfproject b/16/Project 16.bfproject index 8e850a59..33f3135b 100644 --- a/16/Project 16.bfproject +++ b/16/Project 16.bfproject @@ -1,17 +1,17 @@ c2e.convert_special: 0 e2c.convert_num: 0 -openfiles: /dos/z/16/16/dos_gfx.cpp:19214:18374:1: -openfiles: /dos/z/16/16/dos_gfx.h:380:0:0: -openfiles: /dos/z/16/16/dos_kb.c:658:109:0: +openfiles: /dos/z/16/16/dos_gfx.cpp:10793:10158:1: +openfiles: /dos/z/16/16/dos_gfx.h:537:0:0: +openfiles: /dos/z/16/16/dos_kb.c:953:406:0: openfiles: /dos/z/16/16/dos_kb.h:60:0:0: openfiles: /dos/z/16/16/lib/lib_com.cpp:0:0:0: -openfiles: /dos/z/16/16/lib/lib_com.h:0:0:0: +openfiles: /dos/z/16/16/lib/lib_com.h:2523:1479:0: openfiles: /dos/z/16/16/scroll.txt:5307:5103:0: openfiles: /dos/z/16/16/project16.txt:1675:0:0: openfiles: /dos/z/16/16/16.txt:0:0:0: openfiles: /dos/z/16/16/lib/x/MXSM.ASM:12781:12781:0: openfiles: /dos/z/16/16/lib/x/MODEX.H:1768:1601:0: -openfiles: /dos/z/16/16/lib/x/MXPN.ASM:1205:649:0: +openfiles: /dos/z/16/16/lib/x/MXPN.ASM:1205:434:0: snr_recursion_level: 0 convertcolumn_horizontally: 0 adv_open_matchname: 0 @@ -26,7 +26,7 @@ c2e.convert_iso: 0 opendir: file:///dos/z/16/16/lib/x wrap_text_default: 0 bookmarks_filename_mode: 1 -ssearch_text: 3DA +ssearch_text: rand snr_casesens: 0 view_blocks: 1 name: project 16 @@ -63,16 +63,16 @@ recent_files: file:///dos/z/16/16/lib_com.h recent_files: file:///dos/z/16/16/PCGPE10/SCROLL.TXT recent_files: file:///dos/z/16/16/dos_gfx.cpp recent_files: file:///dos/z/16/16/dos_gfx.h -recent_files: file:///dos/z/16/16/dos_kb.h recent_files: file:///dos/z/16/16/dos_kb.c +recent_files: file:///dos/z/16/16/dos_kb.h recent_files: file:///dos/z/16/16/lib/lib_com.cpp recent_files: file:///dos/z/16/16/lib/lib_com.h -recent_files: file:///dos/z/16/16/project16.txt -recent_files: file:///dos/z/16/16/16.txt recent_files: file:///dos/z/16/16/scroll.txt +recent_files: file:///dos/z/16/16/lib/x/MXPN.ASM +recent_files: file:///dos/z/16/16/project16.txt recent_files: file:///dos/z/16/16/lib/x/MODEX.H +recent_files: file:///dos/z/16/16/16.txt recent_files: file:///dos/z/16/16/lib/x/MXSM.ASM -recent_files: file:///dos/z/16/16/lib/x/MXPN.ASM snr_replacetype: 0 savedir: file:///dos/z/16/16 spell_check_default: 1 @@ -84,13 +84,6 @@ snr_escape_chars: 0 htmlbar_view: 0 spell_lang: en ssearch_dotmatchall: 0 -searchlist: fill_plane( -searchlist: fmemset -searchlist: se -searchlist: -searchlist: rect -searchlist: fmem -searchlist: vga searchlist: 386 searchlist: CRTC_INDEX searchlist: setVisiblePage @@ -99,6 +92,13 @@ searchlist: lib/x/MXPN.ASM searchlist: 3c0 searchlist: ABS searchlist: 3DAH +searchlist: _DX +searchlist: unsigned +searchlist: word +searchlist: unsigned +searchlist: word +searchlist: play +searchlist: rand autocomplete: 1 outputb_show_all_output: 0 bookmarks_show_mode: 0 diff --git a/16/dos_gfx.cpp b/16/dos_gfx.cpp index 79de22fa..2f2607ba 100644 --- a/16/dos_gfx.cpp +++ b/16/dos_gfx.cpp @@ -287,7 +287,98 @@ void set320x240x256_X(void) } -/*-----------XXXX-------------*/ +/*-----------XXXX-------------*/ + +///////////////////////////////////////////////////////////////////////////// +// // +// WaitRetrace() - This waits until you are in a Verticle Retrace. // +// // +///////////////////////////////////////////////////////////////////////////// + +void WaitRetrace() { + +// register char qy; + + in.h.dx = 0x03DA; + in.h.al = in.h.dx; + + in.h.al &= 0x08; + int86(0x10, &in, &out); + + + /*l1: asm { + in al,0x03DA; + and al,0x08; + jnz l2; + }*/ +} + +///////////////////////////////////////////////////////////////////////////// +// // +// MoveTo() - This moves to position X*4 on a chain 4 screen. // +// Note: As soon as I find documentation, this function // +// will be better documented. - Snowman // +// // +///////////////////////////////////////////////////////////////////////////// + +void MoveTo (word X, word Y) { + +// word O = Y*SIZE*2+X; + word O = Y*widthBytes*2+X; + + asm { + mov bx, [O] + mov ah, bh + mov al, 0x0C + + mov dx, 0x3D4 + out dx, ax + + mov ah, bl + mov al, 0x0D + mov dx, 0x3D4 + out dx, ax + } +} + +//Procedure Play; +void Play() +{ + int loop1,loop2; + int xpos,ypos,xdir,ydir; + //int ch; +// for(loop1=1;loop1<=62;loop1++) + //Pal ((char)loop1,(char)loop1,(char)0,(char)(62-loop1)); // { This sets up the pallette for the pic } + + moveto(0,0,Size); // { This moves the view to the top left hand corner } + +/* for(loop1=0;loop1<=3;loop1++) + for(loop2=0;loop2<=5;loop2++) + Putpic (loop1*160,loop2*66); // { This places the picture all over the + // chain-4 screen } + getch(); + ch=0x0;*/ +// xpos=rand (78)+1; +// ypos=rand (198)+1; // { Random start positions for the view } + xpos=0; + ypos=0; + xdir=1; + ydir=1; +// while(1) +// { + WaitRetrace(); // { Take this out and watch the screen go crazy! } + moveto (xpos,ypos,Size); + xpos=xpos+xdir; + ypos=ypos+ydir; + if( (xpos>79) || (xpos<1))xdir=-xdir; + if( (ypos>199) || (ypos<1))ydir=-ydir; // { Hit a boundry, change + // direction! } +// if(_bios_keybrd(_KEYBRD_READY))ch=getch(); +// if(ch==0x71)break; // 'q' +// if(ch==0x1b)break; // 'ESC' +// } +} + /*tile*/ //king_crimson's code void putColorBox_X(int x, int y, int w, int h, byte color) { @@ -823,9 +914,10 @@ int main(void) getch(); while(!kbhit()){ // conditions of screen saver - hScroll(1); - scrolly(1); - delay(100); +// hScroll(1); +// scrolly(1); +// delay(100); + Play(); } //++++0000 setvideo(0); diff --git a/16/dos_gfx.h b/16/dos_gfx.h index 43415ab9..02f72c34 100644 --- a/16/dos_gfx.h +++ b/16/dos_gfx.h @@ -11,8 +11,9 @@ #define LGQ 32 #define HGQ 56 #define TILEWH 16 -#define ABS(a) ((a < 0) ? -a : a) -#define SGN(a) ((a < 0) ? -1 : 1) +byte SIZE = 80; // Size = 40 = 1 across, 4 down + // Size = 80 = 2 across, 2 down + // Size = 160 = 4 across, 1 down //#define VMEM 0xA000 // = vga //int width = 320; //int height = 240; diff --git a/16/lib/lib_com.h b/16/lib/lib_com.h index d43b7172..232d4270 100644 --- a/16/lib/lib_com.h +++ b/16/lib/lib_com.h @@ -96,7 +96,8 @@ #define KEY_MENU (0x75) -typedef unsigned char byte; +typedef unsigned char byte; +typedef unsigned int word; void wait(clock_t wait);