Jump to content

Photo

Lynx SD ROM Problems


98 replies to this topic

#26 GadgetUK OFFLINE  

GadgetUK

    Stargunner

  • 1,945 posts
  • Location:UK

Posted Mon May 30, 2016 5:57 AM

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;
}



#27 sage OFFLINE  

sage

    Dragonstomper

  • 984 posts
  • Location:Germany

Posted Mon May 30, 2016 6:37 AM

thats the reason you dont do that in C (where you do not have control over memory locations) but asm.



#28 SainT ONLINE  

SainT

    Stargunner

  • Topic Starter
  • 1,063 posts
  • Location:Gloucestershire, UK

Posted Mon May 30, 2016 7:34 AM

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. :)

#29 Guitari OFFLINE  

Guitari

    Stargunner

  • 1,718 posts
  • Location:Kent

Posted Mon May 30, 2016 8:48 AM

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, Mon May 30, 2016 8:49 AM.


#30 GadgetUK OFFLINE  

GadgetUK

    Stargunner

  • 1,945 posts
  • Location:UK

Posted Mon May 30, 2016 10:24 AM

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.



#31 sage OFFLINE  

sage

    Dragonstomper

  • 984 posts
  • Location:Germany

Posted Tue May 31, 2016 5:01 AM

tehn it might be easier to add the necessary 200somethign bytes of loader to get a valid rom image, write to SRAM and let the "bios" do the job



#32 SainT ONLINE  

SainT

    Stargunner

  • Topic Starter
  • 1,063 posts
  • Location:Gloucestershire, UK

Posted Wed Jun 1, 2016 12:58 PM

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

 

Lastest menu here --

 

http://atariage.com/...u-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.



#33 Guitari OFFLINE  

Guitari

    Stargunner

  • 1,718 posts
  • Location:Kent

Posted Sun Jun 12, 2016 3:42 AM

In order to expand my homebrew collection as shown in post 3 I headed here http://atariage.com/...-lynx-projects/There's a lynx game list in the blog section too that expanded it even further but I can't find it right now.



#34 Orange-Phantom OFFLINE  

Orange-Phantom

    Star Raider

  • 82 posts
  • Location:Isle of Man

Posted Wed Jun 22, 2016 6:48 AM

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.



#35 SainT ONLINE  

SainT

    Stargunner

  • Topic Starter
  • 1,063 posts
  • Location:Gloucestershire, UK

Posted Wed Jun 22, 2016 4:02 PM

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/r...ower_Factor.php

 

with the 1.6 menu.

 

All works fine.

 

If you still have issues give me a shout.



#36 Orange-Phantom OFFLINE  

Orange-Phantom

    Star Raider

  • 82 posts
  • Location:Isle of Man

Posted Thu Jun 23, 2016 12:39 PM

 

I've just tried this ROM here --

 

http://coolrom.com/r...ower_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.



#37 SainT ONLINE  

SainT

    Stargunner

  • Topic Starter
  • 1,063 posts
  • Location:Gloucestershire, UK

Posted Thu Jun 23, 2016 12:43 PM

 

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!



#38 Shawn Jefferson OFFLINE  

Shawn Jefferson

    Stargunner

  • 1,987 posts
  • Location:Victoria, Canada

Posted Thu Jun 23, 2016 11:25 PM

 

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?



#39 SainT ONLINE  

SainT

    Stargunner

  • Topic Starter
  • 1,063 posts
  • Location:Gloucestershire, UK

Posted Fri Jun 24, 2016 12:14 AM

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


Lol, it's like you read my PM. Yes, I agree completely, it does feel like an uninitialised data thing. :)

#40 GadgetUK OFFLINE  

GadgetUK

    Stargunner

  • 1,945 posts
  • Location:UK

Posted Sat Jun 25, 2016 6:51 AM

Please see the 1.4 menu thread for v1.7 - Power Factor should now work.


Edited by GadgetUK, Sat Jun 25, 2016 6:51 AM.


#41 Emehr OFFLINE  

Emehr

    River Patroller

  • 4,210 posts
  • Happiness is... a chomping Pac-Man!
  • Location:An obscure body in the SK system

Posted Sat Jul 16, 2016 12:41 PM

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.



#42 GadgetUK OFFLINE  

GadgetUK

    Stargunner

  • 1,945 posts
  • Location:UK

Posted Sat Jul 16, 2016 12:47 PM

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.

That game was never dumped properly. Here you go:-

 

https://www.dropbox....Heroes.lnx?dl=0



#43 Emehr OFFLINE  

Emehr

    River Patroller

  • 4,210 posts
  • Happiness is... a chomping Pac-Man!
  • Location:An obscure body in the SK system

Posted Sat Jul 16, 2016 1:16 PM

That game was never dumped properly. Here you go:-

 

https://www.dropbox....Heroes.lnx?dl=0

 

 

Perfect, thanks!



#44 travistouchdown OFFLINE  

travistouchdown

    River Patroller

  • 4,537 posts
  • Do the math!
  • Location:Burlington, Vermont

Posted Thu Jul 28, 2016 8:48 AM

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!



#45 Trew OFFLINE  

Trew

    Chopper Commander

  • 246 posts

Posted Thu Jul 28, 2016 9:03 AM

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.



#46 SainT ONLINE  

SainT

    Stargunner

  • Topic Starter
  • 1,063 posts
  • Location:Gloucestershire, UK

Posted Thu Jul 28, 2016 1:16 PM

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 SD 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.



#47 GadgetUK OFFLINE  

GadgetUK

    Stargunner

  • 1,945 posts
  • Location:UK

Posted Thu Jul 28, 2016 5:33 PM

Are you guys running v1.8?



#48 travistouchdown OFFLINE  

travistouchdown

    River Patroller

  • 4,537 posts
  • Do the math!
  • Location:Burlington, Vermont

Posted Thu Jul 28, 2016 7:38 PM

Are you guys running v1.8?


No 1.6....would that make a difference?

#49 GadgetUK OFFLINE  

GadgetUK

    Stargunner

  • 1,945 posts
  • Location:UK

Posted Fri Jul 29, 2016 1:40 AM

No 1.6....would that make a difference?

Yes, I tested last night with v1.8 and T-Tris works (both version I have load and play).



#50 travistouchdown OFFLINE  

travistouchdown

    River Patroller

  • 4,537 posts
  • Do the math!
  • Location:Burlington, Vermont

Posted Fri Jul 29, 2016 7:24 PM

T-tris works with 1.6. it's the "Tetris" ROM that doesn't work.




0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users