IO.FLINE doubts and emulation

Anything QL Software or Programming Related.
User avatar
chernandezba
Chuggy Microdrive
Posts: 54
Joined: Thu Dec 15, 2016 7:10 pm

Re: IO.FLINE doubts and emulation

Post by chernandezba »

By the way, what should be the value for register A1 after returning from IO.FLINE?
If I return a 9 byte line, A1 return value should be input value A1+9 ?


----

ZEsarUX
ZX Second-Emulator And Released for UniX
https://github.com/chernandezba/zesarux
User avatar
tofro
Font of All Knowledge
Posts: 2685
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: IO.FLINE doubts and emulation

Post by tofro »

#1 You don't seem to be tracing TRAP #4 - you should, although do don't need to emulate anything here. I'd expect a TRAP #4 to happen before the IO.FLINE traps. Also, in all of your logs, you should dump a6, as this might be part of the address after a TRAP #4
chernandezba wrote: Paranoid: Trap 3. D0=02H A0=00000020H A1=00000100H A6=0003F268H PC=0032AH is :
Paranoid: Trap 3: IO.FLINE. fetch a line of bytes
This one looks pretty reasonable - (a6,a1) is $3f368, a reasonable buffer address to load something to, also somewhat aligns with what we see in the MT.ALBAS trap.

In the next line, it's starting to get weird:
chernandezba wrote: Paranoid: IO.FLINE. Channel ID=32 Base of buffer A1=00000100H A3=0003FFF0H A6=00028000H
Paranoid: Returning IO.FLINE from our microdrive channel without error
Why did a6 suddenly change to $28000? If your trap emulation really changed something at $28000 + $100, you most probably already killed the system (explaining why you receive some trash as the channel name later on).

I guess your problem occurs exactly between those two traces and would start to investigate there.

Tobias


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
User avatar
tofro
Font of All Knowledge
Posts: 2685
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: IO.FLINE doubts and emulation

Post by tofro »

chernandezba wrote:By the way, what should be the value for register A1 after returning from IO.FLINE?
If I return a 9 byte line, A1 return value should be input value A1+9 ?
Exactly. Irrespectively of whether you had a buffer address relative to A6 or not, you should increment a1 by the number of bytes put into the buffer.


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
User avatar
chernandezba
Chuggy Microdrive
Posts: 54
Joined: Thu Dec 15, 2016 7:10 pm

Re: IO.FLINE doubts and emulation

Post by chernandezba »

I've made it!!!

I was geting an incorrect value for A6, correct value was 0003F368H

https://youtu.be/jh_5qZWvlBU[/youtube]

Thanks a lot !!

P.D. Seems the video is not shown. here is the link https://youtu.be/jh_5qZWvlBU


----

ZEsarUX
ZX Second-Emulator And Released for UniX
https://github.com/chernandezba/zesarux
martyn_hill
Aurora
Posts: 909
Joined: Sat Oct 25, 2014 9:53 am

Re: IO.FLINE doubts and emulation

Post by martyn_hill »

Very nice - well done!


Post Reply