From: sparky4 Date: Sat, 13 Feb 2016 17:28:17 +0000 (-0600) Subject: wwwwwwwwww X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=6334d91faf284bd06a8f1408281f784bd291c4f6;p=plz.git wwwwwwwwww --- diff --git a/16.map b/16.map new file mode 100755 index 0000000..43450b1 --- /dev/null +++ b/16.map @@ -0,0 +1,223 @@ +Open Watcom Linker Version 2.0 beta Jan 20 2016 10:21:07 (32-bit) +Copyright (c) 2002-2016 The Open Watcom Contributors. All Rights Reserved. +Portions Copyright (c) 1985-2002 Sybase, Inc. All Rights Reserved. +Created on: 16/02/13 11:25:37 +Executable Image: plzpart.exe +creating a DOS executable +Error! E2028: init_copper_ is an undefined reference +Error! E2028: close_copper_ is an undefined reference +Error! E2028: _m1 is an undefined reference +Error! E2028: _m2 is an undefined reference +Error! E2028: _m3 is an undefined reference +Error! E2028: _m4 is an undefined reference +Error! E2028: _n1 is an undefined reference +Error! E2028: _n2 is an undefined reference +Error! E2028: _n3 is an undefined reference +Error! E2028: _n4 is an undefined reference +Error! E2028: setplzparas_ is an undefined reference +Error! E2028: plzline_ is an undefined reference +Error! E2028: tw_opengraph2_ is an undefined reference +Error! E2028: set_plzstart_ is an undefined reference +Error! E2028: tw_setrgbpalette_ is an undefined reference + + + +------------+ + | Groups | + +------------+ + +Group Address Size +===== ======= ==== + +DGROUP 0ed5:0000 0000a650 + + + + +--------------+ + | Segments | + +--------------+ + +Segment Class Group Address Size +======= ===== ===== ======= ==== + +plzpart_TEXT CODE AUTO 0000:0000 00000020 +copper_TEXT CODE AUTO 0000:0020 00000997 +ASMYT_TEXT CODE AUTO 0000:09b8 00000000 +PORO CODE AUTO 009c:0000 0000d4ac +plz_TEXT CODE AUTO 009c:d4b0 00000a0a +_TEXT CODE AUTO 009c:deba 000004c8 +FAR_DATA FAR_DATA AUTO 0ed4:0002 00000000 +_NULL BEGDATA DGROUP 0ed5:0000 00000020 +_AFTERNULL BEGDATA DGROUP 0ed7:0000 00000002 +CONST DATA DGROUP 0ed7:0002 00000000 +CONST2 DATA DGROUP 0ed7:0002 00000000 +_DATA DATA DGROUP 0ed7:0002 00000218 +XIB DATA DGROUP 0ef8:000a 00000000 +XI DATA DGROUP 0ef8:000a 00000006 +XIE DATA DGROUP 0ef9:0000 00000000 +YIB DATA DGROUP 0ef9:0000 00000000 +YI DATA DGROUP 0ef9:0000 00000000 +YIE DATA DGROUP 0ef9:0000 00000000 +STRINGS DATA DGROUP 0ef9:0000 00000000 +DATA DATA DGROUP 0ef9:0000 00000000 +_BSS BSS DGROUP 0ef9:0000 00002406 +STACK STACK DGROUP 113a:0000 00008000 + + + +----------------+ + | Memory Map | + +----------------+ + +* = unreferenced symbol ++ = symbol only referenced locally + +Address Symbol +======= ====== + +Module: plzpart.o(/dos/z/plz/plzpart.c) +0000:0000 main_ +Module: copper.o(/dos/z/plz/copper.asm) +0000:0020 _frame_count +0000:0022 _cop_drop +0000:0024* _cop_pal +0000:0028* _do_pal +0000:002a _cop_start +0000:002c* _cop_scrl +0000:002e* _cop_plz +0000:0030* _close_copper +0000:005b* _init_copper +0000:00fb* _pompota +0000:0129* _moveplz +0000:0203 _fadepal +0000:0803 _cop_fadepal +Module: asmyt.o(ASMYT.ASM) +009c:c000* _plzline +009c:c618* _setplzparas +009c:0000* _psini +009c:4000* _lsini4 +009c:8000* _lsini16 +009c:d48e* _set_plzstart +Module: plz.o(/dos/z/plz/plz.c) +009c:d4b0 plz_ +009c:d74c+ init_plz_ +0ed5:0022+ _ptau +0ed5:0122+ _curpal +0ed5:0124* _timetable +0ed5:0138+ _ttptr +0ed5:013a _l1 +0ed5:013c _l2 +0ed5:013e _l3 +0ed5:0140 _l4 +0ed5:0142 _k1 +0ed5:0144 _k2 +0ed5:0146 _k3 +0ed5:0148 _k4 +0ed5:014a _il1 +0ed5:014c _il2 +0ed5:014e _il3 +0ed5:0150 _il4 +0ed5:0152 _ik1 +0ed5:0154 _ik2 +0ed5:0156 _ik3 +0ed5:0158 _ik4 +0ed5:015a+ _inittable +0ed5:0240+ _pals +Module: /dos/fdos/watcom2/lib286/dos/clibh.lib(stk086.asm) +009c:debf __STK +009c:dedf* __STKOVERFLOW_ +Module: /dos/fdos/watcom2/lib286/dos/clibh.lib(cstart) +0ed5:0000* __nullarea +0ed5:01fc* __ovlflag +0ed5:01fd* __intno +0ed5:01fe* __ovlvec +009c:defc _cstart_ +009c:dfcf* _Not_Enough_Memory_ +009c:e101 __exit_ +009c:e120 __do_exit_with_msg__ +009c:e17d __GETDS +Module: /dos/fdos/watcom2/lib286/dos/clibh.lib(cmodel.asm) +009c:e188 _big_code_ +009c:e188* CodeModelMismatch +Module: /dos/fdos/watcom2/lib286/dos/clibh.lib(i4m.asm) +009c:e188 __I4M +009c:e188* __U4M +Module: /dos/fdos/watcom2/lib286/dos/clibh.lib(pia.asm) +009c:e1a7 __PIA +009c:e1a0* __PIS +Module: /dos/fdos/watcom2/lib286/dos/clibh.lib(kbhit.c) +009c:e1be kbhit_ +Module: /dos/fdos/watcom2/lib286/dos/clibh.lib(xmsg.c) +009c:e1d5* __exit_with_msg_ +009c:e1da __fatal_runtime_error_ +Module: /dos/fdos/watcom2/lib286/dos/clibh.lib(crwdata) +0ed5:0202 __curbrk +0ed5:020a __STACKLOW +0ed5:020c __STACKTOP +0ed5:020e __cbyte +0ed5:0210 __child +0ed5:0212 __no87 +0ed5:021f ___FPE_handler +0ed5:0204 __psp +0ed5:0213 __get_ovl_stack +0ed5:0217 __restore_ovl_stack +0ed5:021b __close_ovl_file +0ed5:0223 __LpCmdLine +0ed5:0227 __LpPgmName +0ed5:0206 __osmajor +0ed5:0207 __osminor +0ed5:0208 __osmode +0ed5:0209 __HShift +Module: /dos/fdos/watcom2/lib286/dos/clibh.lib(cmain086.c) +009c:e1f8 __CMain +Module: /dos/fdos/watcom2/lib286/dos/clibh.lib(initrtns.c) +009c:e25e __InitRtns +009c:e25e* __FInitRtns +009c:e2b9 __FiniRtns +009c:e2b9* __FFiniRtns +Module: /dos/fdos/watcom2/lib286/dos/clibh.lib(uselfn.c) +0ed5:022c ___uselfn +Module: /dos/fdos/watcom2/lib286/dos/clibh.lib(dosseg) +009c:e31e __DOSseg__ +Module: /dos/fdos/watcom2/lib286/dos/clibh.lib(enterdb.c) +009c:e31f __EnterWVIDEO_ +0ed5:022e+ ___WD_Present +Module: /dos/fdos/watcom2/lib286/dos/clibh.lib(___argc.c) +0ed5:2640 ____Argv +0ed5:2644 ____Argc +Module: /dos/fdos/watcom2/lib286/dos/clibh.lib(amblksiz.c) +0ed5:0230 __amblksiz +Module: /dos/fdos/watcom2/lib286/dos/clibh.lib(exit.c) +009c:e343+ _null_exit_rtn_ +009c:e343+ __null_int23_exit_ +009c:e344 exit_ +009c:e365+ _exit_ +0ed5:0232+ ___int23_exit +0ed5:0236+ ___FPE_handler_exit +Module: /dos/fdos/watcom2/lib286/dos/clibh.lib(sgdef086) +0ed5:023a __Start_XI +0ed5:0240 __End_XI +0ed5:0240 __Start_YI +0ed5:0240 __End_YI + + + +---------------------------+ + | Unresolved References | + +---------------------------+ + +Undefined Symbol Referenced by +================ ============= + +init_copper_ plzpart.o(/dos/z/plz/plzpart.c) +close_copper_ plzpart.o(/dos/z/plz/plzpart.c) +setplzparas_ plz.o(/dos/z/plz/plz.c) +plzline_ plz.o(/dos/z/plz/plz.c) +tw_opengraph2_ plz.o(/dos/z/plz/plz.c) +set_plzstart_ plz.o(/dos/z/plz/plz.c) +init_copper_ plz.o(/dos/z/plz/plz.c) +tw_setrgbpalette_ plz.o(/dos/z/plz/plz.c) + + + +--------------------+ + | Libraries Used | + +--------------------+ + +/dos/fdos/watcom2/lib286/dos/clibh.lib diff --git a/asmyt.asm b/asmyt.asm new file mode 100755 index 0000000..f1244b0 --- /dev/null +++ b/asmyt.asm @@ -0,0 +1,118 @@ + IDEAL + MODEL huge + +EXTRN C l1:word, C l2:word, C l3:word, C l4:word, C k1:word, C k2:word, C k3:word, C k4:word +EXTRN C m1:word, C m2:word, C m3:word, C m4:word, C n1:word, C n2:word, C n3:word, C n4:word + +SEGMENT poro para private 'CODE' + +ASSUME cs:poro + +PUBLIC C plzline, C setplzparas, C psini, C lsini4, C lsini16 + +LABEL psini BYTE +INCLUDE 'psini.inc' +; db 16384 dup(?) + +LABEL lsini4 WORD +INCLUDE 'lsini4.inc' +; db 16384 dup(?) + +LABEL lsini16 WORD +INCLUDE 'lsini16.inc' +; db 16384 dup(?) + +PROC C plzline + + ARG y1:word, vseg:word + + push ds es si di + + push [vseg] + pop es + push cs + pop ds + mov si, [y1] +; and si, 0fffeh + shl si, 1d + mov di, si + + IRP ccc, <3,2,1,0,7,6,5,4,11,10,9,8,15,14,13,12,19,18,17,16,23,22,21,20,27,26,25,24,31,30,29,28,35,34,33,32,39,38,37,36,43,42,41,40,47,46,45,44,51,50,49,48,55,54,53,52,59,58,57,56,63,62,61,60,67,66,65,64,71,70,69,68,75,74,73,72,79,78,77,76,83,82,81,80> + +IF (ccc AND 1) EQ 1 + +lc2_&ccc=$+2 + mov bx, [ds:si+0c200h] +lc1_&ccc=$+2 + mov ah, [ds:ccc*32 + bx + 0c100h] +lc4_&ccc=$+2 + mov bx, [ds:ccc*64 + di + 0c400h] +lc3_&ccc=$+2 + add ah, [ds:bx + di + 0c300h] +ELSE +lc2_&ccc=$+2 + mov bx, [ds:si+0c200h] +lc1_&ccc=$+2 + mov al, [ds:ccc*32 + bx + 0c100h] +lc4_&ccc=$+2 + mov bx, [ds:ccc*64 + di + 0c400h] +lc3_&ccc=$+2 + add al, [ds:bx + di + 0c300h] +ENDIF +IF (ccc AND 3) EQ 2 + shl eax, 16d +ENDIF +IF (ccc AND 3) EQ 0 + mov [es:ccc], eax +ENDIF + ENDM + pop di si es ds + ret +ENDP + +PROC C setplzparas + + ARG c1:word, c2:word, c3:word, c4:word + + IRP ccc, <0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83> + mov ax, [c1] + add ax, OFFSET psini+ccc*8 + mov [word (cs:lc1_&ccc)], ax + mov ax, [c2] + shl ax, 1d + add ax, OFFSET lsini16-ccc*8+80*8 + mov [word (cs:lc2_&ccc)], ax + mov ax, [c3] + add ax, OFFSET psini-ccc*4+80*4 + mov [word (cs:lc3_&ccc)], ax + mov ax, [c4] + shl ax, 1d + add ax, OFFSET lsini4+ccc*32 + mov [word (cs:lc4_&ccc)], ax + ENDM + ret +ENDP + +PUBLIC C set_plzstart + +PROC C set_plzstart + + ARG start:word + + mov dx, 3d4h + mov al, 18h ; linecompare + mov ah, [Byte start] + out dx, ax + mov al, 07h + mov ah, [Byte start+1] + shl ah, 4d + and ah, 10h + or ah, 0fh + out dx, ax ; 8th bit + ret + +ENDP + + +ENDS +END diff --git a/asmyt.err b/asmyt.err new file mode 100755 index 0000000..973dacc Binary files /dev/null and b/asmyt.err differ diff --git a/asmyt.h b/asmyt.h new file mode 100755 index 0000000..dc4a31f --- /dev/null +++ b/asmyt.h @@ -0,0 +1,5 @@ +#ifndef _ASMYT_H_ +#define _ASMYT_H_ +int plzline(); + +#endif diff --git a/asmyt.o b/asmyt.o deleted file mode 100755 index cccfe42..0000000 Binary files a/asmyt.o and /dev/null differ diff --git a/copper.h b/copper.h new file mode 100755 index 0000000..fbe485b --- /dev/null +++ b/copper.h @@ -0,0 +1,5 @@ +#ifndef _COPPER_H_ +#define _COPPER_H_ +init_copper(); +close_copper(); +#endif diff --git a/copper.o b/copper.o index 59b62a5..d315cdb 100755 Binary files a/copper.o and b/copper.o differ diff --git a/makefile b/makefile index f01a098..bef0889 100755 --- a/makefile +++ b/makefile @@ -50,19 +50,10 @@ TARGET_OS = dos #EXMMTESTDIR=16$(DIRSEP)exmmtest$(DIRSEP) SRC=src$(DIRSEP) SRCLIB=$(SRC)lib$(DIRSEP) -JSMNLIB=$(SRCLIB)jsmn$(DIRSEP) -NYANLIB=$(SRCLIB)nyan$(DIRSEP) -#EXMMLIB=$(SRCLIB)exmm$(DIRSEP) -MODEXLIB=$(SRCLIB)modex16$(DIRSEP) -MODEXLIB_=$(SRCLIB)modex$(DIRSEP) -VGMSNDLIB=$(SRCLIB)vgmsnd$(DIRSEP) -DOSLIB=$(SRCLIB)doslib$(DIRSEP) -WCPULIB=$(SRCLIB)wcpu$(DIRSEP) AFLAGS=-mh -0 -d1 -16FLAGS=-fh=16.hed -BAKAPIFLAGS=-fh=bakapi.hed -SFLAGS=-sg -st -of+ -zu -zdf -zff -zgf -k55808#60000#32768 +PLZFLAGS=-fh=plzpart.hed +SFLAGS=-sg -st -of+ -zu -zdf -zff -zgf -k32768 DFLAGS=-DTARGET_MSDOS=16 -DMSDOS=1 $(SFLAGS) ZFLAGS=-zk0 -zq -zc -zp8# -zm CFLAGS=$(AFLAGS) $(IFLAGS)-lr -l=dos -wo##wwww @@ -70,17 +61,6 @@ OFLAGS=-obmiler -out -oh -ei -zp8 -fpi87 -onac -ol+ -ok####x FLAGS=$(CFLAGS) $(OFLAGS) $(DFLAGS) $(ZFLAGS) -DOSLIBEXMMOBJ = himemsys.$(OBJ) emm.$(OBJ) -VGMSNDOBJ = vgmSnd.$(OBJ) 16_snd.$(OBJ) -DOSLIBOBJ = adlib.$(OBJ) 8254.$(OBJ) 8259.$(OBJ) dos.$(OBJ) cpu.$(OBJ) -16LIBOBJS = 16_in.$(OBJ) 16_mm.$(OBJ) wcpu.$(OBJ) 16_head.$(OBJ) 16_ca.$(OBJ) kitten.$(OBJ) 16_hc.$(OBJ) timer.$(OBJ) -# -#3812intf.$(OBJ) -GFXLIBOBJS = modex16.$(OBJ) bitmap.$(OBJ) planar.$(OBJ) 16text.$(OBJ) bakapee.$(OBJ) scroll16.$(OBJ) 16render.$(OBJ) 16planar.$(OBJ) - -TESTEXEC = exmmtest.exe test.exe pcxtest.exe pcxtest2.exe test2.exe palettec.exe maptest.exe fmemtest.exe fonttest.exe fontgfx.exe scroll.exe vgmtest.exe inputest.exe palettel.exe planrpcx.exe -# tsthimem.exe -#testemm.exe testemm0.exe fonttes0.exe miditest.exe sega.exe sountest.exe EXEC = plzpart.exe all: $(EXEC) @@ -88,25 +68,31 @@ all: $(EXEC) # #game and bakapi executables # -16.exe: 16.$(OBJ) mapread.$(OBJ) jsmn.$(OBJ) $(16LIBOBJS) gfx.lib - wcl $(FLAGS) $(16FLAGS) 16.$(OBJ) mapread.$(OBJ) jsmn.$(OBJ) $(16LIBOBJS) gfx.lib -fm=16.map +plzpart.exe: plzpart.$(OBJ) copper.$(OBJ) asmyt.$(OBJ) tweak.$(OBJ) plz.$(OBJ) + wcl $(FLAGS) $(PLZFLAGS) plzpart.$(OBJ) copper.$(OBJ) asmyt.$(OBJ) tweak.$(OBJ) plz.$(OBJ) -fm=16.map # #executable's objects # -16.$(OBJ): $(SRC)16.h $(SRC)16.c - wcl $(FLAGS) -c $(SRC)16.c +plzpart.$(OBJ): plzpart.h plzpart.c + wcl $(FLAGS) -c plzpart.c # #non executable objects libraries # -16.lib: $(16LIBOBJS)# doslib.lib vgmsnd.lib - wlib -b -q $(16LIBOBJS) $(16LIBOBJS)# doslib.lib vgmsnd.lib +plz.$(OBJ): plz.h plz.c + wcl $(FLAGS) -c plz.c +copper.$(OBJ): copper.h copper.asm + wcl $(AFLAGS) -zcm=tasm -c copper.asm +tweak.$(OBJ): tweak.h tweak.asm + wcl $(AFLAGS) -zcm=tasm -c tweak.asm +asmyt.$(OBJ): asmyt.h asmyt.asm + wcl $(AFLAGS) -zcm=tasm -c asmyt.asm # #other~ # clean: .symbolic @$(REMOVECOMMAND) $(EXEC) - @$(REMOVECOMMAND) *.$(OBJ) + #@$(REMOVECOMMAND) *.$(OBJ) diff --git a/plz.o b/plz.o index 9de156e..266fa9a 100755 Binary files a/plz.o and b/plz.o differ diff --git a/plzpart.c b/plzpart.c index c5e798e..0f79e63 100755 --- a/plzpart.c +++ b/plzpart.c @@ -1,8 +1,6 @@ //#include "..\dis\dis.h" +#include "plzpart.h" -extern plz(); -extern init_copper(); -extern close_copper(); //extern vect(); void main() { diff --git a/plzpart.h b/plzpart.h new file mode 100755 index 0000000..9055993 --- /dev/null +++ b/plzpart.h @@ -0,0 +1,7 @@ +#ifndef _PLZPART_H_ +#define _PLZPART_H_ +#include "asmyt.h" +#include "copper.h" +#include "plz.h" + +#endif diff --git a/plzpart.o b/plzpart.o index d9ad96e..2becf4f 100755 Binary files a/plzpart.o and b/plzpart.o differ diff --git a/tweak.asm b/tweak.asm new file mode 100755 index 0000000..56af677 --- /dev/null +++ b/tweak.asm @@ -0,0 +1,349 @@ + IDEAL + MODEL huge + +CODESEG + +PUBLIC C tw_opengraph, C tw_putpixel, C tw_setpalette, C tw_setstart +PUBLIC C tw_pictovmem, C tw_closegraph, C tw_waitvr, C tw_setrgbpalette +PUBLIC C tw_clrscr, C tw_setpalarea, C tw_getpixel, C tw_opengraph2 + +PUBLIC C scr_seg ; videomuistin alku segmentti + +planetau db 1,2,4,8 +scr_seg dw 0a000h + +; avaa 320x200 tweak tilan, 4 sivua, 4 planea + +PROC tw_opengraph + + mov dx, 03c4h + mov ax, 0f02h + out dx, ax + mov dx, 0a000h + mov es, dx + xor di, di + xor ax, ax + mov cx, 8000h + rep stosw ; clear vmem + + mov dx, 3d4h + mov ax, 0209h + out dx, ax ; 134 y + + mov ax, 5013h + out dx, ax ; 640 wide + ret +ENDP + + +PROC tw_opengraph2 + + mov dx, 03c4h + mov ax, 0604h + out dx, ax ; chain4 off + + mov ax, 0f02h + out dx, ax + mov dx, 0a000h + mov es, dx + xor di, di + xor ax, ax + mov cx, 8000h + rep stosw ; clear vmem + + mov dx, 03d4h + mov ax, 0014h + out dx, ax ; crtc long off + + mov ax, 0e317h + out dx, ax ; crtc byte on + + mov ax, 0009h + out dx, ax ; 400 + + mov ax, 3013h + out dx, ax ; 384 wide + + ret +ENDP + + + +PROC tw_clrscr + + mov dx, 3c4h + mov ax, 0f02h + out dx, ax + mov dx, [cs:scr_seg] + mov es, dx + xor di, di + xor eax, eax + mov cx, 1000h + rep stosd ; clear vmem + + ret +ENDP + +PROC tw_closegraph + + mov ax, 03h + int 10h + + ret +ENDP + +; piirt„„ pisteen ruudulle + +PROC tw_putpixel + + ARG x:word, y:word, color:word + + push bp + mov bp, sp + + mov ax, [cs:scr_seg] + mov es, ax + + mov dx, 03c4h + mov bx, [x] + and bx, 03h + mov ah, [cs:planetau+bx] + mov al, 02h + out dx, ax ; select plane + + mov bx, [x] + shr bx, 2 + mov ax, [y] + shl ax, 4 + add bx, ax + shl ax, 1 + add bx, ax + shl ax, 2 + add bx, ax + + mov cx, [color] + mov [es:bx], cl + + pop bp + ret +ENDP + +PROC tw_getpixel + + ARG x:word, y:word + + push bp + mov bp, sp + + mov ax, [scr_seg] + mov es, ax + + mov dx, 03ceh + mov ax, [x] + and ax, 03h + mov ah, al + mov al, 04h + out dx, ax ; select plane + + mov ax, [y] + shl ax, 4 + mov bx, ax + shl ax, 1 + add bx, ax + shl ax, 2 + add bx, ax + mov ax, [x] + shr ax, 2 + add bx, ax + + xor ax, ax + mov al,[es:bx] + + pop bp + ret +ENDP +; vaihtaa koko paletin + +PROC tw_setpalette + + ARG pal:dword + + push bp + mov bp, sp + push si ds + + lds si,[pal] + cld + mov cx, 300h + mov dx, 03c8h + mov al, 0 + out dx, al + inc dx + + rep outsb + + pop ds si + pop bp + ret +ENDP + +PROC C tw_setpalarea + + ARG pal:dword, start:word, cnt:word + + push si ds + + lds si,[pal] + cld + mov cx, [cnt] + mov ax, cx + add cx, ax + add cx, ax + mov dx, 03c8h + mov ax, [start] + out dx, al + inc dx + + rep outsb + + pop ds si + ret +ENDP + +; asettaa videomuistin alun + +PROC tw_setstart + + ARG start:word + + push bp + mov bp,sp + + mov bx, [start] + mov dx, 03d4h + mov al, 0dh + mov ah, bl + out dx, ax + mov al, 0ch + mov ah, bh + out dx, ax + + pop bp + ret +ENDP + +; kopioi muistista unpacked 1bpl kuvan 4planen kuvaksi videomuistiin +; void tw_pictovmem(char far *pic, unsigned int vstart, unsigned int bytes); + +PROC tw_pictovmem + + ARG pic:dword,to:word,len:word + + push bp + mov bp,sp + push ds es si di + + mov es, [scr_seg] + mov di, [to] + lds si, [pic] + mov cx, [len] + + mov dx,03ceh + mov ax,4005h ; w-mode 0 + out dx,ax + + mov dx, 03c4h + mov al, 02h + mov ah, 1h + out dx, ax + shr cx, 2 +@@l1: + movsb + add si, 3 + loop @@l1 + + + lds si, [pic] + add si, 1d + mov di, [to] + mov cx, [len] + + mov ax, 0202h + out dx, ax + shr cx, 2 +@@l2: + movsb + add si, 3 + loop @@l2 + + + lds si, [pic] + add si, 2d + mov di, [to] + mov cx, [len] + + mov ax, 0402h + out dx, ax + shr cx, 2 +@@l3: + movsb + add si, 3 + loop @@l3 + + + lds si, [pic] + add si, 3d + mov di, [to] + mov cx, [len] + + mov ax, 0802h + out dx, ax + shr cx, 2 +@@l4: + movsb + add si, 3 + loop @@l4 + + pop di si es ds + pop bp + ret +ENDP + +PROC tw_waitvr + + mov dx, 03dah + +@@loop1: + in al, dx + test al, 08h + jnz @@loop1 + +@@loop2: + in al, dx + test al, 08h + jz @@loop2 + + ret +ENDP + + +PROC C tw_setrgbpalette + + ARG pal:word, r:word, g:word, b:word + + mov dx, 3c8h + mov ax, [pal] + out dx, al + + inc dx + mov ax, [r] + out dx, al + mov ax, [g] + out dx, al + mov ax, [b] + out dx, al + + ret +ENDP + +END diff --git a/tweak.h b/tweak.h new file mode 100755 index 0000000..5fe23be --- /dev/null +++ b/tweak.h @@ -0,0 +1,5 @@ +#ifndef _TWEAK_H_ +#define _TWEAK_H_ +void tw_opengraph2(); +void tw_setrgbpalette(); +#endif