Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - MagnusRunesson

Pages: 1 2
1
Tiny Arcade & Pocket Arcade / Re: Neo-Geo MVS Tiny Arcade skin
« on: August 14, 2016, 04:23:28 AM »
It looks amazing!

2
I've been meaning to write up a summary of how I made Tiny Shooter but haven't gotten very far yet.

If you don't know how to make programs/games for the Arduino platform then that's where you should start.

Until I've written anything down you can at least look at the source code for Tiny Shooter, it's available at https://github.com/MagnusRunesson/TAGE

3
Tiny Arcade & Pocket Arcade / Re: Shipping Status
« on: June 10, 2016, 04:57:45 AM »
Excellent, thanks for shedding some light on the issue Ben.

I'm really looking forward to that wood cabinet! :)

4
Tiny Arcade & Pocket Arcade / Re: Shipping Status
« on: June 09, 2016, 12:32:58 AM »
I wonder the same. People that I know backed after me have already gotten theirs and I still haven't heard anything.

I'm glad I'm not the only one who haven't gotten it yet.

5
TinyDuino Processors & TinyShields / Re: TinyScreen+ library and SPI1
« on: February 07, 2016, 01:45:57 PM »
Installing TinyScreen+ board by adding this URL https://tiny-circuits.com/Downloads/ArduinoBoards/package_tinycircuits_index.json as an additional board manager sorted that out.

6
TinyDuino Processors & TinyShields / TinyScreen+ library and SPI1
« on: February 06, 2016, 01:43:45 PM »
Hi everyone!

I want to play around with the updated TinyScreen library but I can't get it to compile. This is the error message I get:

Code: [Select]
/Users/magnusrunesson/Projects/Arduino/libraries/TinyScreen/TinyScreen.cpp: In constructor 'TinyScreen::TinyScreen(uint8_t)':
/Users/magnusrunesson/Projects/Arduino/libraries/TinyScreen/TinyScreen.cpp:487:12: error: 'SPI1' was not declared in this scope
     TSSPI=&SPI1;
            ^

SPI1 is not defined in any of my SPI libraries. I've looked through the ones that come with the Arduino IDE (1.6.7) and I've installed the Arduino Zero core but that doesn't define SPI1 either. I've installed the Arduino Zero core as I figured that is what Tiny Arcade is based on maybe it is a good start, but that didn't help.

Anyone out there who've used the new TinyScreen+ library? (The one in commit with SHA 0a63de70884f1b00a21a9f6051912df86cc78203)

Thanks!

7
TinyDuino Processors & TinyShields / Re: Audio on the TinyArcade
« on: January 20, 2016, 05:20:20 AM »
Excellent, thank you!

The AudioZero example I've looked at ( https://www.arduino.cc/en/Tutorial/SimpleAudioPlayerZero ) set up the timer to feed the analog pin a stereo sample at 44.1KHz, so the timer is called 88200 times per second, and every other sample sent to the analog pin is for the left channel and then for the right channel.

I can't fully understand how many instructions the Audio_Handler adds up to, but considering that it is calling analogWrite, and analogWrite in turn call pinMode, which in turn call pgm_read_byte via the digitalPinToBitMask macro, it seems like a lot of cycles will be spent in the Audio_Handler. (Which means a lot of it can probably be removed/customized for this specific case of analogWrite :) )

I assume the TinyArcade will not be stereo, so the timer can be set up to only feed 44100 samples if I want to play in 44.1KHz mode, right? I'll probably go even lower than that, considering I won't have any 44.1KHz samples playing in my games.

If the Audio_Handler and all of its subsequent function calls amounts to, say, 100 instructions, and it is running 88200 times per second that is 15% of the total frame time for the CPU.

Also, out of curiosity, what will you use DMA for? I assume DMA means direct memory access, as in transferring memory without the CPU having to bother. It seems like a lot of time is spent setting up the pin and writing to it, rather than spending time in memory transfers.

8
TinyDuino Processors & TinyShields / Re: Need help creating Library
« on: January 19, 2016, 12:20:25 AM »
Wohoo! :)

9
TinyDuino Processors & TinyShields / Re: Need help creating Library
« on: January 18, 2016, 10:40:48 AM »
Sorry, it's difficult to assess how much people know when answering a forum post like this. :)

I doubt that a library file (.a file) is actually built. There is no need or gain from building a library file and it is more complex to do so and link that library file into the app compared to simply compiling the cpp files into object files and linking them.

So with that in mind, there is probably nothing weird going on.

I would guess that including the tinyscreen-header at the top of your ino file, AND including it at the top of the cpp file for your library would do the trick perfectly, since by doing so the same header file would not be included twice in the same cpp file. (Or you could add the include guards in the tinyscreen header file to avoid redefining the symbols in case the header file would be included twice)

