turbo R support

Page 5/5
1 | 2 | 3 | 4 |

Par Sonic_aka_T

Enlighted (4130)

Portrait de Sonic_aka_T

01-05-2004, 16:48

Both CPU's start at $0000 like normal. The computer starts on Z80 and then activates the R800, the R800 then also starts at $0000 but checks to see if it is coming out of reboot. If so, it jumps to the CHGCPU routine to change back to Z80. The Z80 then finishes the standard boot code. The logo part is done by the R800 again, but now by simply calling CHGCPU. The rest is done on Z80. I don't know why, they might as well have done at least most of it on R800. I guess it because it needs to check all slots for ROMs anyways...

Par coldbreeze

Expert (127)

Portrait de coldbreeze

18-12-2010, 23:28

Has anyone tried using the Assembly code posted earlier that directly accesses the ports to switch between Z80, R800 + ROM, R800 + DRAM? I tried using it from MSX-DOS2 (org #100) and it hangs up. The standard Turbo R BIOS routines, however, worked fine for me.

Par NYYRIKKI

Enlighted (5941)

Portrait de NYYRIKKI

19-12-2010, 15:13

You can change between DRAM and ROM mode by using I/O ports, but changing CPU is more hard:

You have to remember that each CPU is individual and they have their own registers. Most important register you need to take care is called PC. If you change CPU from your own routine the other CPU will continue where it originally turned off, so it will continue from exactly same address the BIOS routine was. You need to trick both CPU's switch address to some other place but then remember that using BIOS-routine will not work anymore.

Par coldbreeze

Expert (127)

Portrait de coldbreeze

20-12-2010, 06:44

NYYRIKKI, do you have a routine that does the switching bypassing the BIOS calls by any chance?

I must admit, I did not have sufficient time to play with the direct port solution. My problem was to write a command line tool that reports the current CPU mode and switches between the three modes. I have implemented it by using the respective BIOS routines (by using inter-slot calls from MSX-DOS2).

Par NYYRIKKI

Enlighted (5941)

Portrait de NYYRIKKI

29-12-2010, 14:56

I really DON'T recommend making your own version of CHCPU, but if you really want to, then maybe something like this could work:

CHCPU:	EQU #180

INIT_NEW_CHCPU:

	XOR A
	PUSH AF
	CALL CHCPU ' Z80 execute & R800 Exit
	POP AF
	JR NZ,.SKIP ' First exit of NEW_CHCPU
	LD A,2
.SKIP
	DEC A
	PUSH AF
	CALL NEW_CHCPU
	POP AF ' Second exit of NEW_CHCPU
	RET

NEW_CHCPU:
	<copy of the routine in BIOS>

If you need to use CHCPU routine on MSX-DOS, I recommend just doing:

MYCHCPU:
	'IN: A = CPU MODE

	RST #30
	DB #80
	DW #180

	RET

Par coldbreeze

Expert (127)

Portrait de coldbreeze

03-01-2011, 11:32

NYYRIKKI, thanks a lot for your help! Turbo-R has been fun to play with.

Par NYYRIKKI

Enlighted (5941)

Portrait de NYYRIKKI

04-01-2011, 15:40

@coldbreeze: I wrote a bit more detailed information about different CPU modes and how to use them. You may want to check this out:
http://www.msx.org/forumtopicl12166.html

Page 5/5
1 | 2 | 3 | 4 |