Please be advised that access to Atari Forum this coming Friday will be sporadic whilst the backend operating system and dependency upgrades are carried out.

GBA Core porting to Mister

https://github.com/MiSTer-devel/Main_MiSTer/wiki
daty2k1
Atariator
Atariator
Posts: 19
Joined: Wed Nov 27, 2019 8:42 am

Re: GBA Core porting to Mister

Post by daty2k1 »

Anyone know what "Sync core to video" does in the newest release? Thanks
SegaSnatcher
Atari freak
Atari freak
Posts: 50
Joined: Sun Oct 13, 2019 12:34 pm

Re: GBA Core porting to Mister

Post by SegaSnatcher »

daty2k1 wrote:Anyone know what "Sync core to video" does in the newest release? Thanks
Yes, its keeps sync stable, especially for V_Sync Adjust 2 low lag mode.
daty2k1
Atariator
Atariator
Posts: 19
Joined: Wed Nov 27, 2019 8:42 am

Re: GBA Core porting to Mister

Post by daty2k1 »

Thanks, I guess I'll have to test it some more then :)
yoshi41
Atari User
Atari User
Posts: 43
Joined: Sat Sep 07, 2019 11:28 am

Re: GBA Core porting to Mister

Post by yoshi41 »

Regarding Turbo.

Great feature. Less or no screen tearing in Lufia, smooth scrolling in Shining Force (with many objects on screen). All this is much better on MiSTER with activated turbo, compared to original hardware. Thanks!

I'm wondering about technical possibilities to enhance scrolling in Zelda Minish Cap. It's obviously not related (?) to CPU frequency. And it's much more distracting on a big screen, compared to the small handheld screen. Any chance to "fix" that somehow as well?
FPGAzumSpass
Atari nerd
Atari nerd
Posts: 46
Joined: Sat Nov 16, 2019 10:09 am

Re: GBA Core porting to Mister

Post by FPGAzumSpass »

As Minish Cap allows for a HUGE fastforward speed, this game has a lot of CPU reserves.
So with Turbo, the CPU has all the power it could take. If scrolling is still a problem, then it's related to how the games handles it.

So unless it's not better in mGBA or real GBA, i doubt we can do anything.
softtest1
Atari User
Atari User
Posts: 34
Joined: Tue Apr 30, 2019 6:37 pm

Re: GBA Core porting to Mister

Post by softtest1 »

Lufia was quite annoying to play before with all the tearing and sound skips. With turbo enabled it's pretty much perfect.

I'm really impressed with this core and I can't see myself using anything else for playing GBA games at this point. Polynominal gamma + desaturation also makes the picture a lot more pleasant than anything I've seen before.
FPGAzumSpass
Atari nerd
Atari nerd
Posts: 46
Joined: Sat Nov 16, 2019 10:09 am

Re: GBA Core porting to Mister

Post by FPGAzumSpass »

Thanks to you!
Good to hear that this feature has a real advantage and is used.

I still fear to use it, as i know what it does: it breakes the whole instruction timing completly.
Not only is it fully wrong, it's random, too!

However, this shows again that most GBA games don't need exact timing, just a timing that is fast enough.
derFunkenstein
Retro freak
Retro freak
Posts: 15
Joined: Fri Dec 20, 2019 10:27 pm

Re: GBA Core porting to Mister

Post by derFunkenstein »

This core is really, really good. I had considered a GBA Consolizer + EverDrive GBA but the price always put me off. Having this totally negates it.
djmartins
Captain Atari
Captain Atari
Posts: 328
Joined: Wed Nov 21, 2018 10:26 pm

Re: GBA Core porting to Mister

Post by djmartins »

derFunkenstein wrote:This core is really, really good. I had considered a GBA Consolizer + EverDrive GBA but the price always put me off. Having this totally negates it.

and you get a lot more machines to run....
derFunkenstein
Retro freak
Retro freak
Posts: 15
Joined: Fri Dec 20, 2019 10:27 pm

Re: GBA Core porting to Mister

Post by derFunkenstein »

djmartins wrote:
derFunkenstein wrote:This core is really, really good. I had considered a GBA Consolizer + EverDrive GBA but the price always put me off. Having this totally negates it.

and you get a lot more machines to run....
Absolutely. I've got a 256 GB SD card stuffed to the gills with arcade games, cart roms, and Sega CD images. :D
djmartins
Captain Atari
Captain Atari
Posts: 328
Joined: Wed Nov 21, 2018 10:26 pm

