Author Topic: [Planning] The Binding of Isaac  (Read 11423 times)

0 Members and 1 Guest are viewing this topic.

Offline adrusi

  • LV2 Member (Next: 40)
  • **
  • Posts: 25
  • Rating: +4/-0
    • View Profile
    • Adrusi
Re: [Planning] The Binding of Isaac
« Reply #15 on: June 06, 2013, 04:15:18 pm »
I'm thinking of writing it in C on computer first where it's a lot easier to make changes, then porting it to axe.
Lolwut ? This prolly isn't a good idea because Axe is way different than C.

Axe is missing a lot of higher-level features that C has, like types and structures, but the low-level features of C and Axe like program flow, arithmetic, and memory access make them quite similar. C is probably the most similar major programming language to Axe.

If you want to write something in C and later port it to Axe, just be careful not to rely too heavily on features that Axe doesn't support or that you can't easily enough mimic with your own code.

right, I'm thinking in axe, but writing in C. I'm not using stuff like malloc which don't exist in axe. It's all fixed length arrays and such. C just helps keep it organized, so I don't have to think about name conflicts at the same time as I think about algorithms and such (and I can see more of the code at once).

I'm hosting the code on github in case anyone's interested. I'm trying to simulate the environment on calc as realistically as practical without using an emulator or something. Maybe some of the functions I write will be handy for others approaching an axe or asm project similarly. https://github.com/adrusi/Isaac
« Last Edit: June 06, 2013, 04:18:46 pm by adrusi »

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: [Planning] The Binding of Isaac
« Reply #16 on: June 06, 2013, 04:22:15 pm »
In Axe you have getCalc which is equivalent to malloc.

Offline adrusi

  • LV2 Member (Next: 40)
  • **
  • Posts: 25
  • Rating: +4/-0
    • View Profile
    • Adrusi
Re: [Planning] The Binding of Isaac
« Reply #17 on: June 06, 2013, 05:00:27 pm »
In Axe you have getCalc which is equivalent to malloc.
but you can't use getCalc without providing a name for an OS var, right? That's not really practical for anything other than global arrays, and besides, it's best to avoid dynamic memory allocation if possible, I'm sure it's quite expensive on the calculators.

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: [Planning] The Binding of Isaac
« Reply #18 on: June 06, 2013, 05:58:46 pm »
That is looking awesome, good luck with it! :D

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: [Planning] The Binding of Isaac
« Reply #19 on: June 07, 2013, 11:35:24 am »
In Axe you have getCalc which is equivalent to malloc.
but you can't use getCalc without providing a name for an OS var, right? That's not really practical for anything other than global arrays, and besides, it's best to avoid dynamic memory allocation if possible, I'm sure it's quite expensive on the calculators.
It's must unless you use extra ram pages. A lot of Axe program use it due to too few space in safe ram (and its non contiguous nature).

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: [Planning] The Binding of Isaac
« Reply #20 on: June 07, 2013, 11:45:20 am »
Using an appvar (or any other variable but appvars are best since you can name them as you want and have them the size you want) is not really processor demanding. And you only need to provide its name once in the program since then it is repered by a pointer and no longer by its name (except if you lost that pointer and need to find it back). Here is an excellent tutorial about appvars (and external vars in general). Also, as StreetWalker said, when you need a lot of RAM, you don't really have the choice, you have to use those if you don't want you array to be in parts.
« Last Edit: June 07, 2013, 11:45:40 am by Hayleia »
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: [Planning] The Binding of Isaac
« Reply #21 on: June 07, 2013, 12:12:21 pm »
Yeah for example tilemaps and sprite data use a lot of ram.

Offline adrusi

  • LV2 Member (Next: 40)
  • **
  • Posts: 25
  • Rating: +4/-0
    • View Profile
    • Adrusi
Re: [Planning] The Binding of Isaac
« Reply #22 on: June 07, 2013, 04:48:48 pm »
Using an appvar (or any other variable but appvars are best since you can name them as you want and have them the size you want) is not really processor demanding. And you only need to provide its name once in the program since then it is repered by a pointer and no longer by its name (except if you lost that pointer and need to find it back). Here is an excellent tutorial about appvars (and external vars in general). Also, as StreetWalker said, when you need a lot of RAM, you don't really have the choice, you have to use those if you don't want you array to be in parts.

what I mean is that you can't really use GetCalc as malloc in situations like these:

