This commit is contained in:
Frater 2017-09-24 01:45:36 +02:00
commit 43352ff262
1291 changed files with 220976 additions and 0 deletions

26
PANIC/ASMYT.ASM Normal file
View file

@ -0,0 +1,26 @@
IDEAL
MODEL large
P386
CODESEG
PUBLIC C copyline
PROC C copyline
ARG from:dword, to:dword, count:word
push ds si di
lds si, [from]
les di, [to]
mov cx, [count]
cld
rep movsw
pop di si ds
ret
ENDP
END

BIN
PANIC/ASMYT.OBJ Normal file

Binary file not shown.

BIN
PANIC/MONSTER.PAL Normal file

Binary file not shown.

BIN
PANIC/MONSTER.U Normal file

Binary file not shown.

BIN
PANIC/SD.DSK Normal file

Binary file not shown.

BIN
PANIC/SD.EXE Normal file

Binary file not shown.

BIN
PANIC/SD.PRJ Normal file

Binary file not shown.

BIN
PANIC/SD.TFA Normal file

Binary file not shown.

157
PANIC/SHUTDOWN.C Normal file
View file

@ -0,0 +1,157 @@
#include <stdio.h>
#include <conio.h>
#include <fcntl.h>
#include <dos.h>
#include <math.h>
#include "i:\u2\dis\dis.h"
extern void tw_opengraph();
extern void tw_closegraph();
extern void tw_putpixel(int x, int y, int color);
extern int tw_getpixel(int x, int y);
extern void tw_setpalette(void far *pal);
extern void tw_setpalarea(void far *pal,int start,int cnt);
extern void tw_setrgbpalette(int pal, int r, int g, int b);
extern void tw_setstart(int start);
extern void tw_pictovmem(void far *pic, int to, int len);
extern void tw_crlscr();
#define _LOADER_
extern copyline(char far *from, char far *to, int count);
#ifndef _LOADER_CALLS
char far kuva[65000];
#endif
char far kuvapal[768];
char far pal[768];
char fadepals[64][768];
main() {
int fff,x,y;
dis_partstart();
#ifndef _LOADER_
tw_opengraph();
tw_setstart(80);
fff=open("monster.u",O_BINARY|O_RDONLY);
read(fff,kuva,64000);
close(fff);
fff=open("monster.pal",O_BINARY|O_RDONLY);
read(fff,kuvapal,768);
close(fff);
for(y=0;y<200;y++) for(x=0;x<320;x++)
{
tw_putpixel(x+320,y*2,kuva[y*320+x]);
tw_putpixel(x+320,y*2+1,kuva[y*320+x]);
}
tw_setpalette(kuvapal);
#else
getpal(kuvapal);
#endif
shutdown();
}
shutdown()
{
int x,y,a,b;
for(a=0;a<320;a++) tw_putpixel(a,0,0);
for(a=0;a<64;a++) for(b=3;b<768;b++) fadepals[a][b]=(a*63+kuvapal[b]*(64-a))/64;
for(y=0;y<100;y++) for(x=0;x<320;x++)
tw_putpixel(x,y+150,tw_getpixel(x+320,y*4));
tw_setstart(100*160);
dis_waitb();
asm {
mov dx, 3d4h
mov ax, 4109h
out dx, ax
mov dx, 03ceh
mov ax, 4105h
out dx, ax // latch transfer mode
mov dx, 03c4h
mov ax, 0f02h // map mask 1111
out dx, ax
}
tw_setpalette(fadepals[3]);
tw_setrgbpalette(0,63,63,63);
tw_setstart(0);
dis_waitb();
tw_setpalette(fadepals[20]);
asm {
mov dx, 3d4h
mov ax, 0a013h
out dx, ax
}
dis_waitb();
for(a=32;a>2;a=a*5/6)
{
dis_waitb();
tw_setpalette(fadepals[63-a]);
for(b=a/2;b<=a;b++)
{
copyline(MK_FP(0x0a000,0),MK_FP(0x0a000,200*160-(b*320)),80);
copyline(MK_FP(0x0a000,0),MK_FP(0x0a000,200*160+(b*320)),80);
}
for(b=0;b<a;b++)
copyline(MK_FP(0x0a000,80+(400*b/a)*160),MK_FP(0x0a000,200*160+(b-a/2)*320),80);
}
copyline(MK_FP(0x0a000,0),MK_FP(0x0a000,202*160),80);
copyline(MK_FP(0x0a000,0),MK_FP(0x0a000,198*160),80);
asm {
mov dx, 03ceh
mov ax, 4005h
out dx, ax // latch transfer mode
mov dx, 03c4h
mov ax, 0f02h // map mask 1111
out dx, ax
}
for(x=20;x<=160;x+=3)
{
dis_waitb();
tw_putpixel(x,200,0);
tw_putpixel(320-x,200,0);
tw_putpixel(x+1,200,0);
tw_putpixel(319-x,200,0);
tw_putpixel(x+2,200,0);
tw_putpixel(318-x,200,0);
tw_putpixel(x+3,200,0);
tw_putpixel(317-x,200,0);
}
tw_putpixel(160,200,1);
for(a=0;a<60;a++)
{
dis_waitb();
b=cos(a/120.0*3*2*3.1415926535)*31.0+32;
tw_setrgbpalette(1,b,b,b);
}
sleep(1);
}
getpal(char far *pal)
{
asm {
push di
push es
les di, pal
mov cx, 768d
mov dx, 3c7h
mov al, 0d
out dx, al
inc dx
inc dx
rep insb
pop es
pop di
}
}

BIN
PANIC/SHUTDOWN.DSK Normal file

Binary file not shown.

BIN
PANIC/SHUTDOWN.OBJ Normal file

Binary file not shown.

325
PANIC/TWEAK.ASM Normal file
View file

@ -0,0 +1,325 @@
IDEAL
MODEL large
P386
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
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 ax,13h
int 10h
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, 5013h
out dx, ax ; 640 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, 5
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, 5
mov 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

BIN
PANIC/TWEAK.OBJ Normal file

Binary file not shown.

1
PANIC/X.BAT Normal file
View file

@ -0,0 +1 @@
copy sd.exe ..\main\data\panicend.exe