First of, I certainly didn't expect to have to learn WinUAE, how to install Workbench, or extract Kickstarter key from Amiga Forever - it was supposed to be in plainsight in a folder - obviously it wasn't there, but this video from @philscomputerlb helped:https://www.youtube.com/watch?v=2CNqY8mMftk …
-
-
Prikaži ovu nit
-
Oh, and
#Amiga folks - I was envious of Amiga back in the '90, and I still am after learning a bit more about it. The Motorola 68000-family of CPUs looks so simple and elegant. And the AmigaOS interface (both as in API and as in Workbench) are quite interesting as well :)Prikaži ovu nit -
Speaking of the API, basically the whole interface depends on address 0x4, which contains a pointer (ExecBase) to a basic API namespace SysBase. The rest of the API is split into several libraries, so if one wants to open a file, it's a matter of: ...
Prikaži ovu nit -
DOSBase *DOS=SysBase->OpenLibrary("dos.library", ...); BPTR f = DOS->Open("asdf:asdf", MODE_OLDFILE); (though I was multiple ways to simplify the above, e.g. having macros that call "DosBase->Open" when one does "Open") I really like how the API is split into libs/namespaces.
Prikaži ovu nit -
Now one thing I still don't get is why in assembly these jump tables seem to be placed BEFORE the pointers, e.g. the DOS->Open would become: jsr -$1E(a6) (assuming a6 has the DOSBase address) I still need to figure out if the minus there has a special meaning, or what.
Prikaži ovu nit -
(seems I cannot into Twitter, since part of the thread forked to https://twitter.com/gynvael/status/1208497021323268096 …) Anyway, meanwhile I've found "Amberworld" project by Oliver Gantert, who (along with a few other folks) started exploring Ambermoon (sequel to Amberstar) and documented some...
Prikaži ovu nit -
...file formats, and made some nice tools. The archive/compression format seems to be identical in Amberstar (and I think in Albion as well?), and the map formats seem to be pretty similar too (and quite simple actually, as expected from tile-based maps).pic.twitter.com/Lat5YZkg2a
Prikaži ovu nit -
WinUAE isn't simple and I had to watch a YouTube tutorial on how to use it (this one: https://www.youtube.com/watch?v=jJG8-KG9tLI …). But it is really amazing! It has a built-in debugger, and there is an IPC pipe at \\.\pipe\WinUAE that can receive debugger commands (guess who already has a ...
Prikaži ovu nit -
Python interface for that). I've learnt about the pipe from this thread: http://eab.abime.net/showthread.php?t=80058 … And the https://github.com/tonioni/WinUAE/blob/master/uaeipc.cpp … file is useful to look at as well.pic.twitter.com/wrZu8nBwci
Prikaži ovu nit -
Another useful thing is to get memory dumps - WinUAE again helps here (F12 / Misc / Save state...). The state format is a pretty simple block/chunk/hunk/whatever-you-want-to-call-it based format described here: https://github.com/tonioni/WinUAE/blob/master/savestate.cpp#L1928 … One thing that caught me off-guard was...
Prikaži ovu nit -
this: "Every hunk must end to 4 byte boundary," However, the actual implementation is: len2 = 4 - (len & 3); Meaning, if no padding is needed, you have to add full 4 extra null bytes anyway ^_- I'm sure this was added just to mess with people
Prikaži ovu nit -
Oh btw, you start the game at a graveyard near the "Tomb of Sir Marillion". Sounds a bit like Silmarillion ;) Coincidence?pic.twitter.com/4EZ3EFwJjm
Prikaži ovu nit -
Anyway, current state is that I'm almost able to find the exact spot in memory where the current map is loaded. And that's good, because a minimap is something this game desperately needs IMO. So after I'm done with that I want to remove a couple of sleeps here and there to ...pic.twitter.com/E4uN8qj1Ve
Prikaži ovu nit -
... speed things up a bit (especially the battles drag on), and I'm also thinking of playing with the weight system, since the inventory is already really limited, and on top of that even the gold coins weight a lot. Also thinking of adding item highlighting...
Prikaži ovu nit -
Some more links for future me: Amiga Hunk (executable) format: https://en.wikipedia.org/wiki/Amiga_Hunk Nice lists of special Amiga registers: http://amiga-dev.wikidot.com/information:hardware … http://coppershade.org/articles/Code/Reference/Custom_Chip_Register_List/ … Amiga programmings examples (to compare assembly): https://www.kyzer.me.uk/code/ksc/ https://github.com/Sakura-IT/Amiga-programming-examples …
Prikaži ovu nit -
Now that's a really friendly garbage collector (Amberstar) :) "A garbage collection is required. The program will re-load some data. We apologize for the inconvenience."pic.twitter.com/PZdrY0RDnT
Prikaži ovu nit -
WinUAE's IPC is behaving somewhat weirdly. For example, all configuration/event functions return 404 (yes, they return HTTP error codes), but still work correctly. Also, some CFG options can be set, but not read (e.g. statefile_name). Still, progress (and workarounds) was made :)pic.twitter.com/MFO6zi6MYN
Prikaži ovu nit -
Also, for some reason CFG statefile_name doesn't like absolute paths, but works well with relative ones. And DBG m seems to return somewhat-random number of lines in some cases. And EVT SPC_PAUSE 1 is a toggle (instead of 0=unpaused, 1=paused). ...
Prikaži ovu nit -
... And EVT SPC_STATESAVE 1 is non-blocking. Yes... workarounds were made ;)
Prikaži ovu nit -
Getting the position, looking direction and map id turned out to be pretty simple (the builtin debug menu came in handy, and then it was a matter of a standard set of memory scans). The thing that turned out to be more tricky was the way map id changed...pic.twitter.com/hBxqxtVJXw
Prikaži ovu nit -
Basically my approach was to monitor map id change, and then grab the decompressed map file content from memory. The problem was that the map id changed *before* the file was actually loaded/decompressed, so this turned out to be a race condition. The initial idea to solve it...
Prikaži ovu nit -
...was to just grab the file (in unpacked version) from the disk, however then I stumbled upon this little gem of a website: http://home.wtal.de/gmb/news.htm 20 years of updates - I stand impressed!
And there I found this link:
...Prikaži ovu nit -
... https://github.com/ecraven/amberstar?files=1 … All the maps as PNGs, including events! Will save me some work :) I wonder if the author also documented the map format somewhere - I'm quite curious how the events/special places are encoded (and it seems now I won't have to analyze it).
Prikaži ovu nit -
The minimap is working! At least on a few maps I tested (I think there will be issues outside of the city, but I'll get to that later). Now for the weight system and delays in battle, but that's for tomorrow.pic.twitter.com/rrpkIQAP2u
Prikaži ovu nit -
Surprisingly it works outside of the city as well, but I think that's because the map PNGs from the repository are truncated a bit on the sides. Oh well, I mostly care about minimaps for the 3D view anyway.pic.twitter.com/PRCYQcehxP
Prikaži ovu nit -
Yes, the "outside" maps are missing tiles on the borders. Not a problem in my case, but filed a bug anyway :) https://github.com/ecraven/amberstar/issues/1 …pic.twitter.com/7nNVGo3d2t
Prikaži ovu nit -
Randomly stumbled upon another gem website: https://zenhax.com/viewforum.php?f=6 …
@corkami you might like this one ^ :)Prikaži ovu nit -
Aaand ecraven fixed the maps in 0.78 seconds! That's amazing! :) https://github.com/ecraven/amberstar/commit/a29664fd0189d0a68e39ced9cd7d08bb605ea812 …https://github.com/ecraven/amberstar/commit/e4100e279e3369903e5eee76958286da93dd52da …
Prikaži ovu nit
Kraj razgovora
Novi razgovor -
Čini se da učitavanje traje već neko vrijeme.
Twitter je možda preopterećen ili ima kratkotrajnih poteškoća u radu. Pokušajte ponovno ili potražite dodatne informacije u odjeljku Status Twittera.