Jump to content
IGNORED

Lynx Multi cart ROM Problems


SainT

Recommended Posts

I've got some code in place for .o files, but something is wrong. I hate pointers and I am sure I am doing something wrong with regards to pointers.

 

Here's the basic code if anyone wants to help out. I am not sure if I am forming the destination address correctly either. The other complication is the address of this function needs to be either low down in memory (or high up in memory) out of the range of what is being loaded. It's one of these things that sounds simple but ends up being a pain (well for my limited brain it is lol).

 

FRESULT __fastcall__ LynxSD_ProgramHomebrew(const char *pFilename)
{
//work in progress, this is more complex than first thought - if we load into existing memory it could overlap menu code
FRESULT res = FR_DISK_ERR;
if (LynxSD_OpenFile(pFilename) == FR_OK)
{
u32 nSize;

char szHeader[10];
u8 nHeaderSize;
u8 nStartHi, nStartLo;
u16 nLength;
u16 nAddress;

char * ptr;

nSize = LynxSD_GetFileSize();

//read header
LynxSD_ReadFile(szHeader, 10);

//start address
if ((szHeader[0] == 0x80) && (szHeader[1] == 0x08)) //std .o file
{
nHeaderSize = 10;
nStartHi = szHeader[2];
nStartLo = szHeader[3];
}
else
{
if ((szHeader[0] == 0XFF) && (szHeader[1] == 0XFF)) //STD .COM FILE
{
nHeaderSize = 6;
nStartHi = szHeader[2];
nStartLo = szHeader[3];
}
}

//length
nLength = (nSize - nHeaderSize);

//destination address
nAddress = ((u16)(nStartHi << 8)) || (nStartLo);

ptr = (char *)nAddress;

//skip header
LynxSD_SeekFile(nHeaderSize);

//load remainder into the address stated
res = (LynxSD_ReadFile(ptr,nLength) == FR_OK);

LynxSD_CloseFile();

address = nAddress;

jump_address();
}
return res;
}

Link to comment
Share on other sites

That looks pretty much there, Gadget! I was thinking about this last night. The issue is most likely as you say, the loader can be overwritten by the code being loaded.

 

I'll get into the code tomorrow and see what I can do. My train of thought is to make the smallest, relocatable loader possible and move this either very low down or high up in memory, or potentially just before the code loaded. Wherever ends up being appropriate.

 

Two thoughts come to mind in make the final loader as small as possible --

 

1- do all the setup as you have but have the final LynxSD_Load code relocated and optimised for size. This will essentially be the final loader.

 

2- load the object file into SRAM (as you would the cartridge image) then just have a standard cartridge block loader for the final rad into RAM.

 

I'm not sure which would be smallest until I look.

 

I've found the Lynx C compiler to be very efficient, and the reuslting code is likely to be relocatble, so I'm not sure if a small chunk of assembler will be required or not. Not an issue either way, just pick the correct tool for the job. :)

  • Like 1
Link to comment
Share on other sites

