1541 Emulation
Moderator: Moderators
- chysn
- Vic 20 Scientist
- Posts: 1204
- Joined: Tue Oct 22, 2019 12:36 pm
- Website: http://www.beigemaze.com
- Location: Michigan, USA
- Occupation: Software Dev Manager
1541 Emulation
Currently, my VIC-20 workflow involves:
(1) Write the software in Eclipse
(2) Assemble it with 6502Overdrive
(3) (sometimes, but not always, generate a BASIC loader program)
(4) Write the file to SD card
(5) Eject the SD card and insert it into my SD2IEC
(6) Load the file on the VIC-20 from the SD cart
(7) Run it
(8) Eject the SD card and insert it into my MacBook
(9) Back to step 1
Okay, so... is there a way to get the SD card of out this workflow? Maybe have USB hardware to the IEC port and have the MacBook emulate a 1541?
(1) Write the software in Eclipse
(2) Assemble it with 6502Overdrive
(3) (sometimes, but not always, generate a BASIC loader program)
(4) Write the file to SD card
(5) Eject the SD card and insert it into my SD2IEC
(6) Load the file on the VIC-20 from the SD cart
(7) Run it
(8) Eject the SD card and insert it into my MacBook
(9) Back to step 1
Okay, so... is there a way to get the SD card of out this workflow? Maybe have USB hardware to the IEC port and have the MacBook emulate a 1541?
VIC-20 Projects: wAx Assembler, TRBo: Turtle RescueBot, Helix Colony, Sub Med, Trolley Problem, Dungeon of Dance, ZEPTOPOLIS, MIDI KERNAL, The Archivist, Ed for Prophet-5
WIP: MIDIcast BASIC extension
he/him/his
WIP: MIDIcast BASIC extension
he/him/his
- Mike
- Herr VC
- Posts: 4987
- Joined: Wed Dec 01, 2004 1:57 pm
- Location: Munich, Germany
- Occupation: electrical engineer
Re: 1541 Emulation
I don't exactly know the size and type of the project(s) you're working at and for sure my reply doesn't directly address your question, but in your list, ...
In that case, the sheer number of full turn-around cycles you're implying here is minimized and most of the development takes place on the PC/Mac only. Of course this requires you have an up-to-date emulator installed on your big machine, are willing to use it, and you trust its emulation capability.
The only time I'd need to go with the extended cycle you're describing is when I stumble upon (unexpected) behaviour of real hardware that isn't fully replicated by emulation.
... around point 3, I am missing the step "(x) check the software in emulation on PC/Mac until most obvious bugs are ironed out".chysn wrote:(1) Write the software in Eclipse
(2) Assemble it with 6502Overdrive
(3) (sometimes, but not always, generate a BASIC loader program)
(4) Write the file to SD card
[...]
In that case, the sheer number of full turn-around cycles you're implying here is minimized and most of the development takes place on the PC/Mac only. Of course this requires you have an up-to-date emulator installed on your big machine, are willing to use it, and you trust its emulation capability.
The only time I'd need to go with the extended cycle you're describing is when I stumble upon (unexpected) behaviour of real hardware that isn't fully replicated by emulation.
- chysn
- Vic 20 Scientist
- Posts: 1204
- Joined: Tue Oct 22, 2019 12:36 pm
- Website: http://www.beigemaze.com
- Location: Michigan, USA
- Occupation: Software Dev Manager
Re: 1541 Emulation
Heh... I knew that was going to come up.
The fact of the matter is, I don't know how to use VICE. I don't know how to load my programs into it, or what "disk images" have to do with anything. They seem to be files and not directories, so I'm not sure how to add anything to them from outside the VIC-20 emulation. The only thing in VICE I have any use for is petcat.
I know this can all be remediated with the appropriate documentation. When I read through something that seems useful*, I find that what I see on the MacOS version looks absolutely nothing like what's shown in the tutorials or documentation, or whatever. It's not like my VICE version is really old (3.1). It's that they seem to have given up on MacOS. And also the keyboard differences are super-annoying. But I love petcat.
Okay, yeah, that all sounds very get-off-my-lawn-whippersnapper, now that I read it back. But if I could figure out how to actually load the programs I make into VICE, that would be quite the coup.
* Like this: https://wpguru.co.uk/2014/06/how-to-loa ... e-in-vice/
VIC-20 Projects: wAx Assembler, TRBo: Turtle RescueBot, Helix Colony, Sub Med, Trolley Problem, Dungeon of Dance, ZEPTOPOLIS, MIDI KERNAL, The Archivist, Ed for Prophet-5
WIP: MIDIcast BASIC extension
he/him/his
WIP: MIDIcast BASIC extension
he/him/his
- Mike
- Herr VC
- Posts: 4987
- Joined: Wed Dec 01, 2004 1:57 pm
- Location: Munich, Germany
- Occupation: electrical engineer
Re: 1541 Emulation
As a first measure, try dragging a *.prg file or *.d64 disk image from a folder into the main window of VICE and see what happens.
You'll have to acquaint yourself with:
In the first case (TDE on), VICE fully emulates the 1541. Only the emulated DOS has direct access to the *.d64 file and reads it as if there was a magnetic media really. The emulated DOS processes the sectors and sends (or receives) the data from an emulated IEC bus between emulated 1541 and emulated VIC-20. Doesn't get much more accurate than that. Even the clock frequency difference between 1541 (1 MHz) and PAL (~1.10 MHz) or NTSC (~1.03 MHz) VIC-20 is taken care of.
With TDE off, VICE takes a lot of short-cuts, which reduce the emulation fidelity, but increase the speed a lot. This mostly concerns the use of drive speeders, which require TDE on to function correctly. As a rough hint, if something works with TDE off, on real hardware it will also run with a SD2IEC (instead of a 1541).
The c1541 command line tool included with VICE can be used to transfer files between Mac/PC directories and *.d64 disk image files.
Greetings,
Michael
You'll have to acquaint yourself with:
- positional vs. symbolic mapping of the keyboard,
- true drive emulation (TDE) on (most accurate, but only works within disk images!) vs. TDE off (much faster, and can also use host directories as "disks"),
- how to setup different memory sizes (unexpanded, +3K, +8K or more),
- how to setup the joystick,
- how to explicitly change *.d64 images during program execution (i.e. "change disks" !) in 'Peripheral Settings'
In the first case (TDE on), VICE fully emulates the 1541. Only the emulated DOS has direct access to the *.d64 file and reads it as if there was a magnetic media really. The emulated DOS processes the sectors and sends (or receives) the data from an emulated IEC bus between emulated 1541 and emulated VIC-20. Doesn't get much more accurate than that. Even the clock frequency difference between 1541 (1 MHz) and PAL (~1.10 MHz) or NTSC (~1.03 MHz) VIC-20 is taken care of.
With TDE off, VICE takes a lot of short-cuts, which reduce the emulation fidelity, but increase the speed a lot. This mostly concerns the use of drive speeders, which require TDE on to function correctly. As a rough hint, if something works with TDE off, on real hardware it will also run with a SD2IEC (instead of a 1541).
The c1541 command line tool included with VICE can be used to transfer files between Mac/PC directories and *.d64 disk image files.
Greetings,
Michael
- chysn
- Vic 20 Scientist
- Posts: 1204
- Joined: Tue Oct 22, 2019 12:36 pm
- Website: http://www.beigemaze.com
- Location: Michigan, USA
- Occupation: Software Dev Manager
Re: 1541 Emulation
I've been getting acquainted with c1541. As a command-line utility, this was easily-integrated into my existing bash build script, which updates my object code, PRG, and git repo in a single step. Now it also deletes then writes the associated PRG files to the .d64 image so I can try things out in VICE.
I've still got a ton to learn about VICE (where are the Stop and Restore keys? Is there a warm restart for when I crash it?), but it's clear that this is going to be a lot faster than going back and forth between the Mac and the VIC.
Thanks, as always!
I've still got a ton to learn about VICE (where are the Stop and Restore keys? Is there a warm restart for when I crash it?), but it's clear that this is going to be a lot faster than going back and forth between the Mac and the VIC.
Thanks, as always!
VIC-20 Projects: wAx Assembler, TRBo: Turtle RescueBot, Helix Colony, Sub Med, Trolley Problem, Dungeon of Dance, ZEPTOPOLIS, MIDI KERNAL, The Archivist, Ed for Prophet-5
WIP: MIDIcast BASIC extension
he/him/his
WIP: MIDIcast BASIC extension
he/him/his
- Mike
- Herr VC
- Posts: 4987
- Joined: Wed Dec 01, 2004 1:57 pm
- Location: Munich, Germany
- Occupation: electrical engineer
Re: 1541 Emulation
Now that was fast!chysn wrote:[...] c1541 [...] was easily-integrated into my existing bash build script, [...]
Try [Esc] and [PgUp]. Upon taking a quick peek on a photo of a MacBook keyboard, the function of [PgUp] mostly probably requires the [Fn] key held together with the [Up] cursor key.I've still got a ton to learn about VICE (where are the Stop and Restore keys?
Even with positional mapping, it's nearly impossible to replicate the VIC-20 keyboard 1:1 even when there is a numeric keypad. But it's still better than symbolic mapping, IMO - I have a full German keyboard on my laptop here and symbolic mapping would not only confuse Y and Z but also most non-letter/numeral keys would be elsewhere compared to the real layout.
[command] + R should do as desired (preserving RAM, but restarts the CPU as does a userport reset).Is there a warm restart for when I crash it?
Good luck for your further explorations!
- eslapion
- ultimate expander
- Posts: 5037
- Joined: Fri Jun 23, 2006 7:50 pm
- Location: Canada
- Occupation: 8bit addict
Re: 1541 Emulation
I strongly suggest you take a look at DirMaster. Latest release is V3.1.4. Freeware.chysn wrote: ↑Sun Feb 16, 2020 4:30 pm The fact of the matter is, I don't know how to use VICE. I don't know how to load my programs into it, or what "disk images" have to do with anything. They seem to be files and not directories, so I'm not sure how to add anything to them from outside the VIC-20 emulation.
Be normal.
- chysn
- Vic 20 Scientist
- Posts: 1204
- Joined: Tue Oct 22, 2019 12:36 pm
- Website: http://www.beigemaze.com
- Location: Michigan, USA
- Occupation: Software Dev Manager
Re: 1541 Emulation
I will, thanks!eslapion wrote: ↑Mon Feb 17, 2020 8:39 amI strongly suggest you take a look at DirMaster. Latest release is V3.1.4. Freeware.chysn wrote: ↑Sun Feb 16, 2020 4:30 pm The fact of the matter is, I don't know how to use VICE. I don't know how to load my programs into it, or what "disk images" have to do with anything. They seem to be files and not directories, so I'm not sure how to add anything to them from outside the VIC-20 emulation.
VIC-20 Projects: wAx Assembler, TRBo: Turtle RescueBot, Helix Colony, Sub Med, Trolley Problem, Dungeon of Dance, ZEPTOPOLIS, MIDI KERNAL, The Archivist, Ed for Prophet-5
WIP: MIDIcast BASIC extension
he/him/his
WIP: MIDIcast BASIC extension
he/him/his
Re: 1541 Emulation
A major benefit is being able to drop into the monitor and inspect memory and registers, even after a crash. I've found bugs that would have been almost impossible to pin point on a real VIC.
Re: 1541 Emulation
"DirMaster"
... is a program i strongly advice to avoid. it has a history of creating broken .d64 images, and more than once we tracked down a supposed "VICE bug" to a broken D64 created by Dirmaster.
In any case - we have not given up on macOS. quite the contrary - we have a dedicated macOS maintainer now, and he is even providing binaries. you can also install a bleeding edge VICE using "homebrew" now (packages also provided by dqh).
and yes, regarding development... learn VICE, and especially the monitor/debugger. soon enough you will be wondering how you could do anything without it
... is a program i strongly advice to avoid. it has a history of creating broken .d64 images, and more than once we tracked down a supposed "VICE bug" to a broken D64 created by Dirmaster.
In any case - we have not given up on macOS. quite the contrary - we have a dedicated macOS maintainer now, and he is even providing binaries. you can also install a bleeding edge VICE using "homebrew" now (packages also provided by dqh).
and yes, regarding development... learn VICE, and especially the monitor/debugger. soon enough you will be wondering how you could do anything without it
I'm just a Software Guy who has no Idea how the Hardware works. Don't listen to me.
Re: 1541 Emulation
I use Droid64 to copy .prg-files to and from .d64-images.
It's a Java GUI. I run it by entering
$ java -jar ./droid64-0.15b.jar
in a terminal, in the directory with the droid64 program.
Site:
http://droid64.sourceforge.net/
It's a Java GUI. I run it by entering
$ java -jar ./droid64-0.15b.jar
in a terminal, in the directory with the droid64 program.
Site:
http://droid64.sourceforge.net/