'$DYNAMIC 'current library-nesha.qlb DEFINT A-Z DECLARE SUB setstat (num%, who%, stat%, file$, size%, offset!) DECLARE FUNCTION showstat% (who%, stat%, file$, size%, offset%) DECLARE FUNCTION over% (num%, bot%, top%) DECLARE FUNCTION under% (num%, bot%, top%) DECLARE SUB menu (choice%(), set$(), ptr%, top%, rows%, space%, curs%, x%, y%, w%, col%, bor%, p%) DECLARE FUNCTION small% (n1%, n2%) DECLARE FUNCTION large% (n1%, n2%) DECLARE SUB setmodex () DECLARE SUB copypage (BYVAL page1, BYVAL page2) DECLARE SUB setvispage (BYVAL page) DECLARE SUB drawsprite (pic(), pal(), BYVAL po, BYVAL x, BYVAL y, BYVAL page) DECLARE SUB wardsprite (pic(), pal(), BYVAL po, BYVAL x, BYVAL y, BYVAL page) DECLARE SUB loadsprite (pic(), BYVAL x, BYVAL y, BYVAL w, BYVAL h, BYVAL page) DECLARE SUB stosprite (pic(), BYVAL x, BYVAL y, BYVAL page) DECLARE SUB fadeto (palbuff(), BYVAL red, BYVAL green, BYVAL blue) DECLARE SUB fadetopal (pal(), palbuff()) DECLARE SUB setpal (pal()) DECLARE SUB clearpage (BYVAL page) DECLARE SUB loadpage (buf(), fil$, BYVAL p) DECLARE SUB storepage (buf(), fil$, BYVAL p) DECLARE SUB setkeys () DECLARE SUB setfont (f()) DECLARE SUB printstr (s$, BYVAL x, BYVAL y, BYVAL p) DECLARE SUB textcolor (BYVAL f, BYVAL b) DECLARE SUB setitup (fil$, buff(), BYVAL p) DECLARE SUB resetdsp DECLARE SUB playsnd (BYVAL n, BYVAL f) DECLARE SUB closefile DECLARE SUB setpicstuf (buf(), BYVAL b, BYVAL p) DECLARE SUB loadset (fil$, BYVAL i, BYVAL l) DECLARE SUB storeset (fil$, BYVAL i, BYVAL l) DECLARE SUB rectangle (BYVAL x, BYVAL y, BYVAL w, BYVAL h, BYVAL c, BYVAL p) DECLARE FUNCTION Keyseg () DECLARE FUNCTION keyoff () DECLARE FUNCTION keyval (BYVAL a) DECLARE FUNCTION getkey () TYPE Regtype ax AS INTEGER bx AS INTEGER cx AS INTEGER dx AS INTEGER bp AS INTEGER si AS INTEGER di AS INTEGER flags AS INTEGER ds AS INTEGER es AS INTEGER END TYPE DIM SHARED regs AS Regtype regs.ax = &H3509: CALL interruptx(&H21, regs, regs) off9 = regs.bx: seg9 = regs.es DIM font(1024), master(767), noise(16384), fade(1536), placer(1250), pal(1584) setmodex DEF SEG = VARSEG(font(0)): BLOAD "nesha.fnt", VARPTR(font(0)): setfont font(): textcolor 15, 0 setpal master(): DEF SEG = VARSEG(master(0)): BLOAD "master.pal", VARPTR(master(0)) setpal master() DEF SEG = VARSEG(pal(0)): BLOAD "nesha.pal", VARPTR(pal(0)) GOSUB switchon: CALL resetdsp setvispage 1 FOR i = 1 TO 2: READ num(i), perset(i), file$(i): NEXT FOR a = 1 TO 2 setpicstuf noise(), (perset(a) + 1) * 1250, 0 FOR b = 1 TO num(a) READ name$ FOR c = 0 TO perset(a) DEF SEG = VARSEG(placer(0)): BLOAD "draw\" + name$ + "." + RIGHT$(STR$(c), LEN(STR$(c)) - 1), VARPTR(placer(0)) stosprite placer(), c * 1250, 0, 0 NEXT c storeset file$(a) + CHR$(0), b - 1, 0 NEXT b NEXT a RESTORE names FOR a = 1 TO 2 setpicstuf noise(), (perset(a) + 1) * 1250, 0 FOR b = 1 TO num(a) READ name$ loadset file$(a) + CHR$(0), b - 1, 0 FOR c = 0 TO perset(a) loadsprite placer(), c * 1250, 0, 50, 50, 0 clearpage 1 drawsprite placer(), pal(), 0, 0, 0, 1 IF w <> 28 THEN w = getkey NEXT c NEXT b NEXT a finis: fadeto fade(), 0, 0, 0 GOSUB shutoff SCREEN 13: SYSTEM switchon: regs.ax = &H2509: regs.ds = Keyseg: regs.dx = keyoff CALL interruptx(&H21, regs, regs) RETURN shutoff: regs.ax = &H2509: regs.ds = seg9: regs.dx = off9 CALL interruptx(&H21, regs, regs) RETURN DATA 7,12,beings.all DATA 18,4,armament.all names: DATA lapis,knilb,roany,mull,bear,vale,salamand DATA null,sword,shadspot,slash1,pslash,crossbow,arrow,axe,slash2,punch,leafbomb,icesword,twoknife,slit,gelixer,rime,fang,f_breath REM $STATIC SUB setstat (num, who, stat, file$, size, offset!) OPEN file$ FOR BINARY AS #3 size! = size who! = who i! = 1 + (offset! + ((size! * 2) * who!)) + (stat * 2) PUT #3, i!, num CLOSE #3 END SUB