Recent content by TarableCode

  1. TarableCode

    Homebrew GBA Micropolis (SimCity) WIP

    I'll be working on the city evaluation window and budget window soon. In the meantime, if you're feeling adventurous you can build Micropolis with support for music via the Sim City 2000 soundtrack: https://github.com/TaraHoleInIt/gba-micropolis/blob/main/doc/music.md It's a bit involved, but...
  2. TarableCode

    Homebrew GBA Micropolis (SimCity) WIP

    Update: https://github.com/TaraHoleInIt/gba-micropolis/releases/tag/test-stuff Missing from this release (at least): RCI Indicator Budget window Maps Adjust simulation speed Sound Probably more I'm forgetting What's in this release: Save/load Scenarios Disasters Starting a new city...
  3. TarableCode

    Homebrew GBA Micropolis (SimCity) WIP

    The simulator core is fairly straightforward to work with, and I have no complaints about it. Getting everything to fit onto the GBA is another matter. By default Micropolis has a "high-res" 16x16 tileset consisting of roughly ~960 16x16 tiles. I originally wrote a renderer to handle this and...
  4. TarableCode

    Homebrew GBA Micropolis (SimCity) WIP

    Hi. I'm currently working on porting Micropolis (SimCity) to the GBA, and if you want to mess around with what I have so far you can grab the latest .gba file from the main branch of my GitHub repository: https://github.com/TaraHoleInIt/gba-micropolis Controls: DPAD: Scroll around R: Next tool...
  5. TarableCode

    Homebrew Homebrew Development

    That was it lol. *sigh* Okay so I've been trying to teach myself arm assembly in an attempt to speed up graphics conversion. I kind of succeeded in a sort of way. The speed difference between (on o3ds hardware at 30% syscore): void Unpack8BPP( const uint8_t* PixelsIn, uint16_t* PixelsOut...
  6. TarableCode

    Homebrew Homebrew Development

    Yeah I do my basic testing on citra to spare the hinges on my n3DS and move it to hardware every few times or so. I don't get why it's not blocking for the duration of the mutex lock though, svcWaitSynchronization( RenderThreadReadyEvent, INT64_MAX ) seems to return instantly. Normally this...
  7. TarableCode

    Homebrew Homebrew Development

    Okay, I got it working to the point where it will not request another update if it's already busy. However, one thing I don't understand is that as a test I cannot block until it finishes. #include <stdio.h> #include <stdarg.h> #include <stdlib.h> #include <3ds.h> int ShowError( const char*...
  8. TarableCode

    Homebrew Homebrew Development

    I just want to check if it is actually locked, if it is then don't ask the thread to update the screen.
  9. TarableCode

    Homebrew Homebrew Development

    It doesn't need to know when it's done, more like "If you're still rendering then don't bother, I'm moving on anyway". That way the emulator won't block waiting for the framebuffer to convert. e: I'm only blocking in my examples for perf testing.
  10. TarableCode

    Homebrew Homebrew Development

    I'm trying to wrap my head around this lol, I haven't spent much time with threading. Step 1: Main thread signals render thread to start converting the framebuffer svcSignalEvent, svcWaitSynchronization. Step 2: Render thread waits for signal, does the conversion and releases the mutex with...
  11. TarableCode

    Homebrew Homebrew Development

    Something like: volatile bool RenderThreadRun = true; volatile bool RenderThreadReady = false; Handle RenderThreadReqUpdateSignal = 0; Handle RenderThreadConversionMutex = 0; Thread RenderThreadHandle = NULL; void RenderThread( void* Param ) { gfxInitDefault( ); consoleInit(...
  12. TarableCode

    Homebrew Homebrew Development

    https://github.com/TaraHoleInIt/minivmac-3ds/blob/master/src/OSGLU3DS.c Basically from line 119 to 380. It's basically paletted texture->rgb conversion using a LUT, but it's still fairly expensive.
  13. TarableCode

    Homebrew Homebrew Development

    Okay, so I would change it to use a signal when the main thread is like "hey update the display", and the mutex is like "nah im busy, wait"? I'm still looking for a good example of mutexes, is the caller the one that makes the mutex and the thread clears it? Kinda sucks about the 30% time...
  14. TarableCode

    Homebrew Homebrew Development

    Is the threading route even worth pursuing then? I made an attempt at optimizing the framebuffer conversion using asm but it's not a huge amount faster plus it gives the wrong colours for some reason. I feel kinda bad when it chugs a little bit, like I haven't done enough to make it faster.
  15. TarableCode

    Homebrew Homebrew Development

    Okay that makes sense, removing the drawing calls brings it around the ~9ms range. Though the weird part is that the RenderIsBusy flag is set before drawing begins yet removing the drawing calls speeds it up. How would I best approach this so that each frame is handled smoothly to get ~60FPS...