Code Monkey home page Code Monkey logo

esp_8_bit's People

Contributors

peterbarrett1967 avatar rossumur avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

esp_8_bit's Issues

frequency

Hello
Why(NES Games) it works in low frequency on the main console 6502 on 3 MHz
But Why should the frequency be high for the simulator? by Atmega and ESP32 ?
thanks

Can`t pair keyboard

I CAN'T PAIR THE LOGITECH K360 AND LOGITECH CORDLESS DESKTOP EX110 KEYBOARD. ANY IDEA ?

Ghost .nes files

Hello after trying to change out the games on the ESP32 I appear to have managed to have a ghost games list.

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:1216
ho 0 tail 12 room 4
load:0x40078000,len:9720
ho 0 tail 12 room 4
load:0x40080400,len:6352
entry 0x400806b8

esp_8_bit

mounting spiffs (will take ~15 seconds if formatting for the first time)....
... mounted in 96 ms
frame_time:0 drawn:1 displayed:0 blit_ticks:0->0, isr time:0.00%
emu_task nofrendo running on core 0 at 240000000mhz
nofrendo inserting /nofrendo/chase.nes
nofrendo /nofrendo/chase.nes is 24592 bytes
main: partition type = 0.
main: partition subtype = 17.
main: partition starting address = 150000.
main: partition size = 140000.
main: partition label = app1.
main: partition encrypted = 0.

00010000 00010010 /nofrendo/king****.nes
00020000 00040010 /nofrendo/mega****.nes
00070000 00040010 /nofrendo/pun*****.nes
000C0000 00006010 /nofrendo/chase.nes
000D0000 0000C010 /nofrendo/t*****.nes
000E0000 0000A010 /nofrendo/10*****.nes
000F0000 00060010 /nofrendo/g****.nes
00160000 0000DF00 /nofrendo/gr***.nes
00170000 00006010 /nofrendo/ball****.nes
00180000 00020010 /nofrendo/rad***.nes
001B0000 0000A010 /nofrendo/m****.nes
001C0000 00010010 /nofrendo/king****.nes
CrapFS::mmap mapping /nofrendo/chase.nes offset:000C0000 len:24592
CrapFS::mmap mapped to 3F430000
Head: 0x3f430000 (ff ff ff ff)
Guru Meditation Error: Core 0 panic'ed (LoadProhibited). Exception was unhandled.
Core 0 register dump:
PC : 0x400d60a4 PS : 0x00060b30 A0 : 0x800ded41 A1 : 0x3ffd0030
A2 : 0x00000001 A3 : 0x3ffc2ce4 A4 : 0x00000000 A5 : 0x3ffc673c
A6 : 0x00000106 A7 : 0x3ffc679c A8 : 0x800d6402 A9 : 0x3ffd0000
A10 : 0x3ffd002c A11 : 0x53e29bb7 A12 : 0x53e29bb7 A13 : 0x3ffc6d10
A14 : 0x00000008 A15 : 0x00000005 SAR : 0x0000001b EXCCAUSE: 0x0000001c
EXCVADDR: 0x00000000 LBEG : 0x400014fd LEND : 0x4000150d LCOUNT : 0xffffffff

Backtrace: 0x400d60a4:0x3ffd0030 0x400ded3e:0x3ffd0050 0x400dfc69:0x3ffd0070 0x400e0f09:0x3ffd00b0 0x400e0f90:0x3ffd0110 0x400e1a65:0x3ffd0130 0x400e1aa1:0x3ffd0190 0x400d27ed:0x3ffd01b0 0x400d2887:0x3ffd01f0 0x4008dc9d:0x3ffd0210

Rebooting...

Question: Analog broadcasting ?

It was possible to broadcast the video signal to a TV from ESP8266. My question is would it be possible instead of producing composite video signal to broadcast the video to a TV nearby?

Running this on esp32-s2?

I'd be interested to know if this would run on an esp32-s2.

If any of the project contributors are interested in trying, I'd be happy to pay for a couple of esp32-s2 boards for you to use.

I know it's not much money to spend but it's not really fair to ask without volunteering the hardware too.

If any of the project contributors are interested, let me know and we'll work out how I can pay for the purchase.

The esp32-s2 has pros and cons for this versus the esp32.

PROS:

  • the s2 is able to map up to 10MB of PSRAM into DMA addressable memory, which is much better than the esp32 can do, and could enable large frame buffers, although I believe this library does not use a frame buffer?
  • the s2 has USB which would be good for keyboards/mice/controllers
  • the s2 costs less than the esp32 - not a big deal of course if you're only buying one device.

CONS:

  • the s2 does not have bluetooth, so controllers/keyboards would need to be USB connected.
  • the s2 only has a single i2s peripheral, but I believe this library only uses one i2s anyway - is that correct?
  • the S2 only has 320K SRAM but maybe this is not an issue given the large amount of PSRAM that can be mapped in?
  • the S2 only has a single core - I don't know if there's enough computing power to run all this with only one core? Having said that, it is a later version of the Extensa core used in the esp32 AND also there is a RISCV ULP processor on the S2 but I don't think that is yet supported in the ESP-IDF.

Reference:
https://twitter.com/i_grr/status/1245361553035198464
https://twitter.com/i_grr/status/1245429953136594945

HID (controller/keyboard) problem with new Arduino ESP32 core 2 ?

the HID server is the problem?
The program works when i comment this line

hid_update();

If I try the emulator with the line uncommented it shows this error on the serial port:

ets Jun  8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:1324
ho 0 tail 12 room 4
load:0x40078000,len:13508
load:0x40080400,len:3604
entry 0x400805f0

esp_8_bit

mounting spiffs (will take ~15 seconds if formatting for the first time)....
... mounted in 132 ms
frame_time:0 drawn:1 displayed:0 blit_ticks:0->0, isr time:0.00%
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Memory dump at 0x400e320c: 000b5ee5 e5004136 0a2d0b5d
Decoding stack results
0x400e30b1: HCI::update() at /home/user/Arduino/arduino-1.8.16/sketchbook/esp_8_bit/src/hid_server/hci_server.cpp line 898
0x400e3111: hci_update() at /home/user/Arduino/arduino-1.8.16/sketchbook/esp_8_bit/src/hid_server/hci_server.cpp line 1434
0x400e38bb: hid_update() at /home/user/Arduino/arduino-1.8.16/sketchbook/esp_8_bit/src/hid_server/hid_server.cpp line 1007
0x400d2668: loop() at /home/user/Arduino/arduino-1.8.16/sketchbook/esp_8_bit/esp_8_bit.ino line 164
0x400e4985: loopTask(void*) at /home/user/Arduino/arduino-1.8.16/packages/esp32/hardware/esp32/2.0.2/cores/esp32/main.cpp line 50

[Question] Understanding the framebuffer in video_out.h

Hello,

I am trying to write an ESP32 program that outputs composite video. I tried using bitlumi's work as a starting point, but the colors are highly unstable, at least on my display. Reading through your write up, I can tell your code is superior in this regard, but I am having a bit of difficulty looking at video_out.h and understanding how it works. It looks like blit and burst are the workhorse of the operation, but they seem to be tied directly to the emulator in use and seem to do some degree of scaling and jiggery pokery depending on the particular emulator.

Ideally, I would like to be able to simplify this so it simply takes a framebuffer of RGB values and paints it. The particular resolution does not matter, but it would be nice if it were either as much as the ESP32 can handle or some fraction of that. Has anyone already done this work of adapting this code into a general purpose graphics library?

Unless you have any other suggestions, I probably will start by finding out what is the highest resolution emulator and try working backwards until I have a way of setting individual pixels.

X3 Gamepad working! Not an issue

I get working this type of controller, is very cheap and easy to find in ebay or other online sites:

https://i.ytimg.com/vi/N2BsJA6EAOo/maxresdefault.jpg](url)

To make it work you need to press (with the controller OFF) the B button and then press the Home button (while keeping the B button pressed). This make the controller act as a keyboard. When you press any button this will cause a short keypress. When you release the key it cause anther short keypress but from other key. This force me to modify the code in this way:

I dont know how to add this functionality but i share my implementation:

gui.cpp:

bool key(int keycode, int pressed, int mods)
    {
        printf("key:%02X %02X %02X\n",keycode,pressed,mods);
        if (pressed && _visible)
            _click = 1;

        if (pressed && keycode == 12) { // F1 - GUI key
            _visible = !_visible;       // toggle GUi
            if (_visible)
                _overlay->frame();      // draw the frame when it first appears
            _click = 1;
            return true;
        }
        if (!_visible)
            return false;

        if (pressed) {
            switch (keycode) {
                case 30:        // 1 key
                case 31:        // 2 key
                case 14:        // 0 key
                    disk_key(keycode-30);
                    break;
                case 15:
                    enter(mods);    // return
                    break;
                case 26:    // up
                    move_v(-1);
                    break;
                case 7:    // down
                    move_v(1);
                    break;
                case 27:    // left
                    move_tab(-1);
                    break;
                case 4:    // right
                    move_tab(1);
                    break;
                case 11:   // left control key
                    break;  // FIRE
            }
        }
        return true;
    }

emu_nofrendo.cpp

 virtual void key(int keycode, int pressed, int mods)
    {
        switch (keycode) {
            case 26: pad(1,event_joypad1_up); break;
            case 8: pad(0,event_joypad1_up); break;

            case 7: pad(1,event_joypad1_down); break;
            case 6: pad(0,event_joypad1_down); break;

            case 27: pad(1,event_joypad1_left); break;
            case 29: pad(0,event_joypad1_left); break;

            case 04: pad(1,event_joypad1_right); break;
            case 20: pad(0,event_joypad1_right); break;

            case 47: pad(1,event_soft_reset); break; // soft reset - 'r'
            case 48: pad(0,event_soft_reset); break; // soft reset - 'r'

            case 30: pad(1,event_hard_reset); break; // hard reset - 't'
            case 31: pad(0,event_hard_reset); break; // hard reset - 't'

            case 15: pad(1,event_joypad1_start); break; // F4
            case 25: pad(0,event_joypad1_start); break; // F4

            case 18: pad(1,event_joypad1_select); break; // tab
            case 10: pad(0,event_joypad1_select); break; // tab

            case 11: pad(1,event_joypad1_a); break; // left shift key event_joypad1_a
            case 21: pad(0,event_joypad1_a); break; // left shift key event_joypad1_a

            case 24: pad(1,event_joypad1_b); break; // option key event_joypad1_b
            case 9: pad(0,event_joypad1_b); break; // option key event_joypad1_b

            //case 59: system(pressed,INPUT_PAUSE); break; // F2
            //case 61: system(pressed,INPUT_START); break; // F4
            //case 62: system(pressed,((KEY_MOD_LSHIFT|KEY_MOD_RSHIFT) & mods) ? INPUT_HARD_RESET : INPUT_SOFT_RESET); break; // F5
        }
    }

how we can add this functionality?

Savestate?

Is there a way to save the state of games? I saw that nofrendo has something about save states don't know if that's related to it though. If it isn't possible right now it should definitely be added that would make this awesome project perfect.

MALLOC32 FAILED allocation of MEMORY_mem:65540!!!!

Hello I'm trying to run this and I get this error:

esp_8_bit

mounting spiffs (will take ~15 seconds if formatting for the first time)....
... mounted in 99 ms
frame_time:0 drawn:1 displayed:0 blit_ticks:0->0, isr time:0.00%
emu_task atari800 running on core 0 at 240000000mhz
MALLOC32 245608 free, 113792 biggest, allocating Screen_atari:92160
MALLOC32 allocation of Screen_atari:92160 3FFE4374
MALLOC32 153432 free, 64776 biggest, allocating MEMORY_mem:65540
MALLOC32 FAILED allocation of MEMORY_mem:65540!!!!####################
ets Jun  8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 188777542, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:928
ho 0 tail 12 room 4
load:0x40078000,len:9280
load:0x40080400,len:5848
entry 0x40080698

If it helps, this is system information for the esp32 chip:

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 188777542, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:928
ho 0 tail 12 room 4
load:0x40078000,len:9280
load:0x40080400,len:5848
entry 0x40080698
Internal Total heap 405012, internal Free Heap 379196
SPIRam Total heap 0, SPIRam Free Heap 0
ChipRevision 1, Cpu Freq 240, SDK Version v3.3-beta1-179-ge931fe9f5-dirty
 Flash Size 4194304, Flash Speed 80000000
ps=0x0

I've tried it on 2 different esp32 dev boards but same result each time.

Any suggestions as to what I might be doing wrong?

thanks

Can we have a Bootloader?

I'm thinking of writing a Bootloader for all the emulators.
So... this is what i'm thinking:

*The emulators are in the app0 partition
*The roms are stored using the CrapFS in the app1 partition
*The first time the emulator is launched it copy the roms in the spiffs to the app1 partition....

With the CornN64 fork that uses an SD card to store the roms we can have the spiffs partition free and...

*Use the partition app0 to store the bootloader.
*The bootloader is a menu that read a folder called "emulators", display the binary files and the user select what emulator is going to run
*When an emulator is selected from the SD card, the bootloader copy the binary to the app1 and mark the partition as boot source. Then the bootloader restart the ESP booting the app1 (the emulator) partition.
*When the app1 (the emulator) start, mark the app0 as the boot source. After that it start the emulator.
*The partition for ROMS (CRAPFS) is the FFAT or SPIFFS where the roms are copied from the SD.

Can this work?
Im planning to use this library for writing the Menu:
https://github.com/Roger-random/ESP_8_BIT_composite

And this is the code that i use to switch between the apps partitions:

#include "esp_partition.h"
#include "esp_image_format.h"
#include "esp_flash_partitions.h"
#include "esp_ota_ops.h"

esp_err_t err;

void setup() {
  const esp_partition_t *partition_running = esp_ota_get_running_partition();
  const esp_partition_t *partition_boot = esp_ota_get_boot_partition();
  const esp_partition_t *partition_ota0 = esp_partition_find_first(ESP_PARTITION_TYPE_APP, ESP_PARTITION_SUBTYPE_APP_OTA_0, NULL);
  const esp_partition_t *partition_ota1 = esp_partition_find_first(ESP_PARTITION_TYPE_APP, ESP_PARTITION_SUBTYPE_APP_OTA_1, NULL);

  switch (partition_boot->address) {
    case 0x00010000:
      ESP_LOGI(LOG_TAG_MAIN, "Boot partition: ota_0");
      break;
    case 0x00150000:
      ESP_LOGI(LOG_TAG_MAIN, "Boot partition: ota_1");
      break;

    default:
      ESP_LOGE(LOG_TAG_MAIN, "Boot partition: unknown");
      break;
  }


  switch (partition_running->address) {
    case 0x00010000:
      ESP_LOGI(LOG_TAG_MAIN, "Running partition: ota_0");
      err = esp_ota_set_boot_partition(partition_ota1);
      if (err != ESP_OK) {
        ESP_LOGE(TAG, "esp_ota_set_boot_partition failed (%s)!", esp_err_to_name(err));
      }
      else{
        ESP_LOGI(LOG_TAG_MAIN, "esp_ota_set_boot_partition ota_1 OK");
        
      }
      break;
    case 0x00150000:
      ESP_LOGI(LOG_TAG_MAIN, "Running partition: ota_1");
      err = esp_ota_set_boot_partition(partition_ota0);
      if (err != ESP_OK) {
        ESP_LOGE(TAG, "esp_ota_set_boot_partition failed (%s)!", esp_err_to_name(err));
      }
      else{
        ESP_LOGI(LOG_TAG_MAIN, "esp_ota_set_boot_partition ota_0 OK");
        
      }
      break;

    default:
      ESP_LOGE(LOG_TAG_MAIN, "Running partition: unknown");
      break;
  }
  delay(5000);
  esp_restart(); 
}

void loop() {
}

Question about Vertical Sync & UART

Thanks a lot for such a wonderful & fun project! It works flawlessly. 🥰
I try to study the code (hoping to learn something) but was just totally overwhelmed by its complexity 😅. So proceeded to try the next best Noob move, poke around the code...

Experiment #1: Adding an UART input (Arduino as an game input to the ESP32).
As soon as I add the line Serial1.begin(115200, SERIAL_8N1, 16, 17); into Setup() & pump Data through the UART. Even before adding any code for Serial reading, the Vertical Sync on the TV screen is already messed up.
So I am wondering if Serial is somehow affecting the video output timing on Pin#25?

Taking a hint from CornN64 #16 modification, I try to mess around the Sync parameter but to no avail. 🥲

Anybody have any pointer/suggestions on where I should start digging next? 🙏🏻

Esp32-cam bootlooping with error

Hi, I must say that this project is amazing, and it is a shame that its development was stopped. I hope that somebody could help me anyway.
I tried to run this software on an ESP32-CAM board, and after solving problems like downgrading the ESP32 board package to 1.0.4, I was able to compile it and upload it to the microcontroller. The problem is that it does not load. These are the logs:
--------
esp_8_bit

mounting spiffs (will take ~15 seconds if formatting for the first time)....
... mounted in 6375 ms
frame_time:0 drawn:1 displayed:0 blit_ticks:0->0, isr time:0.00%
emu_task smsplus running on core 0 at 240000000mhz
unpacking /smsplus/ftrack.gg
unpacking /smsplus/baraburuu.sms
unpacking /smsplus/nanowars8k.sms
init_screen
CrapFS::CrapFS app1 not found
Guru Meditation Error: Core 0 panic'ed (LoadProhibited). Exception was unhandled.
Core 0 register dump:
PC : 0x400e5e9f PS : 0x00060d30 A0 : 0x800e6141 A1 : 0x3ffe33a0
A2 : 0x3ffe33d4 A3 : 0x3ffe33fc A4 : 0x00020000 A5 : 0x00010000
A6 : 0x00060021 A7 : 0x00000000 A8 : 0x801180ad A9 : 0x3ffe3380
A10 : 0x00000000 A11 : 0x00000000 A12 : 0x00000000 A13 : 0x0000ff00
A14 : 0x00ff0000 A15 : 0xff000000 SAR : 0x0000001c EXCCAUSE: 0x0000001c
EXCVADDR: 0x0000000c LBEG : 0x4000c2e0 LEND : 0x4000c2f6 LCOUNT : 0x00000000

Backtrace: 0x400e5e9f:0x3ffe33a0 0x400e613e:0x3ffe33c0 0x400e6ebe:0x3ffe3450 0x400e7eb9:0x3ffe34a0 0x400e7f40:0x3ffe3500 0x400e8a9d:0x3ffe3520 0x400e8ad9:0x3ffe3580 0x400d21a1:0x3ffe35a0 0x400d224b:0x3ffe35e0 0x40090229:0x3ffe3600

Rebooting...
--------

I've tried to track the problem and I found out that this function in /src/gui.cpp creates error:
void insert(const string& path, int flags)
{
set_pref("recent",path);
_emu->insert(_path + "/" + path,flags);//exacly this line is responsible for my headaches
}

I've tried to find out why it does not work, but my knowledge is not enough to solve the problem :(. Any help would be very appreciated :)

Compilation error

The error:

In file included from C:\Users\The red eye Studio\Desktop\esp_8_bit-master\esp_8_bit\esp_8_bit.ino:9:
C:\Users\The red eye Studio\Desktop\esp_8_bit-master\esp_8_bit\src\video_out.h:286: warning: "IRE" redefined
 #define IRE(_x)          ((uint32_t)(((_x)+40)*255/3.3/147.5) << 8)   // 3.3V DAC
 
In file included from C:\Users\The red eye Studio\Desktop\esp_8_bit-master\esp_8_bit\esp_8_bit.ino:8:
C:\Users\The red eye Studio\Desktop\esp_8_bit-master\esp_8_bit\src\emu.h:43: note: this is the location of the previous definition
 #define IRE(_x)          ((uint32_t)((_x+40)*255/3.3/147.5) << 8)   // 3.3V DAC
 
In file included from C:\Users\The red eye Studio\Desktop\esp_8_bit-master\esp_8_bit\esp_8_bit.ino:9:
C:\Users\The red eye Studio\Desktop\esp_8_bit-master\esp_8_bit\src\video_out.h:290: warning: "GRAY_LEVEL" redefined
 #define GRAY_LEVEL       IRE(50)
 
In file included from C:\Users\The red eye Studio\Desktop\esp_8_bit-master\esp_8_bit\esp_8_bit.ino:8:
C:\Users\The red eye Studio\Desktop\esp_8_bit-master\esp_8_bit\src\emu.h:47: note: this is the location of the previous definition
 #define GRAY_LEVEL       IRE((100-7.5)/2)
 
In file included from C:\Users\The red eye Studio\Desktop\esp_8_bit-master\esp_8_bit\src\emu.h:25,
                 from C:\Users\The red eye Studio\Desktop\esp_8_bit-master\esp_8_bit\esp_8_bit.ino:8:
c:\users\the red eye studio\appdata\local\arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2021r1\xtensa-esp32-elf\sys-include\dirent.h:53:6: error: conflicting declaration of 'DIR* opendir(const char*)' with 'C' linkage
 DIR *opendir(const char *);
      ^~~~~~~
In file included from c:\users\the red eye studio\appdata\local\arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2021r1\xtensa-esp32-elf\sys-include\dirent.h:39,
                 from C:\Users\The red eye Studio\Desktop\esp_8_bit-master\esp_8_bit\src\emu.h:25,
                 from C:\Users\The red eye Studio\Desktop\esp_8_bit-master\esp_8_bit\esp_8_bit.ino:8:
C:\Users\The red eye Studio\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.0-rc1/tools/sdk/esp32/include/newlib/platform_include/sys/dirent.h:53:6: note: previous declaration with 'C++' linkage
 DIR* opendir(const char* name);
      ^~~~~~~
In file included from C:\Users\The red eye Studio\Desktop\esp_8_bit-master\esp_8_bit\src\emu.h:25,
                 from C:\Users\The red eye Studio\Desktop\esp_8_bit-master\esp_8_bit\esp_8_bit.ino:8:
c:\users\the red eye studio\appdata\local\arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2021r1\xtensa-esp32-elf\sys-include\dirent.h:56:3: error: conflicting declaration of 'dirent* readdir(DIR*)' with 'C' linkage
   readdir(DIR *);
   ^~~~~~~
In file included from c:\users\the red eye studio\appdata\local\arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2021r1\xtensa-esp32-elf\sys-include\dirent.h:39,
                 from C:\Users\The red eye Studio\Desktop\esp_8_bit-master\esp_8_bit\src\emu.h:25,
                 from C:\Users\The red eye Studio\Desktop\esp_8_bit-master\esp_8_bit\esp_8_bit.ino:8:
C:\Users\The red eye Studio\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.0-rc1/tools/sdk/esp32/include/newlib/platform_include/sys/dirent.h:54:16: note: previous declaration with 'C++' linkage
 struct dirent* readdir(DIR* pdir);
                ^~~~~~~
In file included from C:\Users\The red eye Studio\Desktop\esp_8_bit-master\esp_8_bit\src\emu.h:25,
                 from C:\Users\The red eye Studio\Desktop\esp_8_bit-master\esp_8_bit\esp_8_bit.ino:8:
c:\users\the red eye studio\appdata\local\arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2021r1\xtensa-esp32-elf\sys-include\dirent.h:58:6: error: conflicting declaration of 'int readdir_r(DIR*, dirent*, dirent**)' with 'C' linkage
 int  readdir_r(DIR *__restrict, struct dirent *__restrict,
      ^~~~~~~~~
In file included from c:\users\the red eye studio\appdata\local\arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2021r1\xtensa-esp32-elf\sys-include\dirent.h:39,
                 from C:\Users\The red eye Studio\Desktop\esp_8_bit-master\esp_8_bit\src\emu.h:25,
                 from C:\Users\The red eye Studio\Desktop\esp_8_bit-master\esp_8_bit\esp_8_bit.ino:8:
C:\Users\The red eye Studio\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.0-rc1/tools/sdk/esp32/include/newlib/platform_include/sys/dirent.h:59:5: note: previous declaration with 'C++' linkage
 int readdir_r(DIR* pdir, struct dirent* entry, struct dirent** out_dirent);
     ^~~~~~~~~
In file included from C:\Users\The red eye Studio\Desktop\esp_8_bit-master\esp_8_bit\src\emu.h:25,
                 from C:\Users\The red eye Studio\Desktop\esp_8_bit-master\esp_8_bit\esp_8_bit.ino:8:
c:\users\the red eye studio\appdata\local\arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2021r1\xtensa-esp32-elf\sys-include\dirent.h:61:7: error: conflicting declaration of 'void rewinddir(DIR*)' with 'C' linkage
 void  rewinddir(DIR *);
       ^~~~~~~~~
In file included from c:\users\the red eye studio\appdata\local\arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2021r1\xtensa-esp32-elf\sys-include\dirent.h:39,
                 from C:\Users\The red eye Studio\Desktop\esp_8_bit-master\esp_8_bit\src\emu.h:25,
                 from C:\Users\The red eye Studio\Desktop\esp_8_bit-master\esp_8_bit\esp_8_bit.ino:8:
C:\Users\The red eye Studio\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.0-rc1/tools/sdk/esp32/include/newlib/platform_include/sys/dirent.h:57:6: note: previous declaration with 'C++' linkage
 void rewinddir(DIR* pdir);
      ^~~~~~~~~
In file included from C:\Users\The red eye Studio\Desktop\esp_8_bit-master\esp_8_bit\src\emu.h:25,
                 from C:\Users\The red eye Studio\Desktop\esp_8_bit-master\esp_8_bit\esp_8_bit.ino:8:
c:\users\the red eye studio\appdata\local\arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2021r1\xtensa-esp32-elf\sys-include\dirent.h:72:7: error: conflicting declaration of 'void seekdir(DIR*, long int)' with 'C' linkage
 void  seekdir(DIR *, long);
       ^~~~~~~
In file included from c:\users\the red eye studio\appdata\local\arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2021r1\xtensa-esp32-elf\sys-include\dirent.h:39,
                 from C:\Users\The red eye Studio\Desktop\esp_8_bit-master\esp_8_bit\src\emu.h:25,
                 from C:\Users\The red eye Studio\Desktop\esp_8_bit-master\esp_8_bit\esp_8_bit.ino:8:
C:\Users\The red eye Studio\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.0-rc1/tools/sdk/esp32/include/newlib/platform_include/sys/dirent.h:56:6: note: previous declaration with 'C++' linkage
 void seekdir(DIR* pdir, long loc);
      ^~~~~~~
In file included from C:\Users\The red eye Studio\Desktop\esp_8_bit-master\esp_8_bit\src\emu.h:25,
                 from C:\Users\The red eye Studio\Desktop\esp_8_bit-master\esp_8_bit\esp_8_bit.ino:8:
c:\users\the red eye studio\appdata\local\arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2021r1\xtensa-esp32-elf\sys-include\dirent.h:73:7: error: conflicting declaration of 'long int telldir(DIR*)' with 'C' linkage
 long  telldir(DIR *);
       ^~~~~~~
In file included from c:\users\the red eye studio\appdata\local\arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2021r1\xtensa-esp32-elf\sys-include\dirent.h:39,
                 from C:\Users\The red eye Studio\Desktop\esp_8_bit-master\esp_8_bit\src\emu.h:25,
                 from C:\Users\The red eye Studio\Desktop\esp_8_bit-master\esp_8_bit\esp_8_bit.ino:8:
C:\Users\The red eye Studio\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.0-rc1/tools/sdk/esp32/include/newlib/platform_include/sys/dirent.h:55:6: note: previous declaration with 'C++' linkage
 long telldir(DIR* pdir);
      ^~~~~~~
In file included from C:\Users\The red eye Studio\Desktop\esp_8_bit-master\esp_8_bit\src\emu.h:25,
                 from C:\Users\The red eye Studio\Desktop\esp_8_bit-master\esp_8_bit\esp_8_bit.ino:8:
c:\users\the red eye studio\appdata\local\arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2021r1\xtensa-esp32-elf\sys-include\dirent.h:76:6: error: conflicting declaration of 'int closedir(DIR*)' with 'C' linkage
 int  closedir(DIR *);
      ^~~~~~~~
In file included from c:\users\the red eye studio\appdata\local\arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2021r1\xtensa-esp32-elf\sys-include\dirent.h:39,
                 from C:\Users\The red eye Studio\Desktop\esp_8_bit-master\esp_8_bit\src\emu.h:25,
                 from C:\Users\The red eye Studio\Desktop\esp_8_bit-master\esp_8_bit\esp_8_bit.ino:8:
C:\Users\The red eye Studio\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.0-rc1/tools/sdk/esp32/include/newlib/platform_include/sys/dirent.h:58:5: note: previous declaration with 'C++' linkage
 int closedir(DIR* pdir);
     ^~~~~~~~
C:\Users\The red eye Studio\Desktop\esp_8_bit-master\esp_8_bit\esp_8_bit.ino: In function 'void emu_task(void*)':
esp_8_bit:75:66: error: 'rtc_clk_cpu_freq_get' was not declared in this scope
       _emu->name.c_str(),xPortGetCoreID(),rtc_clk_cpu_freq_value(rtc_clk_cpu_freq_get()));
                                                                  ^~~~~~~~~~~~~~~~~~~~
C:\Users\The red eye Studio\Desktop\esp_8_bit-master\esp_8_bit\esp_8_bit.ino:75:66: note: suggested alternative: 'rtc_clk_apb_freq_get'
       _emu->name.c_str(),xPortGetCoreID(),rtc_clk_cpu_freq_value(rtc_clk_cpu_freq_get()));
                                                                  ^~~~~~~~~~~~~~~~~~~~
                                                                  rtc_clk_apb_freq_get
esp_8_bit:75:43: error: 'rtc_clk_cpu_freq_value' was not declared in this scope
       _emu->name.c_str(),xPortGetCoreID(),rtc_clk_cpu_freq_value(rtc_clk_cpu_freq_get()));
                                           ^~~~~~~~~~~~~~~~~~~~~~
C:\Users\The red eye Studio\Desktop\esp_8_bit-master\esp_8_bit\esp_8_bit.ino:75:43: note: suggested alternative: 'rtc_clk_freq_cal'
       _emu->name.c_str(),xPortGetCoreID(),rtc_clk_cpu_freq_value(rtc_clk_cpu_freq_get()));
                                           ^~~~~~~~~~~~~~~~~~~~~~
                                           rtc_clk_freq_cal
C:\Users\The red eye Studio\Desktop\esp_8_bit-master\esp_8_bit\esp_8_bit.ino: In function 'void setup()':
esp_8_bit:101:3: error: 'rtc_clk_cpu_freq_set' was not declared in this scope
   rtc_clk_cpu_freq_set(RTC_CPU_FREQ_240M);
   ^~~~~~~~~~~~~~~~~~~~
C:\Users\The red eye Studio\Desktop\esp_8_bit-master\esp_8_bit\esp_8_bit.ino:101:3: note: suggested alternative: 'rtc_clk_apb_freq_get'
   rtc_clk_cpu_freq_set(RTC_CPU_FREQ_240M);
   ^~~~~~~~~~~~~~~~~~~~
   rtc_clk_apb_freq_get
exit status 1
'rtc_clk_cpu_freq_get' was not declared in this scope

The Code:

#include "esp_system.h"
#include "esp_int_wdt.h"
#include "esp_spiffs.h"

#define PERF  // some stats about where we spend our time
#include "src/emu.h"
#include "src/video_out.h"

// esp_8_bit
// Atari 8 computers, NES and SMS game consoles on your TV with nothing more than a ESP32 and a sense of nostalgia
// Supports NTSC/PAL composite video, Bluetooth Classic keyboards and joysticks

//  Choose one of the video standards: PAL,NTSC
#define VIDEO_STANDARD NTSC

//  Choose one of the following emulators: EMU_NES,EMU_SMS,EMU_ATARI
#define EMULATOR EMU_NES

//  Many emus work fine on a single core (S2), file system access can cause a little flickering
//  #define SINGLE_CORE

// The filesystem should contain folders named for each of the emulators i.e.
//    atari800
//    nofrendo
//    smsplus
// Folders will be auto-populated on first launch with a built in selection of sample media.
// Use 'ESP32 Sketch Data Upload' from the 'Tools' menu to copy a prepared data folder to ESP32

// Create a new emulator, messy ifdefs ensure that only one links at a time
Emu* NewEmulator()
{  
  #if (EMULATOR==EMU_NES)
  return NewNofrendo(VIDEO_STANDARD);
  #endif
  #if (EMULATOR==EMU_SMS)
  return NewSMSPlus(VIDEO_STANDARD);
  #endif
  #if (EMULATOR==EMU_ATARI)
  return NewAtari800(VIDEO_STANDARD);
  #endif
  printf("Must choose one of the following emulators: EMU_NES,EMU_SMS,EMU_ATARI\n");
}

Emu* _emu = 0;            // emulator running on core 0
uint32_t _frame_time = 0;
uint32_t _drawn = 1;
bool _inited = false;

void emu_init()
{
    std::string folder = "/" + _emu->name;
    gui_start(_emu,folder.c_str());
    _drawn = _frame_counter;
}

void emu_loop()
{
    // wait for blanking before drawing to avoid tearing
    video_sync();

    // Draw a frame, update sound, process hid events
    uint32_t t = xthal_get_ccount();
    gui_update();
    _frame_time = xthal_get_ccount() - t;
    _lines = _emu->video_buffer();
    _drawn++;
}

// dual core mode runs emulator on comms core
void emu_task(void* arg)
{
    printf("emu_task %s running on core %d at %dmhz\n",
      _emu->name.c_str(),xPortGetCoreID(),rtc_clk_cpu_freq_value(rtc_clk_cpu_freq_get()));
    emu_init();
    for (;;)
      emu_loop();
}

esp_err_t mount_filesystem()
{
  printf("\n\n\nesp_8_bit\n\nmounting spiffs (will take ~15 seconds if formatting for the first time)....\n");
  uint32_t t = millis();
  esp_vfs_spiffs_conf_t conf = {
    .base_path = "",
    .partition_label = NULL,
    .max_files = 5,
    .format_if_mount_failed = true  // force?
  };
  esp_err_t e = esp_vfs_spiffs_register(&conf);
  if (e != 0)
    printf("Failed to mount or format filesystem: %d. Use 'ESP32 Sketch Data Upload' from 'Tools' menu\n",e);
  vTaskDelay(1);
  printf("... mounted in %d ms\n",millis()-t);
  return e;
}

void setup()
{ 
  rtc_clk_cpu_freq_set(RTC_CPU_FREQ_240M);  
  mount_filesystem();                       // mount the filesystem!
  _emu = NewEmulator();                     // create the emulator!
  hid_init("emu32");                        // bluetooth hid on core 1!

  #ifdef SINGLE_CORE
  emu_init();
  video_init(_emu->cc_width,_emu->flavor,_emu->composite_palette(),_emu->standard); // start the A/V pump on app core
  #else
  xTaskCreatePinnedToCore(emu_task, "emu_task", EMULATOR == EMU_NES ? 5*1024 : 3*1024, NULL, 0, NULL, 0); // nofrendo needs 5k word stack, start on core 0
  #endif
}

#ifdef PERF
void perf()
{
  static int _next = 0;
  if (_drawn >= _next) {
    float elapsed_us = 120*1000000/(_emu->standard ? 60 : 50);
    _next = _drawn + 120;
    
    printf("frame_time:%d drawn:%d displayed:%d blit_ticks:%d->%d, isr time:%2.2f%%\n",
      _frame_time/240,_drawn,_frame_counter,_blit_ticks_min,_blit_ticks_max,(_isr_us*100)/elapsed_us);
      
    _blit_ticks_min = 0xFFFFFFFF;
    _blit_ticks_max = 0;
    _isr_us = 0;
  }
}
#else
void perf(){};
#endif

// this loop always runs on app_core (1).
void loop()
{    
  #ifdef SINGLE_CORE
  emu_loop();
  #else
  // start the video after emu has started
  if (!_inited) {
    if (_lines) {
      printf("video_init\n");
      video_init(_emu->cc_width,_emu->flavor,_emu->composite_palette(),_emu->standard); // start the A/V pump
      _inited = true;
    } else {
      vTaskDelay(1);
    }
  }
  #endif
  
  // update the bluetooth edr/hid stack
  hid_update();

  // Dump some stats
  perf();
}

The Folder:

image

The Rom:

image

Fast Forward in rom menu list?

It's possible to fast forward in the rom menu list? It's a bit difficult to find a rom when the rom list is to big.

Thanks!

Picture of wiring?

I was hoping you could post a picture of the actual wiring. I am a beginner at interpreting wiring diagrams but was hoping to build this for my son's gradution.

Thanks!

[Feature Request] OSD video overlay

Just wow, great project!

This isn't a real feature request because it is out of scope, but I wouldn't mind your 2c.

How would you go about overlaying this video on another e.g. making an OSD (text etc) to display over another video source? It is possible to use something like the lm1881 video sync separator, but what would be the best way to use your lib and sync to this video input?


If you've read this far here is the end goal application. FPV quad racing uses an analog video transmitter and sometimes the video receiver misses the vertical or horizontal sync pulses. This of course causes static lines or scrolling. Having a video source generated on the video receiver end that is synced with the incoming video transmission from the quad would be useful for inserting the sync pulses. This helps to eliminate momentary static in the video.

There are now a few commercial products available, but it would be awesome to have an opensource option... long term goals.

Cheers

No video

Hi,

I need some help.

I don't get video with the sketch.
In the console I see a correct boot, Wiimote pairing and .nes load from SPIFFS, but no video

Board: DOIT ESP32 DEVKIT V1
Tried both pins 26 and 25, PAL and NTSC and ATARI and NES setups
Bitlunis CompositeVideoSimple sketch works fine with same setup (ESP32 board, pin 25 and same TV)
In the Oscilloscope I see video output with Bitlunis sketch but not with esp_8_bit nor espflix

Thanks in advance!

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
ets Jun 8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:1044
load:0x40078000,len:8896
load:0x40080400,len:5816
entry 0x400806ac

esp_8_bit

mounting spiffs (will take ~15 seconds if formatting for the first time)....
... mounted in 99 ms
frame_time:0 drawn:1 displayed:0 blit_ticks:0->0, isr time:0.00%
emu_task nofrendo running on core 0 at 240000000mhz
nofrendo inserting /nofrendo/mario.nes
nofrendo /nofrendo/mario.nes is 40976 bytes
main: partition type = 0.
main: partition subtype = 17.
main: partition starting address = 150000.
main: partition size = 140000.
main: partition label = app1.
main: partition encrypted = 0.

00010000 00006010 /nofrendo/chase.nes
00020000 0000A010 /nofrendo/mario.nes
CrapFS::mmap mapping /nofrendo/mario.nes offset:00020000 len:40976
CrapFS::mmap mapped to 3F430000
Head: 0x3f430000 (4e 45 53 1a)
video_init
frame_time:11815 drawn:121 displayed:0 blit_ticks:-1->0, isr time:0.00%
frame_time:11142 drawn:241 displayed:0 blit_ticks:-1->0, isr time:0.00%

Roms not showing up in the menu.

After placing the ROMs in the data folder for the appropriate emulator not all of them show up in the menu.
I kept the names short, with no spaces. Sometimes if I change names device ends in a boot loop where it tries to format FS. A list of supported ROMs and appropriate names would go a long way.

Is it possible to hook up multiple wii motes ?

I'm thinking of taking your code and seeing about making a takeabout console to friends houses and plugging into their TV's. Do the libraries support mutliple BT Controllers / Wii Motes being hooked up ?

I will take a look, but thought input from you would be a good starting point :)

This is a very awesome project, I pulls so many cool things together. I recently did something similar with just a black and white screen output to TV and a PS3 controller for an Arduboy type console
https://github.com/tonym128/ESP32_Arduboy/tree/tvout

SRAM support and SD card access?

https://github.com/badvision/esp32_nesemu

This user commented on your project on HaD and had added some features to the NES emulator, notably SD card use, purported improvements running Metroid, SRAM support and save games.

I'd be very happy to have this with composite out. I'm looking to design a little keychain NES with one of the more high spec WROOM32 modules so it has more RAM and storage.

(Thank you very much for this. It's making being immunocompromised and quarantined in not as tough)

Getting started graphics / games programming?

Hello do you have any suggestions for a graphics library to use with this?

Maybe like the Adafruit GFX or are there others libraries that might be a better start for doing games such as gameduino library or something - I'm just guessing?

Even a simple mode setting/test pattern example would be fun to play with to try out the various resolutions.

Can you suggest where to get started/examples etc or is it too early?

thanks

What is the resolution & color depth?

Hello,

I wrote a comparison of esp32 video solutions here:
https://www.reddit.com/r/esp32/comments/gpezk3/feature_comparison_of_esp32_graphics_sound_game/

I wonder would you mind confirming please, what is the maximum resolution that your solution can do for each of PAL & NTSC? Also what is the color depth?

What is the maximum resolution that you think your solution could do, presuming you are not already pushing it to the max?

As a side question, can you indicate what plans you have from here for this software?

thanks

ATR Image Explorer - Skipping FILE_0x.DAT files?

I am questioning why I see only 3 FILE_0x.DAT files when there appear to be 5 deleted files from the Directory. Could there be a bug where every other FILE_0x.DAT file is not displayed?

I am using my APE to USB to make .ATR files/images of many real/physical diskettes using both a Happy 1050 and an indusGT drives. Later I look at some of the resulting .ATR files within the ATR Image Explorer (a great tool). On some images I see one or more .DAT files that always have names of the form: FILE_0x.DAT as in the 2nd picture. What are these? My guess is these were files that were 'deleted' therefore they are not found in the Directory (3rd picture) but their data sectors are still found/read by ProSystem. Is this the case? Note: ProSystem did not report any errors when it read this particular disk image '01a.ATR'

What are the 3 .DAT files circled in red?

Note 5 of the file names in the Directory are not listed above. Where these 5 files deleted? Maybe ATR Image Explorer has a bug in that it is not displaying FILE_02 or FILE_04?

Failure when connecting Bluetooth keyboard resulting in Panic/Reset of ESP32

Hello Rossum,

I really enjoyed this project and I'm impressed by your knowledge and results!

I have deployed the ESP_8_bit to my ESP32 WROOM. It runs each emulator with no issues.
But when I tried to attach a Bluetooth 3.0 keyboard I observed that a few seconds after it starts to display images to the TV, ESP32 reboots.

So I decided to turn on HCI Messages and to log the serial output to help on finding out
that is going on. The messages I got are at the end of this message.

It clearly recognizes the keyboard as can be seen in HCI messages:
20:73:00:3C:DF:41:402500 input device added
20:73:00:3C:DF:41 connected on handle 129

Last messages before crashing and rebooting are:
HCI_MAX_SLOTS_CHANGED_EVT 3 bytes
unhandled hci case

An unhandled hci case is causing an exception fault.
HCI code doesn't handle HCI_MAX_SLOTS_CHANGED_EVT and crashes followed by an ESP32 reboot.

Best,
Rodrigo Corbera.

========================================================
esp_8_bit

mounting spiffs (will take ~15 seconds if formatting for the first time)....
... mounted in 96 ms

CMD 030C00
emu_task atari800 running on core 0 at 240000000mhz
< EVT 0E0405030C00
HCI_COMMAND_COMPLETE_EVT 4 bytes
-> HCI_RESET 0C03 No Error
CMD 051000
< EVT 0E0B05051000FD03FF09000400
HCI_COMMAND_COMPLETE_EVT 11 bytes
-> HCI_READ_BUFFER_SIZE 1005 No Error
CMD 091000
< EVT 0E0A05091000DA690BC40A24
HCI_COMMAND_COMPLETE_EVT 10 bytes
-> HCI_READ_BD_ADDR 1009 No Error
CMD 240C0307020C
CMD 1A0C0103
< EVT 0E0405240C00
HCI_COMMAND_COMPLETE_EVT 4 bytes
-> HCI_WRITE_CLASS_OF_DEVICE 0C24 No Error
< EVT 0E04051A0C00
HCI_COMMAND_COMPLETE_EVT 4 bytes
-> HCI_WRITE_SCAN_ENABLE 0C1A No Error
CMD 010405338B9E0500
CMD 200C0100
< EVT 0F0400050104
HCI_COMMAND_STATUS_EVT 4 bytes
-> HCI_INQUIRY 0401 No Error
< EVT 0E0405200C00
HCI_COMMAND_COMPLETE_EVT 4 bytes
-> HCI_WRITE_AUTH_ENABLE 0C20 No Error
MALLOC32 246804 free, 113792 biggest, allocating Screen_atari:92160
MALLOC32 allocation of Screen_atari:92160 3FFE4374
MALLOC32 154628 free, 67336 biggest, allocating MEMORY_mem:65540
MALLOC32 allocation of MEMORY_mem:65540 3FFCF8EC
MALLOC32 89072 free, 48532 biggest, allocating _lines:960
MALLOC32 allocation of _lines:960 40094260
MALLOC32 88096 free, 47556 biggest, allocating under_atarixl_os:16384
MALLOC32 allocation of under_atarixl_os:16384 40094630
MALLOC32 71696 free, 31156 biggest, allocating under_cart809F:8192
MALLOC32 allocation of under_cart809F:8192 40098640
MALLOC32 63488 free, 22948 biggest, allocating under_cartA0BF:8192
MALLOC32 allocation of under_cartA0BF:8192 4009A650
Emu::load failed for /atari800/atari_robot.xex.cfg
video_init
< EVT 020F0141DF3C007320010000402500F13E
HCI_INQUIRY_RESULT_EVT 15 bytes
20:73:00:3C:DF:41:402500 input device added
< EVT 020F0141DF3C007320010000402500F63E
HCI_INQUIRY_RESULT_EVT 15 bytes
< EVT 020F0141DF3C0073200100004025000D3F
HCI_INQUIRY_RESULT_EVT 15 bytes
< EVT 020F0141DF3C0073200100004025003A3F
HCI_INQUIRY_RESULT_EVT 15 bytes
< EVT 020F0141DF3C007320010000402500493F
HCI_INQUIRY_RESULT_EVT 15 bytes
< EVT 020F0141DF3C007320010000402500503F
HCI_INQUIRY_RESULT_EVT 15 bytes
< EVT 020F0141DF3C007320010000402500663F
HCI_INQUIRY_RESULT_EVT 15 bytes
< EVT 020F0141DF3C007320010000402500783F
HCI_INQUIRY_RESULT_EVT 15 bytes
< EVT 020F0141DF3C007320010000402500F13F
HCI_INQUIRY_RESULT_EVT 15 bytes
< EVT 020F0141DF3C0073200100004025000240
HCI_INQUIRY_RESULT_EVT 15 bytes
< EVT 020F0141DF3C0073200100004025001840
HCI_INQUIRY_RESULT_EVT 15 bytes
< EVT 020F0141DF3C0073200100004025002E40
HCI_INQUIRY_RESULT_EVT 15 bytes
< EVT 020F0141DF3C0073200100004025003E40
HCI_INQUIRY_RESULT_EVT 15 bytes
< EVT 020F0141DF3C0073200100004025005F40
HCI_INQUIRY_RESULT_EVT 15 bytes
< EVT 020F0141DF3C0073200100004025006B40
HCI_INQUIRY_RESULT_EVT 15 bytes
< EVT 010100
HCI_INQUIRY_COMP_EVT 1 bytes
CMD 05040D41DF3C00732018CC0100000000
< EVT 0F0400050504
HCI_COMMAND_STATUS_EVT 4 bytes
-> HCI_CREATE_CONNECTION 0405 No Error
< EVT 030B00810041DF3C0073200100
HCI_CONNECTION_COMP_EVT 11 bytes
20:73:00:3C:DF:41 connected on handle 129
CMD 19040A41DF3C00732000010000
< EVT 0F0400051904
HCI_COMMAND_STATUS_EVT 4 bytes
-> HCI_REMOTE_NAME_REQUEST 0419 No Error
< EVT 1B0ASSERT_ERR(lm_env.local_name), in lm.c at line 72
3810005
HCI_MAX_SLOTS_CHANGED_EVT 3 bytes
unhandled hci case
Guru Meditation Error: Core 0 panic'ed (Interrupt wdt timeout on CPU0)
Core 0 register dump:
PC : 0x40088278 PS : 0x00060334 A0 : 0x801258bd A1 : 0x3ffcd8b0
A2 : 0x00000001 A3 : 0x00000001 A4 : 0x00000000 A5 : 0x3ffbdbb4
A6 : 0x00000058 A7 : 0x00000000 A8 : 0x80088278 A9 : 0x3ffcd890
A10 : 0x00000032 A11 : 0x00000032 A12 : 0x00000010 A13 : 0xffffffff
A14 : 0x00000000 A15 : 0xfffffffd SAR : 0x00000004 EXCCAUSE: 0x00000005
EXCVADDR: 0x00000000 LBEG : 0x40088221 LEND : 0x40088228 LCOUNT : 0x00000000

Backtrace: 0x40088278:0x3ffcd8b0 0x401258ba:0x3ffcd8d0 0x4002509e:0x3ffcd8f0 0x4011d46d:0x3ffcd930 0x4001a637:0x3ffcd950 0x40019d11:0x3ffcd980 0x40055b4d:0x3ffcd9a0 0x4011a34b:0x3ffcd9c0 0x4011a899:0x3ffcd9e0 0x4008dc49:0x3ffcda10

Core 1 register dump:
PC : 0x4008eae8 PS : 0x00060134 A0 : 0x8008f95a A1 : 0x3ffc9830
A2 : 0x00000001 A3 : 0x3ffbd868 A4 : 0x00000001 A5 : 0x00000001
A6 : 0x00060123 A7 : 0x00000000 A8 : 0xb33fffff A9 : 0x0000abab
A10 : 0x3ffbab6c A11 : 0x000001ac A12 : 0x3ffbab8c A13 : 0x3ffbe790
A14 : 0x3fff7574 A15 : 0x3ffe0994 SAR : 0x00000010 EXCCAUSE: 0x00000005
EXCVADDR: 0x00000000 LBEG : 0x400014fd LEND : 0x4000150d LCOUNT : 0xfffffffb

Backtrace: 0x4008eae8:0x3ffc9830 0x4008f957:0x3ffc9850 0x4008d31a:0x3ffc9870 0x4008d6a8:0x3ffc9890 0x40085c61:0x3ffc98d0 0x400d7a25:0x3ffc98f0 0x400d8091:0x3ffc9910 0x400d8fd6:0x3ffc9940 0x400d9091:0x3ffc9970 0x400d9b8b:0x3ffc9990 0x400d5ec0:0x3ffc99b0 0x400eeb4d:0x3ffc99d0 0x4008dc49:0x3ffc99f0

Rebooting...

Should this work with a 3xRCA to AV cable? Getting video noise, no sound

I'm trying to make the sketch work in a ESP32 mini, and since I do not have any composite video-capable devices at home, I'm trying a 3xRCA to AV cable. After a few seconds connected, I can see some noisy vertical lines and some noisy colors from time to time, but no sound. Not sure if it's a connection problem of if there is something I'm missing. Maybe I didn't understand the scheme.

What I've done:

  • Solder positive of video cable to pin 25
  • Solder negative of video cable to ground
  • Solder both audio left and right positives to pin 26 through a 1k resistor (and set pin 26 as audio out in video_out.h)
  • Solder both audio left and right negatives to ground through a 10nf capacitor

photo_2020-12-13_14-24-55

Reboot after keyboard connect

My bt keyboard connect after video_init.
The console content:

video_init
FF:FF:FF:FF:FF:FF:402500 input device added
frame_time:6121 drawn:121 displayed:130 blit_ticks:2233->2782, isr time:27.33%
frame_time:6155 drawn:241 displayed:250 blit_ticks:2232->2786, isr time:25.16%
s:64 L2CAP_OPENING
ASSERT_ERR(lm_env.local_name), in lm.c at line 79
Guru Meditation Error: Core 0 panic'ed (Interrupt wdt timeout on CPU0)
Core 0 register dump:
PC : 0x4008464c PS : 0x00060534 A0 : 0x801163dd A1 : 0x3ffce100
A2 : 0x00000001 A3 : 0x00000000 A4 : 0x60008048 A5 : 0x3ffbdbb4
A6 : 0x3ffbdbb4 A7 : 0x00000000 A8 : 0x8008464c A9 : 0x3ffce0e0
A10 : 0x00000032 A11 : 0x00000032 A12 : 0x00000010 A13 : 0xffffffff
A14 : 0x00000000 A15 : 0xfffffffd SAR : 0x00000004 EXCCAUSE: 0x00000005
EXCVADDR: 0x00000000 LBEG : 0x400845f4 LEND : 0x400845fb LCOUNT : 0x00000000

ELF file SHA256: 0000000000000000

Backtrace: 0x4008464c:0x3ffce100 0x401163da:0x3ffce120 0x4002509e:0x3ffce140 0x4010c892:0x3ffce180 0x400855ca:0x3ffce1a0 0x40019d11:0x3ffce1d0 0x40055b4d:0x3ffce1f0 0x4010825b:0x3ffce210 0x40108869:0x3ffce230 0x40090756:0x3ffce260

Core 1 register dump:
PC : 0x400ecfa6 PS : 0x00060134 A0 : 0x800ece10 A1 : 0x3ffc9e60
A2 : 0x3ffc6920 A3 : 0x3ffc9e84 A4 : 0x80081832 A5 : 0x3ffc0150
A6 : 0x00001036 A7 : 0x3ffc235c A8 : 0x800ecfa6 A9 : 0x3ffc9e40
A10 : 0x00000000 A11 : 0x3ffc2368 A12 : 0x8008155e A13 : 0x3ffc0130
A14 : 0x00000bb4 A15 : 0x3ffe0c40 SAR : 0x00000004 EXCCAUSE: 0x00000005
EXCVADDR: 0x00000000 LBEG : 0x4000c2e0 LEND : 0x4000c2f6 LCOUNT : 0x00000000

ELF file SHA256: 0000000000000000

Backtrace: 0x400ecfa6:0x3ffc9e60 0x400ece0d:0x3ffc9e80 0x400ecea1:0x3ffc9eb0 0x400ed99f:0x3ffc9ed0 0x400d3190:0x3ffc9ef0 0x400ee819:0x3ffc9f10 0x40090756:0x3ffc9f30

Rebooting...

Vertical sync

I'm having a weird sync problem with one particular screen. It's a dismantled screen from a cheap car rear camera monitor with composite input. The display is not great, but it works fine with other devices (Raspberry Pi, game consoles etc) however with esp_8_bit (or espflix for that matter) the image is crisp but it slowly scrolls vertical (same result with both PAL and NTSC). The output is crisp and steady on other displays so I'm thinking it must be something with this specific combination - and most likely the sync signal passed from the esp32 to the display or maybe the resolution. Sync signals and timing have never been my strong suit, so I haven't been able to find where in the source code the resolution and/or sync can be adjusted. Can anyone point me in the right direction?

Connecting 2nd esp32 as HID

I got a snippet from here:
nkolban/esp32-snippets#230 (comment)

And although my phone detects it as a keyboard, I can't get it to connect with the esp-8bit.

My plan is to put the esp32 in an old nes controller.

Btw this project is awesome. All the beers for you if you ever come around Argentina once we're done with covid.

When compiling the fork esp_8_bit / CornN64 with the EMU_SMS emulator set, he gets an error:

c: /users/jessica/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-80-g6c4433a-5.2.0/bin /../ lib / gcc / xtensa- esp32-elf / 5.2.0 /../../../../ xtensa-esp32-elf / bin / ld.exe: C: \ Users \ Jessica \ AppData \ Local \ Temp \ arduino-sketch-C8DA85705841A54D78442418212C2586 /esp_8_bit.ino.elf section .dram0.bss 'will not fit in region dram0_0_seg'
c: /users/jessica/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-80-g6c4433a-5.2.0/bin /../ lib / gcc / xtensa- esp32-elf / 5.2.0 /../../../../ xtensa-esp32-elf / bin / ld.exe: DRAM segment data does not fit.
c: /users/jessica/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-80-g6c4433a-5.2.0/bin /../ lib / gcc / xtensa- esp32-elf / 5.2.0 /../../../../ xtensa-esp32-elf / bin / ld.exe: region `dram0_0_seg 'overflowed by 512 bytes
collect2.exe: error: ld returned 1 exit status
Compilation error: Error: 2 UNKNOWN: exit status 1