Code: [Select]
entity **collision(entity e) {
  entity **es = malloc(sizeof(entity *) * 16);
  int cursor = 0;
  for (int i = 0; i < num_entities; i++)
  if (collision_exists(entities[i], e)) {
      es[cursor++] = &entities[i];
  }
  return es;
}

Which is the primary use of malloc in modern C.

GetCalc is mainly used if you need persistant data (I don't), or if you need more ram than you can get away with statically allocating with Buff (I do).

I suppose it's possible to use a hack and dynamically generate names for appvars, store the name somewhere in the pointed memory block, and free it with DelVar using that name, but that's inefficient and unrealistic.

This is an off-topic discussion, and I feel like this isn't really the place for it.

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: [Planning] The Binding of Isaac
« Reply #23 on: June 07, 2013, 05:44:01 pm »
Oh right. Buff is not really recommended though because it makes your executable bigger and triggers writeback with shells.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: [Planning] The Binding of Isaac
« Reply #24 on: June 10, 2013, 07:32:08 pm »
If you write it in C on the computer, will you try to update the Axe version simultaneously too so we don't have to wait until the C version is completed before the calc version even starts being worked on? :P

Else, another idea could be to use SDCC (like AHelper is doing for his TI-84+ OS on Cemetech) so you can write the calc version in C as well. I heard that calc C is a bit slower, but nobody really ever tried making the same program in both calc languages to compare afterward.

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: [Planning] The Binding of Isaac
« Reply #25 on: June 11, 2013, 03:12:27 am »
Or you could use token ide and an emulator. :) That way you'll get the convenience of coding on a computer while doing it for a calc.

Offline adrusi

  • LV2 Member (Next: 40)
  • **
  • Posts: 25
  • Rating: +4/-0
    • View Profile
    • Adrusi
Re: [Planning] The Binding of Isaac
« Reply #26 on: June 12, 2013, 10:23:16 pm »
If you write it in C on the computer, will you try to update the Axe version simultaneously too so we don't have to wait until the C version is completed before the calc version even starts being worked on? :P

Else, another idea could be to use SDCC (like AHelper is doing for his TI-84+ OS on Cemetech) so you can write the calc version in C as well. I heard that calc C is a bit slower, but nobody really ever tried making the same program in both calc languages to compare afterward.

I like that idea. I also like GlassOS, and I want to see it be successful. I'm considering developing isaac for GlassOS, to support it, even though that would mean a much smaller player base. If anyone sane is going to decide to switch to it, it's going to need to need some seed programs.

However from what I've heard, the linking tool isn't building right now, or at least something is broken. I'll get in contact with ahelper to see if there's some work around or if I can help fix it.

Sorry if this disappoints anyone wanting to see this project on AOS, but I think this is the direction I'll take the project.

Offline TIfanx1999

  • ಠ_ಠ ( ͡° ͜ʖ ͡°)
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 6173
  • Rating: +191/-9
    • View Profile
Re: [Planning] The Binding of Isaac
« Reply #27 on: June 13, 2013, 08:12:49 am »
I *think* Ahelper was saying there might be a way to get SDCC to output code that was compatible with TI-OS (is this what you mean by AOS?). I think if you release this as a GlassOS exclusive, your audience will be next to zero. IIRC, it can't be dual booted with TI-OS, and as far as I know, it is pretty far from a release. Nothing against GlassOS, but if anything, I'd suggest a dual release.

Offline adrusi

  • LV2 Member (Next: 40)
  • **
  • Posts: 25
  • Rating: +4/-0
    • View Profile
    • Adrusi
Re: [Planning] The Binding of Isaac
« Reply #28 on: June 13, 2013, 04:51:23 pm »
I *think* Ahelper was saying there might be a way to get SDCC to output code that was compatible with TI-OS (is this what you mean by AOS?). I think if you release this as a GlassOS exclusive, your audience will be next to zero. IIRC, it can't be dual booted with TI-OS, and as far as I know, it is pretty far from a release. Nothing against GlassOS, but if anything, I'd suggest a dual release.

Yeah, I know. I'm fine with no audience. However, you bring up a good point with the dual release. with a bit of conditional compilation and a separate rel file, it should be possible to compile it for multiple targets.

Offline Keoni29

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2466
  • Rating: +291/-16
    • View Profile
    • My electronics projects at 8times8
Re: [Planning] The Binding of Isaac
« Reply #29 on: June 13, 2013, 05:01:34 pm »
Herocore is has a very similar engine to binding of isaac. I am working on this game, so if you need some source code: just ask.
If you like my work: why not give me an internet?