I guess for the layman (that's me) we have three objectives currently. 1) get commerical ROMs to have a momentary title screen and this is acheived by having the same file name in the preview folder as the ROM itself. 2) test and rid any duplicate commercial ROMs that go to coloured screen. 3) write code that allows homebrews with .o and .com and .lyx to run.

 

This all seems like a lot of work. I think we all ought to be aiming to contribute in some way toward a central pot of Commerial Roms/ Homebrews and Demos that once finalised can be posted up on this thread for all to share. Correct me if I'm barking up the wrong tree.

 

If there's some simple set of instructions I can follow I don't mind contributing in some way if I can get my head around it!

 

I want to aim a thank you at Gadget for clearly doing a lot of unpaid work so far for the good of the community.

Edited by Guitari
  • Like 2
Link to comment
Share on other sites

1.5 (above) already supports .LYX files! Just the .com and .o stuff which it almost supports, just need to relocate the loader and make sure the code I wrote earlier is actually correct. It should work, I've done the same thing with the comlynx BLL loader previously and that seemed to work OK.

  • Like 2
Link to comment
Share on other sites

I went with Sage's suggestion, it was by far the easiest in the end.

 

Lastest menu here --

 

http://atariage.com/forums/topic/253167-retro-hq-lynx-cart-menu-14/?p=3522328

 

Please let me know if you have any specific issues, everything I have tried seems to be running now, albeit with expected flicker and so on from games which try and interlace for extra colours.

Edited by SainT
  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...

I cannot get the Power Factor rom to work at all. It'll get to the first screen when loading (which displays the yellowish hand made software screen) but it won't load past there.

 

I've tried several roms, non which work.

 

Has anyone else had any issues with this rom? If not can someone post a link to a working rom please?

 

Many thanks people.

Link to comment
Share on other sites

I cannot get the Power Factor rom to work at all. It'll get to the first screen when loading (which displays the yellowish hand made software screen) but it won't load past there.

 

I've tried several roms, non which work.

 

Has anyone else had any issues with this rom? If not can someone post a link to a working rom please?

 

Many thanks people.

 

I've just tried this ROM here --

 

http://coolrom.com/roms/atarilynx/6606/Power_Factor.php

 

with the 1.6 menu.

 

All works fine.

 

If you still have issues give me a shout.

Link to comment
Share on other sites

 

I've just tried this ROM here --

 

http://coolrom.com/roms/atarilynx/6606/Power_Factor.php

 

with the 1.6 menu.

 

All works fine.

 

If you still have issues give me a shout.

 

Thanks SainT. As always you're a true gent in your support for us all here.

 

I tried this rom, renamed it to "powerfac" to match Gadgets fantastic preview image naming convention. Same issue happens and it won't load.

So I tried your "menu" file which checks the SD card. No problems there. Reformatted the SD card, re downloaded the menus etc. Still same problem. Weird!

Anyways I copied the powerfactor rom across, this time without renaming it, voila it works! Ace!

So I then rename it to "powerfac" and now it doesn't work. So I put it back to it's original name and it works again. Right I'm getting somewhere. So I change the preview name to match. The preview works but then I get the same problem as before.

 

So basically if the preview screen loads for this game (if the rom and the preview name match) then the game itself won't load. Not a huge issue but I thought I'd better post my findings up just in case someone else encounters this issue.

 

All the best peeps.

  • Like 1
Link to comment
Share on other sites

 

Thanks SainT. As always you're a true gent in your support for us all here.

 

I tried this rom, renamed it to "powerfac" to match Gadgets fantastic preview image naming convention. Same issue happens and it won't load.

So I tried your "menu" file which checks the SD card. No problems there. Reformatted the SD card, re downloaded the menus etc. Still same problem. Weird!

Anyways I copied the powerfactor rom across, this time without renaming it, voila it works! Ace!

So I then rename it to "powerfac" and now it doesn't work. So I put it back to it's original name and it works again. Right I'm getting somewhere. So I change the preview name to match. The preview works but then I get the same problem as before.

 

So basically if the preview screen loads for this game (if the rom and the preview name match) then the game itself won't load. Not a huge issue but I thought I'd better post my findings up just in case someone else encounters this issue.

 

All the best peeps.

 

Excellent deductive work, many thanks for such a clear report of whats going on! I'll take a look when I get a chance. But certainly the workaround at the moment is no preview for Power Factor. How bizarre!

Link to comment
Share on other sites

 

Thanks SainT. As always you're a true gent in your support for us all here.

 

I tried this rom, renamed it to "powerfac" to match Gadgets fantastic preview image naming convention. Same issue happens and it won't load.

So I tried your "menu" file which checks the SD card. No problems there. Reformatted the SD card, re downloaded the menus etc. Still same problem. Weird!

Anyways I copied the powerfactor rom across, this time without renaming it, voila it works! Ace!

So I then rename it to "powerfac" and now it doesn't work. So I put it back to it's original name and it works again. Right I'm getting somewhere. So I change the preview name to match. The preview works but then I get the same problem as before.

 

So basically if the preview screen loads for this game (if the rom and the preview name match) then the game itself won't load. Not a huge issue but I thought I'd better post my findings up just in case someone else encounters this issue.

 

All the best peeps.

 

Sort of sounds like Powerfactor may be relying on initialized state of some chunk of memory perhaps?

  • Like 1
Link to comment
Share on other sites

  • 3 weeks later...

Has anybody had any luck running Baseball Heroes? I've tried ROMs from three sources (old ROM I downloaded over a decade ago, coolrom, and doperoms) and none would get past the splash screen.

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

Anyone get Tetris ROM working? I have T-Tris working (and love it) but as a Tetris nut would love to see what that looks like. Not sure if it was a homebrew that only works on emulators...

 

Have menu 1.6 and EVERYTHING works great as far as I can tell. Only interested in getting this ROM working due to my love of Tetris :) Thanks!

Link to comment
Share on other sites

On 7/28/2016 at 4:03 PM, Trew said:

Just tried it here and it doesn't work for me.

 

It looks like it's going to load, then I just get a blank screen and a continuous tone.

 

The way to test if the menu is at fault or the image itself is to convert the .o file into a .lnx file and just make sure that works on Handy. If that's all good, rename it to menu.bin and stick that on an memory card.

 

The cart just loads any ROM image named menu.bin and runs it -- so if you name a game to that, it'll run the game. If the game now boots, we still have an issue with the menu. If it has the same error, it just never worked on real hardware.

Edited by SainT
  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...