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

Solution to "I2S video output and wifi lead to a reset" #1

Open
Martin-Laclaustra opened this issue May 5, 2019 · 0 comments
Open

Comments

@Martin-Laclaustra
Copy link

Dear Matthias,
thank you for your work on this project.
You posted here a question to Jan: "Unfortunately using I2S video output and wifi at the same time lead to a reset after few seconds. Do you have an idea, how to fix that?"
This is the solution:
This line:


should be changed to:
LOCAL void ICACHE_RAM_ATTR slc_isr(void) {

and this one:

uint8_t read6502(uint16_t address) {

should be changed to:
uint8_t ICACHE_RAM_ATTR read6502(uint16_t address) {

The latter change could be more elegantly solved, keeping functional parts separated. Instead of directly using read6502 within slc_isr, I suggest to copy the relevant memory values (with read6502) to a global array or struct (3 elements) in the main loop. Then just read directly the array in slc_isr. After that change, adding ICACHE_RAM_ATTR to read6502 will not be needed anymore.

I confirm that with the ICACHE_RAM_ATTR edits above (and changing the relevant parts to always start ArduinoOTA, of course), I can reflash while video is on (video stops on reflashing and resumes after the automatic reset).

I have several ideas about structuring the code to make development easier that I will try to share; most are about separating 6502 emulation, memory mapping (should we say "masking"?), (partial) VIC II simulation, video output (NTSC, PAL, color), and user interaction (keyboard input vs telnet vs webpage).

Thanks again.

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

1 participant