KBD2 / terrario

Terraria rewrite for the FX-9860G/II
Other
30 stars 3 forks source link

Fx-9860 GIII #1

Open PhantomOverrideAlpha opened 4 years ago

PhantomOverrideAlpha commented 4 years ago

It just keeps reseting mycsio fx-9860 GIII could you make a compatible version for my calculator or give me a file that is compatiable

PhantomOverrideAlpha commented 4 years ago

You can email me @ Samuel.es.johnson@gmail.com

KBD2 commented 4 years ago

Hi, thanks for notifying me. The problem is that to store the world in memory, Terrario uses 250kB of RAM that is available on the GII model but not the GIII. This can be fixed by instead using 30kB of the GIII heap, which means the world is quite a bit smaller. I've attached a build that uses the heap. I don't have a GIII, so if you could confirm the build works that'd be great. If it does work, I'll look into adding a build for the GIII in each future release. Terrario.zip

PhantomOverrideAlpha commented 4 years ago

Ok so it kind of works it starts loading for about 5 seconds and then it resets the Calculator i am not sure why that is

KBD2 commented 4 years ago

Strange, that build works on both my GII and another tester's GIII. I'll have another look when I can, but there's no reason it shouldn't run.

PhantomOverrideAlpha commented 4 years ago

What is The OS version of the other testers Calculator

PhantomOverrideAlpha commented 4 years ago

I also have A Casio fx-9750 GIII if you have a way to make it compatible with that since the Casio fx-9750 GIII can and will accept addins in the SH4A format

PhantomOverrideAlpha commented 4 years ago

I tested it on my Casio fx 9860 GII and it worked but not on my Casio Fx 9860 GIII and Casio Fx-9750GIII

lephe commented 4 years ago

The build from https://github.com/KBD2/terrario/issues/1#issuecomment-686358607 crashes on my Graph 35+E II (French fx-9860G III) too, with an address error at 801ebbac, which is really close to the malloc() code on my OS version (3.10).

PhantomOverrideAlpha commented 4 years ago

Ok so how do we fix that and is there any chance that we could ake it work on a Casio Fx-9750 GIII also my Os is 3.10 too And is there a way to make it work on a casio FX-9750GIII

KBD2 commented 4 years ago

Try this build, I identified a possible cause. I forgot to remove a RAM test that wrote to the inaccessible memory. Terrario.zip

PhantomOverrideAlpha commented 4 years ago

Ok it giveing me a error. is the malloc command non compatiable

PhantomOverrideAlpha commented 4 years ago

is there another command you can use instead of Malloc and how about trying to save the game to storage memory (Rom)

KBD2 commented 4 years ago

Which error is it giving you? The game uses gint's functions for everything including malloc, which should all be compatible with the 9750GIII. The game is saved to storage memory, but when you're playing it has to be loaded into RAM for performance reasons.

PhantomOverrideAlpha commented 4 years ago

801ebbac same as the other tester

KBD2 commented 4 years ago

Can you try this one? It has all the storage memory calls stripped out, just in case they're what's causing it. I'm really just grasping at straws here, because I don't know why malloc would be causing the problem, and it's the only way I can make the game work on the 9750GIII. Terrario.zip

PhantomOverrideAlpha commented 4 years ago

thats not it because it just back to reseting it do you have a reboot command in the code that is causing it?but there is no error now then its probaly not the malloc command and it might be a error for another command

KBD2 commented 4 years ago

Nope, no reboots that could be reached just by starting the game. Without a calculator to test on, I can't really do anything to fix all the errors and reboots. The errors stopping without BFile calls mean the game isn't really playable anyway without the ability to save the game. This will probably have to wait until the gint runtime is fully compatible with the fx9750GIII.

PhantomOverrideAlpha commented 4 years ago

so is there another way to save the game

KBD2 commented 4 years ago

No, the BFile calls are the only way to interface with the storage memory. I might be able to ask later tonight about if any native fx9860GII addins are compatible with the fx9750GIII right now, or if this is the first to try which would explain all the issues it has.

PhantomOverrideAlpha commented 4 years ago

