Useless CFW for the Retrostone (1)
- romanaFive
- Posts: 10
- Joined: Sun 13 Oct 2019 15:48
- Location: Stupidville, Florida
Re: Useless CFW for the Retrostone (1)
Here's the source. I forgot where I got it from; it was a pain to find and get the buttons working
on RS-97.
All the files needed to run the game is in squashfs-root.
I'm not sure how to proceed with your instructions:
Maybe look in dingoo.c? I didn't see any calls of SDL_Flip. A screen (pScreen) is created with SDL_SetVideoMode in this file, but nothing is ever done with it. Maybe something else involving dzzFlip() and dingoo_screen and dingoo_screen15?
Well, thanks for looking into it.
http://ceratoph.freeshell.org/retrostone/Nethack.zip
on RS-97.
All the files needed to run the game is in squashfs-root.
I'm not sure how to proceed with your instructions:
Maybe look in dingoo.c? I didn't see any calls of SDL_Flip. A screen (pScreen) is created with SDL_SetVideoMode in this file, but nothing is ever done with it. Maybe something else involving dzzFlip() and dingoo_screen and dingoo_screen15?
Well, thanks for looking into it.
http://ceratoph.freeshell.org/retrostone/Nethack.zip
- gameblabla
- Posts: 43
- Joined: Sun 7 Apr 2019 10:02
Re: Useless CFW for the Retrostone (1)
Ok so i looked into it and its not using SDL but directly to the framebuffer (/dev/fb0) and using eudev.
I could convert it to use SDL but i think you are better off looking for a version that uses SDL instead, that would make it much easier for me to port.
I could convert it to use SDL but i think you are better off looking for a version that uses SDL instead, that would make it much easier for me to port.
- romanaFive
- Posts: 10
- Joined: Sun 13 Oct 2019 15:48
- Location: Stupidville, Florida
Re: Useless CFW for the Retrostone (1)
Err, I looked at it again and I noticed there was an unused sdl.c file among the source files. I deleted dingoo.c from the Makefile and added sdl.c.
I got the screnn working!
The keys work but aren't exactly right: the top button (blue) is B, I think. Also the game tries (and fails) to save to the (readonly) CWD . Someplace in this mess, there must be a way to save to HOME, as that's what nethack originally did until someone ported it to handhelds. Err, where is HOME on Useless?
It looked like it was converting from 16 to 32-bit in sdl.c, so I just commented that converty stuff and applied your instructions:
I updated source linked code above.
I got the screnn working!
The keys work but aren't exactly right: the top button (blue) is B, I think. Also the game tries (and fails) to save to the (readonly) CWD . Someplace in this mess, there must be a way to save to HOME, as that's what nethack originally did until someone ported it to handhelds. Err, where is HOME on Useless?
It looked like it was converting from 16 to 32-bit in sdl.c, so I just commented that converty stuff and applied your instructions:
Code: Select all
static void *InitScreenSDL()
{
SDL_Init(SDL_INIT_VIDEO);
rl_screen = SDL_SetVideoMode(0, 0, 16, SDL_HWSURFACE);
// pScreen = SDL_SetVideoMode(320, 240,32, SDL_SWSURFACE);
pScreen = SDL_CreateRGBSurface(SDL_SWSURFACE, 320, 240, 16, 0,0,0,0);
memset(g_usScreen, 0, sizeof(g_usScreen));
return g_usScreen;
}
static void *FlipScreenSDL()
{
unsigned long ul, r, g, b;
unsigned short us;
//unsigned long *ptr = (unsigned long *) pScreen->pixels;
unsigned short *ptr = (unsigned short *) pScreen->pixels;
int x, y;
for(y = 0; y < 240; y++)
{
for(x = 0; x < 320; x++)
{
us = g_usScreen[y * 320 + x];
// Not really understanding what went on here:
/* r = (us >> 11) & 0x1F; // (us / 2048 ) * 31
g = (us >> 5) & 0x3F; // (us / 63 ) * 63
b = us & 0x1F; // us / 31
ul = ((r * 8) << 16) + ((g * 4) << 8) + (b * 8);
ptr[y * (pScreen->pitch / 4) + x] = ul;
*/
// Well, if 32bpp has pitch/4, 16bpp should have pitch/2 ?
ptr[y * (pScreen->pitch / 2) + x] = us;}
}
// SDL_UpdateRect(pScreen, 0, 0, 320, 240);
SDL_SoftStretch(pScreen, NULL, rl_screen, NULL);
SDL_Flip(rl_screen);
return g_usScreen;
}
I updated source linked code above.
- gameblabla
- Posts: 43
- Joined: Sun 7 Apr 2019 10:02
Re: Useless CFW for the Retrostone (1)
I'm surprised to have missed that file lol... NiceromanaFive wrote: ↑Fri 18 Oct 2019 17:01 Err, I looked at it again and I noticed there was an unused sdl.c file among the source files. I deleted dingoo.c from the Makefile and added sdl.c.
You should not care where HOME is located, as the HOME environment variable is properly exported.The keys work but aren't exactly right: the top button (blue) is B, I think. Also the game tries (and fails) to save to the (readonly) CWD . Someplace in this mess, there must be a way to save to HOME, as that's what nethack originally did until someone ported it to handhelds. Err, where is HOME on Useless?
Instead what you should do is something like this
Code: Select all
char gamepath[512];
snprintf(gamepath, sizeof(gamepath), "%s/.nethack", getenv("HOME"));
Btw, here's the key mapping :
A - SDLK_LCTRL
B - SDLK_LALT
X - SDLK_LSHIFT
Y - SDLK_SPACE
L - SDLK_TAB
R - SDLK_BACKSPACE
L2 - SDLK_3
R2 - SDLK_END
See my code for reference :
https://github.com/retrostone-dev/build ... nts.c#L355
- romanaFive
- Posts: 10
- Joined: Sun 13 Oct 2019 15:48
- Location: Stupidville, Florida
Re: Useless CFW for the Retrostone (1)
Actually using getenv() to read HOME environment variable isn't the problem. Nethack is also trying to create lock files in $CWD. Some kind of save backup scheme in case of nethack crashing, I think. I tried changing the save to /home/useless. It saves, but then when you restart the game, you discover the lock file(s) were not created and then you are dead.
It is sooo much easier to just leave nethack in a folder and launch it with Explorer, than put it in an opk and figure out how it is nameing these locks in files.c. Is it possible to put a gmenu launcher icon for a binary located somewhere in /home/useless instead of in an opk?
Anyway, Nethack runs (saves and loads) fine from Explorer in a folder. Since this game is not exactly brilliant quality, I'm gonna leave it here. I did manage to get the buttons right. However, picking help on the menu will seg. fault and any new progress since the last save will be lost.
I also got Last Mission, Boulder, and Dingux Commander working using your instructions. Thanks again. This is much easier than the nebulous, convoluted Debian mess of retroarch + retropie!
The final Nethack mess and the other opks are in
http://ceratoph.freeshell.org/retrostone
All opks include source code.
Code: Select all
Cannot create file 1lock.0 for level 0 (errno 30)
Anyway, Nethack runs (saves and loads) fine from Explorer in a folder. Since this game is not exactly brilliant quality, I'm gonna leave it here. I did manage to get the buttons right. However, picking help on the menu will seg. fault and any new progress since the last save will be lost.
I also got Last Mission, Boulder, and Dingux Commander working using your instructions. Thanks again. This is much easier than the nebulous, convoluted Debian mess of retroarch + retropie!
The final Nethack mess and the other opks are in
http://ceratoph.freeshell.org/retrostone
All opks include source code.
Last edited by romanaFive on Mon 21 Oct 2019 18:39, edited 1 time in total.
- gameblabla
- Posts: 43
- Joined: Sun 7 Apr 2019 10:02
Re: Useless CFW for the Retrostone (1)
That lock issue could easily be fixed : just remove the related code so it ignores it.romanaFive wrote: ↑Sun 20 Oct 2019 00:39 Actually using getenv() to read HOME environment variable isn't the problem. Nethack is also trying to create lock files in $CWD. Some kind of save backup scheme in case of nethack crashing, I think. I tried changing the save to /home/useless. It saves, but then when you restart the game, you discover the lock file(s) were not created and then you are dead.Code: Select all
Cannot create file 1lock.0 for level 0 (errno 30)
It's really not necessary at all.
Btw, your link isn't working.
- romanaFive
- Posts: 10
- Joined: Sun 13 Oct 2019 15:48
- Location: Stupidville, Florida
Re: Useless CFW for the Retrostone (1)
Those files called nlock.m (where n,m are ints ) are written by create_levelfile(). A new one is written each time you descend a level. I think they might be involved in creating the save file, too.
It looks like a tangled mess in files.c and save.c. I'm not seeing any easy quick way, like disabling a particular function. If you already have it all figured out what can be disabled, please explain.
Sorry about the typo in the url: retrogame <-----> retrostone.
It looks like a tangled mess in files.c and save.c. I'm not seeing any easy quick way, like disabling a particular function. If you already have it all figured out what can be disabled, please explain.
Sorry about the typo in the url: retrogame <-----> retrostone.
Re: Useless CFW for the Retrostone (1)
Hi! great, I use it and it works great, but the FCEUX works way too slow, what can I do to make it work at normal speed?
thanks again for your hard work
thanks again for your hard work
- gameblabla
- Posts: 43
- Joined: Sun 7 Apr 2019 10:02
Re: Useless CFW for the Retrostone (1)
Slow ? Could be due to the sound rate not being set at 48000 or similar... Or are you playing PAL games on it ?
I do admit, some minor updates happened since then so i should update my emulators again. (notably VBA Next, SMS Plus GX and Handy)
Re: Useless CFW for the Retrostone (1)
Yes I tried from USA, EU and JAP and all of them play slow, the fps counter goes at 24 fps. I tried every config with the sound rate and nothing.gameblabla wrote: ↑Tue 25 Feb 2020 21:42Slow ? Could be due to the sound rate not being set at 48000 or similar... Or are you playing PAL games on it ?
I do admit, some minor updates happened since then so i should update my emulators again. (notably VBA Next, SMS Plus GX and Handy)
Also, I'm wondering, for the PSX emulator, is there a possibility to put it the pcsx.cfg a combination of buttons like "Select" + "R2" to pop up the menu? And not like right now, R2, that it is impossible to use that button for any game? Or maybe the button up on the side of the retrostone?