Using the Corvus id number consistently throughout makes it easier to reason
about this code. Previously, some functions used a 0-based drive index
(0..14) and others used the 1-based Corvus id number (1..15). The only
place we actually need it to be 0-based is in corvus_hdc_file(), so now we
just convert it there instead of in several places.
Also adds a complete dump of the FD1089B 317-0027 key!
New Clone Added
----------------------------------------------
SDI - Strategic Defense Initiative (Japan, old, System 16A, FD1089B 317-0027) [Charles MacDonald, ShouTime, The Dumping Union]
* read_pla() leaves the PLA outputs packed, instead of using eight output parameters to return them
* flatten nested switch statements in read_memory() and write_memory()
* mos6566: inline bus_r() and various READ_LINE_MEMBERs
(nw)
from 285% to 300% idling at basic prompt with default slot devices (c1541, no cartridge)
About half the speedup comes from read_pla() refactoring, the other half comes from flattening the switch()es.
The verify drive command (0x07) is used by the "format check" options
of both the Corvus diagnostics program and the SSE HardBox configure
program. Previously, format check would halt with an error because we
did not return a valid response for the verify drive command. Format
check now completes successfully and reports no bad sectors.
nw: The speedup is only really gaudy on CPS-3 where the SH-2 is a major percentage of the frame time (800% -> 1250% unthrottled). SKNS games that access spriteram a lot (cyvern) get a decent speedup as well. Saturn/ST-V and Cool Riders are dominated by the rendering in profiles and get around 10% improvement depending on the game.
(nw)
This precalculation seems to be part of OG's "CPU core template", as all CPU
cores written by him do it. It's used to optimize things like onboard serial
ports and high-frequency timers; however, the m6502 and its derivatives have
neither onboard serial ports nor high-frequency timers, and the precalculation
is simply a boat anchor on drivers with 6502-family CPUs and tight interleaving.
mess c64 benchmarks (3.4 GHz Sandy Bridge i5; 64-bit Linux GCC 4.8 build)
before:
[awj@localhost trunk]$ ./mess64 -window -bench 60 c64
Average speed: 238.17% (59 seconds)
[awj@localhost trunk]$ ./mess64 -window -bench 60 c64
Average speed: 236.36% (59 seconds)
after:
[awj@localhost trunk]$ ./mess64 -window -bench 60 c64
Average speed: 279.93% (59 seconds)
[awj@localhost trunk]$ ./mess64 -window -bench 60 c64
Average speed: 279.30% (59 seconds)