Home › Forums › Vectorblade beta test › Downloadable Vectorblade versions
- This topic has 522 replies, 8 voices, and was last updated 4 years, 8 months ago by
Malban.
-
AuthorPosts
-
April 15, 2020 at 10:19 am #4993
Malban
KeymasterNope.
Or nearly nope.
More or less the only two things done are:- convert “long branches” to short counterparts – if that can be done
- convert “short” branches to long branches if necessary (and can be done)
- use direct addressing instead of extended addressing, when DP is known
Those options can be turned of in the configuration.
The “running” bin in Vide is nonetheless exactly the same as on eprom.This I would like to classify as “highly unlikely” :-).
Chris
April 15, 2020 at 10:33 am #4994Peer
SpectatorThis I would like to classify as โhighly unlikelyโ ๐
Damn!
Could you still, for the next play-until-crash test, switch this option to the opposite?
Cheers,
PeerPS: Next theory will be of “++(highly unlikely)” type …
April 15, 2020 at 11:18 am #4995Malban
KeymasterYeah, this bug hunting is a marathon.
I just aquired a new intermediate target… I took out the “random” in Vectorblade – and I am working with a fixed seed.
So theoretically the emulator and the Vectrex should behave the same.I let VB (demo mode) run for some time… checked after level 3 – and everything was fine (equal).
I checked after level 60 again (I have to work in between) – and its different.
So somewhere the emulator does NOT (!) behave like the real vectrex. Perhaps if I solve that “mystery” – I can use Vide better?
Chris
April 15, 2020 at 11:33 am #4996Peer
SpectatorI have to work in between
Yes, same here. Annoying. Keeps one away from the important stuff ๐
Ok, that is good news. Do a “binary” search. Check after level 30. If same, check after level 45. If different, check after level 15, and so on. That should lead to “the point”. If you send me the binary and tell me how to “check”, I’d be happy to assist. I will be away for the next hours, but afterwards I’d be ready to go.
April 15, 2020 at 11:57 am #4999Malban
KeymasterIn level 4 are the first “visual” differences:
Still the same
1/2 second later
(on the real vectrex, the ship starts to move right!)Ehm.
Now what – how do I find the “code”/”bin” difference?
Have to think more ๐April 15, 2020 at 12:02 pm #5000Peer
SpectatorIsolate the code for the random number generator, and check if the generated sequence is the same in Vide as it is on the real machine. Yes, yes, I know, (++(highly unlikely))++, but I think it would still be worth to check. Especially at or after the “wrap around”, if your are using an LFSR. Just check the number after the 100.000 th iteration, or so.
April 15, 2020 at 12:15 pm #5001Peer
SpectatorYeah, this bug hunting is a marathon.
…and nothing beats the feeling of crossing the finish line…
April 15, 2020 at 3:40 pm #5002Peer
SpectatorI am back now, and I have had some time to think inbetween. What about the following approach (loosely related to my previous posts):
a) Count the calls/invocations of your pseudo random number generator (rng), so that you have a way to determine the n-th random number. This will require additional debug code and some ram cells for storing n, so the whole attempt might be prone to cause Heisenbug effects.
b) For some very large m, stop the game execution and display the m-th generated random number. If (the Vide-number differs from the console-number) or (the display looks different), repeat the whole process with a smaller m and try to find the minimum m for which you get either type of difference.
c) Once you have such a minimum m, good!
d) If for this m, the m-th Vide random number differs from the m-th console random number, then there must be some reason why the rng suddenly behaves differently. Check the cone of influence of the rng logic.
e) If for this m, the m-th Vide random number is equal to the m-th console random number, but the display is different, then “the point” must be somewhere before the m-th call of the rng. Check the call trace. Which part of the code is calling the rng?
In essence, use the sequence of calls of the rng as a marker to narrow down “the point” where suddently Vide and the console behave differently.
Unlikely Cheers,
PeerApril 15, 2020 at 7:01 pm #5003Peer
Spectator– When running VB in Vide, which ROM version do you use? Fastboot? 7adb? 7931? B796? All of them?
– Which ROM version(s) have the consoles that showed the crash / difference in demo mode?
I know that you do not use any ROM routines. Still I would be interested in this. I just do not want to rule out any possible explanation for the observed difference too early.
And for the sake of completeness, do you use any ROM data? E.g. vector-lists from Minestorm? Sine/cosine tables? Frequency tables? Startup tunes? ADSR data?
April 15, 2020 at 8:29 pm #5004Peer
Spectator… another, though highestly unlikely, yet still possible cause for ram corruption:
use direct addressing instead of extended addressing, when DP is known
Wrong DP value, e.g. writing to VIA under the assumption that DP is D0, while in fact DP is C8.
Or the other way around. Accidently writing to VIA while accessing ram under the assumption that DP is C8, when it is in fact D0?
Could there be even the tiniest chance, that such a situation is possibly hiding somewhere?
April 15, 2020 at 10:37 pm #5005Malban
KeymasterFrom back to front…
c) The complete game runs in DP = d0. This never changes! – I never have to worry!
b) different roms (2 test Vectrex) –ย dunno by heart the crc, the oldest and second oldest, but not the noBuzz, in Vide Fastboot, no no ROM at all (apart from Vectorlists for Minestorm) – but the crash never happened during a minestorm ๐
startup tune is “music1” from the BIOS ๐a) it is not the RNG, the RNG is called more often on the vectrex than on the emulator. I am still figuring out why though.
It first happens:
in level 4, after the 8th dropped bonus, after 27 additional rounds… in the star behaviour.This I figured out by many MANY manual tests using my vectrex. I still have to close in further, but I am getting kind of tired tonight…
April 16, 2020 at 5:11 am #5006Peer
SpectatorThe complete game runs in DP = d0. This never changes! โ I never have to worry!
I guessed so. But I still asked, because you told us to question everything. Especially those things you are 100% sure of to be correct ๐
… in Vide Fastboot
I know that I can be a pain in the back, but I am used to checking meticulously in each and every direction. Can you just once set Vide to one of the non-fastboot roms and confirm that the difference is still there?
… no ROM at all
And again I am playing advocatus diaboli: Objection, your Honor! You are using the system’s power-up handler at F000, which is a rom routine. No, I am neither mocking nor teasing. Again just checking meticulously in every direction. The power-up and system initialization routines vary between the different rom versions. I had a look at those routines and tried to understand them. There are differences between 7931 and B796, but nothing looks suspicious in respect of VB. I did not (yet?) check those routines in the fastboot rom.
Here comes another question: You said you are using the complete ram. Can you still give me some details? What is the first ram address, and what is the last ram address you are using? What are the ram cells specifically used for? I am kind of dancing in the dark here as I do not have any code snippets in front of me.
It first happens: in level 4, after the 8th dropped bonus, after 27 additional roundsโฆ in the star behaviour.
Great, that is at least a trace to follow! Good thing that it is level 4, and not 400 ๐ What about a complete ram dump after (for i = 27; i >=0; –i) rounds, to find the first frame where the rams differ? Yeah, laborious, but …
Many Cheers,
PeerApril 16, 2020 at 5:48 am #5007Peer
Spectator… after the 8th dropped bonus … in the star behaviour.
Do I remember correctly that the number of stars is adapted (reduced) according to how many other objects (bonusses?) are active, in order to remain within the 50 Hz framerate? Could there be some overflow/underflow/off-by-one in the star-data management? Is this again a dynamically linked list? In which part of the ram is the star data located? What data comes in front, what data comes after?
Please select: <Like> <Unlike>
April 16, 2020 at 7:51 am #5008Malban
KeymasterToday I will close in further on the exact location.
The whole “BIOS” thing, I find very unlikely (again). Since all things I use, I really init myself. Even the random seed I do myself, since I have an own random function. As it is, the only thing I “rely” on from the BIOS, is that it sets up VIA correctly upon start. And it obviously does that. Everything else I am doing myself.
“certainly” nothing that will appear first in level 4 :-).Well… I’ll get back to that, once every other “more likely” option runs out.
RAM
Not an easy to answer question.
I can gladly send you the sources – but without a short introduction to VB (a couple of days might suffice) you will be quite lost I guess.
There is no “one” RAM layout.Depending on the game situations I use different RAM layouts. There is one layout, I call “static” ram layout – that (more or less) never changes. This is approximately from c800 to dunno lets say c950.
YES, I use BIOS locations too. There are only a small handfull of singular BIOS RAM locations I leave “unused” by myself.
(Refresh rate of WaitRecal, TextSize, PSG Buffer (which I also use) …).But even in the “static” RAM, I double/tripple use some locations.
It is messy – but we only have 1024 bytes of ram!Than there are a RAM layouts I use:
- in game
- in title
- during boss fights
- in minestorm
- during major havoc
These all “overlap” each other – and they are mutual exclusive.
I just copied the current sources to my FTP server, feel free to browse.
(ZIP file has it all)vectrex.malban.de/tmp/src_vb46
If you want to actually run the game – be aware of some “SWI” I placed in the code for debugging
(SWI use the same vector as NMI, and I could place them liberally ๐ ).Easiest would be to load the project in Vide.
The 4 “main” files – well, are the main files (one main for each bank – start bank is 3!).But the “real” starting point would be: http://vectrex.malban.de/tmp/src_vb46/commonGround.i,
which loads: http://vectrex.malban.de/tmp/src_vb46/inBothBanks1.i (from the time I only used 2 banks)
which loads all ram setups, e.g.: http://vectrex.malban.de/tmp/src_vb46/RAMLayoutStatic.asmThe “heads” of the linked lists are in the static RAM layout, the actual list data (since used in game) are defined in:
http://vectrex.malban.de/tmp/src_vb46/RAMLayoutInGame.asm
Yes, stars still “adapt”, but at least one set of stars must be present. All “linked” lists are handled identically (although in different functions, see the different “objectXXX” files.
Malban
PS
I don’t expect you to actually dig your way thru the source code.
I programmed it, did quite a lot of documentation – still, working 2 years with the code – and even I do not manage to follow everything. The most used function is “SEARCH”…
I am just showing off convoluted vectrex source code ๐PPS
The source is not in a really good state either, since months of heavy debugging, did not really beautify it!
April 16, 2020 at 12:36 pm #5009Malban
KeymasterSomething amazing happened!
Overnight a Neutrino hit my Vectrex. Now the “changed” behaviour happens 22 rounds later, and not in the StarBehaviour anymore … seemingly in the “doIntro” sequence of the enemies.
I must close down fast now, before the next Neutrino comes along!
-
AuthorPosts
- The forum ‘Vectorblade beta test’ is closed to new topics and replies.