Homebrew Sonic CD Port Released

placebo_yue

Well-Known Member
Member
Joined
Aug 7, 2019
Messages
739
Trophies
0
Age
33
XP
1,264
Country
Argentina
And if you's want a CIA build, here you go!
thanks to this and your previous advice about the data.rdsk file i managed to run it and it works flawlessly on my O3DS!

Shame sonic is kinda floating in the air with stereo3D, but im sure that can be fixed easily, and the fact that there's stereo3D to begin with is already amazing, many devs ignore it and it's my favourite part about the 3DS

super excited about this, thanks

edit: there's a few things i noticed that i'll mention as some sort of feedback

The first and most worrisome, i can't close the app without the 3DS main menu being stuck on "closing software..." which eventually leads to a BSOD exception.
The special stages also throw a BSOD as soon as they're being loaded, it doesn't display a single frame of them, but from what i've read that's expected behaviour.
Can the debug text on the lower screen be disabled? a simple toggle with a tap on the lower screen would suffice, but if you're saving that for a final build or whatever it's understandable. It's not a dealbreaker by any means.
i think that's all. Oh, i figure an easy fix for the 3D would be to put sonic on the same depth as the floors he walks in, using the 3D effect only to push the backgrounds away? Just a thought, maybe you figure out something better.

Again thanks a lot!
 
Last edited by placebo_yue,
  • Like
Reactions: Wavy and HiSaturnV

HiSaturnV

Well-Known Member
Newcomer
Joined
Jan 29, 2021
Messages
45
Trophies
0
Age
24
Website
saturnsh2x2.ml
XP
488
Country
United States
thanks to this and your previous advice about the data.rdsk file i managed to run it and it works flawlessly on my O3DS!

Shame sonic is kinda floating in the air with stereo3D, but im sure that can be fixed easily, and the fact that there's stereo3D to begin with is already amazing, many devs ignore it and it's my favourite part about the 3DS

super excited about this, thanks

edit: there's a few things i noticed that i'll mention as some sort of feedback

The first and most worrisome, i can't close the app without the 3DS main menu being stuck on "closing software..." which eventually leads to a BSOD exception.
The special stages also throw a BSOD as soon as they're being loaded, it doesn't display a single frame of them, but from what i've read that's expected behaviour.
Can the debug text on the lower screen be disabled? a simple toggle with a tap on the lower screen would suffice, but if you're saving that for a final build or whatever it's understandable. It's not a dealbreaker by any means.
i think that's all. Oh, i figure an easy fix for the 3D would be to put sonic on the same depth as the floors he walks in, using the 3D effect only to push the backgrounds away? Just a thought, maybe you figure out something better.

Again thanks a lot!
No prob. Also, in response to each of your points:
  • Earlier .3dsx builds seemed to crash when exiting the game through the menu; I recently pushed some changes to patch this out, and the issue doesn't seem to happen with a .cia build of the current commit, so fingers crossed this is fixed.
  • The special stages crash for you? On my build, they run (albeit with a glitched floor layer, as I still don't quite understand how the 3D floor drawing code works as of yet and I'm working on getting that running). Does this happen consistently (at the exact same point in the game)? The build does have a few memory leak issues that I need to get sorted out, so the game might've crashed due to those.
  • That should be really easy to fix; I'll patch in something for hiding the text on the bottom screen before the next release.
  • Just today I pushed some commits fixing the depth issues on the sprite/tile layers. Namely, sprite and tile layers now have separate depth values, and Sonic shouldn't appear to "hover" like he did in previous builds. I'll attach a build of the current commit (with both 3dsx and cia files) to this post.
 

Attachments

  • SonicCD.zip
    1.8 MB · Views: 123

placebo_yue

Well-Known Member
Member
Joined
Aug 7, 2019
Messages
739
Trophies
0
Age
33
XP
1,264
Country
Argentina
The special stages crash for you?
On further inspection, they don't. I assume it was the memory leak you mention, because i resumed my saved file that loaded the special stage right away, i expected it to crash and having to delete the save file and restart the game, but it loaded, with a glitched floor as you said.
I'll check out your new cia right away.
You have a loyal O3DS tester right here, as long as i'm handed a .cia because i can't compile anything on my own :grog:

