Jump to content
IGNORED

T-Tris - EEPROM support


xhul

Recommended Posts

Welcome =]

 

Recently, i started testing some ROMs from my collection.
And there's that T-Tris ROM i have: https://atarigamer.com/lynx/game/TTris/304228065
It works fine, except the highscores aren't saved.

 

It's a .lnx, but strangely, it has no header.
Also, it has a pretty unusual size of 15914 bytes.

 

At first, i thought the absence of a header was the reason, since there's no EEPROM specification.
So, i manually injected a header, specifying a 93C46 type EEPROM.
But when i do that, the game fails to boot ("INSERT GAME" syndrom).
I also tried to arbitrarily increase the size to 512K (header excluded), but that doesn't change anything.

 

Any suggestion?
Thanks in advance for your time.

Edited by xhul
Link to comment
Share on other sites

13 minutes ago, SainT said:

If you are getting insert game after after adding a header, you've done something wrong, as that means the ROM is corrupt.

 

How are you adding the header? And what is file extension of the image you are booting?

Thanks for the reply.

 

I first tried to inject the 64 bytes manually, without changing the file extension (still .LNX).

Since it didn't work, i tried using the MAKE_LNX.EXE that comes with handy (first had to change the file extension to .LYX of course, and increase the data size otherwise it returned a size error).

The result is the same on both attempts.

 

So yeah, i'm probably doing something wrong.

Probably because i assumed that a LNX is nothing more than a LYX with a header, and potentially some extra bytes (so that the data size is a power of 2).

Isn't it the case?

Link to comment
Share on other sites

Given the filesize and the fact it doesn't boot after adding a header my guess is the file you have is actually not a ROM image, so adding a LNX header isn't going to make it run. The loader on the Lynx also recognises other formats used by things like the BLL loader. It's possible to make a ROM image by adding some additional code to the beginning of the object file (which is what the LynxGD does internally), but I'm not sure if there are tools to do this available, there may well be.

Link to comment
Share on other sites

13 hours ago, xhul said:

Welcome =]

 

Recently, i started testing some ROMs from my collection.
And there's that T-Tris ROM i have: https://atarigamer.com/lynx/game/TTris/304228065
It works fine, except the highscores aren't saved.

 

It's a .lnx, but strangely, it has no header.
Also, it has a pretty unusual size of 15914 bytes.

 

At first, i thought the absence of a header was the reason, since there's no EEPROM specification.
So, i manually injected a header, specifying a 93C46 type EEPROM.
But when i do that, the game fails to boot ("INSERT GAME" syndrom).
I also tried to arbitrarily increase the size to 512K (header excluded), but that doesn't change anything.

 

Any suggestion?
Thanks in advance for your time.

The header file is not seen by the Lynx. You cannot modify the code by changing the header. Headerless files are either rom images usually with the extension LYX. Or they can be loadable files with the extension O. The loadable files can be uploaded using ComLynx to RAM. But you need a cart that has the ability to use a loader.

Link to comment
Share on other sites

On 2/13/2023 at 10:29 AM, SainT said:

Given the filesize and the fact it doesn't boot after adding a header my guess is the file you have is actually not a ROM image, so adding a LNX header isn't going to make it run. The loader on the Lynx also recognises other formats used by things like the BLL loader. It's possible to make a ROM image by adding some additional code to the beginning of the object file (which is what the LynxGD does internally), but I'm not sure if there are tools to do this available, there may well be.

Thanks a lot, i'll try to see if i can find a way to add that additional code.

On 2/13/2023 at 1:34 PM, karri said:

The header file is not seen by the Lynx. You cannot modify the code by changing the header.

Thanks for the reply.

I never intended to modify the code itself, since it supposedly already includes some interactions with an EEPROM.

The only reason why i need a header is for the GD code to actually redirect those interactions to a .e2p file on the micro SD.

On 2/13/2023 at 1:34 PM, karri said:

Headerless files are either rom images usually with the extension LYX. Or they can be loadable files with the extension O. The loadable files can be uploaded using ComLynx to RAM. But you need a cart that has the ability to use a loader.

The file i have is probably a loadable then.

