Charging TK2 via NET

Anything QL Software or Programming Related.
Post Reply
User avatar
Cristian
Aurora
Posts: 965
Joined: Mon Feb 16, 2015 1:40 pm
Location: Veneto

Charging TK2 via NET

Post by Cristian »

Is it possible to transfer Toolkit2 via NET from a Trumpcard QL to an unexpanded QL (MGI) ?
If yes, could someone tell me how exactly should I proceed please?


User avatar
tofro
Font of All Knowledge
Posts: 2702
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: Charging TK2 via NET

Post by tofro »

The trump card ROM starts at $10000 and has a length of 32kBytes (and obviously contains much more than plain TK2).

You should be able to transfer that by

Code: Select all

a = RESPR(32768):LBYTES neti_1,a: REMark CALL a
on the target and

Code: Select all

SBYTES neto_1,65536,32768
on the source machine. You'll get the complete TrumpCard ROM onto the target. I am not sure if the "native TC part" would ignore the missing hardware when you CALL it and initialise TK2 nevertheless. Also the Trump Card does a number of complicated memory-re-mappings during startup. Needs a try.

The problem with TK2 in this ROM ist that it has apparently split off its initialisation routine and is initialised through the "Trump Card part" - So if you isolate TK2 from the ROM (which would end you about half the size of a transfer) you need to re-write an initialisation routine (I think someone has done this already - There must be a thread on that in the forum)

Tobias


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
User avatar
Cristian
Aurora
Posts: 965
Joined: Mon Feb 16, 2015 1:40 pm
Location: Veneto

Re: Charging TK2 via NET

Post by Cristian »

tofro wrote:I am not sure if the "native TC part" would ignore the missing hardware when you CALL it and initialise TK2 nevertheless. Also the Trump Card does a number of complicated memory-re-mappings during startup. Needs a try.
Thank you very much Tobias. I'll make some proofs.
And what about transferring a suitable TK2 file from flp1 to the unexpanded QL?


User avatar
tofro
Font of All Knowledge
Posts: 2702
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: Charging TK2 via NET

Post by tofro »

Cristian wrote: And what about transferring a suitable TK2 file from flp1 to the unexpanded QL?
Now, that's easy:

Pick some TK2 ROM file from Dilwyn's site and do the same thing as before on the target QL and

Code: Select all

COPY flp1_tk2rom_bin TO neto_1
on the source side. The network works like any other device on the QL.

Tobias


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
User avatar
Cristian
Aurora
Posts: 965
Joined: Mon Feb 16, 2015 1:40 pm
Location: Veneto

Re: Charging TK2 via NET

Post by Cristian »

tofro wrote:

Code: Select all

COPY flp1_tk2rom_bin TO neto_1
Unfortunately this method does not work :-(
At "LBYTES neti_1,a" it returns a BAD PARAMETER error.
I succeeded to LBYTES some screen dumps from NET1, but it seems impossible to LBYTES TK2 file from floppy.
I tried also to transfer Tk2 from Trumpcard using your very first method: the transfer itself seems to succeed without any error (anyway, when CALLed the QL freezes, probably because of the troubles you explained).


User avatar
janbredenbeek
Super Gold Card
Posts: 633
Joined: Wed Jan 21, 2015 4:54 pm
Location: Hilversum, The Netherlands

Re: Charging TK2 via NET

Post by janbredenbeek »

Cristian wrote:
tofro wrote:

Code: Select all

COPY flp1_tk2rom_bin TO neto_1
Unfortunately this method does not work :-(
At "LBYTES neti_1,a" it returns a BAD PARAMETER error.
I succeeded to LBYTES some screen dumps from NET1, but it seems impossible to LBYTES TK2 file from floppy.
I tried also to transfer Tk2 from Trumpcard using your very first method: the transfer itself seems to succeed without any error (anyway, when CALLed the QL freezes, probably because of the troubles you explained).
You might try COPY_H instead of COPY since LBYTES tries to read the file header from the network in order to determine how many bytes it should load.
Also, you cannot just CALL a ROM image since it starts with a specific header (which is actually an illegal 68000 instruction).
You can try this code:

Code: Select all

a=RESPR(16384)
LBYTES <ROM file>,a
CALL a+PEEK_W(a+6),0,0,0,0,0,0,0,0,0,0,a 
Jan.


User avatar
Cristian
Aurora
Posts: 965
Joined: Mon Feb 16, 2015 1:40 pm
Location: Veneto

Re: Charging TK2 via NET

Post by Cristian »

janbredenbeek wrote: You might try COPY_H instead of COPY since LBYTES tries to read the file header from the network in order to determine how many bytes it should load.
Also, you cannot just CALL a ROM image since it starts with a specific header (which is actually an illegal 68000 instruction).
You can try this code:

Code: Select all

a=RESPR(16384)
LBYTES <ROM file>,a
CALL a+PEEK_W(a+6),0,0,0,0,0,0,0,0,0,0,a 
Thank you very much Jan for your suggestions. COPY_H seems to work very well. But unfortunately the QL still freezes as soon as I CALL a+PEEK_W.....
I can't understand where am I wrong. I tried various TK2 files (not the ones for use with emulators) from here:
http://www.dilwyn.me.uk/pe/index.html

Sorry to bother! :oops:


User avatar
janbredenbeek
Super Gold Card
Posts: 633
Joined: Wed Jan 21, 2015 4:54 pm
Location: Hilversum, The Netherlands

Re: Charging TK2 via NET

Post by janbredenbeek »

Cristian wrote: Thank you very much Jan for your suggestions. COPY_H seems to work very well. But unfortunately the QL still freezes as soon as I CALL a+PEEK_W.....
I can't understand where am I wrong. I tried various TK2 files (not the ones for use with emulators) from here:
http://www.dilwyn.me.uk/pe/index.html

Sorry to bother! :oops:
I've tried loading the TK2.ROM file from the QL2K distribution into the (emulated) QL using CALL a+PEEK_W(a+6) and this went fine. Maybe your ROM image is corrupt or not a real ROM image? If it is a real ROM image then PEEK_W(a) should give 19195 and PEEK_W(a+2) should be 1.

Jan.


User avatar
Cristian
Aurora
Posts: 965
Joined: Mon Feb 16, 2015 1:40 pm
Location: Veneto

Re: Charging TK2 via NET

Post by Cristian »

janbredenbeek wrote:Maybe your ROM image is corrupt or not a real ROM image? If it is a real ROM image then PEEK_W(a) should give 19195 and PEEK_W(a+2) should be 1.
You hit the jackpot Jan! I don't know why, but the problem was indeed the downloaded ROMs. I tried with another TK2 Rom (from QemuLator) and it worked immediately 8-) The second QL didn't freeze when CALLed, so I could activate the toolkyt by typing TK2_ext.
Thank you very much for your great patience!


Post Reply