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

The Curse of Astarok v1-0 #8

Open
JCalhoun85 opened this issue Sep 6, 2022 · 6 comments
Open

The Curse of Astarok v1-0 #8

JCalhoun85 opened this issue Sep 6, 2022 · 6 comments
Labels
bug Something isn't working

Comments

@JCalhoun85
Copy link

Screen shifts and wraps around the other side.
to recreate bug the game can be found here: https://community.arduboy.com/t/the-curse-of-astarok-v1-0-with-sound/8203
walk to the right to enter the cave. When you finish rolling your die (plays like poker or yahtzee) after damage is dealt the first time the screen shifts. It shifts a certain number of pixels after every round of damage.

@agg23
Copy link
Owner

agg23 commented Sep 8, 2022

Thanks for the report. This game being broken is particularly interesting, as it suggests there's something not being properly emulated with the display. I also checked on the original core, and it didn't work correctly there either. I'll have to look through the game's code to see what is different.

@ericlewis ericlewis added the bug Something isn't working label Sep 9, 2022
@JCalhoun85
Copy link
Author

JCalhoun85 commented Sep 9, 2022

I'm glad it was useful, I have also noticed going through many damage rounds it wraps vertically too just by fewer pixels each time. In case that is relevant to the troubleshooting. Also it runs on my arduboy without this effect

@uXeBoy
Copy link

uXeBoy commented Oct 21, 2022

@agg23 - the invert screen command is sent when damage is dealt:

https://github.com/Press-Play-On-Tape/The-Curse-Of-AstaroK/blob/master/Curse/Curse_PlayGameState_Update.ino#L595

The fact that this is causing a screen shift suggests that the command is being interpreted as pixel data, when it should be command data instead... this seems to be handled in the OLED emulation here:

https://github.com/agg23/openfpga-arduboy/blob/master/src/fpga/core/rtl/video/ssd1306-to-vga.v#L170

Maybe the DC line isn't working as it should?

@agg23
Copy link
Owner

agg23 commented Oct 21, 2022

Thanks for looking into this @uXeBoy. I've been meaning to come back to this, but I've been a little distracted by other consoles :P

@uXeBoy
Copy link

uXeBoy commented Oct 21, 2022

No problem - totally relatable 😅

This is where the code seems to make a decision to receive SPI as pixel data vs. OLED commands:

https://github.com/agg23/openfpga-arduboy/blob/master/src/fpga/core/rtl/video/ssd1306-to-vga.v#L222

Where does DC get set / cleared externally?

@agg23
Copy link
Owner

agg23 commented Oct 21, 2022

It's fed by OledDC, which is pin 4 (0 indexed) of pio_d. I don't actually know much about Arduinos, so that doesn't mean much to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants