Loading file to VRAM in ASM

Página 3/4
1 | 2 | | 4

Por MsxKun

Paragon (1115)

Imagen del MsxKun

22-04-2011, 13:04

duplicated again :S

Por MsxKun

Paragon (1115)

Imagen del MsxKun

22-04-2011, 13:14

Um, first part seems OK, (maybe it also needs a $C9 at #0xFEDE) but at game_entry_point you need more code. This is how Perfect Fit (ROM cartridge) does it, to load and save levels from/to disk.


; game_entry_point

entry:     di
               ld       b,5			; delete hook
               ld       a,$C9
               ld       hl,HSTKE                                ; FEDA
delhook: ld       (hl),a
               inc      hl
               djnz   delhook
		
	 ; Check if disk found

               ld       a,($FFA7)		              ; checks if there is any diskrom (HPHYD)
               cp      $C9
               jr       z,return

    	 ; comprueba version de DOS y guarda

	 ld       c,_DOSVER_
               call     _BDOS_			; Send DOSVER command to dos
               ld       a,b
	 inc      a
	 ld       (DOSFOUND),a		; Save dos version

	 call     InitDskError		; Initialices Disk Error routines (mail me if you need them)
		
	 jp       Game

return:	 xor     a
	 ld       (DOSFOUND),a
	 jp       Game

The code was made using the tutorial made by Ramones. He made all the hard work of studying the DiskRoms and so!

Por MsxKun

Paragon (1115)

Imagen del MsxKun

22-04-2011, 13:19

Hell, how do you align the stupid code? Eek!

Por aoineko

Paladin (874)

Imagen del aoineko

22-04-2011, 14:40

Hi MsxKun,
Many thank!

Can you please give me the definition of following symbols:
- DOSVER_
- _BDOS_
- DOSFOUND

And yes, I'm interest by the InitDskError. Even if, in fact, I just want to know if disk is available or not to enable/disable the option for loading track from file.

Por MsxKun

Paragon (1115)

Imagen del MsxKun

22-04-2011, 15:04

Ah well, DOSVER and BDOS are the usual DOS adresses. I always have them _LABEL_ on my code, cause this way my editor paints them in green Tongue

_BDOS_: equ $F37D ; BDOS Disk Basic - Input: C function num
_DOSVER_: equ $6F ; outputs DOS version

DOSFOUND is a variable in RAM, so you can save it and check whenever you want. Put it wherever you want Smile

As for Disk Error initializations, better mail me. This way i can send you the complete Ramones example. I think he put it on BeholderBBS ? Cause it seems I can't find it at Karoshi's forum..

Por aoineko

Paladin (874)

Imagen del aoineko

22-04-2011, 15:23

I'm a little bit confuse with usage of the word "DOS".
For me DOS is an operating system, you know, the good old a:\> prompt.
What is the relation between DOS and the access to files from cartridge game?
DiskROM include code used by DOS and Basic, that's it?

Por MsxKun

Paragon (1115)

Imagen del MsxKun

22-04-2011, 15:36

Well , DOS is MSX-DOS. But yes.. what I meant is BIOS DOS (BDOS) routines, as both Msx Disk Basic and MSX-DOS use the same BIOS routines to access disk.
So yep, you're right Tongue

Por aoineko

Paladin (874)

Imagen del aoineko

22-04-2011, 17:27

I can't found your e-mail...

Por MsxKun

Paragon (1115)

Imagen del MsxKun

22-04-2011, 18:39

I can't found your e-mail...

Well, its kinda easy if you type msx_forever followed by the very famous snail @ and then you add yahoo.es Smile

Por aoineko

Paladin (874)

Imagen del aoineko

22-04-2011, 23:30

Anyone know a good doc about DiskROM available on the net?

Página 3/4
1 | 2 | | 4