Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > VICE (x64) hot reloading
2018-02-21 20:03
Digger

Registered: Mar 2005
Posts: 437
VICE (x64) hot reloading

Does anyone know a way to pass a .prg file to already running x64 instance on macOS?

I am trying to optimize the launch time after compilation, killing and respawning x64 takes some time, even with memory injection enabled.
2018-02-21 21:10
JackAsser

Registered: Jun 2002
Posts: 2014
It’s not superstable but use remote monitor and the netcat in monitor args like:

echo -e “bank ram\nf 0000 ffff 0\nl\”file.prg\” 0\ng c000\n” | nc localhost 6510

Your start code (in this case at $c000) should clear timers and ack pending irqs to increase stability
2018-02-21 21:11
JackAsser

Registered: Jun 2002
Posts: 2014
Shouldit JAM which it will, simply run the cmd again
2018-02-21 21:20
Digger

Registered: Mar 2005
Posts: 437
@JackAss: Thanks! I will check this out.

I've also found a similar thread here: http://csdb.dk/forums/?roomid=11&topicid=117433&showallposts=1#.. with some good suggestions.

And a CodeBase64 article by Compyx: http://codebase64.org/doku.php?id=base:using_a_running_vice_ses..
2018-02-22 03:22
oziphantom

Registered: Oct 2014
Posts: 490
Its in Compyx's article, but Ian's Fast Kernal really helps ;)
2018-02-22 07:00
MagerValp

Registered: Dec 2001
Posts: 1078
As long as you have prg files associated with x64sc, just use:
bash$ open file.prg
It'll reset and load in an already running x64sc, or launch x64sc if necessary. open basically does the same thing as double clicking a file in the Finder.
2018-02-22 10:56
JackAsser

Registered: Jun 2002
Posts: 2014
Quote: @JackAss: Thanks! I will check this out.

I've also found a similar thread here: http://csdb.dk/forums/?roomid=11&topicid=117433&showallposts=1#.. with some good suggestions.

And a CodeBase64 article by Compyx: http://codebase64.org/doku.php?id=base:using_a_running_vice_ses..


My "injection" method, while a tiny bit unstable, gives you instant test turn around. I've added an inject-target in my Makefile and directly from Sublime assemble and inject then alt-tab to Vice for immediate check. It's a really sweet and fast setup.
2018-02-22 11:55
Perplex

Registered: Feb 2009
Posts: 255
I'm using this bash script to communicate with x64sc through the remote monitor:

#!/bin/sh

# Reload program and label definitions into a running x64sc session

# Send command to emulator's remote monitor
send () {
    echo "$1" | nc -N localhost 6510 >/dev/null
}

# Verify command line parameters
if test "$#" -lt 2; then
    echo "Usage: $0 <program-file> <labels-file> [start-address]"
    exit 1
fi

PROGRAM=$1
LABELS=$2
ADDRESS=$3

# Reset emulator
send "reset"
# Wait a bit for reset to finish when starting via RUN
# Assumes a kernal patched to bypass memory test
if ! test -n "$ADDRESS"; then sleep 0.1; fi

# Load new program file into memory
send "load \"$PROGRAM\" 0"

# Update labels
send "clear_labels"
send "load_labels \"$LABELS\""

if test -n "$ADDRESS"; then
    # Start using supplied address
    send "g $ADDRESS"
else
    # Start by issuing RUN command using keyboard buffer
    send "f 0277 027a 52 55 4e 0d"
    send "f 00c6 00c6 04"
fi


Like it says in a comment, you need a kernal patched to bypass the memory test on reset (which is useless in an emulator anyway),
otherwise you'll have to extend the sleep delay argument to at least a couple of seconds. You can find info about patching the kernal
and loading code into a running emulator here: http://codebase64.org/doku.php?id=base:using_a_running_vice_ses..
2018-02-23 00:46
Kruthers

Registered: Jul 2016
Posts: 21
Quote: As long as you have prg files associated with x64sc, just use:
bash$ open file.prg
It'll reset and load in an already running x64sc, or launch x64sc if necessary. open basically does the same thing as double clicking a file in the Finder.


I'm assuming that works on the mac b/c "finder", would love to find a way to do this under linux. Tried for hours one day to figure out how to script a "drag and drop" into an already-running vice but to no avail...
2018-02-23 16:58
soci

Registered: Sep 2003
Posts: 480
I use this in Makefiles usually. It does an autostart through remote monitor or starts a new VICE if it's not listening yet. Of course everything is directly runnable or can be compiled so for testing.
XFLAGS := -autostartprgmode 1 -autostart-warp +truedrive +cart -remotemonitor

all: demo
        -echo 'autostart "$(PWD)/$<"' | nc 127.0.0.1 6510 -q 1 2>/dev/null >/dev/null || (x64 $(XFLAGS) $< </dev/null 2>/dev/null >/dev/null) &
2018-02-23 17:44
chatGPZ

Registered: Dec 2001
Posts: 11386
noone made a codenet clone for the remote binary interface yet? why?
 
... 8 posts hidden. Click here to view all posts....
 
Previous - 1 | 2 - Next
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
Flashback
diabolus
Peacemaker/CENSOR/Hi..
duce/extend
Beast/Crescent
Hydrogen/Glance
Alakran_64
Devia/Ancients
Guests online: 93
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 Edge of Disgrace  (9.6)
6 What Is The Matrix 2  (9.6)
7 The Demo Coder  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 No Listen  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 Rainbow Connection  (9.5)
7 Dawnfall V1.1  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Triad  (9.3)
5 Censor Design  (9.3)
Top Diskmag Editors
1 Magic  (9.8)
2 hedning  (9.6)
3 Jazzcat  (9.5)
4 Elwix  (9.1)
5 Remix  (9.1)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.045 sec.