Re: GBA Core porting to Mister

Post by djmartins »

derFunkenstein wrote:Absolutely. I've got a 256 GB SD card stuffed to the gills with arcade games, cart roms, and Sega CD images. :D
I have a 128Gb card but will be getting a 256Gb card next time I swing by MicroCenter thanks to this core.
Now if I could just bring MiSTer back to 1983....
softtest1
Atari User
Atari User
Posts: 34
Joined: Tue Apr 30, 2019 6:37 pm

Re: GBA Core porting to Mister

Post by softtest1 »

I have noticed a small issue with Ougon no Taiyou - Ushinawareshi Toki (Japan).

Save file: https://easyupload.io/0yo3qr

Load the third save (マーズとうだい). Walk past the ice blocks to the left. You will see an issue with the priority of tiles, where the ice tiles will appear above the character instead of below.

Image
Image

If you walk back and forth a couple times it sometimes looks correct, with the ice block behind the character:

Image


I have also noticed an issue with Crash Bandicoot - The Huge Adventure (USA), but I can only reproduce it with turbo enabled. With turbo enabled, the game randomly crashes the whole core when there is some kind of transition (saving, entering bonus level, dying).
Last edited by softtest1 on Mon Dec 30, 2019 8:48 pm, edited 1 time in total.
FPGAzumSpass
Atari nerd
Atari nerd
Posts: 46
Joined: Sat Nov 16, 2019 10:09 am

Re: GBA Core porting to Mister

Post by FPGAzumSpass »

Thanks for reporting!

Turbo breaks timing completely so it can crash games. There is nothing that can be done about that, except turning it off.

For the priority bug: i can take a look. In future, it would be great if you could add a screenshot of the effect.
softtest1
Atari User
Atari User
Posts: 34
Joined: Tue Apr 30, 2019 6:37 pm

Re: GBA Core porting to Mister

Post by softtest1 »

I was not aware of MiSTer's screenshot feature. I have now edited my report to add some screenshots. Thanks.
FPGAzumSpass
Atari nerd
Atari nerd
Posts: 46
Joined: Sat Nov 16, 2019 10:09 am

Re: GBA Core porting to Mister

Post by FPGAzumSpass »

Could you maybe retest with the latest release? There have been some fixes with the priority already.

If it still happens it would be great if you could attach a savestate while the effect is present (when you stand "below" an iceblock)
That way i can easily debug it.

Mister savegames are not compatible to my debug system (savestates are), so it would be a huge help and saves me a lot of time.
Thanks in advance!
paulbnl
Captain Atari
Captain Atari
Posts: 151
Joined: Wed Oct 24, 2018 9:43 am

Re: GBA Core porting to Mister

Post by paulbnl »

Great work on the new release!

I have debugged the ice in Golden Sun and posted it at the Github issue tracker. It is interesting behavior that mGBA does mostly correct and No$Gba and Higan don't emulate it.
daty2k1
Atariator
Atariator
Posts: 19
Joined: Wed Nov 27, 2019 8:42 am

Re: GBA Core porting to Mister

Post by daty2k1 »

Maybe a noob question but from my understanding, it was supposed to be extremely difficult / unlikely to implement savestates. Any idea about how it was achieved ?

And of course, thanks for the hard work !
FPGAzumSpass
Atari nerd
Atari nerd
Posts: 46
Joined: Sat Nov 16, 2019 10:09 am

Re: GBA Core porting to Mister

Post by FPGAzumSpass »

it was supposed to be extremely difficult / unlikely to implement savestates
That is how it was achieved!
Calling things difficult increases the motivation :D

There are 4 main things to save in GBA:
1: All the memories (WRAM, VRAM, OAM, Palette)
2: All GBA Registers
3: All internal states
4: Save memories(EEPROM, SRAM, Flash)

How it was done:
1: The Memory Bus in the GBA design already had a debug option that can fully takeover the bus and read whatever it wants as long as the core is paused, so i just made autopause when state is saved or loaded.

2: the GBA registers cannot just be read back, as some are writeonly. So i made a bussniffer that recognizes all saves to Registers and save them in a BRAM until Savestate is requested. When a state is loaded, they are just written as usual. However, some registers need to be masked. You wouldn't want a DMA to restart when loading a state, now would you?

