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

Problems after changing the display. #4

Open
spairo1741 opened this issue Dec 9, 2023 · 25 comments
Open

Problems after changing the display. #4

spairo1741 opened this issue Dec 9, 2023 · 25 comments
Assignees

Comments

@spairo1741
Copy link

  • After changing Adafruit 9341 to the "no name" display 9341, the new screen displays only a square one, not a rectangular one.
  • For the Arduino system and with TFT_eSPI 2.5.34 drivers, after selecting #define ILI9341_2_DRIVER // Alternative ILI9341 driver, the screen works correctly under Arduino.
  • Below is a link to this topic with the problem.
  • ILI9341_Init.h - Strange graphic issues depending on TFT Bodmer/TFT_eSPI#1172
@cfrankb
Copy link
Owner

cfrankb commented Dec 9, 2023

Restart the device and enter monitor mode.
Grab a copy of the log.
idf.py monitor

@spairo1741
Copy link
Author

@cfrankb
Copy link
Owner

cfrankb commented Dec 9, 2023

Screenshot_2023-12-09_18-44-41
test.log

@cfrankb
Copy link
Owner

cfrankb commented Dec 10, 2023

Screenshot_2023-12-09_23-29-07

what value is the SPI_Frequency set to in driver.cpp ?

@cfrankb
Copy link
Owner

cfrankb commented Dec 10, 2023

In the log for my esp32:
I (40) boot.esp32: SPI Speed : 40MHz

In your log
I (34) boot.esp32s3: Boot SPI Speed : 80MHz

@cfrankb
Copy link
Owner

cfrankb commented Dec 10, 2023

I have ordered another ILI9341 so I can test it with one of my esp32s3 but i won't receive it until January.

@spairo1741
Copy link
Author

  • driver.cpp is ok but in sdkconig not
    spi
    sdkconfig

@spairo1741
Copy link
Author

  • its working without debug buttons
    level2

@cfrankb
Copy link
Owner

cfrankb commented Dec 10, 2023

Screenshot_2023-12-10_02-16-10

i think color inversion is RGB/BGR thing
on line 398
spi_master_write_data_byte(dev, 0x08);

try replacing 0x08 with 0x00

if you set this value to 0x40 or 0x60 it should also cause the screen to rotate as per the doc.

Screenshot_2023-12-10_02-14-46

@cfrankb
Copy link
Owner

cfrankb commented Dec 11, 2023

From the image above, it is clear that the image is flipped horizontally, which something which a different combination of bits in Memory Access Control can also fix. I don't have an ILI9341 hooked to an esp32 device to test at the moment. It is also possible that changing that setting (with the right combination of bits) can also fix the "square picture" things as it is the result of the image being drawn in the wrong orientation. Some experimentation is required here. @spairo1741

@spairo1741
Copy link
Author

  • Memory Access Control = 0x40 + "square picture"
  • I will try other combinations.
    0x40

@cfrankb
Copy link
Owner

cfrankb commented Dec 11, 2023

the colors are correct and horizontal flip is fixed.

@spairo1741
Copy link
Author

  • I am sending drive.cpp with it there is no bar on the screen.
  • where can I find the level boards so that I can compare the colors, e.g. level with bricks, blue, green colors, such as a color control board.
    0x48-2
    driver.zip

@cfrankb
Copy link
Owner

cfrankb commented Dec 11, 2023

The health bar doesn't show on level 1 (due to a possible bug).
The code exits the loop early when the level is shorter than the screen height. Resulting in no health bar.

Screenshot_2023-12-11_13-36-40

a sub-optimal quick fix can be to move the condition into the inner loop

Screenshot_2023-12-11_13-45-26

attached is level 2

  • the health bar is there
  • the brick are red, the swamp is blue and the trees are green, exactly what you need to adjust the color map.
    20231211_132259

@cfrankb
Copy link
Owner

cfrankb commented Dec 11, 2023

20231211_135719

@cfrankb
Copy link
Owner

cfrankb commented Dec 11, 2023

alternatively you can play the online version at this url to checkout the colors
https://cfrankb.com/games/ems/cs3v2.html

or visit the level editor
https://github.com/cfrankb/cs3-map-edit

@cfrankb cfrankb self-assigned this Dec 12, 2023
@spairo1741
Copy link
Author

spairo1741 commented Dec 12, 2023

