| |
tlr
Registered: Sep 2003 Posts: 1790 |
Freezer test-programs?
Before starting to write some of these, I'd like to know which already exist. It's also interesting to know of programs that are notably hard to freeze.
I know of these: https://sourceforge.net/p/vice-emu/code/HEAD/tree/testprogs/C64..
thnx in advance |
|
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
anything that relies on cia timers being in sync with the raster. if i had to come up with something that breaks every freezer, i'd use the TOD for some long time measurements and then 2 or 3 timers that run at frequencies that are not even multiples of each other |
| |
AlexC
Registered: Jan 2008 Posts: 299 |
May I add to the list:
- using 100% of stack (some old freezers had problem with it)
- using SID registers (some freezes have problem with it)
- using communication with drive while uploading into drive memory code that synchronizes with code in c64 |
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
using drive is cheating :) (very easy to break freezer with that)
but SID is an interesting thing indeed |
| |
tlr
Registered: Sep 2003 Posts: 1790 |
In reply to groepaz: Good suggestions! I'm trying to start off with more rudimentary coverage first. E.g 00/01 combinatons, stack corruption, etc... The aim is to be able to profile behaviour of freezers such that corner cases can be improved a bit. Quite a few cases will be hard to fix obviously. |
| |
tlr
Registered: Sep 2003 Posts: 1790 |
SID is tricky indeed. You could rely on the waveform read from d41b for example. This is less of a problem for debugging as the registers can be kept then. |
| |
ChristopherJam
Registered: Aug 2004 Posts: 1409 |
SID state looks nigh intractable to get 100% correct, unless you monitor all writes to it and run your own cycle exact emulation on the cart.
So do existing carts like AR VI etc just track the last values set for each register or what? |
| |
tlr
Registered: Sep 2003 Posts: 1790 |
No, they more or less just check for activity in $d41b and set the volume register to $00 or $0f on unfreeze depending on that (they do set some static values for the voices as well).
Anyway, I'd really like pointers to preexisting programs (games perhaps?) to test out various freezing aspects. |
| |
AlexC
Registered: Jan 2008 Posts: 299 |
Two from top of my head:
1. Happy Bug (demo) Happy Bug
2. Protium (uses disable NMI trick described in vice test docs) |
| |
tlr
Registered: Sep 2003 Posts: 1790 |
I did some tests on stack corruption just to get an idea:number of corrupted bytes on the stack (normally just below the current SP):
cart freeze/restore backup
-------------------------------------
FC3 $25 ($25) $27 ($27)
ARVI $18 ($18) $18 ($18)
RR38P $18 ($18) $18 ($18)
SS522v1 $11* ($11*) $19* ($19*)
KCSv2 $12 ($12) $19 ($19)
FFmk4 n/a $29 ($29)
FMv2 n/a $24 ($24)
TFR08 $0B (n/a**) n/a
SF05Y $04 ($09) n/a
SF05 $0B ($0B) n/a
-------------------------------------
values within parenthesis are with $01=$34, otherwise $37
* 5 of the bytes look like corruption at $01dc-$01e1
** crashes The three last ones do not include a backup option and lack some TOD functionality so stack usage is kept low. AR and RR seems to use the same restore code for both freeze/unfreeze and backup, hence the largish value.
SS5.22 seems surprisingly bad! Try this:.C:c000 A2 E0 LDX #$E0
.C:c002 9A TXS
.C:c003 EE 20 D0 INC $D020
.C:c006 4C 03 C0 JMP $C003 ... then freeze/restore... BOOM! |
| |
AlexC
Registered: Jan 2008 Posts: 299 |
Great work tlr! I guess all interested knew some of those values but I could never find one place that has all details. I'll take look into Expert and share my results. |