6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Fri Nov 22, 2024 7:46 am

All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Sat Apr 27, 2019 6:49 am 
Offline

Joined: Sat Aug 21, 2010 7:52 am
Posts: 231
Location: Arlington VA
I'm working with VICE emulator on Linux, but this approach should work on other operating systems. What I want to do is
  • build my 6502 code
  • launch a PET (shell script)
  • load the freshly built binary (KEYBUF)
  • then execute it(also KEYBUF)
  • Finally I'd like the emulated PET to exit, to disappear (BREAK/COMMAND trick).

VICE has breakpoints. This uses the COMMAND to run a monitor command when VICE hits the breakpoint, which on the VIC-20 contains an RTS opcode. The 6502 test code will (hopefully) complete successfully, and as a final action do SYS 65503 (or somehow transfer control to $FFDF). Hitting breakpoint triggers the command, which kills the emulator process!

Code:
BREAK +65503
COMMAND 1 "quit"
KEYBUF load"test",8\x0Drun\x0D


Attachments:
Screenshot_2019-04-27_01-33-41.png
Screenshot_2019-04-27_01-33-41.png [ 23.24 KiB | Viewed 1996 times ]
Top
 Profile  
Reply with quote  
PostPosted: Sat Apr 27, 2019 6:52 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10985
Location: England
Nice idea!


Top
 Profile  
Reply with quote  
PostPosted: Sat May 04, 2019 6:00 am 
Offline

Joined: Tue Feb 24, 2015 11:07 pm
Posts: 81
Very cool!

I have an `on-change` script that uses inotify to notice when the `.d64` file is updated by the build process and then does `killall xplus4` and then re-launches VICE with the updated `.d64` but it's cool that you can terminate VICE under 6502 control!


Top
 Profile  
Reply with quote  
PostPosted: Fri Jun 07, 2019 8:51 am 
Offline

Joined: Sat Aug 21, 2010 7:52 am
Posts: 231
Location: Arlington VA
it sorta works now!

https://twitter.com/pettilmobile/status ... 9609624578


Top
 Profile  
Reply with quote  
PostPosted: Fri Jun 21, 2019 10:29 pm 
Offline

Joined: Fri May 05, 2017 9:27 pm
Posts: 895
chitselb wrote:
I'm working with VICE emulator on Linux

Me too.
Quote:
VICE has breakpoints. This uses the COMMAND to run a monitor command when VICE hits the breakpoint, which on the VIC-20 contains an RTS opcode. The 6502 test code will (hopefully) complete successfully, and as a final action do SYS 65503 (or somehow transfer control to $FFDF). Hitting breakpoint triggers the command, which kills the emulator process!

I didn't know VICE has break points.
I suppose I just saw it as a C-64 on my Linux box and used it pretty much as I used the real C-64 I had.
This is really cool. You've just given me an idea. I don't know if it is possible yet, and it may already have been done. What about using the addresses of the C-64 user port and data direction register as break points to get VICE to emulate the C-64's user port?


Top
 Profile  
Reply with quote  
PostPosted: Sat Jul 13, 2019 12:37 am 
Offline

Joined: Sat Aug 21, 2010 7:52 am
Posts: 231
Location: Arlington VA
behold! remote 8-bit test automation!

https://photos.app.goo.gl/BX42trUAy7Q3Ui4x9


Top
 Profile  
Reply with quote  
PostPosted: Fri May 14, 2021 9:47 pm 
Offline

Joined: Sat Sep 05, 2020 3:12 pm
Posts: 22
chitselb wrote:
behold! remote 8-bit test automation!

https://photos.app.goo.gl/BX42trUAy7Q3Ui4x9


Great stuff!

Picking up this 2 year old thread to compare notes. A bit after you I faced the same problem, fully automating build and test sequences with VICE. I hadn't seen your post, and didn't know or didn't think about VICE's breakpoint feature; I instead used the emulated file system as signal path from inside VICE to the outside world: The emulator is watched by a shell loop, and as soon as a certain file (called "notdone") disappears (because the code inside the emulator scratched it), the shell loop terminates VICE. See https://github.com/pzembrod/cc64/blob/m ... ice.sh#L50

In a thread on github/DurexForth (https://github.com/jkotlinski/durexforth/issues/312) I learned of yet another method to terminate VICE: The "debug cartridge": https://vice-emu.pokefinder.org/index.php/Debugcart
If activated via command line flag, then writing to a certain address terminates VICE.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 29 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: