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

KBD2 commented 4 years ago

No, SH4A. It also doesn't change much in the source code, the only incompatibilities are with keyboard functions.

PhantomOverrideAlpha commented 4 years ago

do you see any diffrence from 3.10(GIII) OS to 2.09 os (GII)

KBD2 commented 4 years ago

https://www.planet-casio.com/Fr/forums/topic15699-1-test-de-la-graph-35e-ii-partie-1-applications.html

PhantomOverrideAlpha commented 4 years ago

is the problem the amount of pixels? and memeory

KBD2 commented 4 years ago

No, I don't know what the problem is. It's likely to do with malloc but I have no idea why.

PhantomOverrideAlpha commented 4 years ago

Screenshot 2020-09-05 at 7 57 56 PM look

PhantomOverrideAlpha commented 4 years ago

is there a replacement command for malloc

KBD2 commented 4 years ago

That's a different model calculator, not the 9750GIII... No, there's no replacement function.

PhantomOverrideAlpha commented 4 years ago

No that is the techinal name in french for the casio fx 9750 GII

PhantomOverrideAlpha commented 4 years ago

cant you use the free command?

KBD2 commented 4 years ago

I know the Graph 35+E II is the fx9750GIII equivalent. It has a display size of 128x64 pixels, the same as the fx9860GII.

Are you sure you know what you're talking about? The free command is for releasing a block of allocated memory.

PhantomOverrideAlpha commented 4 years ago

sorry but in all reality there has to be a longer and yes but i thought you could use that as a replacement or aleast that was what i was told is that wrong

KBD2 commented 4 years ago

https://en.cppreference.com/w/c/memory/malloc Here is how the malloc function is used.

PhantomOverrideAlpha commented 4 years ago

ok so free still had something to do with malloc it just wsnt what i was told

PhantomOverrideAlpha commented 4 years ago

so what command does calc city use and did the ftune file help you

KBD2 commented 4 years ago

Calc City most likely allocates memory for the map, loads the map from file into the memory, then does the opposite when saving the game.

PhantomOverrideAlpha commented 4 years ago

is there a way we can do that

KBD2 commented 4 years ago

That's what Terrario already does.

PhantomOverrideAlpha commented 4 years ago

so what could possibly be the problem

KBD2 commented 4 years ago

I don't know, and I can't find out without having a GIII.

PhantomOverrideAlpha commented 4 years ago

am about to compare the two codes real quick

PhantomOverrideAlpha commented 4 years ago

how does the terrario code start out

PhantomOverrideAlpha commented 4 years ago

how about you try this just to test it switch all the saving over to the storage memory and run everything off of storage memory

KBD2 commented 4 years ago

We've already established the BFile functions don't work. Additionally, as already explained I can't stream everything out of the storage memory because it's very slow. It would also require a massive amount of work for something that wouldn't pay off.

PhantomOverrideAlpha commented 4 years ago

ok i am going to do some research on this and post a thread on the universal casio forum to see if anybody can find a way to fix this probelm if you dont mind .do you mind?

KBD2 commented 4 years ago

Go ahead, I'm out of ideas. Remember that Terrario uses something called gint, which makes it different from most addins (you should probably mention it if you make a post).

PhantomOverrideAlpha commented 4 years ago

ok here is the link to the post https://community.casiocalc.org/topic/8021-help-making-terrario-compatiable/?p=63477

lephe commented 4 years ago

This will probably have to wait until the gint runtime is fully compatible with the fx9750GIII.

Quick reminders. The fx-9860G III, fx-9750G III and Graph 35+E II all have the same ROM size, same applications, and they all support Python. Supporting Python is the key to the heap, because Python is the biggest heap user of them all. Try to run Critor's Python heap memory estimator first to determine the amount of heap memory available to the user. The only documented differences between the fx-9750G III and the fx-9860G III are the unsupported Python drawing modules and a stricter examination mode.

Secondly, the Graph 35+E II has a different display than the previous GII series. The difference is not in pixel size, nor in surface, it's in protocol. You can see the differences in gint's T6K11 driver. A good way to tell if the screen is the problem is as follows: a crash/reboot will immediately restart the calculator without you needing to do anything, but a screen protocol failure will blank out the screen without rebooting, forcing you to press the RESET button to go back to the main menu.