edit after testing new .cia: the memory leak is still at large, the game crashes after completing a stage most of the times. My guess is that time traveling or entering a special stage makes it worse, since it seems to happen more often when i do. When i don't i might be able to play two stages without a crash. Perhaps there's an issue with whatever the game does during a stage completion? like saving the savestate and such?
the stereo 3D looks much better now, some details look a bit weird still (like the pipes on the future version of the first stage, or the first boss' arm) but i'm being super picky there, most of the loops and enemies and tunnels in the stages look good, so as it is i'd consider it done.
 
Last edited by placebo_yue,

HiSaturnV

Well-Known Member
Newcomer
Joined
Jan 29, 2021
Messages
45
Trophies
0
Age
24
Website
saturnsh2x2.ml
XP
488
Country
United States
edit after testing new .cia: the memory leak is still at large, the game crashes after completing a stage most of the times. My guess is that time traveling or entering a special stage makes it worse, since it seems to happen more often when i do. When i don't i might be able to play two stages without a crash. Perhaps there's an issue with whatever the game does during a stage completion? like saving the savestate and such?

I think I've found out what it is, as I've been getting similar behavior to what you're describing on Citra; from everything I can tell it looks like the memory leak is coming from sound effects not being freed properly on the SDL_mixer backend. I've tried a few a ways to fix it, but none of them seem to work as of yet. I'll keep you all posted on this though, and upload a build to test once I can get the leak to stop on Citra.
 

HiSaturnV

Well-Known Member
Newcomer
Joined
Jan 29, 2021
Messages
45
Trophies
0
Age
24
Website
saturnsh2x2.ml
XP
488
Country
United States
UPDATE: I think I fixed it; there's a separate bug that got introduced where stage-specific sound effects don't play on restarts (which shouldn't be too hard to address later on), but the memory leak issue seems to be gone; was able to make it to Quartz Quadrant in one go on Citra without any crashes. I'll upload the build here, hopefully the issue should be fixed on real hardware as well.
 

Attachments

  • SonicCD.zip
    1.8 MB · Views: 129

placebo_yue

Well-Known Member
Member
Joined
Aug 7, 2019
Messages
739
Trophies
0
Age
33
XP
1,264
Country
Argentina
UPDATE: I think I fixed it; there's a separate bug that got introduced where stage-specific sound effects don't play on restarts (which shouldn't be too hard to address later on), but the memory leak issue seems to be gone; was able to make it to Quartz Quadrant in one go on Citra without any crashes. I'll upload the build here, hopefully the issue should be fixed on real hardware as well.
Damn that was fast. I won't be able to test this for a couple days (away from my 3DS) but i'll get back at you ASAP
 
  • Like
Reactions: HiSaturnV

Moon164

Well-Known Member
Member
Joined
Nov 21, 2015
Messages
859
Trophies
0
Age
26
XP
2,955
Country
Brazil
A friend of mine posted in a group on Telegram that the port now works with good speed even on the Old 3DS and that it even has 3D function.

Is that true?, because if it is, it's superb, it's unbelievable that they've achieved that and it's great to see more stuff that still supports the Old 3DS.
 

Wavy

Splatana Stamper Enjoyer
Member
Joined
Aug 24, 2020
Messages
302
Trophies
0
Location
MAP13: Downtown
XP
1,572
Country
Australia
A friend of mine posted in a group on Telegram that the port now works with good speed even on the Old 3DS and that it even has 3D function.

Is that true?, because if it is, it's superb, it's unbelievable that they've achieved that and it's great to see more stuff that still supports the Old 3DS.
I don't have an O3DS to confirm but setting my N3DS CPU clockspeed to the O3DS clockspeed had no performance dips
 
Last edited by Wavy,
  • Like
Reactions: bonkmaykr

placebo_yue

Well-Known Member
Member
Joined
Aug 7, 2019
Messages
739
Trophies
0
Age
33
XP
1,264
Country
Argentina
I'm back, and i can confirm that the third .cia posted before the official 1.30v (is it the same?) seems to work perfectly. No crashes after a good 45/60 minutes of gameplay, 3D still works perfectly, and i was able to exit the game normally (which was solved in the previous version).
I didn't get to play a special stage, i assume those still look strange. But if you can overlook that tiny issue, this port is just perfect
Also, i'm testing on O3DS so yes, this runs fullspeed even while using 3D, so go ahead and install it!

edit: the menus on the time attack part of the game look weird! i just found out. Not a dealbreaker, still playable. But there's that
 
Last edited by placebo_yue,

HiSaturnV

Well-Known Member
Newcomer
Joined
Jan 29, 2021
Messages
45
Trophies
0
Age
24
Website
saturnsh2x2.ml
XP
488
Country
United States
@HiSaturnV I saw that you pushed a new release to Github today. I noticed though that the HW builds you uploaded do not appear to reflect the changes you noted. The SW builds appear to do so.
Gotcha, I think I might've messed up the files. I've recompiled the HW build and edited the release, let me know if the changes are present.

I'm back, and i can confirm that the third .cia posted before the official 1.30v (is it the same?) seems to work perfectly. No crashes after a good 45/60 minutes of gameplay, 3D still works perfectly, and i was able to exit the game normally (which was solved in the previous version).
I didn't get to play a special stage, i assume those still look strange. But if you can overlook that tiny issue, this port is just perfect
Also, i'm testing on O3DS so yes, this runs fullspeed even while using 3D, so go ahead and install it!

edit: the menus on the time attack part of the game look weird! i just found out. Not a dealbreaker, still playable. But there's that
Yea, Time Attack is weird, mainly because the HW backend doesn't fully take palettes into account as of yet.

The Retro Engine is kinda built like an old game console in that graphics loaded need to take into account a limited set (or palette) of 256 colors. Older game consoles had support for paletted textures (which would make implementing something like this trivial), but unfortunately, the 3DS doesn't appear to, at least, in 3DS mode. This is why palette-based effects don't work correctly in the current HW build. If I remember correctly, this is also why some 3DS emulators don't work well with games that use specific palette-based effects. The SW backend, while inefficient, allows these effects to be rendered correctly, by virtue of manually placing each pixel on the screen, checking graphics against the current color palette.

Thing is, the Retro Engine stores 8 palettes internally, and from what I've seen, these palettes appear to be static. I think caching the graphics against all 8 palettes and creating a reference to the current palette texture index should be enough to implement palette cycling, as well as fix most palette-related issues.

That said, graphics need to be rearranged (tiled/swizzled) to play nice with the 3DS's graphics chip (PICA200), and the current way the HW build does this is kinda inefficient, in that it rearranges graphics in real time. This is part of the reason why load times suck on O3DS. Considering the game's tilesets should all be the same size, I think introducing a lookup table and caching graphics against that should speed things up considerably, as well as make it easier to cache versions of the tileset using all 8 palettes.
 

bonkmaykr

Battle Ready
Member
Joined
Jul 30, 2021
Messages
177
Trophies
0
Website
bonkmaykr.xyz
XP
381
Country
United States
Stereoscopic 3D was one of the last things I expected to be implemented, as I thought it would be quite a lot of work for a gimmick many people don't appreciate, but I guess I was wrong
 
  • Like
Reactions: HiSaturnV

HiSaturnV

Well-Known Member
Newcomer
Joined
Jan 29, 2021
Messages
45
Trophies
0
Age
24
Website
saturnsh2x2.ml
XP
488
Country
United States
Stereoscopic 3D was one of the last things I expected to be implemented, as I thought it would be quite a lot of work for a gimmick many people don't appreciate, but I guess I was wrong
Yea, the stereoscopic 3D was surprisingly easy to implement with the HW backend I had written; the engine draws everything in tile/sprite layers, so implementing the 3D was only a matter of drawing all tiles/sprites to the right screen and offsetting by a certain set of pixels (hardcoded into a lookup table) to achieve a parallax effect. The fact that the engine doesn't need to scale an internal framebuffer up to fit the screen also helps (fun fact: the Steam version's internal framebuffer resolution is the exact resolution of the 3DS's top screen, 400x240).
 
  • Like
Reactions: bonkmaykr

bonkmaykr

Battle Ready
Member
Joined
Jul 30, 2021
Messages
177
Trophies
0
Website
bonkmaykr.xyz
XP
381
Country
United States
After installing the new hardware accelerated CIA onto my o3DS I have to say I'm quite impressed with how many bug fixes have been implemented. Most of the menus are no longer an eyesore and the backgrounds don't leave trails when they reach the bottom of the level, but the new stereoscopic 3D causes some new problems. One minor nitpick is that some levels and effects look way too flat, and Sonic appears slightly in front of the ground in some of them, particularly when the ground and background are on the same depth level.

Because the 3D effect allows you to see beyond the left and right edge of the screen, some backgrounds and sprites need to be expanded out in that direction in order to prevent the player from being able to see around them. The level introduction card that appears (with the name of the level and the act number), and the water + sky in the title screen are the best examples. The title screen looks really bad with the 3D enabled, because the middle section of the background pops out and meets the logo in the foreground.

Also, the Options menu still does not work. Selecting Controls, Settings, etc will just fade to black and back to the main menu without going anywhere.
 
Last edited by bonkmaykr,

HiSaturnV

Well-Known Member
Newcomer
Joined
Jan 29, 2021
Messages
45
Trophies
0
Age
24
Website
saturnsh2x2.ml
XP
488
Country
United States
After installing the new hardware accelerated CIA onto my o3DS I have to say I'm quite impressed with how many bug fixes have been implemented. Most of the menus are no longer an eyesore and the backgrounds don't leave trails when they reach the bottom of the level, but the new stereoscopic 3D causes some new problems. One minor nitpick is that some levels and effects look way too flat, and Sonic appears slightly in front of the ground in some of them, particularly when the ground and background are on the same depth level.

Because the 3D effect allows you to see beyond the left and right edge of the screen, some backgrounds and sprites need to be expanded out in that direction in order to prevent the player from being able to see around them. The level introduction card that appears (with the name of the level and the act number), and the water + sky in the title screen are the best examples. The title screen looks really bad with the 3D enabled, because the middle section of the background pops out and meets the logo in the foreground.
Yea, the 3D's a bit tough to get to look right, with some zones like Palmtree Panic Good Future being really hard to look at it with it enabled. Fixing those issues, though, might require a mod to the game itself instead of simple modifications to the engine. I might look into this, once the HW backend is more or less finished, though.

Also, the Options menu still does not work. Selecting Controls, Settings, etc will just fade to black and back to the main menu without going anywhere.
To my knowledge this is also an issue with the base decomps, as the engine makes unimplemented callbacks. That said, there are mods out there intended to address this.
 
  • Like
Reactions: bonkmaykr

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Psionic Roshambo @ Psionic Roshambo: https://www.youtube.com/watch?v=ZJewzRHdH8c