DSK-PRO 10.1 Killer Copy Machine Edition Released

Página 5/8
1 | 2 | 3 | 4 | | 6 | 7 | 8

Por cbsfox

Champion (392)

imagem de cbsfox

01-02-2016, 19:42

Well, at least it stoped crashing. Good news.

If I had that disk I could work on it to try to copy it.

But the tool is copying more and more. Here in Brazil it copies all the protections that exist. And we have a lot of them.

Por flyguille

Prophet (3028)

imagem de flyguille

01-02-2016, 19:44

yes, but that was with the map2.com trick I think, that hack just work on half the msx models.

Por cbsfox

Champion (392)

imagem de cbsfox

02-02-2016, 02:09

Yes, but I don't like bios routines, DOS routines, nothing.
I like to create my own routines,
I know, its the hard way. But I prefer the hard way. No outside routines. I just use the FCB routines because it would be too BIG to create my own.

L_OLIVEIRA, what is you email, so I can send you a BETA version to try to fix this problem?

Regards
Marcos Daniel

Por flyguille

Prophet (3028)

imagem de flyguille

02-02-2016, 02:28

cbsfox wrote:

Yes, but I don't like bios routines, DOS routines, nothing.
I like to create my own routines,
I know, its the hard way. But I prefer the hard way. No outside routines. I just use the FCB routines because it would be too BIG to create my own.

L_OLIVEIRA, what is you email, so I can send you a BETA version to try to fix this problem?

Regards
Marcos Daniel

There is another compatibility problem, FCB routine set inside DOS2 don't support 16bits FAT used in HDDs, if you use those routines, it will corrupt the FAT in the HDDs, and nobody will want to test the program anymore in real systems.

So, one or two things, or you do it only for DOS1 and made it to refuse run in DOS2, or you do it for DOS2 100% legal.

Por cbsfox

Champion (392)

imagem de cbsfox

02-02-2016, 04:07

100% LEGAL, all my own routines, all perfect.
And it works perfectly here with Nextor with FAT16. No problems at all.

By the way, please, TEST this new BETA version and tell me if it still freezes with your memory mapper.

Download: http://1drv.ms/1m9kk0P

Por flyguille

Prophet (3028)

imagem de flyguille

02-02-2016, 13:16

cbsfox wrote:

100% LEGAL, all my own routines, all perfect.
And it works perfectly here with Nextor with FAT16. No problems at all.

By the way, please, TEST this new BETA version and tell me if it still freezes with your memory mapper.

Download: http://1drv.ms/1m9kk0P

FCB functions handles the FAT as FAT12, if it writes in FAT12 mode, and then read in FAT12 mode, sure it will work, but corrupted for the rest of the programs that uses FileHandles functions.

File handles is not that bad....

The app only remember one byte value (the file handle ID).

and input in HL the address of a null terminated string that can be like "C:\blabla\filename.vvv", 0

Everythingelse works the same.

Indeed, When was the time of my app to do the DOS2 support, I was worried just like you.... oh noh another shit to learn, but in less than two days I got converted to file handle in all routines.

But I did it, I backup the last code that works on DOS1 (aka MSX2 legacy), So I maintain two codes up to certain goal, after that, new features was developed only in the DOS2 version. This is because any todays developer has DOS2, so, no sense to code new things twice.

Por flyguille

Prophet (3028)

imagem de flyguille

02-02-2016, 14:17


@BDOSWRAPPED:				EQU $5



; BDOS calls have two problems (don't matter what FCB or FileHandles), one is the lack of DOS2 support for loading to secondary mappers, or saving from secondary mappers (secondary mapper isn't mean SUBSLOT, it is the logical internal dos2 so called secondaries RAM mappers, that is RAM that is not logically mapped as the primary mapper (default)).

; So the following routine, intercepts file write and file load BDOS functions and place a buffer in page3, for doing the FILE I/O but only if currently is slotted a secondary ram mapper.

; The other problem if any Device I/O error, happens it will waste your app and return the prompt to the user with the error. So, is supposte to mask those errors in a handable way.



