I don't know about VICE128, but on real hardware that looks about right. Or rather, on a C128 that looks right for 64 mode vs 128 mode. Play the same music file in 64mode and 128 mode, tempo is a little quicker in 64 mode. I used a version of Wachet Auf written for to check it some time ago, similar disparity of 128 mode being about 7/8 as fast as 64 mode. I have no idea about the real hardware C64. Mine has crapped out, works only with a few cartridges.
Last Edit: Mar 25, 2015 13:29:16 GMT by donno128: didn't address actual question in initial post
Let us not talk falsely now The hour is getting late
It has been reported before: the C128 is *both* the fastest and slowest 8-bit by CBM.
In slow (1MHz) mode, it is much slower than VIC-20 or C-64 (not sure about Plus/4). Based on my analysis of BASIC ROM, this is because many extra things are done by BASIC 7 (of the C128)... for example, it checks for Errors and Interrupts for every instruction (thus many delays if multiple BASIC instructions on a single line). Also, the IRQ manages split-screen, sound/music, and sprites... even if you don't use any of those features, the same program will run slower in "standard" (1MHz) on the C128 (as compared to C64 etc.)
But in fast (2Hz) mode, BASIC 7 will run faster than VIC-20/64/Plus4 despite all the extra baggage... no surprise because the CPU is working "double time"!
So obviously, use 80-colum 2MHz if you want speed... but if you need/want 40-column, here are some things you can do:
Easy - POKE 216,255 ... this will disable split-screen (Time 82 -> 81 = 1.22% speed boost) [until GRAPHIC command is used!]
Easy - POKE 2564,192... this will disable sound/music/sprites to gain speed (Time 82 -> 81 = 1.22% speed boost)
Easy - POKE both... disable many obscure BASIC 7 features (Time 82 -> 80 = 2.50% speed boost)
Hard - Custom IRQ to enable 2MHz during the VIC border (17% [NTSC] to 25% [PAL] speed boost)
I tested the first 3 with your demo... the last option is generic/untested (but it works best).
OK, I installed "lame" 2MHz-Border trick (see attached files).
With this method, I get:
PAL "time" 82 -> 61 (25.6% speed boost)
NTSC "time" 82 -> 67 (18.3% speed boost)
Thus I have proved (IMHO) my estimate of the 17% / 25% boost for 2MHz-Border (NTSC/PAL respectively)... if you believe VICE, the boost is a tiny bit more.
I have attached 3 files for everyone:
bendevil speed (a BASIC test program)
2MHZ BORDER.SRC (assembly text file)
2MHzV0.prg (compiled ASM file... enable 2MHz-Border with SYS 5888)
Note my 2MHz-Border program is ULTRA simple... it only works (well tested) with standard 40-column text. May work with full-screen HI-RES graphics or full-screen MULTI-Color graphics.... but it is will surely fail with split-screen 40-column modes.... hey, don't say I didn't warn you
Thanks, Hydro... for your pokes which I did not know of and the Plus/4 mention reminded me to check xplus4...
The Plus/4 is slower as an NTSC machine, faster as PAL. In VICE Plus/4 bendevil's prg results: NTSC=89 PAL=64 There are pokes to speed up NTSC Plus/4. I can't remember what they are. One is to put an NTSC in PAL mode. The Plus/4 goes at 1.77Mhz during borders and 0.88Mhz for screen draws.
It would be interesting to try the other good Plus/4 emulators and see if they produce the same results.
Let us not talk falsely now The hour is getting late
I submitted 2MHz hack to VICE team around v2.0 ; I believe they made it official with improvements (clock-stretching) in v2.1 (?)
Anyway, if you use v2.2+ of VICE, it should be accurate for 8502 CPU (both C64 and C128 modes). However, speed is still not right for Z80... my submission to VICE team also included 4MHz / 2 hack for Z80 (thus virtual 2MHz)... but as far as I can tell (and as reported by other forum members) the Z80 still runs at wrong speed of 1MHz -- thus CP/M mode is not real speed. Also there are problems with some disk drives; like 1571 and CMD FD-Drives.
Hopefully next version of VICE will improve those issue(s)!
I hear there is Super-CPU emulation for VICE? I don't know if this is true... but I would be very skeptical about timing accuracy of 65816!
Also, Bendevil, I posted your test program on my website. I hope it is okay; if not, let me know and I will remove it.
Last Edit: Mar 30, 2015 8:25:06 GMT by hydrophilic: Thought of something else...
Thanks, bendevil, for allowing me to share your test code!
Real shame 65816/Super-CPU not available for C128 yet... but considering the other issues, I am glad to wait for a real/accurate emulator (go VICE team!)
Also, I want to warn everybody that my *lame* 2MHz-Border hack only works with RASTER interrupts (and as explained before, only standard, non-split-screen).
In particular, BASIC 7 is very powerful... it can also "intercept" VIC-II(e) IRQs which are for SPRITES and/or the light-PEN (that is, not a Raster).
But my published "lame" code will NOT work for SPRITE or PEN interrupts... just so you know!
Maybe one day I will find the time (or somebody will pay me) to publish more advanced code...
If you are cheap (don't want to pay) then I suggest you examine my BASIC 7.80 code and/or my MediaPlayer128 code... they both employ some advance IRQ (interrupt) processing... but neither are a simple hack...
Sorry about that, I just wanted to publish a quick/cheap hack to help/motivate programmers... more sophistication will (obviously) require more advanced code!
Err, I guess that may seem like a lame "cop out"... so feel free to "grill" me for more details if you want!