Jump to content



Photo
- - - - -

AFX2 BASIC FILES


  • Please log in to reply
6 replies to this topic

#1 2072

2072

    Casio over god

  • Admin
  • PipPipPipPipPipPipPipPip
  • 1550 posts
  • Gender:Male
  • Location:Somewherebourg
  • Interests:Cinema, Programming, Music and a lot of thing...

  • Calculators:
    AFX2 ROM 1.02, CFX-9940GT+, FX-180P-Plus

Posted 03 September 2002 - 01:30 AM

Well I am attempting to directly create basic files in memory from a C program (to implement it to my basic files access routines).

everybody knows the structure of a basic files is:

- size (2 bytes)
- 0x01 (control character for basic file)
- name + password (8 + 8 bytes)
- 2 bytes (base...)
- data (size - 24 bytes)
- a NULL char
- size (2 bytes again)

(the size is at start and at end because the calc cover the memory in two directions).

IMPORTANT NOTE: almost each other type of data has a different control character (0x01 for the basic file, 0x05 for the lists) but it follows a similar structure than the b files. These memory zone are placed in order of control characters (if this order isn't respected the calc just crash).
To create a basic file or another of these memory zone is almost the same...

Well at fisrt I thought that we simply had to add such a structure at the right place to create a new basic file (or new zone) but it's wrong: if I do so, the new b file doesn't appear in the list and its size doesn't appear in basic prog total size in the system menu but it is yet counted as used memory so the calc detect it but "doesn't know that it exists".

After a lot of tests and experiments I was driven to the conclusion that it must be, somewhere, in the memory an area where is stored the current state of the main user memory (memry after 0x1c20:A).

After several hours (I will not decribe the way I found it, unless you ask me ;-) ) I found that this area is placed at 0x1BF2:D till 1BF8:2, I tried to damage it to see its influence: by replacing all the bytes of this zone by a single character for example "F" (not 0xFF) I returned to the system menu and see that there was 0 byte free whereas there was nothing in the memory ! So that's it, we can call it the "MAT" (Memory Allocation Table).

But for now I'm unable to understand its format: As soon as a new zone is created (by using the run mode or creating a list or a b file...) the entire MAT change ! We can see that some offset increase with the total zone number but it is really strange (try yourself using TOUCHE memory viewer and do not forget to use the cursor mode (pressing C viewing the memory) to check a particular offset value).


So I request your help to find out what this MAT format is exactly so we can dynamicaly create basic files and use the memory that appears in the system menu for program who have an Icon in the main menu, I discovered how to do it too, it's the same thing that the b files but the control character is 0x0C, and the "0x03FNAME" zone (right after the basic files) is used to do so: it contains the name of the last program executed from the main menu and enable programs to create a 0x0C zone with the name after the 0x03FNAME (I'm absolutely sure about that, I have done severals experiences that prove that, just ask me if you want details).


Well take a look to the MAT if you have time because I can't figure it out. :(


PS: During my experiments I found several zones that were not cleared after a whole reset : 1BE2:3 -> 1BE3:F and 1BE8:D -> 1BF1:F.

#2 rjstephens

rjstephens

    Casio Freak

  • Members
  • PipPipPipPip
  • 239 posts
  • Location:Brisbane, Queensland, Australia

  • Calculators:
    CFX9850GB+

Posted 04 September 2002 - 08:17 AM

how did you find the MAT adress

#3 2072

2072

    Casio over god

  • Admin
  • PipPipPipPipPipPipPipPip
  • 1550 posts
  • Gender:Male
  • Location:Somewherebourg
  • Interests:Cinema, Programming, Music and a lot of thing...

  • Calculators:
    AFX2 ROM 1.02, CFX-9940GT+, FX-180P-Plus

Posted 07 September 2002 - 12:52 PM

Don't worry I've found everything I need myself, thank you very much for all your precious help and enthusiasm...

I will probably release a tutorial about these memory zone and their MAT.



rjstephens: I found it looking differencies of memory backups I downloaded with FX-interface and actually found that there is a special area in these backups call "RAMI" that is this MAT, and I proved it trying filling this area with anything and see that the system menu of the calc was telling very strange thing like: "0 byte free" whereas the mem was empty...

#4 2072

2072

    Casio over god

  • Admin
  • PipPipPipPipPipPipPipPip
  • 1550 posts
  • Gender:Male
  • Location:Somewherebourg
  • Interests:Cinema, Programming, Music and a lot of thing...

  • Calculators:
    AFX2 ROM 1.02, CFX-9940GT+, FX-180P-Plus

Posted 08 September 2002 - 08:39 AM

IT'S WORKING !!!!!!!!!!!!


Yes now I can create basic files directly form TOUCHE without memory error at all.

And any programer will be able to do the same using my Basic libs 2.0 (should be release soon - I have the help to complete).

No more "you must create a basic file of ## bytes" any more !!


I think that THIS is a good piece of news ! Isn't it ?

#5 Roeoender

Roeoender

    UCF ASM/C Programming Only Winner

  • [Legends]
  • PipPipPipPip
  • 273 posts
  • Gender:Male
  • Location:Gdynia, Poland
  • Interests:Technical University student (informatics)
    Interests:
    Sport climbing
    Orieenting (100km walk in 23h31min)
    C/Asm on calculators

    Dislike cars

  • Calculators:
    CASIO AFX 2.0 ROM 1.01, 10 countable fingers

Posted 08 September 2002 - 04:25 PM

[QUOTE]thank you very much for all your precious help and enthusiasm[QUOTE]
Don't be so sarcastic 2072, I think that many people would like to help you but they just couldn't log in (so and I).

Yeah, sure this is really great job! Especially that my next release will use around 20Kb (!!!) of BASIC data. Sadly I have this ugly habit that I don't use someone else's code, so until I write such code for myself I will only include in a readme file that a dummy BASIC program can be done with TOUCHE.
Roeoender

#6 2072

2072

    Casio over god

  • Admin
  • PipPipPipPipPipPipPipPip
  • 1550 posts
  • Gender:Male
  • Location:Somewherebourg
  • Interests:Cinema, Programming, Music and a lot of thing...

  • Calculators:
    AFX2 ROM 1.02, CFX-9940GT+, FX-180P-Plus

Posted 08 September 2002 - 06:30 PM

Well, I don't like either to use code that I haven't written but my code is really well done and I did it to avoid programmers to loose time re-doing very basic system functions, if you do youre own code you won't do better than I.

It's just a lib you just have to put the .c of my lib in your makefile and include the .h and you can use my functions the same you use fopen, printf...

Patric Davidson use it, imagine if he didn't he would have spend time coding such acces functions instead of programming his wonderful game !

By the way my functions support addressing > 65535 Ko. It was maybe one of the most boring thing to do, if only the AFX2 had a 32bit cpu...

#7 Killer83Z

Killer83Z

    Casio CEO

  • [Legends]
  • PipPipPipPipPipPip
  • 427 posts
  • Location:I'm near to the place where I study
  • Interests:Guitar, Piano, Music, UCN<br />

  • Calculators:
    Algebra FX2.0, CFX-9850G, fx-7000G, fx-7500G, TI-83, HP100lx

Posted 09 September 2002 - 04:14 PM

Hey, as a user it is very convenient that you haven't to write these 20k files :) Good work, 2072!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users