Join us on Discord!
You can help CodeWalrus stay online by donating here.

Storing code/functions in a .8xv file as a library

Started by kotu, November 14, 2016, 09:59:20 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

kotu

Is it trivial to do this? @MateoConLechuga ? lol. or anyone

my game is coming close to the upper size limit, not sure if it will make it at the moment. there's not much space for code lol

thanks!
  • Calculators owned: TI 84+CE-T
  • Consoles, mobile devices and vintage computers owned: Sega Master System, Sony PlayStation 3
SUBSCRIBE TO THE FUTURERAVE.UK MAILING LIST
http://futurerave.uk

Snektron

It is possible, but note that it can only contain relocatable code since it isnt guaranteed where in ram the 8xv lies. That means only jumps smaller than 128 bytes and for larger ones a bigger piece of code which adds the base address.
  • Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


kotu

Quote from: Snektron on November 14, 2016, 10:03:21 AM
It is possible, but note that it can only contain relocatable code since it isnt guaranteed where in ram the 8xv lies. That means only jumps smaller than 128 bytes and for larger ones a bigger piece of code which adds the base address.

what does that mean if the functions are in c? i have no idea how big the jumps are lol

sounds like it would probably be easier to store the graphics in their own file

thanks
  • Calculators owned: TI 84+CE-T
  • Consoles, mobile devices and vintage computers owned: Sega Master System, Sony PlayStation 3
SUBSCRIBE TO THE FUTURERAVE.UK MAILING LIST
http://futurerave.uk

Dream of Omnimaga

Ideally, you need to make sure that all text/graphics in the game is displayed using the same piece of code and stored into a data application variable, to keep the code size down. Hardcoding everything (eg one piece of code per animation) is going to make the code size skyrocket.

Another alternative that is not the ideal solution but could work as last resort is to make the game an hybrid TI-BASIC and C game, where the BASIC program acts solely as a launcher, combined with XCOPY or something else that can copy archived files to RAM, and then you have one C program per game part (eg one for the intro/menus and another for the game part). In such case you would need to return several values into an appvar so that once one of the C programs is quit, those values can be retrieved by the next C program. Such hybrid TI-BASIC/C game would give you unlimited code space.
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

Snektron

Quote from: kotu on November 14, 2016, 10:05:31 AM
Quote from: Snektron on November 14, 2016, 10:03:21 AM
It is possible, but note that it can only contain relocatable code since it isnt guaranteed where in ram the 8xv lies. That means only jumps smaller than 128 bytes and for larger ones a bigger piece of code which adds the base address.

what does that mean if the functions are in c? i have no idea how big the jumps are lol

sounds like it would probably be easier to store the graphics in their own file

thanks

Yeah, it would probably be easier to do that :P

What you can do too is store the code in an appvar, but copy it to some free ram area.
  • Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


Sorunome

  • Calculators owned: Too many (why are you even reading this?)
  • Consoles, mobile devices and vintage computers owned: Gamebuino!
This is a signature.
And now......give me an internet!

To be or not to be.........is that even a question? Who gets to decide this anyways?

Dream of Omnimaga

TI-83 Premium CE, TI-84 Plus CE and TI-84 Plus CE-T (I think he mainly uses C)
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

Powered by EzPortal