Code: Select all
LNKPRG = $C533 ; rebuild BASIC line chaining
Moderator: Moderators
Code: Select all
LNKPRG = $C533 ; rebuild BASIC line chaining
thanks! I was able to create a "relinked" version of the prg file, by first loading it and then doing SYS 50483 ($c533).
See Mike's second post at this thread:
No, it is perfectly legal for a BASIC program to come around with 'badly-linked' link pointers. That happens as soon as you load a BASIC program to another BASIC start address than where it was saved from. That's the reason the re-link routine gets called inside the LOAD command (the load routine in the KERNAL does not touch the loaded memory contents).chysn wrote:However, I think you've clearly identified that it's the actual prg file that's screwed up, not your emulator.
The emulator ought to reproduce the behaviour of the original machine + OS as close as possible. In the case of the BASIC LOAD command, when the KERNAL load routine has finished and the LOAD command was issued in direct mode, it *does* re-link the BASIC program and the emulator should do likewise with a inject-to-RAM method when it autostarts a *.prg file.I'd think the best approach here would be to do nothing. If you start changing your code to accommodate something that's broken in the first place, you'll eventually code yourself into a nasty corner.
Inject-to-RAM is a fairly standard technique for emulators to avoid the intricacies of emulating the peripheral completely 'just' for transferring a file into RAM. In that case the result is what matters.chysn wrote:Why would an emulator need to explicitly do this? Is it not running the actual BASIC ROM code on emulated hardware?
I have hinted at that in this and my preceding post: you need to distinguish between what is at the responsibility of BASIC and what is at the responsibility of the KERNAL. The KERNAL load routine just transfers the file to memory, nothing else. Inject-to-RAM does the same in the end. BASIC then is responsible to establish all pointers and re-links the BASIC program if LOAD was issued in direct mode.Or does the autostart bypass or replace LOAD somehow?
Code: Select all
https://nippur72.github.io/vic20-emu/?joy=1&load=http://www.zimmers.net/anonftp/pub/cbm/vic20/games/unexpanded/3D+Silicon+Fish.prg