And finally, I only have a Graph 35+E II so I have never tested my applications on international GIII models. If you suspect the problem is with gint itself, please build and run gint's testing application gintctl and try to spot any problem here. I can walk you through it. I would appreciate bug reports in gint's repository. The SH3/SH4 difference is most likely irrelevant since all these machines are SH4 and gint is binary-compatible with both anyway.

As KBD2 mentioned, there is practically no way that malloc() is completely broken or that using it the way Terrario does is incorrect. I'll try the builds in this issue on my Graph 35+E II later and report back.

PhantomOverrideAlpha commented 4 years ago

OK thank you

PhantomOverrideAlpha commented 4 years ago

anybody found out anything or anything i can do to help

PhantomOverrideAlpha commented 4 years ago

So where are we at on compiling a version that is compatible with the casio fx-9750 GIII and what did your tests do.

PhantomOverrideAlpha commented 4 years ago

found a link that might help but i can't read french so you will have to tell me if it helps https://www.planet-casio.com/Fr/forums/topic13572-1-gint-un-noyau-pour-developper-des-add-ins.htmlthe way i am viewing it i wont allow me to translate it here is a file that came along wth the site gintdemo-13572.zip

KBD2 commented 4 years ago

lephe is the developer of gint, I'm guessing he knows a fair bit about it already.

PhantomOverrideAlpha commented 4 years ago

oh i did not know that he was the same person on planet casio

PhantomOverrideAlpha commented 4 years ago

I have summoned more help but i am waitng for them to get back with me one specializes in addins and assemby and another has made some addins for the Casio fx-9860 GIII and the Casio fx-9750GIII

lephe commented 4 years ago

Here's a recap of all the builds on the Graph 35+E II OS 3.10.

So not a lot to blame on BFile I suppose, which is for the better because debugging gint's BFile and return-to-menu is always 10x harder than anything else.

@KBD2 I'd like to build and do some debugging myself, so I'll have to build a new toolchain with newlib support (I've had significant issues with it in the past so I dropped it at some point). In the meantime...

KBD2 commented 4 years ago

I've already implemented malloc() NULL checks, but I'll fix the other issues.

KBD2 commented 4 years ago

Newest commit should have fixed the issues you noted.

PhantomOverrideAlpha commented 4 years ago

ok i will test it right now

PhantomOverrideAlpha commented 4 years ago

are we going to compile a test file that i can test on my 9750 GIII and or 9860GIII

KBD2 commented 4 years ago

Here's a build from the latest commit that uses the heap, though I doubt anything will have changed. Terrario.zip

lephe commented 4 years ago

Same error indeed. This is an interesting situation.

PhantomOverrideAlpha commented 4 years ago

yeah i got the same error too

PhantomOverrideAlpha commented 4 years ago

could we be looking at this the wrong way

PhantomOverrideAlpha commented 4 years ago

is there a emulator for the casio fx-9750GIII

PhantomOverrideAlpha commented 4 years ago

I was reading and i came across a article on Planete Casio that said if the addin uses any getkey function otherthan getkey or getkey wait syscall will not work also check out mennos addins as all of his addins when ran through the SH3 to SH4 compatibilty tool worked

PhantomOverrideAlpha commented 4 years ago

here is the link to the article https://www.planet-casio.com/Fr/forums/topic11632--.html scroll to bottom and read comments

KBD2 commented 4 years ago

As previously stated, Terrario is designed for SH4 calculators and doesn't need the compatibility tool (gint has its own keyboard interface so avoids the getkey problem). There is an emulator for the fx9860G SD but no other fx model.

PhantomOverrideAlpha commented 4 years ago

Ok so what are we going to do are we leaving the issue open so we can find out more or should i open up a thread on the universal casio forum to discuss it more there and close this thread

lephe commented 4 years ago

I had to spend some time building a new toolchain with newlib, because Memallox's port does not actually support m4-nofpu as a multilib target (the newlib floating-point code wasn't extended with that in mind), and that target is included in my normal setup. It took me some time to troubleshoot the details... then rebuild the toolchain, reinstall gint and the libraries.

I was able to build a basic version of Terrario that worked as expected on the fx-9860G II and failed as expected on the Graph 35+E II. Next comes the actual debugging (finally).