@BDOS:			push af

			xor a
			ld (DiskErrorCode),a		; Resets the error code.

			in a, ($a8)
			ld (BDOSA8Status), a

			ld a, ($FFFF)
			cpl
			ld (BDOSFFFFStatus), a

			ld a, c				; Checks if the command is file transfer.
			cp $48
			jp c, .Normal
			cp $4A
			jp nc, .Normal

			ld a, (DOS2FilesIOPatchEnable)
			and a
			jp z, .Normal

			ld a, d				; Checks if source/destination address is PAGE2, all others pages are always primary RAM mapper (in my app).
			and $C0
			cp $80
			jp nz, .Normal

			push bc				; Checks if the current slot/sslot is the same for page 3 & 2 so, test if page2 is primary mapper.
			in a, ($A8)
			ld b, a
			and $C0
			ld c, a
			ld a, b
			and $30
			rlca
			rlca
			cp c
			pop bc
			jr nz, .Secondary

			push bc
			ld a, ($FFFF)
			ld b, a
			and $C0
			ld c, a
			ld a, b
			and $30
			rlca
			rlca
			cp c
			pop bc
			jp z, .Normal

.Secondary:		ld a, c				; Checks if the command is LOAD or SAVE file.
			cp $48
			jr z, .Load				

.Save:			pop af
			ld (BDOSStackWrap), sp		; Save the stack return point from an abort.

.SaveLoop:		ld a, h
			or l
			ret z

			push bc				; Save command.
			ld bc, 512
			sbc hl, bc			; HL = HL - 512.
			jr c, .FinalSave

			push hl
			ex de, hl			; now HL = location in Page 2.
			ld de, GeneralPurposeBuffer
			ldir
			ex de, hl			; now DE = next location in Page 2.
			pop hl

			pop bc				; Restore command.

			push bc
			push de
			push hl

			ld de, GeneralPurposeBuffer
			ld hl, 512
			call @BDOSWRAPPED

			pop hl
			pop de
			pop bc

			jr .SaveLoop

.FinalSave:		add hl, bc			; Restore length.

			push hl				; Save length.
			ld c, l
			ld b, h
			ex de, hl			; Now HL = location in Page 2.
			ld de, GeneralPurposeBuffer
			ldir
			pop hl				; Restore length.

			pop bc				; Restore command.

			ld de, GeneralPurposeBuffer
			jp @BDOSWRAPPED

.Load:			pop af
			ld (BDOSStackWrap), sp		; Save the stack return point from an abort.

.LoadLoop:		ld a, h
			or l
			ret z

			push hl
			push bc
			push de

			push bc
			ld bc, 512
			sbc hl, bc
			jr c, .FinalLoad
			pop bc				; Restore command.

			ld hl, 512			; Transfer is atleast 512 bytes this time.
			ld de, GeneralPurposeBuffer
			call @BDOSWRAPPED

			ld hl, GeneralPurposeBuffer
			pop de				; Restore destination adress.
			ld bc, 512
			ldir				; After DE = next destination address.
			pop bc				; Restore command.
			pop hl				; Restore original transfer size.
			dec h				; Transfer size = transfer size - 512.
			dec h
			jr .LoadLoop

.FinalLoad:		add hl, bc			; Restore length.
			pop bc				; Restore command.

			push hl				; Save length.
			ld de, GeneralPurposeBuffer
			call @BDOSWRAPPED

			pop bc				; Restore length, now BC = transfer that left (when is < 512).
			ld hl, GeneralPurposeBuffer
			pop de				; Restore destination address.
			ldir
			pop bc				; Restore command but not needed anymore.
			pop hl				; Restore last transfer size, but not needed anymore.

			xor a
			ret

.Normal:		pop af

			ld (BDOSStackWrap), sp		; Save the stack return point from an abort.

			jp @BDOSWRAPPED






@rberr:			ld (DiskErrorCode),a		; Save the error.
			ld a, 1				; ABORT!.
			ret






@abort:			ld sp, (BDOSStackWrap)

			ld a, (BDOSA8Status)
			out ($a8), a

			ld a, (BDOSFFFFStatus)
			ld ($FFFF), a

			ld a, (DiskErrorCode)
			and a
			ret nz

			ld a, $FF			; WARNING: It assumes mapper hasn't changed by the BDOS / DISKROM.
			and a

			ret				; Returns after the original BDOS function call.