10
TinyDuino Processors & TinyShields / Re: Audio on the TinyArcade
« on: January 18, 2016, 03:29:19 AM »
Instead, one way a similar capability can be fabricated is to simply make a function per "thread" and ensure that each "thread" function is cooperatively multi-tasking, which is to say, when you call into the function, it should have a quick check on whether it's time to do some piece of work, and exit quickly if not.

Thanks for the tip. I think I will go down this route.

My current plan is to have a ring buffer with audio samples that is filled up by my mixing function, running as a regular function call from loop(), and emptied by the T5 interrupt, similar to how the Audio_Handler is implemented in this file https://github.com/arduino-libraries/AudioZero/blob/master/src/AudioZero.cpp#L165-L179

If I'm just a bit careful with timing and when audio is playing (so I don't try to play audio when I know I don't have time to fill the buffer, such as during load times) it shouldn't be a problem.

The only thing I need to do before implementing this is to verify that the TinyArcade play their audio by doing an analogWrite from the CPU instead of shipping the audio sample over from CPU to another shield via i2c.

11
It's probably wise of you not to go down the rabbit hole of fixing the demo. Fixing const correctness is almost always a bad idea. :)

12
TinyDuino Processors & TinyShields / Re: Need help creating Library
« on: January 18, 2016, 03:19:43 AM »
The reason you get the redefine error is because your library header file is including TinyScreen.h AND your app ino file also include TinyScreen.h. It can only be included once.

Consider this example.
We have a file called TinyLibrary.h with the content:
Code: [Select]
const int tinyLibraryVariable = 12;
Then we have another file called MyLibrary.h with the content:
Code: [Select]
#include <TinyLibrary.h>
int myLibraryVariable = tinyLibraryValue;

You will then get the redefine error if you create a myapp.ino file that looks like this:
Code: [Select]
#include <TinyLibrary.h>
#include <MyLibrary.h>

The reason why you get the redefine error message is because MyLibrary.h is including TinyLibrary.h, but TinyLibrary.h was already included from myapp.ino

So you have three options to solve this:
1) Do not include TinyLibrary.h from MyLibrary.h
2) Do not include TinyLibrary.h from myapp.ino
3) Write TinyLibrary.h in a way so it doesn't redefine symbols if it has already been included

Option 3 is generally the correct way forward, but since that code is out of your control it may be difficult. (I will create a pull request that address this issue later today, but I don't know how long it will take for TinyCircuit to integrate it in their source)

In my example above MyLibrary.h needs to have the symbol tinyLibraryVariable so TinyLibrary.h needs to be included either before MyLibrary.h is included, or at the top of MyLibrary.h. If you don't intend on distributing your library it doesn't really matter which option you go for.

13
Hi Mitch,

I'm making a short answer long. :)

What does this line look like after you changed it?
static hal_aci_data_t setup_msgs[NB_SETUP_MESSAGES] PROGMEM = SETUP_MESSAGES_CONTENT;

I believe the correct way to define this is to define setup_msgs as const, like this:
static const hal_aci_data_t setup_msgs[NB_SETUP_MESSAGES] PROGMEM = SETUP_MESSAGES_CONTENT;

With this error message, provided it is at the line where you define setup_msgs
invalid conversion from 'const hal_aci_data_t*' to 'hal_aci_data_t*' [-fpermissive]

It seems like you've made SETUP_MESSAGES_CONTENT into a const, because the error message state that it is the right hand value of the assignment operator that is const, but the left hand value is not const.

If you've properly declared setup_msgs as const it is likely that there is a function somewhere that expects a hal_aci_data_t pointer but you're passing in a const hal_aci_data_t pointer. It seems like none of the functions expect a const pointer.

If you provide the line of code that generates the new error then maybe I can help out a bit more.

14
TinyDuino Processors & TinyShields / Re: Audio on the TinyArcade
« on: January 14, 2016, 06:17:30 AM »
Ok, I'm changing this question to, how is audio played on the TinyArcade?

Does the TinyArcade audio do mixing of sound effects at all or do I have to do that myself?

I've read up on threading on the Arduino and since it isn't very common I'm assuming that none of the libraries (i2c, wire etc) are thread safe.

Soooo, if the TinyArcade doesn't do mixing, and none of the libraries to communicate with the audio hardware are thread safe, is it at least possible to queue buffers of audio that are played one after another seamlessly. (Like how OpenAL work)

15
TinyDuino Processors & TinyShields / Audio on the TinyArcade
« on: January 12, 2016, 04:48:22 AM »
Hi all,

How is audio played on the tiny arcade? Will it be possible to have a separate thread that does the mixing and feed a mixed buffer to the audio some how?

Pages: 1 2
SMF spam blocked by CleanTalk