what if we compile another addin to create a save file to and then run the terraio file

KBD2 commented 4 years ago

Again, this would require that I have an fx9750GIII. Not actually having a way to test on it means I'm very handicapped for making this game work on the GIII, especially without much documentation on the exact differences between the two models that I could use to make the game compatible.

PhantomOverrideAlpha commented 4 years ago

there is 1 that i know of it is bazzoka here is the file maybe we could save th worlds inside of the g1a file https://www.planet-casio.com/Fr/programmes/programme865-last-bazzzooka-bebe-vador-a7.html

PhantomOverrideAlpha commented 4 years ago

that file i have on my calculator and it saves

KBD2 commented 4 years ago

That game is much simpler and doesn't use the gint runtime, which is why it's a lot more likely to be compatible. I can't do anything else here without having a physical calculator or emulator to test on.

PhantomOverrideAlpha commented 4 years ago

yeah but i also have calc city and it a little more complex here is the file

Archive.zip

PhantomOverrideAlpha commented 4 years ago

it save as a .dat and the map file saves as a file .map file instead of in game which could be a possiblity maybe with terraio maybe we could try and do something like that

KBD2 commented 4 years ago

Terrario already uses .dat files to save the world, and Calc City definitely loads that save file into RAM when you're playing the game. I can't do anything more than try to use malloc, because I can't actually test the game myself.

PhantomOverrideAlpha commented 4 years ago

can you give me a test dat file for a little theory i have

PhantomOverrideAlpha commented 4 years ago

i also am more than willing to help you make it compatible since i do have both calculators just email me @ samuel.es.johnson@gmail.com whenever you need me to test things.

KBD2 commented 4 years ago

Here's a save game and addin build that would in theory work with the GIII. game.zip Fixing all the crashes over a GitHub issue or email (and we don't even know if they're all fixable) isn't really feasible, since it would involve dozens of builds and debug displays to fix things.

PhantomOverrideAlpha commented 4 years ago

did you take out the command that makes the save files?

KBD2 commented 4 years ago

Not in that build, because you need it to load the game save.

PhantomOverrideAlpha commented 4 years ago

ok i was just checking

PhantomOverrideAlpha commented 4 years ago

ok so now it just keeps loading so we are getting somewhere

PhantomOverrideAlpha commented 4 years ago

how much ram memory does the game take up

KBD2 commented 4 years ago

That build uses 30kB of RAM for the world data, and probably around 35-40kB at peak to store everything it uses the heap for.

PhantomOverrideAlpha commented 4 years ago

is there a way to transfer the files not being used to the storage memory because i think that is our problem

KBD2 commented 4 years ago

There aren't any 'files' being used, it's all buffers and structs, and they're all used. 30kB is well within what the heap can hold, that's not the issue.

PhantomOverrideAlpha commented 4 years ago

ok hold on i have a idea

PhantomOverrideAlpha commented 4 years ago

it did not work i tried resting my calc and running the game

PhantomOverrideAlpha commented 4 years ago

i am going to reserach and find out more about the diffrencs and get back to you tommorw ok

PhantomOverrideAlpha commented 4 years ago

did you examine the code and try and use the same sequence as calc city

PhantomOverrideAlpha commented 4 years ago

saving sequence

KBD2 commented 4 years ago

I don't have the source code for that game. The internal structure of the save files are very different, Calc City's save sequence wouldn't work for Terrario.

PhantomOverrideAlpha commented 4 years ago

ok well we can work more on th\is once have had a chance to compare the code also here ftune for SH4A Ftune.zip

PhantomOverrideAlpha commented 4 years ago

if that helps you with diffrent commands for sh3 to SH4A

KBD2 commented 4 years ago

The 9860GII and 9750GIII both use SH4A - in fact, Terrario isn't supported on SH3 calculators.

PhantomOverrideAlpha commented 4 years ago

i ment to say SH4 do you see any major code differences

KBD2 commented 4 years ago

There is no 'SH4', only SH4A. SH4 is just the shortened term

PhantomOverrideAlpha commented 4 years ago

thought power graphic 2 ran on sh4 but that amkes sense