Emulation for develping SW that works on real HW: FEATURE REQUEST

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

By hap

Paragon (2037)

hap's picture

12-06-2009, 11:20

AFAIK that only applies to VRAM accesses.
Could you send the ROM to me too, and tell where exactly it's supposed to mess up? =)

By ARTRAG

Enlighted (6517)

ARTRAG's picture

12-06-2009, 13:15

sure!
sending

By hap

Paragon (2037)

hap's picture

12-06-2009, 16:51

I couldn't test it on my MSX1 (since I can't run 48KB ROMs on it), though meisei says these are too fast:
67FE ED B2 inir
6844 ED B2 inir

Another thing, not related to VRAM accesses, if i press the spacebar more than ~0.1 seconds at cutscene message, the game will go to the next message. Could you change it so the game will listen to presses only? (1->0)

*edit* another idea, how about a sprite animation together with the cha-cha-cha-cha when walking up/down stairs? 1 sprite for head+feet, 1 sprite for torso, 1 sprite for pants (align torso and pants sprites below eachother: max 2 sprites per line so there's still room for the 2-sprite floor indicator). When going downstairs, use 4 invisible high priority sprites below the stairs as mask (lower priority than floor indicator). Doable? Tongue

By Manuel

Ascended (18088)

Manuel's picture

12-06-2009, 18:34

So, ARTRAG, did you arleady expand the script a bit to check for reads as well? Maybe then you'll find the things hap mentioned as well!

By ARTRAG

Enlighted (6517)

ARTRAG's picture

12-06-2009, 23:00

yes! I did a vdp_read_test script and it confirms that I have 2 INIR that read too fast an outside the VBLANK...

namespace eval vdp_read_test {

# you can tweak these to test for other stuff
variable ioport 0x98
variable cycle_max 29
# if you set this to true, you can also see OK reads, but there are many of those!
variable debug false

variable last_read_time 0
variable is_enabled false
variable watchpoint_id
variable address_list

proc check_time {} {
	variable last_read_time
	variable cycle_max
	variable debug
	variable address_list

	set current_time [machine_info time]
	set cycles [expr round($::z80_freq*($current_time - $last_read_time))]
	set screen_enabled [expr [debug read "VDP regs" 1] & 64]
	set pc [format "%04x" [reg PC]]
	if {($cycles < $cycle_max) && $screen_enabled} {
		if {[lsearch -exact $address_list $pc] == -1} {
			puts stderr  [format "VDP I/O read too fast on address: 0x%s, took $cycles cycles (< $cycle_max)" $pc]
			lappend address_list $pc
			puts "List of addresses where too fast I/O is done: $address_list"
		}
	} else {
		if {$debug} {
			if { !$screen_enabled } {
				set reason "screen is disabled"
			} else {
				set reason "took $cycles cycles, > $cycle_max"
			}
			puts stderr "VDP I/O read OK on address: 0x$pc, $reason"
		}
	}
	set last_read_time $current_time
}

proc toggle_vdp_read_test {} {
	variable is_enabled
	variable watchpoint_id
	variable address_list
	variable ioport

	if {!$is_enabled} {
		set watchpoint_id [debug set_watchpoint read_io $ioport {} vdp_read_test::check_time]
		set is_enabled true
		set address_list 
    } else { debug remove_watchpoint $watchpoint_id set is_enabled false } } namespace export toggle_vdp_read_test } ;# namespace vdp_read_test namespace import vdp_read_test::*

I think that this is the reason of my bug, no exotic emulation problems or other....sorry for the false allarm...

I added an HALT before the INIR and this should have solved. As soon as I will be able to test the code on a real msx1 I will be able to say how it goes.

hap, nice idea, but I think that the minimalistic style of the game could be disrupted by such a detail
in other words,
we are too lazy for that :-)

By Manuel

Ascended (18088)

Manuel's picture

12-06-2009, 23:46

It's easy to merge the two scripts, then you can even measure between read and write (e.g. first a read, then a write), which should also be not too short a time from each other...!
All you need to do is add an extra watchpoint line. (And store its id in a new var, if you want to do it cleanly.)

By ARTRAG

Enlighted (6517)

ARTRAG's picture

13-06-2009, 07:56

manuel
I was thinking that you must always set port 0x99 telling the address and the fact that the next operation is a READ or WRITE before accessing port 0x98....

assume you have to read from address N and write that value to address N+1

I would do

set address N for read using port 0x99,
in a,0x98
set address N+1 for write using port 0x99,
out 0x98, a

are you sure that on msx1 you can read and write the vram by just interleaving in's and out's from port 0x98,
without setting port 0x99 for read and write each time ?

From what you say it would be possible do do:

set address N for read using port 0x99,
in a,0x98
out 0x98, a

??

By Manuel

Ascended (18088)

Manuel's picture

13-06-2009, 11:11

Um, I only talked about how to set up the Tcl script, I don't know much about how to program the VDP...

By ARTRAG

Enlighted (6517)

ARTRAG's picture

13-06-2009, 11:42

Well, the need of measuring the time between read and write exists only if in's and out's at port 0x98 can be interleaved without setting port 0x99 to change of I/O mode from read to write and vice versa.
Otherwise the time spent for setting port 0x99 is by far larger than the one needed by even the crappiest vdp on the msx scene

By Manuel

Ascended (18088)

Manuel's picture

13-06-2009, 12:14

ah, now I see what you mean. Well, I didn't mean to imply this, because, as I said, I know too little of programming the VDP.

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