DTA:								; Used to build up file data, to check file headers before loading them.
GeneralPurposeBuffer:		RB	512			; Used for building lists, handling strings, and by the "UserArea to UserArea" copy routine. Now it is needed to use for workaround the DOS2 bug!!! CHAN!!!.

DOS2FilesIOPatchEnable:		RB	1			; If <> 0 means that multimapper was detected, so it must check not doing file I/O directly on secondary mappers, to avoid the DOS2 bug. <----- WARNING: Enable this if detect that the app allocated RAM from a secondary mapper.



DiskErrorHandlerHookUpBackUp:	RW	1
AbortHandlerHookUpBackUp:	RW	1
DiskErrorCode:			RB	1
BDOSStackWrap:			RW	1
BDOSA8Status:			RB	1
BDOSFFFFStatus:			RB	1

FileHandle:			RB	1			; Filehandle ID for the current disk I/O.



After this issue solved (don't matter if FCB or file handles, the problems are there).

using it is simple



;opening a file


			ld de, MsgBoxBuffer		; Points to null terminate string "DRIVE:\PATH\filename.ext", 0 
			ld c, $43				; File open for read only.
			ld a, 1
			call @BDOS
			and a
			jr z, .LDFound

; not found.

.LDFound:		ld a, b
			ld (FileHandle), a			; Save the file handle ID.





;for knowing the file size.


ld a, (FileHandle)
			ld b, a					; It must read the filelength by moving the pointer to the end of the file.
			ld c, $4A
			ld a, 2
			ld hl, 0
			ld e, l
			ld d, h
			call @BDOS

			push de
			push hl

			ld a, (FileHandle)			; It must move the pointer to the start.
			ld b, a
			ld c, $4A
			xor a
			ld hl, 0
			ld e, l
			ld d, h
			call @BDOS

			pop hl
			pop de; hl de file size.






; file loading



ld c, $48
			ld a, (FileHandle)
			ld b, a
			ld de, (FCBTransferRawUserAreaAddrLow)
			ld hl, (FCBTransferCurrentSize)
			call @BDOS

			and a
			scf 
			ret nz ; <-escape if error.




; For saving a file



			ld c, $49
			ld a, (FileHandle)
			ld b, a
			ld de, (FCBTransferRawUserAreaAddrLow)
			ld hl, (FCBTransferCurrentSize)
			call @BDOS
			and a
			scf
			ret nz





; closing the file


push af
			ld c, $45				; File close.
			ld a, (FileHandle)
			ld b, a
			call @BDOS
			pop af
			ret





; creating or opening a file.

			ld de, MsgBoxBuffer; null terminated string "DRIVE:\PATH\file.ext",0

			xor a
			ld b, a
			ld c, $44				; File Create or delete/recreate.
			call @BDOS
			and a
			jr z, .FileCreated


I thinks it is all covered.

Por flyguille

Prophet (3028)

imagem de flyguille

02-02-2016, 14:26


@BDOSWRAPPED:				EQU $5



; BDOS calls have two problems (don't matter what FCB or FileHandles), one is the lack of DOS2 support for loading to secondary mappers, or saving from secondary mappers (secondary mapper isn't mean SUBSLOT, it is the logical internal dos2 so called secondaries RAM mappers, that is RAM that is not logically mapped as the primary mapper (default)).

; So the following routine, intercepts file write and file load BDOS functions and place a buffer in page3, for doing the FILE I/O but only if currently is slotted a secondary ram mapper.

; The other problem if any Device I/O error, happens it will waste your app and return the prompt to the user with the error. So, is supposte to mask those errors in a handable way.

so , in the initialization of the app, for subscribe the error masking routine.

ld c, $64				; Sets the error handle routine.
			ld de, @rberr
			call @BDOS

			ld c, $63
			ld de, @abort
			call @BDOS







@BDOS:			push af

			xor a
			ld (DiskErrorCode),a		; Resets the error code.

			in a, ($a8)
			ld (BDOSA8Status), a

			ld a, ($FFFF)
			cpl
			ld (BDOSFFFFStatus), a

			ld a, c				; Checks if the command is file transfer.
			cp $48
			jp c, .Normal
			cp $4A
			jp nc, .Normal

			ld a, (DOS2FilesIOPatchEnable)
			and a
			jp z, .Normal

			ld a, d				; Checks if source/destination address is PAGE2, all others pages are always primary RAM mapper (in my app).
			and $C0
			cp $80
			jp nz, .Normal

			push bc				; Checks if the current slot/sslot is the same for page 3 & 2 so, test if page2 is primary mapper.
			in a, ($A8)
			ld b, a
			and $C0
			ld c, a
			ld a, b
			and $30
			rlca
			rlca
			cp c
			pop bc
			jr nz, .Secondary

			push bc
			ld a, ($FFFF)
			ld b, a
			and $C0
			ld c, a
			ld a, b
			and $30
			rlca
			rlca
			cp c
			pop bc
			jp z, .Normal

.Secondary:		ld a, c				; Checks if the command is LOAD or SAVE file.
			cp $48
			jr z, .Load				

.Save:			pop af
			ld (BDOSStackWrap), sp		; Save the stack return point from an abort.

.SaveLoop:		ld a, h
			or l
			ret z

			push bc				; Save command.
			ld bc, 512
			sbc hl, bc			; HL = HL - 512.
			jr c, .FinalSave

			push hl
			ex de, hl			; now HL = location in Page 2.
			ld de, GeneralPurposeBuffer
			ldir
			ex de, hl			; now DE = next location in Page 2.
			pop hl

			pop bc				; Restore command.

			push bc
			push de
			push hl

			ld de, GeneralPurposeBuffer
			ld hl, 512
			call @BDOSWRAPPED

			pop hl
			pop de
			pop bc

			jr .SaveLoop

.FinalSave:		add hl, bc			; Restore length.

			push hl				; Save length.
			ld c, l
			ld b, h
			ex de, hl			; Now HL = location in Page 2.
			ld de, GeneralPurposeBuffer
			ldir
			pop hl				; Restore length.

			pop bc				; Restore command.

			ld de, GeneralPurposeBuffer
			jp @BDOSWRAPPED

.Load:			pop af
			ld (BDOSStackWrap), sp		; Save the stack return point from an abort.

.LoadLoop:		ld a, h
			or l
			ret z

			push hl
			push bc
			push de

			push bc
			ld bc, 512
			sbc hl, bc
			jr c, .FinalLoad
			pop bc				; Restore command.

			ld hl, 512			; Transfer is atleast 512 bytes this time.
			ld de, GeneralPurposeBuffer
			call @BDOSWRAPPED

			ld hl, GeneralPurposeBuffer
			pop de				; Restore destination adress.
			ld bc, 512
			ldir				; After DE = next destination address.
			pop bc				; Restore command.
			pop hl				; Restore original transfer size.
			dec h				; Transfer size = transfer size - 512.
			dec h
			jr .LoadLoop

.FinalLoad:		add hl, bc			; Restore length.
			pop bc				; Restore command.

			push hl				; Save length.
			ld de, GeneralPurposeBuffer
			call @BDOSWRAPPED

			pop bc				; Restore length, now BC = transfer that left (when is < 512).
			ld hl, GeneralPurposeBuffer
			pop de				; Restore destination address.
			ldir
			pop bc				; Restore command but not needed anymore.
			pop hl				; Restore last transfer size, but not needed anymore.

			xor a
			ret

.Normal:		pop af

			ld (BDOSStackWrap), sp		; Save the stack return point from an abort.

			jp @BDOSWRAPPED






@rberr:			ld (DiskErrorCode),a		; Save the error.
			ld a, 1				; ABORT!.
			ret






@abort:			ld sp, (BDOSStackWrap)

			ld a, (BDOSA8Status)
			out ($a8), a

			ld a, (BDOSFFFFStatus)
			ld ($FFFF), a

			ld a, (DiskErrorCode)
			and a
			ret nz

			ld a, $FF			; WARNING: It assumes mapper hasn't changed by the BDOS / DISKROM.
			and a

			ret				; Returns after the original BDOS function call.








DTA:								; Used to build up file data, to check file headers before loading them.
GeneralPurposeBuffer:		RB	512			; Used for building lists, handling strings, and by the "UserArea to UserArea" copy routine. Now it is needed to use for workaround the DOS2 bug!!! CHAN!!!.

DOS2FilesIOPatchEnable:		RB	1			; If <> 0 means that multimapper was detected, so it must check not doing file I/O directly on secondary mappers, to avoid the DOS2 bug. <----- WARNING: Enable this if detect that the app allocated RAM from a secondary mapper.



DiskErrorHandlerHookUpBackUp:	RW	1
AbortHandlerHookUpBackUp:	RW	1
DiskErrorCode:			RB	1
BDOSStackWrap:			RW	1
BDOSA8Status:			RB	1
BDOSFFFFStatus:			RB	1

FileHandle:			RB	1			; Filehandle ID for the current disk I/O.



After this issue solved (don't matter if FCB or file handles, the problems are there).

using it is simple



;opening a file


			ld de, MsgBoxBuffer		; Points to null terminate string "DRIVE:\PATH\filename.ext", 0 
			ld c, $43				; File open for read only.
			ld a, 1
			call @BDOS
			and a
			jr z, .LDFound

; not found.

.LDFound:		ld a, b
			ld (FileHandle), a			; Save the file handle ID.





;for knowing the file size.


ld a, (FileHandle)
			ld b, a					; It must read the filelength by moving the pointer to the end of the file.
			ld c, $4A
			ld a, 2
			ld hl, 0
			ld e, l
			ld d, h
			call @BDOS

			push de
			push hl

			ld a, (FileHandle)			; It must move the pointer to the start.
			ld b, a
			ld c, $4A
			xor a
			ld hl, 0
			ld e, l
			ld d, h
			call @BDOS

			pop hl
			pop de; hl de file size.






; file loading



ld c, $48
			ld a, (FileHandle)
			ld b, a
			ld de, (FCBTransferRawUserAreaAddrLow)
			ld hl, (FCBTransferCurrentSize)
			call @BDOS

			and a
			scf 
			ret nz ; <-escape if error.




; For saving a file



			ld c, $49
			ld a, (FileHandle)
			ld b, a
			ld de, (FCBTransferRawUserAreaAddrLow)
			ld hl, (FCBTransferCurrentSize)
			call @BDOS
			and a
			scf
			ret nz





; closing the file


push af
			ld c, $45				; File close.
			ld a, (FileHandle)
			ld b, a
			call @BDOS
			pop af
			ret





; creating or opening a file.

			ld de, MsgBoxBuffer; null terminated string "DRIVE:\PATH\file.ext",0

			xor a
			ld b, a
			ld c, $44				; File Create or delete/recreate.
			call @BDOS
			and a
			jr z, .FileCreated


I thinks it is all covered.

Por cbsfox

Champion (392)

imagem de cbsfox

02-02-2016, 14:38

I made several tests in the emulator, now with DOS2.

Indeed, when using DOS2 it freezes. Pressing "D" disables memory expansion and solves the problem.

BUT if you attach another external memory mapper, a bigger one, it does not freezes anymore.
And if you attach a megaram it does not freezes either.

And with Nextor, it does not freezes at all.

So, I am close to find the problem with DOS2. And with my own routines people.

PS: Of couse DSK-PRO will never work with DOS2 with fat16 partitions because we need the running program FAT16.COM and DSK-PRO does not allow that.

Por flyguille

Prophet (3028)

imagem de flyguille

02-02-2016, 15:34

cbsfox wrote:

I made several tests in the emulator, now with DOS2.

Indeed, when using DOS2 it freezes. Pressing "D" disables memory expansion and solves the problem.

BUT if you attach another external memory mapper, a bigger one, it does not freezes anymore.
And if you attach a megaram it does not freezes either.

That is because DOS2 takes as primary ram mapper the bigger one, except in turboR machines, that by speed reasons is forced to set the internal one as primary.

cbsfox wrote:

And with Nextor, it does not freezes at all.

So, I am close to find the problem with DOS2. And with my own routines people.

PS: Of couse DSK-PRO will never work with DOS2 with fat16 partitions because we need the running program FAT16.COM and DSK-PRO does not allow that.

PD: No excuse to make it 100% compatible, I served it to you in silver plate!.

Página 5/8
1 | 2 | 3 | 4 | | 6 | 7 | 8