some games don't work with VICE

You need an actual VIC.

Moderator: Moderators

User avatar
Mayhem
High Bidder
Posts: 3026
Joined: Mon May 24, 2004 7:03 am
Website: http://www.mayhem64.co.uk
Location: London

Re: some games don't work with VICE

Post by Mayhem »

Mike wrote:Vista Ultimate 32 bit. I don't think it has anything to do with the OS, though, rather the exact build of WinVICE. Here's how it looks on my setup:
Intriguing. Never seen that. I am using the release v2.4 Vice here though, not the current builds, so something might have been "broken" since. I just have to ask the questions, it's part of my nature and my day job heh...
Lie with passion and be forever damned...
User avatar
Vic 2000
Vic 20 Afficionado
Posts: 334
Joined: Mon Mar 03, 2014 2:17 am

Re: some games don't work with VICE

Post by Vic 2000 »

Looks like this on my computer

Using Windows 7 NTSC mode and the "generic" setting for cartridges. I use VICE 2.4

Image

It must be something wrong with your computer.
User avatar
Mike
Herr VC
Posts: 4816
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: some games don't work with VICE

Post by Mike »

Vic 2000 wrote:It must be something wrong with your computer.
You are telling me that? :lol:

Sorry, but as I already wrote I think it is dependent on the actual build of VICE I currently use. As that build works fine for most other programs, and I know that BANDITS is known to use the VIA registers in a quite unusual way, I had lots of trouble with previous versions of WinVICE because of unstable frame rate, crashes, crackling sound etc. (most of those issues also listed in the bug tracker in sourceforge) ...

... I just can't bothered to hunt for a new version, which doesn't cause any new troubles, just to get BANDITS working.

(Besides: you telling me that it works with VICE 2.4 is as much accurate as I am telling you I am using Win Vista - you'd need me to tell me the *exact* build of VICE you are using so I'd take the time to compare. And no, I'm not going to use the official VICE 2.4 version - even if BANDITS works on it - as it has quite a lot of other bugs ironed out in the later developer releases)
User avatar
Vic 2000
Vic 20 Afficionado
Posts: 334
Joined: Mon Mar 03, 2014 2:17 am

Re: some games don't work with VICE

Post by Vic 2000 »

I shared the same problem when switching to Win 7 using the STeem emulator (atari st emulator). STeem wasn't fully updated to work correctly in Win 7 and i encountered lots of problems i the beginning. Then STeem got updated.

I use the official lastest version of VICE, so far it seems to work quite well. Perhaps it's something that clashes with Vista or the graphic driver? I hope they fix it until next release of VICE so it works well on your computer too.

Vice is a bit like Hatari (french atari st emulator) that uses a spartan outdated GUI, that's because Hatari isn't a windows specific emulator.

The best of them all is this one
http://www.virtualdub.org/altirra.html

Just the update history is impressive to watch on that emulator.
User avatar
Mike
Herr VC
Posts: 4816
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: some games don't work with VICE

Post by Mike »

Vic 2000 wrote:Perhaps it's something that clashes with Vista or the graphic driver? I hope they fix it until next release of VICE so it works well on your computer too.
Believe me, I'm not in any way concerned about the stability of my computer, OS or VICE emulator setup.

Since version 1.16, VICE has been a prime example of creeping featurism: lots of features added, some bugs fixed, even more bugs newly inserted. Up to the point I didn't want to use any releases from 1.17 up to around 2.3.x on several different Win PCs as those installations of WinVICE all suffered from the problems I now summed up several times.

For some time, I then kept a certain build of 2.3 on my Vista notebook, as it didn't display those issues anymore (at least not in that severe extent I had experienced earlier), even though it had a subtle bug in VDrive (there was a positioning error in the P command for REL files). I then fell out with one fellow of the VICE team, when I reported some strange behaviour of the newer 2.3 development builds regarding keystroke entry - as the warnings of my virus scanner at least went away with the official 2.4 build I suppose they actually *found* something. Still, as I wrote, the official 2.4 build again suffered from the old issues.

As long as I don't find a particularily *good* reason to replace my 2.4.2 x86 r27141 (and getting BANDITS run doesn't cut it for me), I'll keep it. After all, if you take a look at the VIC-20 software releases, I surely wouldn't have released that much software for the VIC-20 in the last 10 years, if I had relied upon a mostly unusable build of VICE.
User avatar
Vic 2000
Vic 20 Afficionado
Posts: 334
Joined: Mon Mar 03, 2014 2:17 am

Re: some games don't work with VICE

Post by Vic 2000 »

I understand what you mean and hope that they will listen and fix the reported bugs in VICE

Some emulator authors is real picky about the emulation engine, so far so good, but some of them hardly care about the emulators integration to the OS that will host the emulator. Then you will have an awesome emulator engine that works so so because not enough effort was done to make the emulator run smooth and error free.