Boot_Loop when rom is failing to load.

I think that when the execution start the best option is to show the menu. Sometimes when the emulator fails to load a rom to the app0 partition fails to boot and the user needs to reprogram that partition using the arduino IDE. so... if the menu have an option to format that partition, and the emulator menu shows at start (No loading the rom) is a good option to fix this issue.

BTW i think that if the audio pin is mapped to the IO17 and make free the IO18, we can use the standart pins for SPI protocol making it easy to atach a SD card to that pins.
Im trying to understand the CRAPFS part of the code to load roms from the SD card.

early 80's arcade machines

Amazing project! Given that you're already doing Z80 emulation are you thinking of adding emulation for any of the early 80's arcade machines? (Donkey Kong, Pac Man, Galaga, Galaxians, Rally X, Route 16, Crash, Head On, Asteroids, etc.)

How to set proper CLOCK frequency?

Hi,

I compiled esp_8_bit with success and uploaded it to NodeMCU 32 module. I found pin with video signal, connected it to TV and no image appeared. Then I checked it on the oscilloscope and I see that time between each line is very short... 2uS.. as I remember, time to draw one line shall be about 64uS... I have no idea how to set proper value and where?

signal-2023-01-15-142831

compile error for EMU_SMS

hello, i need help with this error.
compile error for EMU_SMS(only for EMU_SMS)

