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 > D64 from KickAssembler -> Autorun in Vice
2023-02-08 11:51
TWW

Registered: Jul 2009
Posts: 514
D64 from KickAssembler -> Autorun in Vice

Can someone point me in the right direction to autostart .d64 images made in KickAssembler in Vice;


When creating a D64 file from within KickAssembler, you would go about doing it like this;

"disktest.asm" file:
	.disk [filename="test.d64", name="AAARGGGHHH      ", id="FOOKK" ] {

		[name="File1",            type="prg",  segments="File1_PRG" ],
		[name="File2",            type="prg",  segments="File2_PRG" ],
		[name="----------------", type="rel"                        ],
	}


.segment File1_PRG []
    BasicUpstart2(Main)
    Main:
        lda #$00
        sta $d020
        rts

.segment File2_PRG []
    BasicUpstart2(Main)
    Main:
        lda #$01
        sta $d020
        rts


You the assemble it with:

java -jar KickAss.jar disktest.asm - which will create the file "test.d64"

How do i add the command line option to:

-execute "x64sc.exe"

to make Vice autostart the test.d64 file we just assembled without manually adding the "test.d64" to the -execute command (I want it to work for all D64 files i Assemble without having to change this command every time?
2023-02-08 11:56
Krill

Registered: Apr 2002
Posts: 2533
Just use a different hammer, for once, like the shell.

Something like
java -jar KickAss.jar disktest.asm && x64sc.exe [...]
2023-02-08 12:46
TWW

Registered: Jul 2009
Posts: 514
Quoting Krill
java -jar KickAss.jar disktest.asm && x64sc.exe [...]


It's the [...] part I'm asking about :)

To reiterate:

"I want it to work for all D64 files i Assemble without having to change this command every time"

So how do I take the filename "test.d64" (which was produced by KickAssembler, based on the "filename" parameter in the .disk function) and make it run when launching Vice (by whatever hammer used)?
2023-02-08 13:09
Groepaz

Registered: Dec 2001
Posts: 10589
Quite obviously you'll have to pass the filename to the emulator somehow...

I smell XY problem. Is this a commandline to be used in some IDE or sth like that?
2023-02-08 13:17
Stone

Registered: Oct 2006
Posts: 158
You're already changing the input filename "each time", so why not the output filename as well?

If whatever IDE you're using has some kind of macro facility, you could agree with yourself on some naming convention and make a generic build-and-execute rule like

java -jar KickAss.jar $(InputName).asm -execute "x64sc -autostart $(InputName).d64"
2023-02-08 13:42
TWW

Registered: Jul 2009
Posts: 514
@ GPZ: Yes, I use NP++ and NppExec plugin. Currently this works for autoinjecting .prg files and cartridge files and also to supercpu emulator by choosing the appropriate script when i "F6" to assemble/run. Conveniant. However I ran into this issue with D64 files due to the way KickAss creates the files.

Therefore agreed, it's a question of how to pass the appropriate file name and hence more of a Assembler / IDE issue. Chapter 12.1 of the KA manual illustrates how you can pass command line arguments to the script, but here is the XY smell issue. What i need is a way to export the filename from the source when assembling it.

@ Stone:
Yes, this is how I got it to work by using the assemblers autolaunch command but then I had to have the source name (test.asm) equal to the output name (test.d64) and the filname parameter in the .disk directive as well. In addition (since test.d64 is only a file, no "regular output" was created by the assembler) I had to add a simple .pc = $0801 ; nop thnig just to produce some data. Looked like this was overwritten by the .disk directive and allowed Vice to be started. If I omitted this part, Vice would just open/close as no info was passed. So it was basically a hack and very restrictive.
2023-02-08 14:05
Groepaz

Registered: Dec 2001
Posts: 10589
So what stone suggested is the solution. Use the Macros your IDE provides. And don't use weird assembler features to name output files, always pass filenames to the assembler from command line.

That said, for a more complex setup with multiple input and output files, use a makefile.
2023-02-08 15:52
Frantic

Registered: Mar 2003
Posts: 1605
Yes, it is good to know how to use makefiles.
2023-02-17 09:49
TWW

Registered: Jul 2009
Posts: 514
This works but you need to save a new script and change the D64 filename for each project (NP++ allows this, no problem):
    java -jar "PATH\KickAss.jar" "$(FULL_CURRENT_PATH)" -showmem
    cmd /c "PATH\x64sc.exe "DISKNAME.d64"" >vice.txt

And you could just use a standard filname across all projects as suggested above.
2023-02-19 02:05
bepp

Registered: Jun 2010
Posts: 258
I can highly recommend Paul Hocker's extension for Visual Studio Code + Kick Assembler.

Not being an expert, it took me 5 mins to set it up. And it will compile and start Vice with a keystroke. It has full intellisense for all the instructions, tooltips for variables etc. Adding breakpoints is very simple and it will launch the C64Debugger and stop in the right place, and then you can step instructions etc.

In my opinion Notepad++ does not excel as a programming editor =)

Check it out!
https://marketplace.visualstudio.com/items?itemName=paulhocker...
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
hedning/G★P
Mason/Unicess
Krill/Plush
MightyAxle
TheEnemy/TREX/THD
Meikel aka ZUX/Sparks
MCM/ONSLAUGHT
DaTucker/Rabenauge
Airwolf/F4CG
katon/Lepsi De
Røly/Mayday!
Guests online: 95
Top Demos
1 Edge of Disgrace  (9.6)
2 Coma Light 13  (9.6)
3 Uncensored  (9.6)
4 Comaland 100%  (9.6)
5 Lunatico  (9.6)
6 Bromance  (9.5)
7 E2IRA  (9.5)
8 Unboxed  (9.5)
9 The World Is Not Eno..  (9.5)
10 Memento Mori  (9.5)
Top onefile Demos
1 Party Elk 2  (9.9)
2 Copper Booze  (9.6)
3 Barry Boomer - Trapp..  (9.5)
4 Dawnfall V1.1  (9.5)
5 Daah, Those Acid Pil..  (9.5)
6 Onscreen 5k  (9.5)
7 POKE 56576,1 for Unl..  (9.5)
8 No Mercy for the Tro..  (9.4)
9 Offering  (9.4)
10 Selbuvotter Latitudes  (9.4)
Top Groups
1 Booze Design  (9.4)
2 Censor Design  (9.3)
3 Crest  (9.3)
4 Oxyron  (9.2)
5 Maniacs of Noise  (9.2)
Top Cover Designers
1 Duce  (9.8)
2 Electric  (9.8)
3 Junkie  (9.7)
4 The Elegance  (9.5)
5 Mermaid  (9.3)

Home - Disclaimer
Copyright © No Name 2001-2023
Page generated in: 0.042 sec.