Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash or graphic mess up when leaving a conversation without taking the items #74

Open
Pyrdacor opened this issue Nov 3, 2022 · 4 comments
Labels
bug Something isn't working game Issues related to the Amiga game

Comments

@Pyrdacor
Copy link
Owner

Pyrdacor commented Nov 3, 2022

For example give the 4 golden horseshoes to Tolimar and leave without the reward items. Confirm the question with Yes. Then talk to him again.

@Pyrdacor Pyrdacor added bug Something isn't working game Issues related to the Amiga game labels Nov 3, 2022
@Pyrdacor Pyrdacor added this to the Release 1.18 milestone Nov 3, 2022
@Pyrdacor
Copy link
Owner Author

Pyrdacor commented Nov 3, 2022

I could fix it in Ambermoon Advanced but it is a bit complex. Basically each window has an update function which is called each few ticks until the window is closed.

In conversations this update function checks if there are any items in the item grid (reward items etc). If so it will show the item grid, otherwise it will hide the item grid. This is done by opening another "window" and closing it when hiding. In Jurie's window system, every state is basically a window or screen.

This new "window" which shows the item grid, uses the same update function and event handlers, so it behaves exactly as the window without the item grid. Of course the item grid provides a few more to drag and drop items etc.

The problem now is that if you close the conversation and there are remaining items, the update function will recreate the item grid by opening it. This seems to happen after the real window is closed. When you open a new conversation window, it accesses the same item grid window data structure. Therefore you see parts of it drawn over the new conversation window and all kind of crazy stuff happens.

Normally this doesn't happen. Either you take all items (the the item grid is removed and not re-created) or abort and stay in the window.

There are two approaches I can think of without touching the whole window event stuff:

  • Add a bool to avoid updating the item grid when the window is about to close (that's what I did)
  • Clear all items from the item grid, so that it is not recreated (needs a new bigger function)

@a1exh
Copy link

a1exh commented Nov 3, 2022

FYI this is tracked on my spreadsheet as unfixed error 12 (Meynaf 06/04/2009)

Here is a link back to the Bug report

http://eab.abime.net/showpost.php?p=533428&postcount=175

@Pyrdacor
Copy link
Owner Author

Pyrdacor commented Nov 3, 2022

Ah thanks. It's been a while since I had a look at the spreadsheet. Currently I only find bugs while testing stuff for the extension. I found this particular bug when I was testing a new event. I had to program quite a lot m68k asm and thought that I messed up when I saw those fancy graphic issues and the crash. But luckily it wasn't my fault. :D

@Pyrdacor
Copy link
Owner Author

Pyrdacor commented Nov 3, 2022

Fixing those bugs is relatively easy nowadays since I have the full ASM. So in theory I can also add code in-between etc. The only caveat is, that I commented much code in Ghidra and Ghidra can display stuff in a much nicer way. For example structures etc.

So when I adjust the exported ASM and would re-import it to Ghidra, all the comments and labels would be gone.

In the near future I would like to build a Ghidra plugin to re-import the ASM but I have no experience with that yet. This way we could freely change the ASM and still update it in Ghidra.

This would make code fixing and even adding new features very easy.

@Pyrdacor Pyrdacor removed this from the Release 1.18 milestone Apr 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working game Issues related to the Amiga game
Projects
None yet
Development

No branches or pull requests

2 participants