I guess i need to convert it to a .LYX first (assuming it's possible), and then to a LNX afterwards (so that the GD code can do its thing).

Link to comment
Share on other sites

18 minutes ago, xhul said:

I guess i need to convert it to a .LYX first (assuming it's possible), and then to a LNX afterwards (so that the GD code can do its thing).

If it is a .O file you need to swap the BLL header with a cart loader. The easiest way is to compile a simple "Hello World" and extract the 52 byte encrypted loader and the first 8 bytes which load in the game.

 

But then you also need to find out the start address from the BLL header and set it into the first directory entry in the new cart header.

There may be some conversion software that does it. Or just study it and write a small script in Python that does this.

Link to comment
Share on other sites

Finally managed to make the .e2p files successfully generated on the GD.

For the record, i used https://atarigamer.com/lynx/lnx2lyx to go from O to LYX, then MAKE_LNX.EXE (from handy) to go from LYX to LNX, and finally set byte $3C to $01.

Would have been of course faster if the file didn't have the wrong extension to begin with.

Thanks everybody for the precious guidelines =]

  • Like 1
Link to comment
Share on other sites

  • 3 months later...
On 2/12/2023 at 3:19 PM, xhul said:

Welcome =]

 

Recently, i started testing some ROMs from my collection.
And there's that T-Tris ROM i have: https://atarigamer.com/lynx/game/TTris/304228065
It works fine, except the highscores aren't saved.

 

It's a .lnx, but strangely, it has no header.
Also, it has a pretty unusual size of 15914 bytes.

 

At first, i thought the absence of a header was the reason, since there's no EEPROM specification.
So, i manually injected a header, specifying a 93C46 type EEPROM.
But when i do that, the game fails to boot ("INSERT GAME" syndrom).
I also tried to arbitrarily increase the size to 512K (header excluded), but that doesn't change anything.

 

Any suggestion?
Thanks in advance for your time.

Wait, are high scores supposed to be saved on the Lynx GD?

Link to comment
Share on other sites

1 hour ago, tripled79 said:

Wait, are high scores supposed to be saved on the Lynx GD?

When the ROM code interacts with EEPROM, and it's properly specified in the LNX header, the GD basically simulates the reads/writes on a dedicated .e2p file on the micro-SD (similarly to the .eeprom file generated by Handy 0.98-alt).

Regarding T-Tris specifically, there are at least 2 different ROMs, one that saves highscores to EEPROM, and an other that doesn't.

So yes, as long as you have the right ROM of the 2, highscores are automatically saved on the GD.

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

On 6/11/2023 at 10:45 AM, xhul said:

When the ROM code interacts with EEPROM, and it's properly specified in the LNX header, the GD basically simulates the reads/writes on a dedicated .e2p file on the micro-SD (similarly to the .eeprom file generated by Handy 0.98-alt).

Regarding T-Tris specifically, there are at least 2 different ROMs, one that saves highscores to EEPROM, and an other that doesn't.

So yes, as long as you have the right ROM of the 2, highscores are automatically saved on the GD.

What if I have T-Tris on cart?

Link to comment
Share on other sites

I have a few T-Tris carts, one doesn't have the eeprom on the cart, but when I dumped them, they are exactly the same.

I never had any luck editing the headers to get any eeprom games working with the GameDrive, but with Elcheapo, works fine, You can also pause the game and turn off the Lynx, next time you start it up, you can resume the game where you left off.

My guess is that the roms floating around the net are bad dumps if they aren't working correctly.

 

Link to comment
Share on other sites

You just need to set the eeprom bit in the header, that’s it.

 

elcheapo doesn’t support any other save features, so it always has eeprom enabled regardless of the header. In fact it’s a physical eeprom attached to the cart port, it’s not possible to disable it.

 

IIRC you can press option1 or 2 on a lnx file to see what header options are set.

Edited by SainT
Link to comment
Share on other sites

 

11 hours ago, thefred said:

My guess is that the roms floating around the net are bad dumps if they aren't working correctly.

Both ROMs do work correctly, actually.

It's just that the one with EEPROM support isn't in the proper format to enable EEPROM interaction simulation on the GD, and also has a wrong file extension (.LNX but .O in reality).

So it's required to convert it from .O to .LYX, then from .LYX to .LNX, after what you manually set byte $3C to $01, like SainT just suggested.

But once you did that, it works fine on the GD =]

11 hours ago, thefred said:

with Elcheapo, You can also pause the game and turn off the Lynx, next time you start it up, you can resume the game where you left off.

Interesting, does that means it uses custom interrupts?

Cause that's something i've been wanting to suggest for the GD as well, just in a more flexible way (save states basically).

Edited by xhul
Link to comment
Share on other sites

10 hours ago, xhul said:

 

Interesting, does that means it uses custom interrupts?

Cause that's something i've been wanting to suggest for the GD as well, just in a more flexible way (save states basically).

T-Tris uses the eeprom to save where you are when you pause it. It is the game doing it not the flash cart.

