GadgetUK Posted May 30, 2016 Share Posted May 30, 2016 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 << ) || (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;} Quote Link to comment Share on other sites More sharing options...
sage Posted May 30, 2016 Share Posted May 30, 2016 thats the reason you dont do that in C (where you do not have control over memory locations) but asm. 1 Quote Link to comment Share on other sites More sharing options...
SainT Posted May 30, 2016 Author Share Posted May 30, 2016 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. 1 Quote Link to comment Share on other sites More sharing options...
Guitari Posted May 30, 2016 Share Posted May 30, 2016 (edited) 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 May 30, 2016 by Guitari 2 Quote Link to comment Share on other sites More sharing options...
GadgetUK Posted May 30, 2016 Share Posted May 30, 2016 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. 2 Quote Link to comment Share on other sites More sharing options...
sage Posted May 31, 2016 Share Posted May 31, 2016 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 2 Quote Link to comment Share on other sites More sharing options...
SainT Posted June 1, 2016 Author Share Posted June 1, 2016 (edited) 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 October 25, 2019 by SainT 1 Quote Link to comment Share on other sites More sharing options...
Guitari Posted June 12, 2016 Share Posted June 12, 2016 In order to expand my homebrew collection as shown in post 3 I headed here http://atariage.com/forums/topic/151888-current-atari-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. Quote Link to comment Share on other sites More sharing options...
Orange-Phantom Posted June 22, 2016 Share Posted June 22, 2016 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. Quote Link to comment Share on other sites More sharing options...
SainT Posted June 22, 2016 Author Share Posted June 22, 2016 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. Quote Link to comment Share on other sites More sharing options...
Orange-Phantom Posted June 23, 2016 Share Posted June 23, 2016 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. 1 Quote Link to comment Share on other sites More sharing options...
SainT Posted June 23, 2016 Author Share Posted June 23, 2016 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! Quote Link to comment Share on other sites More sharing options...
Shawn Jefferson Posted June 24, 2016 Share Posted June 24, 2016 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? 1 Quote Link to comment Share on other sites More sharing options...
SainT Posted June 24, 2016 Author Share Posted June 24, 2016 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. 1 Quote Link to comment Share on other sites More sharing options...
GadgetUK Posted June 25, 2016 Share Posted June 25, 2016 (edited) Please see the 1.4 menu thread for v1.7 - Power Factor should now work. Edited June 25, 2016 by GadgetUK 1 Quote Link to comment Share on other sites More sharing options...
Emehr Posted July 16, 2016 Share Posted July 16, 2016 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. 1 Quote Link to comment Share on other sites More sharing options...
GadgetUK Posted July 16, 2016 Share Posted July 16, 2016 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.com/s/l83ucfq4fq9qoeg/Baseball%20Heroes.lnx?dl=0 4 Quote Link to comment Share on other sites More sharing options...
Emehr Posted July 16, 2016 Share Posted July 16, 2016 That game was never dumped properly. Here you go:- https://www.dropbox.com/s/l83ucfq4fq9qoeg/Baseball%20Heroes.lnx?dl=0 Perfect, thanks! Quote Link to comment Share on other sites More sharing options...
Rick Dangerous Posted July 28, 2016 Share Posted July 28, 2016 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! Quote Link to comment Share on other sites More sharing options...
Trew Posted July 28, 2016 Share Posted July 28, 2016 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. 1 Quote Link to comment Share on other sites More sharing options...
SainT Posted July 28, 2016 Author Share Posted July 28, 2016 (edited) 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 October 25, 2019 by SainT 1 Quote Link to comment Share on other sites More sharing options...
GadgetUK Posted July 28, 2016 Share Posted July 28, 2016 Are you guys running v1.8? Quote Link to comment Share on other sites More sharing options...
Rick Dangerous Posted July 29, 2016 Share Posted July 29, 2016 Are you guys running v1.8? No 1.6....would that make a difference? Quote Link to comment Share on other sites More sharing options...
GadgetUK Posted July 29, 2016 Share Posted July 29, 2016 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). Quote Link to comment Share on other sites More sharing options...
Rick Dangerous Posted July 30, 2016 Share Posted July 30, 2016 T-tris works with 1.6. it's the "Tetris" ROM that doesn't work. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.