Enabling turbo mode in Assembly on Panasonic 2+/Turbo R machines

Страница 3/3
1 | 2 |

By Gradius2

Hero (621)

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

24-07-2021, 05:24

Enable R800 mode:
Filename: CHGCPU.COM

Usage (under MSX-DOS 2):
CHGCPU 0 (for Z80 mode)
CHGCPU 1 (for R800 ROM mode)
CHGCPU 2 (for R800 DRAM mode)

	.Z80
RDSLT	EQU	0000CH		; read slot
CALSLT	EQU	0001CH		; call slot
EXPTBL	EQU	0FCC1H		; Main ROM Slot

	ld	a,(EXPTBL)
	ld	hl,2dh		; read address
	call	RDSLT		; read slot
	cp	3
	jr	nc,TURBOR
	ld	de,MSG_NOTR	; not MSX turboR
	ld	c,9		; _STROUT
	call	5
	rst	0		; return to DOS

TURBOR:
	ld	c,6fh		; _DOSVER
	call	5
	ld	a,b		; DOS version
	cp	2
	jr	c,NOTDOS2
	ld	a,d		; MSXDOS.SYS version
	cp	2
	jr	c,NOTDOS2

	ld	a,(005ch+1)	; parameter
	sub	'0'		; 0:Z80  1:R800_ROM  2:R800_RAM
	ret	c		; abort if parameter < '0'
	cp	3
	ret	nc		; abort if '3' <= parameter
	or	80h		; change LED flag
	ld	ix,180h		; CHGCPU address
	ld	iy,(EXPTBL-1)	; Main ROM Slot
	call	CALSLT		; call slot
	rst	0		; return to DOS

NOTDOS2:
	ld	de,MSG_NOTDOS2	; not MSX-DOS2
	ld	c,9		; _STROUT
	call	5
	rst	0		; return to DOS

MSG_NOTR:
	DB	'not MSX turboR', 0dh, 0ah, '$'
MSG_NOTDOS2:
	DB	'not MSX-DOS 2', 0dh, 0ah, '$'
	END
Страница 3/3
1 | 2 |