It resumes when you load the game again, not power on the Lynx. That is what I meant when I said start it up. sorry for the confusion. 

 

I have never had any luck editing the header, I have used a few different hex editors, after I change they bytes the games don't load on the GD. 

Currently I have firmware 1.05 I'll try 1.06 but I don't think the update had anything to do with eeprom.

Link to comment
Share on other sites

4 minutes ago, thefred said:

I have never had any luck editing the header, I have used a few different hex editors, after I change they bytes the games don't load on the GD. 

Currently I have firmware 1.05 I'll try 1.06 but I don't think the update had anything to do with eeprom.

1.06 was to do with the BennVenn LCD mod failing on specific Lynx2's with the GD, this fixed the issue.

 

For the EEPROM support it's the byte at offset $3C, change the value at this offset to 1 for a standard EEPROM. You should be able to verify this by hitting OPT1 (or 2) on the game in the menu as I remember. It should say what the game size is and what EEPROM / GD support is enabled.

Link to comment
Share on other sites

2 hours ago, thefred said:

T-Tris uses the eeprom to save where you are when you pause it. It is the game doing it not the flash cart.

It resumes when you load the game again, not power on the Lynx. That is what I meant when I said start it up. sorry for the confusion. 

 

I have never had any luck editing the header, I have used a few different hex editors, after I change they bytes the games don't load on the GD. 

Currently I have firmware 1.05 I'll try 1.06 but I don't think the update had anything to do with eeprom.

Oh, i see, so it basically has a dedicated EEPROM that's used as if the ROM was on a "real" cart, makes sense.

 

About hex-editing the file, if it still doesn't work, it could be that you have a wrong format, to summarise:

 

If the first 2 bytes of the file are $4C,$59, it's a .LNX, you can edit byte $3C right away (like SainT just said, changing it from $00 to $01 should work in most cases).

If the first 2 bytes are $80,$08, it's a .O, you first need to use https://atarigamer.com/lynx/lnx2lyx, then MAKE_LNX.EXE (available in Handy emulator archive), before editing.

If the first 2 bytes are none of the above, it's a probably a .LYX, just use MAKE_LNX.EXE (available in Handy emulator archive), before editing.

  • Like 2
Link to comment
Share on other sites

  • 6 months later...

Instructions manual mentions that you can pause the game, turn off handheld, boot up game later and resume right where you left off. I tried it on the 2 "known" roms that have been kicking around (removed bll header, converted to lnx, added eeprom header, high scores are persistent with 1) but it always starts a new game instead of "reloading" the paused 1P game.

 

Wondering if it's the Handy emulator or if these are older "beta" releases that didn't have this feature.

Link to comment
Share on other sites

Posted (edited)
On 12/30/2023 at 6:12 PM, dropbean said:

Instructions manual mentions that you can pause the game, turn off handheld, boot up game later and resume right where you left off. I tried it on the 2 "known" roms that have been kicking around (removed bll header, converted to lnx, added eeprom header, high scores are persistent with 1) but it always starts a new game instead of "reloading" the paused 1P game.

 

Wondering if it's the Handy emulator or if these are older "beta" releases that didn't have this feature.

You're gonna need Handy 0.98 to be able to simulate EEPROM read|write.

https://forums.atariage.com/topic/305507-handy-latest-version-098-for-windows-eeprom-support-new-backgrounds/

Edited by xhul
Link to comment
Share on other sites

On 1/2/2024 at 1:16 AM, dropbean said:

I'm using the Retroarch libretro Handy core.

https://github.com/libretro/libretro-handy

 

It does support EEPROM reads / writes with several other games I've tried, including the T-Tris high score feature (shutdown, restart, previous best score is there).

 

Just that Pause feature I'd like to check out.

My bad, i guess i read you too fast.

I haven't tried the "continue" feature on my ROM, i'll check it ASAP.

 

Like you said, it could be that the concerned ROM simply doesn't have it implemented.

Or maybe the continue point is actually saved in RAM instead.

That's of course assuming the RAM can somehow stay powered when the unit is turned off, as long as the batteries stay in, or the power cable isn't removed.

At least that could explain why it doesn't work on emulators, if they wipe the simulated RAM at each boot.

Link to comment
Share on other sites

On 1/2/2024 at 1:16 AM, dropbean said:

I'm using the Retroarch libretro Handy core.

https://github.com/libretro/libretro-handy

 

It does support EEPROM reads / writes with several other games I've tried, including the T-Tris high score feature (shutdown, restart, previous best score is there).

 

Just that Pause feature I'd like to check out.

You have to turn off while paused.

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