-Thank you, the colors are set.

  • is it possible to configure ADC channels and joystick parameters in the sdkconfig file?
  • I use a Funduino joystick ver 2.0
  • `#define EXAMPLE_ADC1_CHAN0 ADC_CHANNEL_0 // pin 35 (x) BROWN
    #define EXAMPLE_ADC1_CHAN1 ADC_CHANNEL_1 // pin 34 (y) WHITE

/*#if CONFIG_IDF_TARGET_ESP32
#define EXAMPLE_ADC1_CHAN0 ADC_CHANNEL_4
#define EXAMPLE_ADC1_CHAN1 ADC_CHANNEL_5
#else
#define EXAMPLE_ADC1_CHAN0 ADC_CHANNEL_2
#define EXAMPLE_ADC1_CHAN1 ADC_CHANNEL_3
#endif
*/`

  • ` uint16_t joy = JOY_NONE;

    if (adc_vry > 3000) // extra org 50
    {
    joy |= JOY_UP;
    }
    else if (adc_vry < 50) // extra org 3000
    {
    joy |= JOY_DOWN;
    }

    if (adc_vrx < 50)
    {
    joy |= JOY_LEFT;
    }
    else if (adc_vrx > 3000)
    {
    joy |= JOY_RIGHT;
    }
    `

  • the fonts are not cut off at the top, is it the display's fault?

level2
Joystick-V2-Funduino ver 2 0
cut-fonts

@cfrankb
Copy link
Owner

cfrankb commented Dec 12, 2023

-Thank you, the colors are set.

  • is it possible to configure ADC channels and joystick parameters in the sdkconfig file?
  • I use a Funduino joystick ver 2.0
  • `#define EXAMPLE_ADC1_CHAN0 ADC_CHANNEL_0 // pin 35 (x) BROWN
    #define EXAMPLE_ADC1_CHAN1 ADC_CHANNEL_1 // pin 34 (y) WHITE

i'll add the channels to the config

/*#if CONFIG_IDF_TARGET_ESP32 #define EXAMPLE_ADC1_CHAN0 ADC_CHANNEL_4 #define EXAMPLE_ADC1_CHAN1 ADC_CHANNEL_5 #else #define EXAMPLE_ADC1_CHAN0 ADC_CHANNEL_2 #define EXAMPLE_ADC1_CHAN1 ADC_CHANNEL_3 #endif */`

  • uint16_t joy = JOY_NONE; if (adc_vry > 3000) // extra org 50 { joy |= JOY_UP; } else if (adc_vry < 50) // extra org 3000 { joy |= JOY_DOWN; } if (adc_vrx < 50) { joy |= JOY_LEFT; } else if (adc_vrx > 3000) { joy |= JOY_RIGHT; }

my joystick is working in reverse apparently.
one more thing to configure

  • the fonts are not cut off at the top, is it the display's fault?

displays have a dead zone at the top and it varies per model.
so we would have to set a y-offset for the font.

Screenshot_2023-12-12_09-00-23

Screenshot_2023-12-12_09-08-36

@cfrankb
Copy link
Owner

cfrankb commented Dec 12, 2023

  • is it possible to configure ADC channels and joystick parameters in the sdkconfig file?

@spairo1741 I have created another issue to track the joystick configuration
#5

@cfrankb
Copy link
Owner

cfrankb commented Dec 14, 2023

@spairo1741 does your generic ili9341 have a backlight? not having one could affect the colors.

@spairo1741
Copy link
Author

  • something has changed, the images are more vivid, even the "no name" LCD strip has disappeared.

20231215_114440
The Adafrui display has 7 illuminating diodes, the second board has only one diode.
But the changes are for the better!
20231215_120003

@cfrankb
Copy link
Owner

cfrankb commented Dec 15, 2023

@spairo1741 the only thing that i can think off is the merging of your driver.cpp changes during the latest refactoring of the code.

@spairo1741
Copy link
Author

  • Does grandma have any weapons against monsters or does she just have to rely on her wits.
  • is it possible to financially support the esp-idf-cs3 channel?

@cfrankb
Copy link
Owner

cfrankb commented Dec 22, 2023

  • Does grandma have any weapons against monsters or does she just have to rely on her wits.

only her wits at the moment as there are no plans to add weapons as this would change the game mechanic completely.

however, new power-ups were added in the remake (invinvibility, fast speed, extra life etc). no level is taking advantage of them at the moment.

* is it possible to financially support the esp-idf-cs3 channel?

not at the moment but i'll update you

@cfrankb
Copy link
Owner

cfrankb commented Jan 3, 2024

gameplay changes moved to
#6

@spairo1741

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants