page_t screen, screen2;\r
map_t map;\r
map_view_t mv, mv2;\r
- map_view_t *draw, *show, *tmp;\r
+ map_view_t *draw, *spri, *tmp;\r
byte *ptr;\r
\r
setkb(1);\r
modexShowPage(mv.page);\r
\r
/* set up paging */\r
- show = &mv;\r
- draw = &mv2;\r
+ draw = &mv;\r
+ spri = &mv2;\r
// draw = &mv;
//TODO: LOAD map data and position the map in the middle of the screen if smaller then screen
mapGoTo(draw, 0, 0);
- mapGoTo(show, 0, 0);\r
+ mapGoTo(spri, 0, 0);\r
//TODO: put player in starting position of spot\r
//default player position on the viewable map
player.ty--;
}\r
}\r
-// modexDrawBmp(draw->page, player.x, player.y, &bmp);\r
- //modexShowPage(draw->page);\r
-\r
}\r
modexLeave();\r
{
case 0:
//up
- if(ls<2) modexDrawSpriteRegion(mv->page, x-4, y-qq-TILEWH, 24, 0, 24, 32, bmp);
- if(4>ls && ls>=2) modexDrawSpriteRegion(mv->page, x-4, y-qq-TILEWH, 48, 0, 24, 32, bmp);
- if(6>ls && ls>=4) modexDrawSpriteRegion(mv->page, x-4, y-qq-TILEWH, 0, 0, 24, 32, bmp);
- if(ls>6) modexDrawSpriteRegion(mv->page, x-4, y-qq-TILEWH, 24, 0, 24, 32, bmp);
+ //if(ls==0) modexClearPlayer(mv->page, x-4, y-qq-TILEWH, 24, 32);
+ if(ls<1) { modexClearPlayer(mv->page, x-4, y-qq-TILEWH, 24, 32); modexDrawSpriteRegion(mv->page, x-4, y-qq-TILEWH, 24, 0, 24, 32, bmp); }
+ if(4>ls && ls>=1) { modexClearPlayer(mv->page, x-4, y-qq-TILEWH, 24, 32); modexDrawSpriteRegion(mv->page, x-4, y-qq-TILEWH, 48, 0, 24, 32, bmp); }
+ if(7>ls && ls>=4) { modexClearPlayer(mv->page, x-4, y-qq-TILEWH, 24, 32); modexDrawSpriteRegion(mv->page, x-4, y-qq-TILEWH, 0, 0, 24, 32, bmp); }
+ if(ls>=7) { modexClearPlayer(mv->page, x-4, y-qq-TILEWH, 24, 32); modexDrawSpriteRegion(mv->page, x-4, y-qq-TILEWH, 24, 0, 24, 32, bmp); }
break;
case 1:
// right
- //right
- if(ls<2) modexDrawSpriteRegion(mv->page, x+qq-4, y-TILEWH, 24, 32, 24, 32, bmp);
- if(4>ls && ls>=2) modexDrawSpriteRegion(mv->page, x+qq-4, y-TILEWH, 48, 32, 24, 32, bmp);
- if(6>ls && ls>=4) modexDrawSpriteRegion(mv->page, x+qq-4, y-TILEWH, 0, 32, 24, 32, bmp);
- if(ls>6) modexDrawSpriteRegion(mv->page, x+qq-4, y-TILEWH, 24, 32, 24, 32, bmp);
+ //if(ls==0) modexClearPlayer(mv->page, x+qq-4, y-TILEWH, 24, 32);
+ if(ls<1) { modexClearPlayer(mv->page, x+qq-4, y-TILEWH, 24, 32); modexDrawSpriteRegion(mv->page, x+qq-4, y-TILEWH, 24, 32, 24, 32, bmp); }
+ if(4>ls && ls>=1) { modexClearPlayer(mv->page, x+qq-4, y-TILEWH, 24, 32); modexDrawSpriteRegion(mv->page, x+qq-4, y-TILEWH, 48, 32, 24, 32, bmp); }
+ if(7>ls && ls>=4) { modexClearPlayer(mv->page, x+qq-4, y-TILEWH, 24, 32); modexDrawSpriteRegion(mv->page, x+qq-4, y-TILEWH, 0, 32, 24, 32, bmp); }
+ if(ls>=7) { modexClearPlayer(mv->page, x+qq-4, y-TILEWH, 24, 32); modexDrawSpriteRegion(mv->page, x+qq-4, y-TILEWH, 24, 32, 24, 32, bmp); }
break;
case 2:
//down
- if(ls<2) modexDrawSpriteRegion(mv->page, x-4, y+qq-TILEWH, 24, 64, 24, 32, bmp);
- if(4>ls && ls>=2) modexDrawSpriteRegion(mv->page, x-4, y+qq-TILEWH, 48, 64, 24, 32, bmp);
- if(6>ls && ls>=4) modexDrawSpriteRegion(mv->page, x-4, y+qq-TILEWH, 0, 64, 24, 32, bmp);
- if(ls>6) modexDrawSpriteRegion(mv->page, x-4, y+qq-TILEWH, 24, 64, 24, 32, bmp);
+ //if(ls==0) modexClearPlayer(mv->page, x-4, y+qq-TILEWH, 24, 32);
+ if(ls<1) { modexClearPlayer(mv->page, x-4, y+qq-TILEWH, 24, 32); modexDrawSpriteRegion(mv->page, x-4, y+qq-TILEWH, 24, 64, 24, 32, bmp); }
+ if(4>ls && ls>=1) { modexClearPlayer(mv->page, x-4, y+qq-TILEWH, 24, 32); modexDrawSpriteRegion(mv->page, x-4, y+qq-TILEWH, 48, 64, 24, 32, bmp); }
+ if(7>ls && ls>=4) { modexClearPlayer(mv->page, x-4, y+qq-TILEWH, 24, 32); modexDrawSpriteRegion(mv->page, x-4, y+qq-TILEWH, 0, 64, 24, 32, bmp); }
+ if(ls>=7) { modexClearPlayer(mv->page, x-4, y+qq-TILEWH, 24, 32); modexDrawSpriteRegion(mv->page, x-4, y+qq-TILEWH, 24, 64, 24, 32, bmp); }
break;
case 3:
//left
- if(ls<2) modexDrawSpriteRegion(mv->page, x-qq-4, y-TILEWH, 24, 96, 24, 32, bmp);
- if(4>ls && ls>=2) modexDrawSpriteRegion(mv->page, x-qq-4, y-TILEWH, 48, 96, 24, 32, bmp);
- if(6>ls && ls>=4) modexDrawSpriteRegion(mv->page, x-qq-4, y-TILEWH, 0, 96, 24, 32, bmp);
- if(ls>6) modexDrawSpriteRegion(mv->page, x-qq-4, y-TILEWH, 24, 96, 24, 32, bmp);
+ //if(ls==0) modexClearPlayer(mv->page, x-qq-4, y-TILEWH, 24, 32);
+ if(ls<1) { modexClearPlayer(mv->page, x-qq-4, y-TILEWH, 24, 32); modexDrawSpriteRegion(mv->page, x-qq-4, y-TILEWH, 24, 96, 24, 32, bmp); }
+ if(4>ls && ls>=1) { modexClearPlayer(mv->page, x-qq-4, y-TILEWH, 24, 32); modexDrawSpriteRegion(mv->page, x-qq-4, y-TILEWH, 48, 96, 24, 32, bmp); }
+ if(7>ls && ls>=4) { modexClearPlayer(mv->page, x-qq-4, y-TILEWH, 24, 32); modexDrawSpriteRegion(mv->page, x-qq-4, y-TILEWH, 0, 96, 24, 32, bmp); }
+ if(ls>=7) { modexClearPlayer(mv->page, x-qq-4, y-TILEWH, 24, 32); modexDrawSpriteRegion(mv->page, x-qq-4, y-TILEWH, 24, 96, 24, 32, bmp); }
break;
}
}
c2e.convert_special: 0
e2c.convert_num: 0
openfiles: /dos/z/16/doc/project.txt:0:0:0:
-openfiles: /dos/z/16/scroll.c:82:0:1:
+openfiles: /dos/z/16/scroll.c:12102:11962:1:
+openfiles: /dos/z/16/modex16.c:6464:6244:0:
+openfiles: /dos/z/16/modex16.h:1191:2119:0:
snr_recursion_level: 0
convertcolumn_horizontally: 0
adv_open_matchname: 0
opendir: file:///dos/z/16
wrap_text_default: 0
bookmarks_filename_mode: 1
-ssearch_text: mapScrollRight
+ssearch_text: color
snr_casesens: 1
view_blocks: 1
name: project 16
replacelist: putPixel_X
replacelist: SCREEN_WIDTH
replacelist: SCREEN_HEIGHT
+replacelist: animatePlayer(spri
+replacelist: animatePlayer(draw
+replacelist: modexClearPlayer(mv->page
fb_show_hidden_f: 0
editor_tab_width: 4
show_visible_spacing: 1
e2c.convert_iso: 0
ssearch_casesens: 0
charmap_block: 1
-recent_files: file:///dos/z/16/16/lib/x/MXPN.ASM
-recent_files: file:///dos/z/4x4_16/!/c/TUT10.C
recent_files: file:///dos/z/16/16/lib/x/MXVS.ASM
recent_files: file:///dos/z/16/16/lib/x/MAKEFILE
recent_files: file:///dos/z/16/16/lib/x/MODEX.DEF
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/doc/project.txt
recent_files: file:///dos/z/16/scroll.c
+recent_files: file:///dos/z/16/doc/project.txt
+recent_files: file:///dos/z/16/modex16.h
+recent_files: file:///dos/z/16/modex16.c
snr_replacetype: 0
-savedir: file:///dos/z/16/16/modex16
+savedir: file:///dos/z/16
spell_check_default: 1
spell_insert_entities: 0
last_filefilter:
htmlbar_view: 0
spell_lang: en
ssearch_dotmatchall: 0
-searchlist: QUADWH
-searchlist: pdump
-searchlist: #include "modex16.h"\r\n#include <stdio.h>\r\n\r\nword far* clock= (word far*) 0x046C; /* 18.2hz clock */\r\n\r\nvoid main() {\r\n#include "modex16.h"\r\n#include <stdio.h>\r\n\r\nword far* clock= (word far*) 0x046C; /* 18.2hz clock */\r\n\r\nvoid main() {\r\n
-searchlist: extern
-searchlist: VGA
-searchlist: vga
-searchlist: clock
-searchlist: setvideo
-searchlist: gq
-searchlist: SC_INDEX
-searchlist: draw
-searchlist: int index
-searchlist: map.dat
-searchlist: 32
searchlist: mapScrollRight
+searchlist: 32
+searchlist: map.dat
+searchlist: int index
+searchlist: draw
+searchlist: SC_INDEX
+searchlist: gq
+searchlist: setvideo
+searchlist: clock
+searchlist: vga
+searchlist: color 0
+searchlist: sprite
+searchlist: clear
+searchlist: modexClearRegion(mv->page
+searchlist: color
autocomplete: 1
outputb_show_all_output: 0
bookmarks_show_mode: 0
JNZ SCAN_START\r
}\r
}\r
+
+
+void\r
+modexClearPlayer(page_t *page, int x, int y, int w, int h) {\r
+ word pageOff = (word) page->data;\r
+ word xoff=x/4; /* xoffset that begins each row */\r
+ word scanCount=w/4; /* number of iterations per row (excluding right clip)*/\r
+ word poffset = pageOff + y*(page->width/4) + xoff; /* starting offset */\r
+ word nextRow = page->width/4-scanCount-1; /* loc of next row */\r
+ byte lclip[] = {0x0f, 0x0e, 0x0c, 0x08}; /* clips for rectangles not on 4s */\r
+ byte rclip[] = {0x00, 0x01, 0x03, 0x07};\r
+ byte left = lclip[x&0x03];\r
+ byte right = rclip[(x+w)&0x03];\r
+\r
+ /* handle the case which requires an extra group */\r
+ if((x & 0x03) && !((x+w) & 0x03)) {\r
+ right=0x0f;\r
+ }\r
+\r
+ __asm {\r
+ MOV AX, SCREEN_SEG ; go to the VGA memory\r
+ MOV ES, AX\r
+ MOV DI, poffset ; go to the first pixel\r
+ MOV DX, SC_INDEX ; point to the map mask\r
+ MOV AL, MAP_MASK\r
+ OUT DX, AL\r
+ INC DX\r
+ MOV AL, NULL ; get ready to write colors\r
+ SCAN_START:\r
+ MOV CX, scanCount ; count the line\r
+ MOV BL, AL ; remember color\r
+ MOV AL, left ; do the left clip\r
+ OUT DX, AL ; set the left clip\r
+ MOV AL, BL ; restore color\r
+ STOSB ; write the color\r
+ DEC CX\r
+ JZ SCAN_DONE ; handle 1 group stuff\r
\r
+ ;-- write the main body of the scanline\r
+ MOV BL, AL ; remember color\r
+ MOV AL, 0x0f ; write to all pixels\r
+ OUT DX, AL\r
+ MOV AL, BL ; restore color\r
+ REP STOSB ; write the color\r
+ SCAN_DONE:\r
+ MOV BL, AL ; remeber color\r
+ MOV AL, right\r
+ OUT DX, AL ; do the right clip\r
+ MOV AL, BL ; restore color\r
+ STOSB ; write pixel\r
+ ADD DI, nextRow ; go to the next row\r
+ DEC h\r
+ JNZ SCAN_START\r
+ }\r
+}\r
+
\r
void\r
modexDrawBmp(page_t *page, int x, int y, bitmap_t *bmp) {\r
void modexShowPage(page_t *page);\r
void modexPanPage(page_t *page, int dx, int dy);\r
void modexSelectPlane(byte plane);\r
-void modexClearRegion(page_t *page, int x, int y, int w, int h, byte color);\r
+void modexClearRegion(page_t *page, int x, int y, int w, int h, byte color);
+void modexClearPlayer(page_t *page, int x, int y, int w, int h);\r
void modexDrawBmp(page_t *page, int x, int y, bitmap_t *bmp);\r
void modexDrawBmpRegion(page_t *page, int x, int y, int rx, int ry, int rw, int rh, bitmap_t *bmp);\r
void modexDrawSprite(page_t *page, int x, int y, bitmap_t *bmp);\r
page_t screen, screen2;\r
map_t map;\r
map_view_t mv, mv2;\r
- map_view_t *draw, *show, *tmp;\r
+ map_view_t *draw, *spri, *tmp;\r
byte *ptr;\r
\r
setkb(1);\r
modexShowPage(mv.page);\r
\r
/* set up paging */\r
- show = &mv;\r
- draw = &mv2;\r
+ draw = &mv;\r
+ spri = &mv2;\r
// draw = &mv;
//TODO: LOAD map data and position the map in the middle of the screen if smaller then screen
mapGoTo(draw, 0, 0);
- mapGoTo(show, 0, 0);\r
+ mapGoTo(spri, 0, 0);\r
//TODO: put player in starting position of spot\r
//default player position on the viewable map
player.ty--;
}\r
}\r
-// modexDrawBmp(draw->page, player.x, player.y, &bmp);\r
- //modexShowPage(draw->page);\r
-\r
}\r
modexLeave();\r
{
case 0:
//up
- if(ls<2) modexDrawSpriteRegion(mv->page, x-4, y-qq-TILEWH, 24, 0, 24, 32, bmp);
- if(4>ls && ls>=2) modexDrawSpriteRegion(mv->page, x-4, y-qq-TILEWH, 48, 0, 24, 32, bmp);
- if(6>ls && ls>=4) modexDrawSpriteRegion(mv->page, x-4, y-qq-TILEWH, 0, 0, 24, 32, bmp);
- if(ls>6) modexDrawSpriteRegion(mv->page, x-4, y-qq-TILEWH, 24, 0, 24, 32, bmp);
+ //if(ls==0) modexClearPlayer(mv->page, x-4, y-qq-TILEWH, 24, 32);
+ if(ls<1) { modexClearPlayer(mv->page, x-4, y-qq-TILEWH, 24, 32); modexDrawSpriteRegion(mv->page, x-4, y-qq-TILEWH, 24, 0, 24, 32, bmp); }
+ if(4>ls && ls>=1) { modexClearPlayer(mv->page, x-4, y-qq-TILEWH, 24, 32); modexDrawSpriteRegion(mv->page, x-4, y-qq-TILEWH, 48, 0, 24, 32, bmp); }
+ if(7>ls && ls>=4) { modexClearPlayer(mv->page, x-4, y-qq-TILEWH, 24, 32); modexDrawSpriteRegion(mv->page, x-4, y-qq-TILEWH, 0, 0, 24, 32, bmp); }
+ if(ls>=7) { modexClearPlayer(mv->page, x-4, y-qq-TILEWH, 24, 32); modexDrawSpriteRegion(mv->page, x-4, y-qq-TILEWH, 24, 0, 24, 32, bmp); }
break;
case 1:
// right
- //right
- if(ls<2) modexDrawSpriteRegion(mv->page, x+qq-4, y-TILEWH, 24, 32, 24, 32, bmp);
- if(4>ls && ls>=2) modexDrawSpriteRegion(mv->page, x+qq-4, y-TILEWH, 48, 32, 24, 32, bmp);
- if(6>ls && ls>=4) modexDrawSpriteRegion(mv->page, x+qq-4, y-TILEWH, 0, 32, 24, 32, bmp);
- if(ls>6) modexDrawSpriteRegion(mv->page, x+qq-4, y-TILEWH, 24, 32, 24, 32, bmp);
+ //if(ls==0) modexClearPlayer(mv->page, x+qq-4, y-TILEWH, 24, 32);
+ if(ls<1) { modexClearPlayer(mv->page, x+qq-4, y-TILEWH, 24, 32); modexDrawSpriteRegion(mv->page, x+qq-4, y-TILEWH, 24, 32, 24, 32, bmp); }
+ if(4>ls && ls>=1) { modexClearPlayer(mv->page, x+qq-4, y-TILEWH, 24, 32); modexDrawSpriteRegion(mv->page, x+qq-4, y-TILEWH, 48, 32, 24, 32, bmp); }
+ if(7>ls && ls>=4) { modexClearPlayer(mv->page, x+qq-4, y-TILEWH, 24, 32); modexDrawSpriteRegion(mv->page, x+qq-4, y-TILEWH, 0, 32, 24, 32, bmp); }
+ if(ls>=7) { modexClearPlayer(mv->page, x+qq-4, y-TILEWH, 24, 32); modexDrawSpriteRegion(mv->page, x+qq-4, y-TILEWH, 24, 32, 24, 32, bmp); }
break;
case 2:
//down
- if(ls<2) modexDrawSpriteRegion(mv->page, x-4, y+qq-TILEWH, 24, 64, 24, 32, bmp);
- if(4>ls && ls>=2) modexDrawSpriteRegion(mv->page, x-4, y+qq-TILEWH, 48, 64, 24, 32, bmp);
- if(6>ls && ls>=4) modexDrawSpriteRegion(mv->page, x-4, y+qq-TILEWH, 0, 64, 24, 32, bmp);
- if(ls>6) modexDrawSpriteRegion(mv->page, x-4, y+qq-TILEWH, 24, 64, 24, 32, bmp);
+ //if(ls==0) modexClearPlayer(mv->page, x-4, y+qq-TILEWH, 24, 32);
+ if(ls<1) { modexClearPlayer(mv->page, x-4, y+qq-TILEWH, 24, 32); modexDrawSpriteRegion(mv->page, x-4, y+qq-TILEWH, 24, 64, 24, 32, bmp); }
+ if(4>ls && ls>=1) { modexClearPlayer(mv->page, x-4, y+qq-TILEWH, 24, 32); modexDrawSpriteRegion(mv->page, x-4, y+qq-TILEWH, 48, 64, 24, 32, bmp); }
+ if(7>ls && ls>=4) { modexClearPlayer(mv->page, x-4, y+qq-TILEWH, 24, 32); modexDrawSpriteRegion(mv->page, x-4, y+qq-TILEWH, 0, 64, 24, 32, bmp); }
+ if(ls>=7) { modexClearPlayer(mv->page, x-4, y+qq-TILEWH, 24, 32); modexDrawSpriteRegion(mv->page, x-4, y+qq-TILEWH, 24, 64, 24, 32, bmp); }
break;
case 3:
//left
- if(ls<2) modexDrawSpriteRegion(mv->page, x-qq-4, y-TILEWH, 24, 96, 24, 32, bmp);
- if(4>ls && ls>=2) modexDrawSpriteRegion(mv->page, x-qq-4, y-TILEWH, 48, 96, 24, 32, bmp);
- if(6>ls && ls>=4) modexDrawSpriteRegion(mv->page, x-qq-4, y-TILEWH, 0, 96, 24, 32, bmp);
- if(ls>6) modexDrawSpriteRegion(mv->page, x-qq-4, y-TILEWH, 24, 96, 24, 32, bmp);
+ //if(ls==0) modexClearPlayer(mv->page, x-qq-4, y-TILEWH, 24, 32);
+ if(ls<1) { modexClearPlayer(mv->page, x-qq-4, y-TILEWH, 24, 32); modexDrawSpriteRegion(mv->page, x-qq-4, y-TILEWH, 24, 96, 24, 32, bmp); }
+ if(4>ls && ls>=1) { modexClearPlayer(mv->page, x-qq-4, y-TILEWH, 24, 32); modexDrawSpriteRegion(mv->page, x-qq-4, y-TILEWH, 48, 96, 24, 32, bmp); }
+ if(7>ls && ls>=4) { modexClearPlayer(mv->page, x-qq-4, y-TILEWH, 24, 32); modexDrawSpriteRegion(mv->page, x-qq-4, y-TILEWH, 0, 96, 24, 32, bmp); }
+ if(ls>=7) { modexClearPlayer(mv->page, x-qq-4, y-TILEWH, 24, 32); modexDrawSpriteRegion(mv->page, x-qq-4, y-TILEWH, 24, 96, 24, 32, bmp); }
break;
}
}