Emulator - get latest release here.

The Uzebox now have a fully functional emulator! Download and discuss it here.
User avatar
nicksen782
Posts: 714
Joined: Wed Feb 01, 2012 8:23 pm
Location: Detroit, United States
Contact:

Re: Emulator - get latest release here.

Post by nicksen782 »

I've been looking for how to utilize the SD card. I want to store map and music data on the SD. I see that 1.19 Uzem is in beta and supports a new SD card emulation. What is the latest version now?

What APIs are available to access the SD card (emulated or real? Same right?) Or is it done with raw SD commands? Also, if I remember correctly, you must read an entire sector (512 bytes) on an SD card as you can't just grab a byte or two. How is that handled? Will it cost 512 bytes of ram?
User avatar
uze6666
Site Admin
Posts: 4801
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Emulator - get latest release here.

Post by uze6666 »

nicksen782 wrote:I've been looking for how to utilize the SD card. I want to store map and music data on the SD. I see that 1.19 Uzem is in beta and supports a new SD card emulation. What is the latest version now?

What APIs are available to access the SD card (emulated or real? Same right?) Or is it done with raw SD commands? Also, if I remember correctly, you must read an entire sector (512 bytes) on an SD card as you can't just grab a byte or two. How is that handled? Will it cost 512 bytes of ram?
I packaged the release version of uzem 1.19 it is available for download in the 1st post of this topic. You will notice it's is not hosted on google code, since they changed their terms of service and we can't upload anymore since January 15th. I guess we will have to move the project somewhere else like github. I'll check that in the next few months.

V1.19 is the latest and has sufficient SD emulation to support Petitfatfs (and perhaps FatFs though I didn't have time to test it yet). Petifatfs is a tiny version of FatFS, a well known open source FAT/SD library for embedded applications. It is integrated in the Uzebox codebase and is the easiest way interact with the SD card to read files. Read the online docs, they are pretty complete. With it you can read a byte at a time or a whole sector. But beware, althought your program is reading one byte at a time, behind the scene PetitFatFS still needs to read the whole sector each time. In other words: it is really slow!! If you can allocate a bigger buffer, use one. Check the Uze8 demo project for usage. There's also the Uze mario game that used the library.

You should be able to load maps without problems (I strongly recommend using a single resource file, instead of many little ones). Loading music is another story, I and Lee where discussing that at some point and it is not trivial.

If you can write documentation on the SD stuff as you go (both how to use in uzem and how to use in in games) that would be awesome for a lot of folks here. :mrgreen:
User avatar
nicksen782
Posts: 714
Joined: Wed Feb 01, 2012 8:23 pm
Location: Detroit, United States
Contact:

Re: Emulator - get latest release here.

Post by nicksen782 »

Documentation, for sure. I looked for some documentation on the forums and wiki and was unable to find any. I'm just about ready to finish up the documentation for the sprite/movement tutorial. I just need to make sure that what I have is solid and ready.

I'm just guessing here but loading music is a sort of real-time thing unless you buffer it in RAM before hand. As for map screens I could load it during the transitions between screens where I want a scrolling effect anyway. I could potentially hide the 'slowness'.

* The source download for your Mario game is broken. Actually, it was the first place I looked as I pulled much good info from your older Mario demo that is included in the r212 trunk.

BTW, what happened with Google code?
User avatar
uze6666
Site Admin
Posts: 4801
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Emulator - get latest release here.

Post by uze6666 »

Version 1.19.1 was commited to SVN. Win32 version was added to the main post.

V1.19.1:
----------
-Bug fix: Initial seek was ignored
-Bug fix: Can't read past 64k. FAT was not filled with cluster chain.
-Changed cluster size to a more standard 32k
User avatar
uze6666
Site Admin
Posts: 4801
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Emulator - get latest release here.

Post by uze6666 »

Here's Uzem 1.20 Beta for Windows. I added support for the new Uzebox Keyboard interface. I tried to keep changes to a minimum to make it easier when merging the SPI ram stuff and esp8266 later.

Uzem automatically detects when the game uses the keyboard protocol and captures the PC keyboard input for it. P2 port is always used for the Uzebox keyboard. Naturally that means you can't also use the keyboard as a joystick at the same time. But you can use a regular pc jopystick/joypad for P1.

I'll beta test a bit more and if you guys find bugs or have comments or suggestions, let me know.
Attachments
uzem_v1_20_beta.zip
(454.59 KiB) Downloaded 692 times
User avatar
uze6666
Site Admin
Posts: 4801
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Emulator - get latest release here.

Post by uze6666 »

I've pushed v1.20 with the preliminary keyboard support to the repo. For those also working on uzem, you'll have to rebase. I've updated the main post too.
User avatar
uze6666
Site Admin
Posts: 4801
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Emulator - get latest release here.

Post by uze6666 »

Uzem V1.3 with improved framerate and bug fixes has been released. See main post for the download.
User avatar
uze6666
Site Admin
Posts: 4801
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Emulator - get latest release here.

Post by uze6666 »

It never occurred to me before, but if you are enclined to compile your own uzem (if you have GCC with x86 target), you can recompile it optimized for your own CPU architecture. At the beginning of the makefile just add:

Code: Select all

ARCH=native
TUNE=y
I got a modest performance boost accounting for my core2. The default binary is compiled for pentium pro I think.
User avatar
uze6666
Site Admin
Posts: 4801
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Emulator - get latest release here.

Post by uze6666 »

Uzem 1.3.1 was published to teh main post. Two main new features:
-Added feature to capture/playback controller buttons
-Implemented the watchdog timer to support the true random generator
User avatar
uze6666
Site Admin
Posts: 4801
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Emulator - get latest release here.

Post by uze6666 »

Uzem 1.3.2 published. Fix to the controller capture code that was screwing up the MSbyte of the controller data.
Post Reply