TIP: Click on subject to list as thread! ANSI
echo: 80xxx
to: ALL
from: FERNANDO ARIEL GONT
date: 1998-01-19 13:27:00
subject: CD-ROM

Hullo All , hope you are having a nice day!!
Well, I have a problem:
I've W'95.
I've made a simple program to play a track from an audio CD, and it works
ok if I run it under DOS, but not under W'95.
That means, if I restart my computer in MS-DOS mode, my program works ok,
but if I start a MS-DOS sesion (maybe full-screen), it doesn't work.
I debugged it, and found that when it doesn't work, it seems that the name
it gets of the driver isn't correct, so when I try to open the driver as a
file, I get a "file not found" error code.
The name it gets under MS-DOS is different from the one that it gets under
W'95, but it should work anyway, I think....
Another fact, all the programs (well, except one from Tenie Remmel's
snippets that doesn't use this "technique") have the same "bug" as my
program...
I have really no idea about what could be happening... :(
Here's my program:
/* (80XXX.ASM)
.model tiny
.code
.startup
; Test if the driver is present
; *****************************
    mov ax,0dadah
    push ax
    mov ax,1100h
    int 2fh
    pop bx
    mov dx, offset isnt_msg
    cmp bx, 0adadh
    jne not_installed
    cmp al,0ffh
    jne not_installed
    mov dx, offset installed
not_installed:
    mov ah,09h
    int 21h
    
; Leer el fucking block de la compactera
; **************************************
    
    mov ax, cs
    mov es,ax
    mov ax,150dh
    mov bx, offset unit
    int 2fh
    mov al, byte ptr unit
    mov bx, offset fin
    mov ax,1501h 
    int 2fh
    
    mov al, byte ptr [fin]
    mov command, al
    mov si, word ptr [fin+1]
    add si,10
    push ds
    mov ds, word ptr [fin+3]
    pop es
    mov di, offset nameZ
    mov cx,8
    cld
copy:
    lodsb
    cmp al, 20h
    jz end_of_name
    stosb
    loop copy
end_of_name:
    mov al,00h
    stosb
 
    mov dx, offset nameZ
    push es
    pop ds
    mov ax,3d04h
    int 21h
    mov handle, ax
    mov bx,ax
; Get information of track 1
;***************************
        mov cl,1
        mov [coma+1],cl
        mov dx, offset coma
        mov cx,8
        mov ax, 4402h
        int 21h
        call convert
        mov startframe, ax
        mov star, dx
; Get information of track 2
;***************************
        mov [coma+1],2
        mov dx, offset coma
        mov cx,8
        mov bx, handle
        mov ax, 4402h
        int 21h
        call convert
        sub ax,1
        sbb dx,0
        sub ax, startframe
        sbb dx, star
        mov frame, ax
        mov count, dx
        mov ax,1510h
        mov bx, offset block
        push cs
        pop es
        xor cx,cx
        mov cl, unit
        int 2fh
    mov dx, offset failed
    jc bye
    mov dx, offset Ok
bye:
    mov ah,09h
    int 21h
    mov ax, 4c00h
    int 21h
failed db 0ah,0dh,"Operation failed!! :(",0ah,0dh,"$"
Ok db 0ah,0dh,"Starting to play track 1, sir :)",0ah,0dh,"$"
isnt_msg db 0ah,0dh,"MSCDEX not installed. :(",0ah,0dh,"$"
installed db 0ah,0dh,"MSCDEX is installed. :)",0ah,0dh,"$"
nameZ db 9 dup (00h)
handle dw ?
; **************************************
; Converts Red book format to HSG format
; **************************************
convert proc
mov al, byte ptr [redb+1]
mov cl, 75
mul cl
; ax = seconds
mov bx,ax
mov ax, 4500
mov cl, byte ptr [redb+2]
xor ch,ch
mul cx
; dx:ax = mins
xor ch,ch
mov cl, [redb]
add bx, cx
add ax,bx
adc dx,0
sub ax, 150
sbb dx,0
ret
convert endp
unit db ?
fin:
db 00h
off dw ?
se dw ?
block db 22
command db 00h
        db 84h
        db 10 dup (00h)
        db 00h
startframe        dw ?
       star dw ?
frame   dw ?
count   dw ?
coma db 0bh
track db ?
redb db ?
db ?
db ?
db ?
end
*/
 -=> Yours sincerely, Fernando Ariel Gont <=-
e-mail: FGont@siscor.bibnal.edu.ar
e-mail "Good Stuff!" _*Magazine*_ : gstuff@siscor.bibnal.edu.ar
FidoNet: 4:900/470.10
Sk-Network (Argentina): Murdock's Point (200:201/200.1)
--- Terminate 5.00 UnReg(97)
---------------
* Origin: Do that again Beavies!! (4:900/470.10)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.