In file included from C:\Users\ulises\Downloads\esp_8_bit2\esp_8_bit\esp_8_bit.ino:26:0:
sketch\src/video_out.h:41:15: warning: extra tokens at end of #ifdef directive
#ifdef IR_PIN || NES_CTRL_LATCH
^
C:\Users\ulises\Downloads\esp_8_bit2\esp_8_bit\esp_8_bit.ino: In function 'void emu_task(void*)':
C:\Users\ulises\Downloads\esp_8_bit2\esp_8_bit\esp_8_bit.ino:84:43: warning: 'uint32_t rtc_clk_cpu_freq_value(rtc_cpu_freq_t)' is deprecated [-Wdeprecated-declarations]
_emu->name.c_str(),xPortGetCoreID(),rtc_clk_cpu_freq_value(rtc_clk_cpu_freq_get()));
^
In file included from sketch\src/video_out.h:25:0,
from C:\Users\ulises\Downloads\esp_8_bit2\esp_8_bit\esp_8_bit.ino:26:
C:\Users\ulises\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6/tools/sdk/include/soc/soc/rtc.h:368:10: note: declared here
uint32_t rtc_clk_cpu_freq_value(rtc_cpu_freq_t cpu_freq) attribute((deprecated));
^
C:\Users\ulises\Downloads\esp_8_bit2\esp_8_bit\esp_8_bit.ino:84:43: warning: 'uint32_t rtc_clk_cpu_freq_value(rtc_cpu_freq_t)' is deprecated [-Wdeprecated-declarations]
_emu->name.c_str(),xPortGetCoreID(),rtc_clk_cpu_freq_value(rtc_clk_cpu_freq_get()));
^
In file included from sketch\src/video_out.h:25:0,
from C:\Users\ulises\Downloads\esp_8_bit2\esp_8_bit\esp_8_bit.ino:26:
C:\Users\ulises\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6/tools/sdk/include/soc/soc/rtc.h:368:10: note: declared here
uint32_t rtc_clk_cpu_freq_value(rtc_cpu_freq_t cpu_freq) attribute((deprecated));
^
C:\Users\ulises\Downloads\esp_8_bit2\esp_8_bit\esp_8_bit.ino:84:66: warning: 'rtc_cpu_freq_t rtc_clk_cpu_freq_get()' is deprecated [-Wdeprecated-declarations]
_emu->name.c_str(),xPortGetCoreID(),rtc_clk_cpu_freq_value(rtc_clk_cpu_freq_get()));
^
In file included from sketch\src/video_out.h:25:0,
from C:\Users\ulises\Downloads\esp_8_bit2\esp_8_bit\esp_8_bit.ino:26:
C:\Users\ulises\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6/tools/sdk/include/soc/soc/rtc.h:357:16: note: declared here
rtc_cpu_freq_t rtc_clk_cpu_freq_get() attribute((deprecated));
^
C:\Users\ulises\Downloads\esp_8_bit2\esp_8_bit\esp_8_bit.ino:84:66: warning: 'rtc_cpu_freq_t rtc_clk_cpu_freq_get()' is deprecated [-Wdeprecated-declarations]
_emu->name.c_str(),xPortGetCoreID(),rtc_clk_cpu_freq_value(rtc_clk_cpu_freq_get()));
^
In file included from sketch\src/video_out.h:25:0,
from C:\Users\ulises\Downloads\esp_8_bit2\esp_8_bit\esp_8_bit.ino:26:
C:\Users\ulises\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6/tools/sdk/include/soc/soc/rtc.h:357:16: note: declared here
rtc_cpu_freq_t rtc_clk_cpu_freq_get() attribute((deprecated));
^
C:\Users\ulises\Downloads\esp_8_bit2\esp_8_bit\esp_8_bit.ino:84:87: warning: 'rtc_cpu_freq_t rtc_clk_cpu_freq_get()' is deprecated [-Wdeprecated-declarations]
_emu->name.c_str(),xPortGetCoreID(),rtc_clk_cpu_freq_value(rtc_clk_cpu_freq_get()));
^
In file included from sketch\src/video_out.h:25:0,
from C:\Users\ulises\Downloads\esp_8_bit2\esp_8_bit\esp_8_bit.ino:26:
C:\Users\ulises\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6/tools/sdk/include/soc/soc/rtc.h:357:16: note: declared here
rtc_cpu_freq_t rtc_clk_cpu_freq_get() attribute((deprecated));
^
C:\Users\ulises\Downloads\esp_8_bit2\esp_8_bit\esp_8_bit.ino:84:88: warning: 'uint32_t rtc_clk_cpu_freq_value(rtc_cpu_freq_t)' is deprecated [-Wdeprecated-declarations]
_emu->name.c_str(),xPortGetCoreID(),rtc_clk_cpu_freq_value(rtc_clk_cpu_freq_get()));
^
In file included from sketch\src/video_out.h:25:0,
from C:\Users\ulises\Downloads\esp_8_bit2\esp_8_bit\esp_8_bit.ino:26:
C:\Users\ulises\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6/tools/sdk/include/soc/soc/rtc.h:368:10: note: declared here
uint32_t rtc_clk_cpu_freq_value(rtc_cpu_freq_t cpu_freq) attribute((deprecated));
^
C:\Users\ulises\Downloads\esp_8_bit2\esp_8_bit\esp_8_bit.ino: In function 'void setup()':
C:\Users\ulises\Downloads\esp_8_bit2\esp_8_bit\esp_8_bit.ino:145:3: warning: 'void rtc_clk_cpu_freq_set(rtc_cpu_freq_t)' is deprecated [-Wdeprecated-declarations]
rtc_clk_cpu_freq_set(RTC_CPU_FREQ_240M);
^
In file included from sketch\src/video_out.h:25:0,
from C:\Users\ulises\Downloads\esp_8_bit2\esp_8_bit\esp_8_bit.ino:26:
C:\Users\ulises\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6/tools/sdk/include/soc/soc/rtc.h:319:6: note: declared here
void rtc_clk_cpu_freq_set(rtc_cpu_freq_t cpu_freq) attribute((deprecated));
^
C:\Users\ulises\Downloads\esp_8_bit2\esp_8_bit\esp_8_bit.ino:145:3: warning: 'void rtc_clk_cpu_freq_set(rtc_cpu_freq_t)' is deprecated [-Wdeprecated-declarations]
rtc_clk_cpu_freq_set(RTC_CPU_FREQ_240M);
^
In file included from sketch\src/video_out.h:25:0,
from C:\Users\ulises\Downloads\esp_8_bit2\esp_8_bit\esp_8_bit.ino:26:
C:\Users\ulises\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6/tools/sdk/include/soc/soc/rtc.h:319:6: note: declared here
void rtc_clk_cpu_freq_set(rtc_cpu_freq_t cpu_freq) attribute((deprecated));
^
C:\Users\ulises\Downloads\esp_8_bit2\esp_8_bit\esp_8_bit.ino:145:41: warning: 'void rtc_clk_cpu_freq_set(rtc_cpu_freq_t)' is deprecated [-Wdeprecated-declarations]
rtc_clk_cpu_freq_set(RTC_CPU_FREQ_240M);
^
In file included from sketch\src/video_out.h:25:0,
from C:\Users\ulises\Downloads\esp_8_bit2\esp_8_bit\esp_8_bit.ino:26:
C:\Users\ulises\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6/tools/sdk/include/soc/soc/rtc.h:319:6: note: declared here
void rtc_clk_cpu_freq_set(rtc_cpu_freq_t cpu_freq) attribute((deprecated));
^
sketch\src\atari800\afile.c: In function 'AFILE_OpenFile':
sketch\src\atari800\afile.c:211:50: warning: implicit declaration of function 'UI_SelectCartType' [-Wimplicit-function-declaration]
CARTRIDGE_SetTypeAutoReboot(&CARTRIDGE_main, UI_SelectCartType(r));
^
sketch\src\atari800\atari.c: In function 'load_roms':
sketch\src\atari800\atari.c:322:76: warning: passing argument 2 of 'SYSROM_LoadImage' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
MEMORY_have_basic = basic_ver != -1 && SYSROM_LoadImage(basic_ver, MEMORY_basic);
^
In file included from sketch\src\atari800\atari.c:87:0:
sketch\src\atari800\sysrom.h:144:5: note: expected 'unsigned char *' but argument is of type 'const unsigned char *'
int SYSROM_LoadImage(int id, UBYTE *buffer);
^
sketch\src\atari800\atari.c: In function 'Atari800_Initialise':
sketch\src\atari800\atari.c:880:38: warning: implicit declaration of function 'UI_SelectCartType' [-Wimplicit-function-declaration]
CARTRIDGE_SetType(&CARTRIDGE_main, UI_SelectCartType(CARTRIDGE_main.size));
^
sketch\src\atari800\atari.c: In function 'Atari800_Frame':
sketch\src\atari800\atari.c:1292:3: warning: implicit declaration of function 'UI_Run' [-Wimplicit-function-declaration]
UI_Run();
^
sketch\src\atari800\cfg.c: In function 'CFG_LoadConfig':
sketch\src\atari800\cfg.c:320:13: warning: implicit declaration of function 'Colours_ReadConfig' [-Wimplicit-function-declaration]
else if (Colours_ReadConfig(string, ptr)) {
^
sketch\src\atari800\cfg.c: In function 'CFG_WriteConfig':
sketch\src\atari800\cfg.c:467:2: warning: implicit declaration of function 'Colours_WriteConfig' [-Wimplicit-function-declaration]
Colours_WriteConfig(fp);
^
sketch\src\atari800\gtia.c: In function 'GTIA_PutByte':
sketch\src\atari800\gtia.c:1294:16: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
grafp_ptr[0] = grafp_lookup[byte & 3];
^
sketch\src\atari800\gtia.c:1299:16: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
grafp_ptr[1] = grafp_lookup[byte & 3];
^
sketch\src\atari800\gtia.c:1304:16: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
grafp_ptr[2] = grafp_lookup[byte & 3];
^
sketch\src\atari800\gtia.c:1309:16: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
grafp_ptr[3] = grafp_lookup[byte & 3];
^
sketch\src\atari800\memory.c: In function 'MEMORY_StateRead':
sketch\src\atari800\memory.c:590:23: warning: passing argument 1 of 'StateSav_ReadUBYTE' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
StateSav_ReadUBYTE(&MEMORY_basic[0], 8192);
^
In file included from sketch\src\atari800\memory.c:44:0:
sketch\src\atari800\statesav.h:15:6: note: expected 'unsigned char *' but argument is of type 'const unsigned char *'
void StateSav_ReadUBYTE(UBYTE *data, int num);
^
sketch\src\atari800\memory.c:594:23: warning: passing argument 1 of 'StateSav_ReadUBYTE' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
StateSav_ReadUBYTE(&MEMORY_os[0], 16384);
^
In file included from sketch\src\atari800\memory.c:44:0:
sketch\src\atari800\statesav.h:15:6: note: expected 'unsigned char *' but argument is of type 'const unsigned char *'
void StateSav_ReadUBYTE(UBYTE *data, int num);
^
sketch\src\atari800\sio.c: In function 'SIO_StateRead':
sketch\src\atari800\sio.c:1703:23: warning: iteration 2u invokes undefined behavior [-Waggressive-loop-optimizations]
SIO_drive_status[i] = (SIO_UnitStatus)saved_drive_status;
^
sketch\src\atari800\sio.c:1698:2: note: containing loop
for (i = 0; i < 8; i++) {
^
sketch\src\atari800\util.c: In function 'Util_sleep':
sketch\src\atari800\util.c:514:3: warning: implicit declaration of function 'nanosleep' [-Wimplicit-function-declaration]
nanosleep(&ts, NULL);
^
sketch\src\nofrendo\bitmap.c: In function '_make_bitmap':
sketch\src\nofrendo\bitmap.c:64:38: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
bitmap->line[0] = (uint8 *) (((long long)bitmap->data + overdraw + 3) & ~3);
^
sketch\src\nofrendo\bitmap.c:64:26: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
bitmap->line[0] = (uint8 *) (((long long)bitmap->data + overdraw + 3) & ~3);
^
sketch\src\nofrendo\nofrendo.c: In function 'internal_insert':
sketch\src\nofrendo\nofrendo.c:152:23: warning: implicit declaration of function 'strdup' [-Wimplicit-function-declaration]
console.filename = strdup(filename);
^
sketch\src\nofrendo\nofrendo.c:152:23: warning: incompatible implicit declaration of built-in function 'strdup'
sketch\src\nofrendo\nofrendo.c: In function 'main_insert':
sketch\src\nofrendo\nofrendo.c:198:27: warning: incompatible implicit declaration of built-in function 'strdup'
console.nextfilename = strdup(filename);
^
sketch\src\nofrendo\nofrendo.c: In function 'main_loop':
sketch\src\nofrendo\nofrendo.c:244:27: warning: incompatible implicit declaration of built-in function 'strdup'
console.nextfilename = strdup(filename);
^
sketch\src\emu.cpp:271:0: warning: "BUF_SIZE" redefined
#define BUF_SIZE 0x8000
^
sketch\src\emu.cpp:150:0: note: this is the location of the previous definition
#define BUF_SIZE 4096
^
In file included from sketch\src\atari800/sound.h:7:0,
from sketch\src\emu_atari800.cpp:24:
sketch\src\atari800/atari.h:31:0: warning: "ULONG" redefined
#define ULONG unsigned int
^
In file included from sketch\src\emu_atari800.cpp:23:0:
sketch\src\atari800/libatari800.h:18:0: note: this is the location of the previous definition
#define ULONG uint32_t
^
C:\Users\ulises\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6\cores\esp32\esp32-hal-spi.c: In function 'spiTransferBytesNL':
C:\Users\ulises\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6\cores\esp32\esp32-hal-spi.c:922:39: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
uint8_t * last_out8 = &result[c_longs-1];
^
C:\Users\ulises\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6\cores\esp32\esp32-hal-spi.c:923:40: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
uint8_t * last_data8 = &last_data;
^
c:/users/ulises/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-97-gc752ad5-5.2.0/bin/../lib/gcc/xtensa-esp32-elf/5.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\ulises\AppData\Local\Temp\arduino_build_387376/esp_8_bit.ino.elf section .dram0.bss' will not fit in region dram0_0_seg'
c:/users/ulises/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-97-gc752ad5-5.2.0/bin/../lib/gcc/xtensa-esp32-elf/5.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: DRAM segment data does not fit.
c:/users/ulises/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-97-gc752ad5-5.2.0/bin/../lib/gcc/xtensa-esp32-elf/5.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: region `dram0_0_seg' overflowed by 40 bytes
collect2.exe: error: ld returned 1 exit status
exit status 1
Error compilando para la tarjeta ESP32 Dev Module.

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.