Help with autostarting prg basic file with my JS emulator

You need an actual VIC.

Moderator: Moderators

Post Reply
matsondawson
The Most Noble Order of Denial
Posts: 343
Joined: Fri May 01, 2009 4:44 pm

Help with autostarting prg basic file with my JS emulator

Post by matsondawson »

Can anyone think of the easiest way to load a basic file into my Javascript emulator, given my emulator has no drives attached.

I'm thinking I could just load the file into ram at the correct basic location, and send a SYS command via keyboard events to emulator.
Is there's SYS location that would recognise the basic file and intialise it correctly?

Or, maybe, do I just have to load the file to the correct place in ram, and adjust some basic memory so that it is recognised?

I don't want to travel down the snapshot road.
User avatar
Mike
Herr VC
Posts: 4839
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Post by Mike »

Provided the program is copied into memory, and the pointers 43 .. 46 are set correctly, you can run it by executing this small ML program with a SYS from the READY prompt:

Code: Select all

JSR $C533 ; relink line pointers
JSR $C659 ; CLR, reset TXTPTR
JMP $C7AE ; execute next statement ("RUN")
This code can conveniently be put at address 320.

If the program is exactly placed in the position it was saved from, the relink step isn't necessary, and it suffices to place "RUN"+RETURN into the keyboard buffer. The pointers 43 .. 46 still must be correct.

Greetings,

Michael
rhurst
Omega Star Commander
Posts: 1371
Joined: Thu Jan 31, 2008 2:12 pm
Website: https://robert.hurst-ri.us
Location: Providence, RI
Occupation: Tech & Innovation

Post by rhurst »

Thanks Mike, that's great info ... and that should be simpler to implement Matthew. Let us know if you have any issues with it, good luck!
Any technology distinguishable from magic is insufficiently advanced.
https://robert.hurst-ri.us/rob/retrocomputing
matsondawson
The Most Noble Order of Denial
Posts: 343
Joined: Fri May 01, 2009 4:44 pm

Post by matsondawson »

Awesome thanks. JS emulator now loads PRG files. I've put blue meanies on to prove it.
matsondawson
The Most Noble Order of Denial
Posts: 343
Joined: Fri May 01, 2009 4:44 pm

Post by matsondawson »

Mike wrote:Provided the program is copied into memory, and the pointers 43 .. 46 are set correctly, you can run it by executing...
Oops, 45 and 46 need to be set to the end of where the basic program loaded... some programs weren't working for some reason and I just figured out why. Just wasn't paying enough attention.
Post Reply