shadowVIC – a lightweight VIC-20 emulator

You need an actual VIC.

Moderator: Moderators

User avatar
pixel
Vic 20 Scientist
Posts: 1330
Joined: Fri Feb 28, 2014 3:56 am
Website: http://hugbox.org/
Location: Berlin, Germany
Occupation: Pan–galactic shaman

shadowVIC – a lightweight VIC-20 emulator

Post by pixel »

Well, here's my early Christmas present for you:

https://github.com/SvenMichaelKlose/shadowvic

Currently Pulse and Arukanoido are run on a Raspberry Pi Model 1 with it to entertain people in public places.

It's out to help you port your games to low-power devices or to just port your game cores to retain the original feeling and upgrade them with better sound and graphics via illegal opcodes that would usually jam the CPU. The license should suit any business intentions. How about your cool VIC games on Android or iphone or just as a Linux, DOS or Windows binary?

I slapped in BASIC which hangs due to missing keyboard emulation(?). And that's were you could start to help out. How do I get this to run without emulating the keyboard in the first place? :(

love + respect
pixel
A man without talent or ambition is most easily pleased. Others set his path and he is content.
https://github.com/SvenMichaelKlose
User avatar
pixel
Vic 20 Scientist
Posts: 1330
Joined: Fri Feb 28, 2014 3:56 am
Website: http://hugbox.org/
Location: Berlin, Germany
Occupation: Pan–galactic shaman

Re: shadowVIC – a lightweight VIC-20 emulator

Post by pixel »

Added Pulse, so you can convince yourself of the emulator's functionality. A joystick is required. ;)
A man without talent or ambition is most easily pleased. Others set his path and he is content.
https://github.com/SvenMichaelKlose
User avatar
majikeyric
Vic 20 Afficionado
Posts: 349
Joined: Fri Oct 24, 2014 2:08 pm
Website: http://majikeyric.free.fr
Location: France

Re: shadowVIC – a lightweight VIC-20 emulator

Post by majikeyric »

Nice Christmas gift! :D Thank you!

It's very interesting. Unfortunately I'm not a linux user but I'll look inside.
User avatar
pixel
Vic 20 Scientist
Posts: 1330
Joined: Fri Feb 28, 2014 3:56 am
Website: http://hugbox.org/
Location: Berlin, Germany
Occupation: Pan–galactic shaman

Re: shadowVIC – a lightweight VIC-20 emulator

Post by pixel »

Switched from shell script to GNU autotools for building and installing. Tweaking the Makefile.am files is very easy if you want to try out your own code. (I'm wondering how many people here use a Unix.)
A man without talent or ambition is most easily pleased. Others set his path and he is content.
https://github.com/SvenMichaelKlose
User avatar
pixel
Vic 20 Scientist
Posts: 1330
Joined: Fri Feb 28, 2014 3:56 am
Website: http://hugbox.org/
Location: Berlin, Germany
Occupation: Pan–galactic shaman

Re: shadowVIC – a lightweight VIC-20 emulator

Post by pixel »

This was too easy. Installs shared and static libraries, headers and binaries like it's supposed to do. Ready for the wild.

Please pull updates regularly as the interface is probably about to change a bit within the next couple of days because I have to adapt the arcade tube stuff now.
A man without talent or ambition is most easily pleased. Others set his path and he is content.
https://github.com/SvenMichaelKlose
nippur72
de Lagash
Posts: 574
Joined: Thu Sep 07, 2006 8:35 am

Re: shadowVIC – a lightweight VIC-20 emulator

Post by nippur72 »

User avatar
pixel
Vic 20 Scientist
Posts: 1330
Joined: Fri Feb 28, 2014 3:56 am
Website: http://hugbox.org/
Location: Berlin, Germany
Occupation: Pan–galactic shaman

Re: shadowVIC – a lightweight VIC-20 emulator

Post by pixel »

nippur72 wrote:added to VIC 20 Emulators list
Awesome! Thanks! I hope I'll get some help porting this to other platforms, especially mobiles.
A man without talent or ambition is most easily pleased. Others set his path and he is content.
https://github.com/SvenMichaelKlose
User avatar
pixel
Vic 20 Scientist
Posts: 1330
Joined: Fri Feb 28, 2014 3:56 am
Website: http://hugbox.org/
Location: Berlin, Germany
Occupation: Pan–galactic shaman

Re: shadowVIC – a lightweight VIC-20 emulator

Post by pixel »

GNU autotools gives me crap code that doesn't work on the Raspberry Pi Model 1 in matters of speed. Now I'm back to shell scripts to concatenate all source files into one to feed gcc in one go, because link–time optimization doesn't do the job as expected.
A man without talent or ambition is most easily pleased. Others set his path and he is content.
https://github.com/SvenMichaelKlose
User avatar
pixel
Vic 20 Scientist
Posts: 1330
Joined: Fri Feb 28, 2014 3:56 am
Website: http://hugbox.org/
Location: Berlin, Germany
Occupation: Pan–galactic shaman

Re: shadowVIC – a lightweight VIC-20 emulator

Post by pixel »

BCD arithmetics just went in as well as zero page wrap–arounds.

But now for the bummer: somehow I missed out about LDX/STX zeropage,Y.

m)