Some emulators looks terrible dated because the author didn't care about to spend much work on the GUI. A stonage GUI containing non standard keyboard shortcuts and a file selector that looks like it was from a hobby project from 1985. Weird layout and hard to find settings.

That is like inserting a rolls royce engine in a Trabant because every little bit is just as importand. A good emulation engine, good integration with the specific OS and a descent GUI that is fast and easy to handle.

That's why i think Altirra is such great emulator. The author spent much time on all these areas and made an easy to use, stable, good looking emulator containing tons of options and settings.
User avatar
Mayhem
High Bidder
Posts: 3026
Joined: Mon May 24, 2004 7:03 am
Website: http://www.mayhem64.co.uk
Location: London

Re: some games don't work with VICE

Post by Mayhem »

I'll grab the uber latest version of Vice that I can find, or maybe even the same build that you are using Mike, and compare. If Bandits still works fine for me then, it's definitely going to be more a computer problem then.
Lie with passion and be forever damned...
User avatar
beamrider
Vic 20 Scientist
Posts: 1446
Joined: Sun Oct 17, 2010 2:28 pm
Location: UK

Re: some games don't work with VICE

Post by beamrider »

As much as I would like to point the finger at Vista :wink: , I don't think it's a computer problem as I can also reproduce on Windows 7 with my fairly recent nightly build of VICE. As stated 2.4 however is fine.

Image
groepaz
Vic 20 Scientist
Posts: 1180
Joined: Wed Aug 25, 2010 5:30 pm

Re: some games don't work with VICE

Post by groepaz »

From what I know, the game relies on some not to well documented behaviour of the VIAs right after power-up, and doesn't (re-)initialise them as it is usually done. At some time, some members of the VICE team wrote, that fixing VICE for BANDITS would require a thorough reorganisation of the interrupt management of VICE.
i'm not so sure about that - apparently bandits uses the serial shift register interrupt, which indeed is kindof undocumented (or lets say, vaguely documented). It should be fixable in the viacore though.... i created a ticket for it here. Some small test programs for this behaviour would be really helpful :)
as the warnings of my virus scanner at least went away with the official 2.4 build I suppose they actually *found* something.
not at all - we did not and will never fix anything because of a picky virus scanner - thats the job of whoever makes that scanner, not ours.
As long as I don't find a particularily *good* reason to replace my 2.4.2 x86 r27141 (and getting BANDITS run doesn't cut it for me), I'll keep it.
the only noteable thing since then that affects xvic is probably this drive related fix.
I'm just a Software Guy who has no Idea how the Hardware works. Don't listen to me.
groepaz
Vic 20 Scientist
Posts: 1180
Joined: Wed Aug 25, 2010 5:30 pm

Re: some games don't work with VICE

Post by groepaz »

i'm not so sure about that - apparently bandits uses the serial shift register interrupt, which indeed is kindof undocumented (or lets say, vaguely documented). It should be fixable in the viacore though.... i created a ticket for it here. Some small test programs for this behaviour would be really helpful
ok, so well, it wasnt that.... the problem was that someone "fixed" the VIA emulation to not acknowledge the timer1 irq when writing to the high order latch... and didnt confirm the behavior with a test program first. because in fact, the irq IS acknowledged in that case :)

so, i fixed VICE accordingly, grab r29803 or later from pokefinder

just for fun i also fixed bandits for PAL the other night... never realised its SO much nicer than the C64 port :) click
I'm just a Software Guy who has no Idea how the Hardware works. Don't listen to me.
User avatar
tokra
Vic 20 Scientist
Posts: 1120
Joined: Tue Apr 27, 2010 5:32 pm
Location: Scheessel, Germany

Re: some games don't work with VICE

Post by tokra »

Great work finding this bug and thanks for the PAL-version of Bandits as well. While we are at fixing things in emulation... NTSC-emulation still has some issue with rasterline-based routines, specifically those that check the rasterline register ($9004) for zero (with either BNE or BEQ). This is most visible on Capture the Flag. It synchronizes to value 0 of $9004 at $b688 with this little routine:

Code: Select all

.C:b688  AD 04 90    LDA $9004
.C:b68b  F0 FB       BEQ $B688
.C:b68d  AD 04 90    LDA $9004
.C:b690  D0 FB       BNE $B68D
This is nicely done, it even checks if the CPU already is in rasterline 0 before waiting for it again so the next command will not happen at the end of rasterline 0.

However in VICE the switch for rasterline 0 is triggered 33 cycles too early as laid out in this VICE-bug already:

http://sourceforge.net/p/vice-emu/bugs/254/

I did some tests with a stable-raster routine on my real NTSC-VIC and in VICE. [EDIT: deleted earlier observations as they look wrong on closer inspection]

