;-------------------------------------- ; ColoRix SCI file loader ; (c) 24-01-1994 by Jan Laitenberger ;-------------------------------------- JMP SHORT @Start @FText: DB "File not found", 13, 10, 36 @Modus: DB @SetPal:MOV AX, 1012h ; AH = 10h: set palette MOV BX, 0 ; MOV CX, 256 ; 256 colors MOV DX, OFFSET @Pal ; offset of color table INT 10h ; video interrupt RET ; @Start: MOV AH, 0Fh ; AH = 0F: get video mode INT 10h ; MOV [?@Modus], AL ; save in @Modus MOV BL, [0080h] ; length of command line CMP BL, 00 ; if length = 0 JZ @error ; then jump to @error XOR BH, BH ; mark end of command line MOV BYTE PTR [BX+81h], 0 ; with EOS @2: MOV DX, 0082h ; offset of filename MOV AX, 3D00h ; AL = 0: read access INT 21h ; DOS - open file JNB @Ok ; skip error message @error: MOV DX, OFFSET @FText ; offset of error message MOV AH, 09 ; AH = 9: display text INT 21h ; DOS - interrupt JMP @Ende ; end program @Ok: PUSH AX ; AX = handle PUSH AX ; MOV AX, 0013h ; AL = 13h: MCGA mode INT 10h ; INT10 - set mode MOV DI, OFFSET @Pal ; offset of color table MOV CX, 768 ; = 256 colors (*3) MOV AL, 0 ; fill with 0 REPZ ; repeat CX times STOSB ; store byte CALL @SetPal ; set palette POP BX ; file handle -> BX MOV DX, OFFSET @Info ; load file above this offset MOV CX, 030Ah ; 778 bytes MOV AH, 3Fh ; AH = 3Fh: load file INT 21h ; DOS - interrupt POP BX ; file handle -> BX PUSH DS ; save data segment MOV DX, 0A000h ; video ram adress -> DS MOV DS, DX ; XOR DX, DX ; DX = 0 MOV CX, 0FA00h ; 64000 bytes MOV AH, 3Fh ; AH = 3Fh: load file INT 21h ; DOS - interrupt POP DS ; restore DS CALL @SetPal ; set palette XOR AH, AH ; AH = 0: get char INT 16h ; keyboard interrupt XOR AH, AH ; AH = 0: set videomode MOV AL, [?@Modus] ; AL = saved mode INT 10h ; @Ende: MOV AH, 4Ch ; AH = 4Ch: terminate program INT 21h ; DOS - interrupt @Info: DB "0123456789" ; picture file header @Pal: ; MCGA - palette follows at this ; position in the file