Windows & Linux Simulator repository on github

https://developer.mbed.org/handbook/mbed-Compiler

is this a same site?

1 Like

Yes. That is the one. We will also provide an offline version using EmBitz and ARMGCC

Alright, I installed Fedora 25 workstation in a virtual machine. I did the following:

Downloaded the zipped simulator from github and extracted it to my home directory.

sudo dnf install codeblocks
sudo dnf install SDL2.x86_64
sudo dnf install SDL2-devel.x86_64

Started code blocks, loaded the project, clicked run, and it worked first try.

If you have a 32 bits processor you will want x86 instead of x86_64, but that’s all there is to it. I didn’t tweak a single thing. I get no error messages. Actually, as far as running something out of the box on a distro I am not familiar with, that was amazingly simple. You shouldn’t have to change any settings for the linker and such. I would suggest that you start over again from a fresh copy of the simulator.

1 Like

Mine also worked at first run, problem is that when you edit code and rebuild it to make change in output it shows these errors

Today I again check same thing with *.so file path and getting same error again, I think I must wait until Official IDE (online/offline) available.

Finally Some relief, I have successfully perform some test using Pokitto.cbp file using Wine on Fedora 25,
Just uploading output !!!

Also Those who are troubling with this just follow the following steps

  1. Install mingw code blocks version (Windows) on Fedora 25 using wine manager.
  2. Open Pokitto.cdp file.
  3. Set build to HelloWindows.
  4. Make changes in code as you req.
  5. Rebuild with code:blocks without any other change to load simulator.

Thank You,

1 Like

Could you post the code that didn’t work on Fedora? I’ll see what I can do. There should not be any need for Wine in this case because everything is native.

Thank you,
here is the simple code I am trying on Fedora native:
#include “Pokitto.h”

Pokitto::Core game;

int main () {
game.begin();
int x;
int y;

while(game.isRunning())
{
if(game.update())
{
game.display.drawLine(0,20,110,20);
//x = random(12);
//y = random(13);
game.display.drawPixel(50,50);
//game.display.print(x,y);
}
}
return 0;
}

#include “Pokitto.h”
Pokitto::Core game;

int main () {
game.begin();

while(game.isRunning()) {
    if(game.update()) {
        game.display.drawLine(0,20,110,20);
        game.display.drawPixel(50,50);
    }
}
return 1;

}

This works fine on Xubuntu, but I do get the exact same min/max error you get on Fedora… this is weird.

Maybe the #define min and #define max in Pokitto_fakeavr.h are causing the problem? Or Fedora has some really new or really outdated headers?

Please post error message. I will also take a look.

DISABLEAVRMIN in the project #defines completely removes the min/max declarations from fakeavr_h, so they should not me the root of the problem

I would have copy pasted it but for some reason VirtualBox refuses to do it… but its the same error message I quoted here from an earlier post.

I know where the error is!!

Thanks guys! Will fix.

Problem is caused by wrong type of call to min/max from within the Pokitto lib. I simply need to add a check for what min/max is in use and use a #ifndef DISABLEAVRMIN to have 2 different versions

I know this has been traumatic for @krp but: this is exactly the way errors are found. This is very important for improving Pokitto. Thanks a lot guys!

2 Likes

Does hi-res 16 colour work? or is it just cga for now?

Hi-res has 4 colors (freely selectable)

edit: 16 color hires would need 19k of RAM. I have not made it because RAM is in 2 chunks of 16k. It is cumbersome and inpractical

could we get 16 colors or more without a screen buffer
example like our WIP roguelike doesn’t actually need the buffer to be that big
also what about scalene type buffer?

We can get 64k colors without a screenbuffer and it is already implemented in both HW and sim

Use display.direct commands in API

correction: 64k. Display is capable of 18 bit mode but not enabled on our custom flat flex connector

1 Like

256 would be enough for me XD

1 Like

Nope. Unable to recreate problem in Windows. Even when commenting out min / max from fake_avr.h

Fake_avr.h min & max are not used in the Pokitto lib. Only in Arduboy & Gamebuino ports.

Here’s the build log straight from the VM, hope this helps. If you can’t get a Fedora VM running, I guess I could install Teamviewer in mine and let you have fun with it.

-------------- Clean: HelloLinux in PokittoSimHello (compiler: GNU GCC Compiler)---------------

Cleaned “PokittoSimHello - HelloLinux”

-------------- Build: HelloLinux in PokittoSimHello (compiler: GNU GCC Compiler)---------------

