Git Product home page Git Product logo

Comments (8)

tobiloeb avatar tobiloeb commented on July 19, 2024 1

Got it!!
The problem was the position from audio icon. The second parameter for config_draw_icon() is the start position. For audio icon it is set to 19 but the icon itself needs 6 leds to be shown. If it starts at 19 we have an overflow of 5 leds.

I changed the code to:

void config_draw_menu(uint8_t sel) {

if(config_audio)
config_draw_icon((W-sizeof(audio_on_icon))/2,14,
audio_on_icon,sizeof(audio_on_icon),6, sel == 0, -1);
else
config_draw_icon((W-sizeof(audio_off_icon))/2,14,
audio_off_icon,sizeof(audio_off_icon),6, sel == 0, -1);

config_draw_icon((W-sizeof(brightness_icon))/2,6,
brightness_icon,sizeof(brightness_icon),7, sel==1,
((uint16_t)config_brightness * 14) / 255);

config_draw_icon((W-sizeof(ok_icon))/2,0,
ok_icon,sizeof(ok_icon),5, sel == 2, -1);
}
`

The tetris game is very very cool!

from make-block-reloaded.

harbaum avatar harbaum commented on July 19, 2024

The game itself runs correctly?

Sounds like i have some buffer overflow somewhere which overwrites the milliseconds counter. Or similar ...

from make-block-reloaded.

harbaum avatar harbaum commented on July 19, 2024

Did you try to uncomment parts of the menu to see which part triggers the millis malfunction?

from make-block-reloaded.

tobiloeb avatar tobiloeb commented on July 19, 2024

Thanks for your fast reply. So for you the config menu is working on the arduino? I have changed your code a little bit. I am using an old super nintendo controller and changed the keys.ino.

Yes the game runs perfectly! Its awesome!!

https://github.com/tobiloeb/make-block-reloaded

Currently I have changed some more code, but it didn't work before too.
Is it possible that the code got problems with the included snes classes?

from make-block-reloaded.

harbaum avatar harbaum commented on July 19, 2024

The snes classes may be tje problem. Or the additional ram requirements or the like.

And yes, of course it works for me. But there may e.g. a subtile bug which only triggers a problem with a different compiler version.

from make-block-reloaded.

tobiloeb avatar tobiloeb commented on July 19, 2024

Ok so I think the snes class will crash it. I am very new to arduino programming so I was wondering that it can have such an impact and only in the config menu. Everything else is working very well.

Later I will try to uncomment some parts of the config menu. Maybe I can figure out which part will crash it.
Thanks for your support meanwhile!

from make-block-reloaded.

tobiloeb avatar tobiloeb commented on July 19, 2024

I uncommited step by step parts from the config menu. The problem is the audio icon. If I remove the icons for audio on/off everything is working fine. The config menu will be shown with the brightness and OK icon.

Tomorrow I will check whats exactly the problem with the audio icon in my code.
Thanks for your support.

from make-block-reloaded.

harbaum avatar harbaum commented on July 19, 2024

Excellent. That's the kind of buffer overflow i initially expected. Thanks for finding the problem.

from make-block-reloaded.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.