3: the internal States are the most crucial thing. I created a new bus and put up registers for all the internal things like cpu registers, program counter, timer/dma/ppu state,... Overall 67 registers with up to 32 bit each.
The most important thing is: how can you load them without screwing up the timing, that is already at the edge?
My idea was to abuse the reset that was present already. So in fact the core reset is like a mini savestate and using the same mechanic as a real savestate. This way there was no new path for the crucial CPU registers, just the value loaded on "reset" may change.

4: save memories are currently not saved in a savestate. If that would be required it can just be added like part 1.

So overall the solution may seem very special but i guess it would not differ much for the other systems i know of. However, i don't know the implementation for these cores, so no estimate how long it would take. For GBA it was overall ~3 full days of work + sorgeligs work for the framework.
daty2k1
Atariator
Atariator
Posts: 19
Joined: Wed Nov 27, 2019 8:42 am

Re: GBA Core porting to Mister

Post by daty2k1 »

Thanks for the detailed information, really cool even if I don't understand all of it. And great work again.
AntialiasedPixel
Atarian
Atarian
Posts: 9
Joined: Fri Nov 22, 2019 3:37 pm

Re: GBA Core porting to Mister

Post by AntialiasedPixel »

Awesome work on the save states! I Don't use them all that much even in software emus, so was a little confused in trying to use them. Does it save the f1-f4 save states to a file across game launches, or are these save state just during the current game launch? I tried doing a save, which loads fine, then loaded up another game, and hit f1 and the previous game save state came up, though maybe glitchy a bit, I assume because it's only writing in some state, while the current loaded/running rom doesn't match the one when the save state was read. Even if it functions just during the current run, that's great, was just curious on what it's actually able to do.
FPGAzumSpass
Atari nerd
Atari nerd
Posts: 46
Joined: Sat Nov 16, 2019 10:09 am

Re: GBA Core porting to Mister

Post by FPGAzumSpass »

I only tested once on Mister with saving directly in the osd and it was saved to disk, so i could load it after switched to another game and back.

If you did notice something weird, please report how to reproduce.
softtest1
Atari User
Atari User
Posts: 34
Joined: Tue Apr 30, 2019 6:37 pm

Re: GBA Core porting to Mister

Post by softtest1 »

The issue with Ougon no Taiyou - Ushinawareshi Toki (Japan) remains in the latest version of the core.

I made a savestate but I can't find it on the SD card, and after powering off the MiSTer I can't load it. There were some changes related to savestates in Main_MiSTer since the last release so I'm guessing I'll have to wait for the next Main_MiSTer release before it will work.
AntialiasedPixel
Atarian
Atarian
Posts: 9
Joined: Fri Nov 22, 2019 3:37 pm

Re: GBA Core porting to Mister

Post by AntialiasedPixel »

Looks like it is actually saving across reboots, not sure if I just missed that when testing earlier. I was able to reproduce the loading in a 2nd game issue though. I loaded a random game "Mega Man & Bass" did a save state withe alt-f1, then confirmed it would jump to that save state via f1, then did a 2nd via alt-f2 and confirmed I could jump between the two with f1, then f2. Next, I loaded a new Rom via the mister menu "Mario vs Donkey Kong" and hit f1 upon loading. It loads the mega man save state graphics, but has a locked up audio and everything is frozen (Mister menu still works fine though). Restarted the Mister and then was able to re-load the same f1/f2 saved in the mega man game, but if I go into the mario vs donkey kong game, it will still load the mega man save states.

Finally I tried keeping the f1 save as mega man, loads fine if that game rom is loaded, then saved an f2 state for donkey kong, that loads fine if that game is open, switching to either game lets me load the state that matches that game, but the other state locks up and doesn't load as described above. I assume there supposed to be 4 slots for each game, but it seems to be acting shared on mine. Maybe something with the directly location of roms/save files on the mister?
trashuncle
Atari maniac
Atari maniac
Posts: 93
Joined: Fri Jul 05, 2019 9:34 pm

Re: GBA Core porting to Mister

Post by trashuncle »

Tested the savestate feature with Donkey Kong Country 2. Saving and loading the states works fine, until you reboot the MiSTer.

Once you reboot, the savestates no longer load. Is this intentional?

I can test some more games to see if it is just this game, but so far that is what I have experienced.
Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 6348
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: GBA Core porting to Mister

Post by Sorgelig »

Only first state (Alt-F1) is saved to disk. Rest 3 states are kept only in memory and not saved to disk. They can be used for temporary states.

Return to “MiSTer”