Commit 9520fb90 authored by Steven Fuller's avatar Steven Fuller

A bit more progress

parent 2419d4f9
...@@ -2,3 +2,5 @@ ...@@ -2,3 +2,5 @@
id_ca.c has code for setting the extension to load files id_ca.c has code for setting the extension to load files
so does wl_menu.c so does wl_menu.c
* would it not make sense to remove bufferseg from id_ca.c? * would it not make sense to remove bufferseg from id_ca.c?
* menu code is a mess, always does things differently than the rest of the
code, it really needs to be cleaned up
; ID_VL.ASM
IDEAL
MODEL MEDIUM,C
INCLUDE 'ID_VL.EQU'
SCREENSEG = 0a000h
UPDATEWIDE = 20
UPDATEHIGH = 13
DATASEG
EXTRN bufferofs :WORD
EXTRN displayofs :WORD
EXTRN ylookup :WORD
EXTRN linewidth :WORD
EXTRN blockstarts :WORD ;offsets from drawofs for each update block
EXTRN update :BYTE
CODESEG
;=================
;
; VH_UpdateScreen
;
;=================
PROC VH_UpdateScreen
PUBLIC VH_UpdateScreen
USES si,di
mov dx,SC_INDEX
mov ax,SC_MAPMASK+15*256
out dx,ax
mov dx,GC_INDEX
mov al,GC_MODE
out dx,al
inc dx
in al,dx
and al,252
or al,1
out dx,al
mov bx,UPDATEWIDE*UPDATEHIGH-1 ; bx is the tile number
mov dx,[linewidth]
;
; see if the tile needs to be copied
;
@@checktile:
test [update+bx],1
jnz @@copytile
@@next:
dec bx
jns @@checktile
;
; done
;
mov dx,GC_INDEX+1
in al,dx
and al,NOT 3
or al,0
out dx,al
ret
;
; copy a tile
;
@@copytile:
mov [update+bx],0
shl bx,1
mov si,[blockstarts+bx]
shr bx,1
mov di,si
add si,[bufferofs]
add di,[displayofs]
mov ax,SCREENSEG
mov ds,ax
REPT 16
mov al,[si]
mov [di],al
mov al,[si+1]
mov [di+1],al
mov al,[si+2]
mov [di+2],al
mov al,[si+3]
mov [di+3],al
add si,dx
add di,dx
ENDM
mov ax,ss
mov ds,ax
jmp @@next
ENDP
END
...@@ -18,15 +18,21 @@ long filelength(int handle) ...@@ -18,15 +18,21 @@ long filelength(int handle)
return buf.st_size; return buf.st_size;
} }
char *ltoa(long value, char *string, int radix) char *itoa(short int value, char *string, int radix)
{ {
/* wolf3d only uses radix 10 */
sprintf(string, "%d", value); sprintf(string, "%d", value);
return string; return string;
} }
char *ltoa(long value, char *string, int radix)
{
sprintf(string, "%ld", value);
return string;
}
char *ultoa(unsigned long value, char *string, int radix) char *ultoa(unsigned long value, char *string, int radix)
{ {
sprintf(string, "%u", value); sprintf(string, "%lu", value);
return string; return string;
} }
\ No newline at end of file
...@@ -6,6 +6,7 @@ extern char **_argv; ...@@ -6,6 +6,7 @@ extern char **_argv;
long filelength(int handle); long filelength(int handle);
char *itoa(short int value, char *string, int radix);
char *ltoa(long value, char *string, int radix); char *ltoa(long value, char *string, int radix);
char *ultoa(unsigned long value, char *string, int radix); char *ultoa(unsigned long value, char *string, int radix);
......
This diff is collapsed.
// WL_INTER.C /* wl_inter.c */
#include "WL_DEF.H"
#pragma hdrstop
#include "wl_def.h"
//========================================================================== //==========================================================================
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment