More DOS2 questions... (Development Foros MSX)MSX Resource Center PassionMSX MSX2 contest           
                       
English Nederlands Español Português Russian                  
 Noticias
   Página principal
  Almacén de noticias
  Temas de noticias

 Recursos
   Foros MSX
  Artículos
  Analisis
  Informe de ferias/RUs
  Álbum de fotos
  Ferias y encuentros
  Encuestas
  Enlaces
  Buscar

 Software
   Descargas
  Tienda Online

 MRC
   Quiénes somos
  Únete a nuestro equipo
  Donar
  Políticas
  Contacta con nosotros
  Enlázanos
  Estadísticas

 Buscar
 
  

  

 Login
 

Login

Contraseña




¿Aún no tienes una cuenta? ¡Conviértete en miembro del MSX Resource Center! ¡Únete a nosotros!.


 Estadísticas
 

Hay 106 invitados y 2 miembros en línea

Eres un usuario anónimo.
 

Foros MSX


Foros MSX

Development - More DOS2 questions...

Autor

More DOS2 questions...

Sonic_aka_T

msx guru
Mensajes: 2262
Publicado: Marzo 01 2004, 03:00   
Hey all,

Another quick DOS2 question... I'm currently working on a small project that will eventually need to grab a file from RAMdisk, decompress it and shove it down the VDP's throat. Since I want to support DOS2 so ppl with a harddisk can use it, I'll need to use DOS2's mapping routines. A little digging got me no further.

I know I'm somehow supposed to get my hands on a jump table address which I can then use to use the ALLSEG, GET_P2 and PUT_P2 functions. From what I understand I should somehow get the address of the jumptable in HL, and should then be able to jump to:

HL+$00 to allocate a segment
HL+$24 to set a segment at $8000
HL+$27 to get the segment at $8000

The problem is I do not know where to get the jumptable address in the >>BASIC<< environment. I assume the functions should be available under BASIC in DOS2 mode, but I've got no idea how to get my hands on the jumptable address.

Furthermore, would the following code do what it's supposed to do? Sorry to bother you all, but I haven't even touched an assembler for like 7 years and am finding it difficult to get the hang of it again...

{sorry, due to a small bug in our forums it wasn't possible to post the code rite here, working on a workaround )}
BiFi
msx guru
Mensajes: 3142
Publicado: Marzo 01 2004, 09:45   
DOS2 has some routines hooked to the EXTBIO hook ($FFCA). In general the D represents some device ID and the E represents the function ID for that device. Other registers are used to pass parameters to them. What you are looking for is this DOS2 document. It contains exact info on how to obtain the jump table base address using the EXTBIO hook. The exact section is 5.2 Mapper Variables and Routines.
GuyveR800
msx guru
Mensajes: 3048
Publicado: Marzo 01 2004, 10:49   
GEM DOS2 init code:

DOS: EQU 0005h
EXTBIO: equ 0FFCAh
HOKVLD: equ 0FB20h

MprVarTab: dw 0
MprSupAdr: dw 0

MprSupCall:
jp 0 ; self-modified!

Initialize:
ld c,6Fh ; check DOS version
call DOS
or a
jp nz,0 ; No DOS, jump to 0
ld a,b
cp 2
jp c,DOS1

ld a,[HOKVLD] ; check EXTBIO
bit 0,a
ld a,85h
jp z,Error ; no extended bios, return "wrong MSX-DOS"

xor a ; get mapper support stuff
ld d,4
ld e,1
call EXTBIO
or a
ld a,85h
jp z,Error ; no mapper support, return "wrong MSX-DOS"
ld [MprVarTab],hl

ld d,4
ld e,2
call EXTBIO
ld [MprSupAdr],hl
ret

That's the init code.

Then you can use it like this:
ld hl,[MprSupAdr]
ld de,15h ; check page 0-3 segments (GET_PH)
add hl,de
ld [MprSupCall+1],hl

ld h,0C0h
call MprSupCall
or a
ld a,85h
jp nz,Error
ld h,80h
call MprSupCall
cp 1
ld a,85h
jp nz,Error
ld h,40h
call MprSupCall
cp 2
ld a,85h
jp nz,Error
ld h,0
call MprSupCall
cp 3
ld a,85h
jp nz,Error

That code (just an example) checks if page 0-3 are actually segments 3-0.

Sonic_aka_T

msx guru
Mensajes: 2262
Publicado: Marzo 01 2004, 16:39   
Thanks guys... That should get me going, I'll see what I can come up with.
 
 







(c) 1994 - 2008 Fundación MSX Resource Center. MSX es una marca registrada de MSX Licensing Corporation