MSXDISK 0.9 BETA: Virtual Floppy Disk Driver over JOYSTICK2 of MSX

Страница 10/11
3 | 4 | 5 | 6 | 7 | 8 | 9 | | 11

By ocitygate

Expert (67)

Аватар пользователя ocitygate

02-04-2021, 23:14

MSXDISK 0.98.2 released
Fixed RX and TX routines (bit misalignment bugs pointed out by NYYRIKKI)
Implemented ROMLDR in ASM (smaller file size, loads faster)

Source available here
Drop me an email for password

By gdx

Enlighted (4493)

Аватар пользователя gdx

03-04-2021, 02:11

ocitygate wrote:

Drop me an email for password

It's not freeware?

By RvS

Resident (49)

Аватар пользователя RvS

03-04-2021, 12:30

That is a nice trick!

NYYRIKKI wrote:

So one last time... 5 cycles away we send:

    CPI	                ;(18)
    EX AF,AF'           ;(5)
    ... 
    EX AF,AF'           ;(5) 
    JP PE,RXSTARTBIT    ;(11)

I just wanted to post an improved version (69 cycles), but by combining the code I believe I can remove another 3 cycles:

RXSTARTBIT:											
	IN A,($A2)                      |	|							
	AND E			        |	| (28)				
	JP NZ,RXSTARTBIT	        |	|						
DELAY:					|					
	CPI				| (78)				
	EX AF,AF'			|					
	LD D,B		        	|				
	LD B,$08			|						
					|					
BITLOOP:				|						
	INC HL				|		|			
	DEC HL				|		|			
	IN A,($A2) 				|	| (62)				
	RRCA					|	|			
	RR (HL)					|	|			
	DJNZ BITLOOP  			        |	|		
NEXTBYTE:					| (64)				
	LD B,D					|						
	EX AF,AF'  				|					
	JP PE,RXSTARTBIT	        	|					

By ocitygate

Expert (67)

Аватар пользователя ocitygate

03-04-2021, 12:02

gdx wrote:

It's not freeware?

The source code is password protected

By NYYRIKKI

Enlighted (5776)

Аватар пользователя NYYRIKKI

03-04-2021, 16:13

RvS wrote:

I just wanted to post an improved version (69 cycles), but by combining the code I believe I can remove another 3 cycles:

Hmm... Unfortunately I can't use your code as I need to test bit 4 instead of bit 0... but at least I found a way to par although it is not quite that elegant. Smile

    DEC HL
    LD D,(HL)

RXSTARTBIT:             ;WAIT FOR STARTBIT
    IN A,(090H)         ;(12)* | |
    AND E               ;(5)   | | (28)
    JP NZ,RXSTARTBIT    ;(11)  | |
    LD (HL),D           ;(8)   |
    CPI	                ;(18)  |
    EX AF,AF'           ;(5)   | (78)
    LD D,80H            ;(8)   |
    JP RXSKIP		;(11)  |
                        ;      
RXBITLOOP:              ;
    INC HL              ;(7)     |
    DEC HL              ;(7)     | (62)
RXSKIP:                 ;        |
    IN A,(090H)         ;(12)   ||
    AND E               ;(5)    ||
    ADD A,255           ;(8)    ||
    RR D                ;(10)   ||
    JR NC,RXBITLOOP     ;(13/8) ||  
    EX AF,AF'           ;(5)    | (64)
    NOP                 ;(5)    |
    JP PE,RXSTARTBIT    ;(11)   |
    LD (HL),D					

By NYYRIKKI

Enlighted (5776)

Аватар пользователя NYYRIKKI

03-04-2021, 16:31

... and just a moment later, finally a perfectly timed version. Smile

    DEC HL
    LD D,(HL)

RXSTARTBIT:             ;WAIT FOR STARTBIT
    IN A,(090H)         ;(12)* | |
    AND E               ;(5)   | | (28)
    JP NZ,RXSTARTBIT    ;(11)  | |
    LD (HL),D           ;(8)   |
    CPI	                ;(18)  |
    EX AF,AF'           ;(5)   | (78)
    LD D,80H            ;(8)   |
    JP RXSKIP		;(11)  |
                        ;      
RXBITLOOP:              ;
    LD IX,0             ;(16)    | (62)
RXSKIP:                 ;        |
    IN A,(090H)         ;(12)   ||
    AND E               ;(5)    ||
    ADD A,255           ;(8)    ||
    RR D                ;(10)   ||
    JP NC,RXBITLOOP     ;(11)   ||  
    EX AF,AF'           ;(5)    | (62)
    JP PE,RXSTARTBIT    ;(11)   |
    LD (HL),D

By RvS

Resident (49)

Аватар пользователя RvS

03-04-2021, 17:21

NYYRIKKI wrote:

... and just a moment later, finally a perfectly timed version. Smile

Nice work! I think this should work almost within the ~3% tolerance of the bitrate.
I will start testing this evening...

By NYYRIKKI

Enlighted (5776)

Аватар пользователя NYYRIKKI

03-04-2021, 19:49

One more... Here is my try to verify:

VERIFY:
    DEC HL
    LD D,(HL)
    LD E,10H

VERSTARTBIT:             ;WAIT FOR STARTBIT
    IN A,(090H)         ;(12)    | |
    AND E               ;(5)     | | (28)
    JP NZ,VERSTARTBIT   ;(11)    | |
    OR D                ;(5)     |
    CPI	                ;(18)    | (78)
    EX AF,AF'           ;(5)     |
                        ;        |      
VERBITLOOP:             ;        |
    LD A,(#21DD)        ;(14/16) ||  
    LD D,80H            ;(8/0)   ||
    IN A,(090H)         ;(12)   | |
    AND E               ;(5)    | | (62)
    ADD A,255           ;(8)    | |
    RR D                ;(10)   | |
    JP NC,VERBITLOOP+1  ;(11)   | |  
    EX AF,AF'           ;(5)    |
    RET NZ		;(6)    | (68)
    JP PE,VERSTARTBIT   ;(11)   |
    LD A,(HL)
    CP D
    RET

By ocitygate

Expert (67)

Аватар пользователя ocitygate

04-04-2021, 20:00

Has anyone tried the Chest feature?
Do you have any comments?

By RvS

Resident (49)

Аватар пользователя RvS

07-04-2021, 11:43

I have checked the routines with a function generator and I see errors appearing in the data at 59400 bps and at 55600 bps. This translates for my MSX in +2.8% and -3.1% tolerance for the bitrate. A very acceptable result!
I guess the 57600bps routines are now perfected. Time to increase the bitrates Smile

Страница 10/11
3 | 4 | 5 | 6 | 7 | 8 | 9 | | 11