Hope that'll get BASIC to boot...
A man without talent or ambition is most easily pleased. Others set his path and he is content.
https://github.com/SvenMichaelKlose
User avatar
pixel
Vic 20 Scientist
Posts: 1330
Joined: Fri Feb 28, 2014 3:56 am
Website: http://hugbox.org/
Location: Berlin, Germany
Occupation: Pan–galactic shaman

Re: shadowVIC – a lightweight VIC-20 emulator

Post by pixel »

The missing LDX/STX zeropage,Y is now there.

BASIC gets stuck while… well… it seems to try to print the number of free bytes as a float!?!? :o …and gets stuck in an endless loop.
A man without talent or ambition is most easily pleased. Others set his path and he is content.
https://github.com/SvenMichaelKlose
User avatar
pixel
Vic 20 Scientist
Posts: 1330
Joined: Fri Feb 28, 2014 3:56 am
Website: http://hugbox.org/
Location: Berlin, Germany
Occupation: Pan–galactic shaman

Re: shadowVIC – a lightweight VIC-20 emulator

Post by pixel »

I have compared the 6502 emulation of this thing to lots of other emulators, googled a lot to make sure, fixed interrupt processing, BRK, BIT, made everything more readable, hacked in stack dumps, etc. Now the main 6502 emulator is ~470 lines of very, very simple code.

And it still doesn't do the floating point thing to boot BASIC.

But I know here're people on Denial who could read it like others would read a comic and point out the last bugs in it within a handful of minutes…

Please help out… BASIC apps won't need cycle exact emulation.
A man without talent or ambition is most easily pleased. Others set his path and he is content.
https://github.com/SvenMichaelKlose
nippur72
de Lagash
Posts: 574
Joined: Thu Sep 07, 2006 8:35 am

Re: shadowVIC – a lightweight VIC-20 emulator

Post by nippur72 »

What I suggest, is to add unit testing to your CPU emulation.

Something simple like this:

Code: Select all

execute(169,1);  // lda #$01
assert(cpu.a == 1);
User avatar
pixel
Vic 20 Scientist
Posts: 1330
Joined: Fri Feb 28, 2014 3:56 am
Website: http://hugbox.org/
Location: Berlin, Germany
Occupation: Pan–galactic shaman

Re: shadowVIC – a lightweight VIC-20 emulator

Post by pixel »

nippur72 wrote:What I suggest, is to add unit testing to your CPU emulation.

Something simple like this:

Code: Select all

execute(169,1);  // lda #$01
assert(cpu.a == 1);
Hoped to get around that as I'm too lazy. ;) There's already an escape code for testing registers.
A man without talent or ambition is most easily pleased. Others set his path and he is content.
https://github.com/SvenMichaelKlose
User avatar
pixel
Vic 20 Scientist
Posts: 1330
Joined: Fri Feb 28, 2014 3:56 am
Website: http://hugbox.org/
Location: Berlin, Germany
Occupation: Pan–galactic shaman

Re: shadowVIC – a lightweight VIC-20 emulator

Post by pixel »

Found a bunch of tests I wrote in the beginning and included them as an example application. It detected a mistake made yesterday. Am out of wits.
A man without talent or ambition is most easily pleased. Others set his path and he is content.
https://github.com/SvenMichaelKlose
User avatar
pixel
Vic 20 Scientist
Posts: 1330
Joined: Fri Feb 28, 2014 3:56 am
Website: http://hugbox.org/
Location: Berlin, Germany
Occupation: Pan–galactic shaman

Re: shadowVIC – a lightweight VIC-20 emulator

Post by pixel »

I know you're not hacking away with your games on shadowVIC to become a phone app millionaire, because you haven't complained about the missing debugger. :mrgreen:

That's fixed a little bit. As soon as you hit Ctrl+c a most basic debugger will welcome you. Enter 'h' to get help or hit Ctrl+d to leave it.

BTW the package installs "picovic", which still cannot boot BASIC :(, and the game "pulse".
A man without talent or ambition is most easily pleased. Others set his path and he is content.
https://github.com/SvenMichaelKlose
Post Reply