Tcl script to check the contents of a byte just after the program header.

Page 1/2
| 2

Par DRomero

Expert (126)

Portrait de DRomero

30-01-2020, 00:05

Hello, I'm compiling some asm programs and testing them under openMSX using the Dirasdisk feature.

The machine I'm emulating is a TurboR with MegaflashRomSCC so it takes a while to fully load.

Is there a way to speed up the load process? I was thinking something like this:

In my ASM code, after Bload header for example, reserve one byte to communicate to some tcl script.

This way I can start openMSX at full speed with throttle and when the tcl script found the reserved byte after the header it can return to normal speed stopping the throttle process.

Should such script would be even possible and easy to program?

Thanks

!login ou Inscrivez-vous pour poster

Par Manuel

Ascended (19471)

Portrait de Manuel

30-01-2020, 09:47

Are you aware of this setting: https://openmsx.org/manual/commands.html#fullspeedwhenloading ?

You could still make a script with a watchpoint on a certain memory address and when the watchpoint triggers, you can execute any command, including throttle control.

Par DRomero

Expert (126)

Portrait de DRomero

30-01-2020, 18:03

Thanks Manuel, yes, I'm using already the fullspeedwhenloading command, but is not sufficient. In a system with a MegaflashROMSCC + MSX-DOS boot it take maybe 5 or 6 seconds to execute my compiled bloadable Asm BIN program from autoexec.bat, so I was thinking it would be cool to speed up the boot process for rapid testing by checking a signature my program has at 0xC000 for example.

Anyway I will check openMSX documentation thanks.

Par DrWh0

Paladin (839)

Portrait de DrWh0

30-01-2020, 18:12

https://openmsx.org/manual/commands.html#speed

"speed" command changes emulation speed, so I think this is exactly what you need :)

Par DRomero

Expert (126)

Portrait de DRomero

30-01-2020, 18:19

Thanks DrWh0, yesterday I tried the speed command but I noticed no difference at all, at least on Windows, and I tried the maximum speed, I think it was 100000 or something like that.

Don't know why, maybe I was doing something wrong...

Par Grauw

Ascended (10772)

Portrait de Grauw

30-01-2020, 20:45

openmsx.tcl:

set maxframeskip 100
set throttle off
after time 10 "set throttle on"

Run openmsx with openmsx -script openmsx.tcl. Using after time is the simplest.

To throttle on when writing a byte you can use debug set_watchpoint write_mem -once.

Par DRomero

Expert (126)

Portrait de DRomero

30-01-2020, 19:35

Thanks Grauw!!!! You are my hero, hehehe.

This is exactly what i was trying to accomplish, fast loading to test my programs Smile

I tried your method yesterday by myself but i forgot to put the maxframeskip there.

Thanks again Smile

Par DRomero

Expert (126)

Portrait de DRomero

30-01-2020, 19:44

And if you don't mind... another noob question please.

Is there any way to hide the second console window that pop ups on Windows each time openMSX starts? I think it's used for the ouput of stderr and logs but it's quite annoying. Anyway to pipe the results to a log file instead of an actual console window maybe?

Par DRomero

Expert (126)

Portrait de DRomero

09-02-2020, 22:03

I'll answer myself: for starting openMSX without the secondary stderr console you can use the command:

start /b openMSX

this can be used in the console or inside a batch file.

Thanks anyway.

Par Manuel

Ascended (19471)

Portrait de Manuel

09-02-2020, 23:19

Thanks for sharing Smile I didn't know about that.

Par NYYRIKKI

Enlighted (6067)

Portrait de NYYRIKKI

10-02-2020, 11:32

I think the original plan was pretty bad as it is both hard to implement and not compatible with real hardware.

Sometimes when I want to control the speed on my test routine, I do something like:

debug set_bp 0xfe10 {} {[return [set throttle false]]}
debug set_bp 0xfe20 {} {[return [set throttle true]]}

... then to my program I add CALL $FE10 when I want full speed and CALL $FE20 when I want normal speed... Pretty easy and straight forward.

Page 1/2
| 2