Emulator availability

2 more bugs down…

3 Likes

I tested the emu with my Mars Attack game, but it did not start (not even “Pokitto” start screen). The binary is quite big as it contains MicroPython interpreter.

I saw that… The amount of code breaks Chrome, somehow. Unfortunately, I think this is a browser bug and can’t do much, other than wait for an update.

Firefox gets further, before locking up. That is probably my fault, I’m still hunting that bug.

Ok. I tested with Chrome and Edge.

Had a look at marsattack, it’s freezing on:

     146:	e7fe      	b.n	0x146

Looks like Chrome also gets this far, but the really tight loop is what makes it crash.
I guess it’s never supposed to go into this loop at all. Finding out why it does is going to take a while.

Also, I started work on SPI and SD card support today:

SPI works and is practically done, but the SD card simply responds with 1 to all the commands… which is enough for this game to run, but is not exactly what it’s supposed to do.

1 Like

I have seen that kind of busy loop when the main() function returns after the program exits.

That seems to be the case here. Any idea why it would do that? I haven’t been able to find the source to PythonMain.

I do not think it has even called MicroPython library yet. That happens after the initialization and startup screens had been has been passed which is not the case, because I did not see the startup screen.

MicroPython library is in a separate repository, forked from the official MicroPython. If you get that far I can build you a new version of Mars Attack and deliver correct versions of the sources too.

Oh, right, I forgot to update the preview build. It gets that far now.
Edit: You might need to clear your browser cache to see the latest version.

Zip some files and drop that into the emulator instead of a bin and you’ll get…


a 1MB SD card formatted with FAT32 and all the zipped files in it (in this case, a game and LOA.DER).
I think reading the card is done, still implementing writing.
EDIT: This build isn’t online yet, I’ll finish writing first.

3 Likes

That is very impressive indeed

1 Like

Thanks, it helped that there’s lots of code for FAT32 on the net. If it had to be exFAT or NTFS… shudders.

I just uploaded a new preview build:

Pokitaire caught me being sloppy with the CRC calculation, had to do it properly.

Most of this week went to hunting down the last bug in Pokisky. Finally managed to find it: ASR with an immediate shift of 32 still wasn’t calculating the result correctly. Oddly, the mbed version of GCC does not emit this opcode, but compiling offline does.

Did some GPIO optimization. Should get better framerates on games that don’t change many pixels on every frame.

And here it’s running a game that needs to read the SD card:


I’m still trying to find out what’s wrong with Polar, CPong, and Racers (@Zuzu36: is the source for Racers available? I haven’t been able to find it and it would help me debug). Pokitris freezes, not sure if that’s a bug in the emulator or the game (looks like the library has changed a bit since its release?).

3 Likes

Hi,

Here is the latest (WIP) of Mars Attack:

pythonex.bin (202.7 KB)

The sources are here:

Note this is still WIP, so if you experience graphical glitches that might not be due the emulation :wink:

2 Likes

Thanks! Do you see the Pokitto/volume screen with it?

I noticed that with your bin, Chrome crashes on my desktop but it gets to the infinite loop on my laptop. Both are up-to-date, on Ubuntu 17, with similar specs. I have no idea why the behaviour is different.

On Firefox it freezes on this:

For a change, I think this freeze is actually going to be easy to fix! :smiley:

1 Like

I have disabled startup screen in that binary.

Btw. In my PokittoLib repo the branch is “mars-attack-2-wip”, and in MicroPython repo the brach is “master”.

Edit: The text shoud scroll slowly, or press A to start right away.

1 Like

It’s aliiiive! :smiley:

Well, on Firefox, but, yeah!

1 Like

A-W-E-S-O-M-E ! :So now also Python works in your emulator :slight_smile:

Haha! A game in an interpretor in an emulator in a JS VM… it’s a software onion!

4 Likes

Could do worse by emulating the machine running the browser!

2 Likes

“So I heard you liked sandboxes.”
fires up VirtualBox…

2 Likes