Programming for a 20MHz VICE-20?

You need an actual VIC.

Moderator: Moderators

Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Programming for a 20MHz VICE-20?

Post by Boray »

Have you ever considered writing a program for the VICE emulator with a speed setting of for example 2000% ? I mean, that would be like a dream to have a Vic-20 running at 20MHz...
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
rhurst
Omega Star Commander
Posts: 1371
Joined: Thu Jan 31, 2008 2:12 pm
Website: https://robert.hurst-ri.us
Location: Providence, RI
Occupation: Tech & Innovation

Post by rhurst »

Is that even possible? I mean, can VICE run with the CPU only at 20mHz, while leaving all the timers, screen refreshes, etc. at original speeds?
Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Post by Boray »

I guess everything will be 20 times faster... But if you write a basic program, you wouldn't care about raster line timing etc...

You should be able to poke to slow the cursor and key repetition down...
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
User avatar
Mike
Herr VC
Posts: 4846
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Post by Mike »

I use the setting 'No speed limit', when I run a VIC programm, that does a prolonged calculation. This came in quite handy for preparing the fill shapes for VICtoria (Deluxe and Gold), or pre-computing the lines in the rotating earth globe demo (both store the results on disc, so the time-consuming parts are only done once).

For an interactive program, be it a game, or anything else, I see little sense to require a setting anything else than 100% speed. Most probably, you won't ever see it at that speed on a real VIC, and I'd rather use the computing power of the underlying PC with native code. ;)

Michael
User avatar
orion70
VICtalian
Posts: 4341
Joined: Thu Feb 02, 2006 4:45 am
Location: Piacenza, Italy
Occupation: Biologist

Post by orion70 »

On the contrary, I often use 50% speed, as I'm not so good on arcades... Instead of planning a new game @20MHz, please, do it @0.5! :wink:
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

"PRESS A KEY FOR NEXT FRAME" ?
Anders Carlsson

Image Image Image Image Image
User avatar
orion70
VICtalian
Posts: 4341
Joined: Thu Feb 02, 2006 4:45 am
Location: Piacenza, Italy
Occupation: Biologist

Post by orion70 »

:oops: That's why I do prefer text games, adventures, turn-based strategy and RPGs (well, one of the reasons why).
Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Post by Boray »

orion70 wrote:please, do it @0.5! :wink:
But then you would have to play it at 0.25MHz then... I guess a game written for VICE running at 200% speed would be perfect for you when played on a real vic-20...
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
User avatar
orion70
VICtalian
Posts: 4341
Joined: Thu Feb 02, 2006 4:45 am
Location: Piacenza, Italy
Occupation: Biologist

Post by orion70 »

Oh yes, relativity applied to a VIC-20... :D
Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Post by Boray »

If I want to slow down the timing in basic, for example TI and TI$, is 37158 and 37159 the only addresses to modify?

If I poke both to 255, I can set the speed to 355% and the basic will appear as normal with time and key repetition, but run 3,55 times faster...

I want to slow down the timers more!

If I can't do that, is there a poke to at least slow down the key repeat?
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
User avatar
Mike
Herr VC
Posts: 4846
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Post by Mike »

Boray wrote:If I can't do that, is there a poke to at least slow down the key repeat?
The key repeat rate is fixed to every 4 jiffies within the routine 'Process Key Image', which is - at least, fortunately - vectored through $028F. This part needs to be altered:

Code: Select all

.C:ebab   CE 8B 02   DEC $028B
.C:ebae   D0 26      BNE $EBD6
.C:ebb0   A0 04      LDY #$04  ; <- !
.C:ebb2   8C 8B 02   STY $028B
Edit: Looking further, I found out, that $028F is dynamically altered by the kernel to accomodate unshifted, shifted, C='d, and CTRL'd keyboard mappings ... so you'll more or less need to replace the entire keyboard scan routine. :(

Michael
Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Post by Boray »

Ok, thanks!
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
User avatar
Kweepa
Vic 20 Scientist
Posts: 1315
Joined: Fri Jan 04, 2008 5:11 pm
Location: Austin, Texas
Occupation: Game maker

Post by Kweepa »

There are pokes for the key repeat too...
Check the programmer's reference manual - they are around 650 decimal.
User avatar
Mike
Herr VC
Posts: 4846
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Post by Mike »

Those addresses (651 and 652), that you're most probably referring to, only contain the state variables for the key repetition. You can't POKE them to change the rate. They're re-initialised with fixed values within the kernal, in the routine mentioned above.

With address 650, you can disable key repetition entirely (POKE650,64), enable repetition for all keys (POKE650,128), or set to default (space and cursor) with POKE650,0.
Legacy
Vic 20 Enthusiast
Posts: 154
Joined: Wed Dec 31, 2008 4:01 pm

Post by Legacy »

poke 36879,25
Post Reply