However rasterline 0 and only rasterline 0 is completely bonkers. It starts 33 cycles later on the real machine than it should. This behaviour is not emulated by VICE right now and leads to the garbled display in "Capture the Flag" and the problems in the original "Number Game".


A whole other issue is NTSC-interlace-emulation. A picture alternates between 262 and 263 lines for a total 525. Every second picture has a rasterline 131 that is not reached without interlace. A rudimentary NTSC-emulation could just put the half-frames on top of each other when the interlace bit 7 in $9000 is set and do the raster-counting from 0 to 130 and 0 to 131 alternating.
Last edited by tokra on Sat Jun 13, 2015 3:29 am, edited 3 times in total.
User avatar
Mayhem
High Bidder
Posts: 3026
Joined: Mon May 24, 2004 7:03 am
Website: http://www.mayhem64.co.uk
Location: London

Re: some games don't work with VICE

Post by Mayhem »

All interesting, indeed. I'll give the PAL version a whirl in due course. Any idea why I never saw an issue with NTSC Bandits in Vice though, even after running it for 30 minutes+ in the past?
Lie with passion and be forever damned...
User avatar
tokra
Vic 20 Scientist
Posts: 1120
Joined: Tue Apr 27, 2010 5:32 pm
Location: Scheessel, Germany

Re: some games don't work with VICE

Post by tokra »

Ok, regarding NTSC-VIC-emulation and reporting of the rasterline in $9004 I finally wrote a little test program, that waits for $9004 and does a little effect with $900f. To make this visible on the screen for the interesting rasterlines near the beginning and end of the frame I included a waiting loop. The test-program is included on this disk-image as "NTSC-RASTEST" and works on an unexpanded VIC. There is no adjustment for jitter so you can see the line happily jittering and see where the earliest switch is recognized. The result is the same for values 1 to 130 (press SPACE to go through the values):
IMG_0202.JPG
IMG_0202.JPG (68.06 KiB) Viewed 3954 times
The effect starts at position 0.

However for value 0 in $9004:
IMG_0162.JPG
IMG_0162.JPG (57.37 KiB) Viewed 3954 times
it starts at position 33.

For fun I switched the interlace-bit on with POKE36864,133 before starting this test and the results are the same for values 1 to 131 (one extra value in interlace). However for value 0 one half-frame starts at position 33 and the other at position 0 as well.

So it looks like the reporting to $9004 is delayed for 33 cycles when a new frame starts and not when a half-frame starts. I could not find any other irregularities regarding reporting of $9004 just the one for value 0. Sadly I don't understand the VICE-code (not a C-programmer) but this looks like it could be a "hack-fix" into the VICE-source. Calling tlr and groepaz :D

Right now any NTSC-program that synchronizes to value 0 in $9004 is broken in VICE. I know of two games that do so: "The Number Game" and "Capture the Flag". While I could do without the first one, the second one is one of the best VIC-games out there. It always bugged me that the raster effect was broken in VICE:
ctf-vice.png
ctf-vice.png (2.29 KiB) Viewed 3954 times
When the game was reviewed in the RetroGamer-mag they even used a screenshot of this broken raster-effect :( I hacked together a quick fix for this as long as the VICE-issue remains unfixed, by patching the game with a loader which adds a 33 cycle-wait loop after the raster-test. You can find this in the same disk-image mentioned above. Just drop it into VICE (full expansion enabled) or load and run "ctf". It should then look like this:
ctf-vicefix.png
ctf-vicefix.png (2.01 KiB) Viewed 3954 times
User avatar
Mayhem
High Bidder
Posts: 3026
Joined: Mon May 24, 2004 7:03 am
Website: http://www.mayhem64.co.uk
Location: London

Re: some games don't work with VICE

Post by Mayhem »

tokra wrote:When the game was reviewed in the RetroGamer-mag they even used a screenshot of this broken raster-effect :(
That would have been me. It was either that or no screenshot, or not featuring the game, so I picked the lesser of two evils there. If a fixed version had been available at the time, I would of course have used it heh.
Lie with passion and be forever damned...
groepaz
Vic 20 Scientist
Posts: 1180
Joined: Wed Aug 25, 2010 5:30 pm

Re: some games don't work with VICE

Post by groepaz »

ok, so as for the rasterline 0 "delay"... i fixed it in r29805 - "capture the flag" works perfectly now (and also, as far as i can see, all the other games listed as "ntsc only" in megacart).

it would be great if you could also post the source to that test program, so i can include it in the VICE repo :)

as for the interlace thing... a test program would be really nice, too :)

edit: just for fun, last nites hack: Capture the Flag for PAL
I'm just a Software Guy who has no Idea how the Hardware works. Don't listen to me.
Post Reply