g++ -Wall -std=gnu++11 -fsigned-char -DPOK_SIM -g -pthread -lasound -lX11 -lXext -DPROJ_HIRES=0 -DPROJ_STARTUPLOGO=0 -DPROJ_GAMEBUINO=0 -DPROJ_GBSOUND=0 -DPROJ_STREAMING_MUSIC=0 -DPROJ_ENABLE_SYNTH=0 -DPROJ_ENABLESOUND=0 -I…/SDL2/include -I…/POKITTO_CORE -I…/POKITTO_SIM -I…/POKITTO_SIM/mbed_sim -I…/POKITTO_LIBS/FileIO -I…/POKITTO_LIBS/Synth -I…/POKITTO_CORE/FONTS -I…/ -c /home/fedora/PokittoSim-master/Hello.cpp -o obj/Debug/Hello.o
g++ -Wall -std=gnu++11 -fsigned-char -DPOK_SIM -g -pthread -lasound -lX11 -lXext -DPROJ_HIRES=0 -DPROJ_STARTUPLOGO=0 -DPROJ_GAMEBUINO=0 -DPROJ_GBSOUND=0 -DPROJ_STREAMING_MUSIC=0 -DPROJ_ENABLE_SYNTH=0 -DPROJ_ENABLESOUND=0 -I…/SDL2/include -I…/POKITTO_CORE -I…/POKITTO_SIM -I…/POKITTO_SIM/mbed_sim -I…/POKITTO_LIBS/FileIO -I…/POKITTO_LIBS/Synth -I…/POKITTO_CORE/FONTS -I…/ -c /home/fedora/PokittoSim-master/POKITTO_SIM/Makewav.cpp -o obj/Debug/POKITTO_SIM/Makewav.o
g++ -Wall -std=gnu++11 -fsigned-char -DPOK_SIM -g -pthread -lasound -lX11 -lXext -DPROJ_HIRES=0 -DPROJ_STARTUPLOGO=0 -DPROJ_GAMEBUINO=0 -DPROJ_GBSOUND=0 -DPROJ_STREAMING_MUSIC=0 -DPROJ_ENABLE_SYNTH=0 -DPROJ_ENABLESOUND=0 -I…/SDL2/include -I…/POKITTO_CORE -I…/POKITTO_SIM -I…/POKITTO_SIM/mbed_sim -I…/POKITTO_LIBS/FileIO -I…/POKITTO_LIBS/Synth -I…/POKITTO_CORE/FONTS -I…/ -c /home/fedora/PokittoSim-master/POKITTO_SIM/Pokitto_simport.cpp -o obj/Debug/POKITTO_SIM/Pokitto_simport.o
g++ -Wall -std=gnu++11 -fsigned-char -DPOK_SIM -g -pthread -lasound -lX11 -lXext -DPROJ_HIRES=0 -DPROJ_STARTUPLOGO=0 -DPROJ_GAMEBUINO=0 -DPROJ_GBSOUND=0 -DPROJ_STREAMING_MUSIC=0 -DPROJ_ENABLE_SYNTH=0 -DPROJ_ENABLESOUND=0 -I…/SDL2/include -I…/POKITTO_CORE -I…/POKITTO_SIM -I…/POKITTO_SIM/mbed_sim -I…/POKITTO_LIBS/FileIO -I…/POKITTO_LIBS/Synth -I…/POKITTO_CORE/FONTS -I…/ -c /home/fedora/PokittoSim-master/POKITTO_SIM/PokittoClock.cpp -o obj/Debug/POKITTO_SIM/PokittoClock.o
g++ -Wall -std=gnu++11 -fsigned-char -DPOK_SIM -g -pthread -lasound -lX11 -lXext -DPROJ_HIRES=0 -DPROJ_STARTUPLOGO=0 -DPROJ_GAMEBUINO=0 -DPROJ_GBSOUND=0 -DPROJ_STREAMING_MUSIC=0 -DPROJ_ENABLE_SYNTH=0 -DPROJ_ENABLESOUND=0 -I…/SDL2/include -I…/POKITTO_CORE -I…/POKITTO_SIM -I…/POKITTO_SIM/mbed_sim -I…/POKITTO_LIBS/FileIO -I…/POKITTO_LIBS/Synth -I…/POKITTO_CORE/FONTS -I…/ -c /home/fedora/PokittoSim-master/POKITTO_SIM/PokittoSimButtons.cpp -o obj/Debug/POKITTO_SIM/PokittoSimButtons.o
g++ -Wall -std=gnu++11 -fsigned-char -DPOK_SIM -g -pthread -lasound -lX11 -lXext -DPROJ_HIRES=0 -DPROJ_STARTUPLOGO=0 -DPROJ_GAMEBUINO=0 -DPROJ_GBSOUND=0 -DPROJ_STREAMING_MUSIC=0 -DPROJ_ENABLE_SYNTH=0 -DPROJ_ENABLESOUND=0 -I…/SDL2/include -I…/POKITTO_CORE -I…/POKITTO_SIM -I…/POKITTO_SIM/mbed_sim -I…/POKITTO_LIBS/FileIO -I…/POKITTO_LIBS/Synth -I…/POKITTO_CORE/FONTS -I…/ -c /home/fedora/PokittoSim-master/POKITTO_SIM/PokittoSimCore.cpp -o obj/Debug/POKITTO_SIM/PokittoSimCore.o
g++ -Wall -std=gnu++11 -fsigned-char -DPOK_SIM -g -pthread -lasound -lX11 -lXext -DPROJ_HIRES=0 -DPROJ_STARTUPLOGO=0 -DPROJ_GAMEBUINO=0 -DPROJ_GBSOUND=0 -DPROJ_STREAMING_MUSIC=0 -DPROJ_ENABLE_SYNTH=0 -DPROJ_ENABLESOUND=0 -I…/SDL2/include -I…/POKITTO_CORE -I…/POKITTO_SIM -I…/POKITTO_SIM/mbed_sim -I…/POKITTO_LIBS/FileIO -I…/POKITTO_LIBS/Synth -I…/POKITTO_CORE/FONTS -I…/ -c /home/fedora/PokittoSim-master/POKITTO_SIM/PokittoSimulator.cpp -o obj/Debug/POKITTO_SIM/PokittoSimulator.o
In file included from /usr/include/c++/6.3.1/bits/char_traits.h:39:0,
from /usr/include/c++/6.3.1/ios:40,
from /usr/include/c++/6.3.1/ostream:38,
from /usr/include/c++/6.3.1/iostream:39,
from /home/fedora/PokittoSim-master/POKITTO_SIM/PokittoSimulator.cpp:42:
/usr/include/c++/6.3.1/bits/stl_algobase.h:243:56: error: macro “min” passed 3 arguments, but takes just 2
min(const _Tp& __a, const _Tp& __b, _Compare __comp)
^
/usr/include/c++/6.3.1/bits/stl_algobase.h:265:56: error: macro “max” passed 3 arguments, but takes just 2
max(const _Tp& __a, const _Tp& __b, _Compare __comp)
^
In file included from …/POKITTO_CORE/PokittoSound.h:44:0,
from /home/fedora/PokittoSim-master/POKITTO_SIM/PokittoSimulator.cpp:40:
/usr/include/c++/6.3.1/bits/stl_algobase.h:195:5: error: expected unqualified-id before ‘const’
min(const _Tp& __a, const _Tp& __b)
^
/usr/include/c++/6.3.1/bits/stl_algobase.h:195:5: error: expected ‘)’ before ‘const’
/usr/include/c++/6.3.1/bits/stl_algobase.h:195:5: error: expected ‘)’ before ‘const’
/usr/include/c++/6.3.1/bits/stl_algobase.h:195:5: error: expected initializer before ‘const’
/usr/include/c++/6.3.1/bits/stl_algobase.h:219:5: error: expected unqualified-id before ‘const’
max(const _Tp& __a, const _Tp& __b)
^
/usr/include/c++/6.3.1/bits/stl_algobase.h:219:5: error: expected ‘)’ before ‘const’
/usr/include/c++/6.3.1/bits/stl_algobase.h:219:5: error: expected ‘)’ before ‘const’
/usr/include/c++/6.3.1/bits/stl_algobase.h:219:5: error: expected initializer before ‘const’
In file included from /usr/include/c++/6.3.1/bits/char_traits.h:39:0,
from /usr/include/c++/6.3.1/ios:40,
from /usr/include/c++/6.3.1/ostream:38,
from /usr/include/c++/6.3.1/iostream:39,
from /home/fedora/PokittoSim-master/POKITTO_SIM/PokittoSimulator.cpp:42:
/usr/include/c++/6.3.1/bits/stl_algobase.h:243:5: error: ‘std::min’ declared as an ‘inline’ variable
min(const _Tp& __a, const _Tp& __b, _Compare __comp)
^~~
/usr/include/c++/6.3.1/bits/stl_algobase.h:246:7: error: expected primary-expression before ‘if’
if (__comp(__b, __a))
^~
/usr/include/c++/6.3.1/bits/stl_algobase.h:246:7: error: expected ‘}’ before ‘if’
/usr/include/c++/6.3.1/bits/stl_algobase.h:246:7: error: expected ‘;’ before ‘if’
/usr/include/c++/6.3.1/bits/stl_algobase.h:248:7: error: expected unqualified-id before ‘return’
return __a;
^~~~~~
/usr/include/c++/6.3.1/bits/stl_algobase.h:265:5: error: ‘max’ declared as an ‘inline’ variable
max(const _Tp& __a, const _Tp& __b, _Compare __comp)
^~~
/usr/include/c++/6.3.1/bits/stl_algobase.h:268:7: error: expected primary-expression before ‘if’
if (__comp(__a, __b))
^~
/usr/include/c++/6.3.1/bits/stl_algobase.h:268:7: error: expected ‘}’ before ‘if’
/usr/include/c++/6.3.1/bits/stl_algobase.h:268:7: error: expected ‘;’ before ‘if’
/usr/include/c++/6.3.1/bits/stl_algobase.h:270:7: error: expected unqualified-id before ‘return’
return __a;
^~~~~~
/usr/include/c++/6.3.1/bits/stl_algobase.h:271:5: error: expected declaration before ‘}’ token
}
^
Process terminated with status 1 (0 minute(s), 0 second(s))
21 error(s), 0 warning(s) (0 minute(s), 0 second(s))

I’m installing Fedora right now. I hope i get same errors.