Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - iconmaster

Pages: 1 2 3 [4] 5 6
46

Hey Cyrille!

Hello,

>smaller than ICON (Uncompressed PNG file? There has to be a better way).
ICON is a compressed PNG... problem is that since it is in hex, it takes 2 bytes per nibble :-(
I can see what you had to do it that way, though. Translating bytes directly into unicode would mean there would be characters like ; or control chars in the ICON. Perhaps if you encode it into base64?

>For example, there's no simple function to get only a part of a list
yes there is! L1({5,8}) will get you elements 5 to 8 of L1 in a list..

>or to insert a list item in the middle of one.
concat(L1({1,n}), { 1, 2, 3}, L1({n,1000}))
What.

You can also pass around functions, but they need to be properly QUOTEd to make sure that they are not evaluated at the wrong time...

Cyrille
WHAT.

Well, knowing this, back to messing around with quotes...


EDIT: Today, I learned that a list can have a maximum of 2^31 entries! You learn something new every day.

47
Seems interesting. Since HP PPL is fast I think an alternate language that compiles to it could be very feasible, although an interpreted language would probably run as slow as 83+ BASIC or so. Just make sure, however, that the compiled code doesn't end up totally bloated or unoptimized, though.
Yeah, an interpreted language isn't a good idea for speed here. Even if I made, like, a bytecode language, it wouldn't be fast.

And yes, optimization will be important. I'll have to do lots of testing to see what code patterns run the most efficiently.

One thing I would suggest is offering certain pre-made routines for sprites or maps, for example, with a decompressor, so that people could use different image formats that are smaller than the built-in ones. The resulting code would simply decompress the images into a GROB upon runtime.

I do plan on having all-new custom functions in the mix as well, yes. Graphics-wise, I'll see if there's a format that's smaller than ICON (Uncompressed PNG file? There has to be a better way). The compiler will be smart enough to only put HPP+ custom functions into the code if you call them.

For example, there's no simple function to get only a part of a list, or to insert a list item in the middle of one. HPP+ will add these functions, which will decompile into an HPPL function that gets called when needed.


In the future, I'll probably be collaborating with other interested people to figure out A. how to organise functions into packages and B. what custom function we need and how they should be called.

48
Once upon a time, I was writing programs for the HP Prime in HPPL. The more I worked in HPPL, the more I became dissatisfied with the language. I mean, it was usable, but I wanted better.

So I decided to make something better. I started work on Source. It's a programming language.

Source is a procedural, statically-typed bytecode-compiled language that can either compile to whatever platform you need or interpret directly on your computer. Currently, it compiles to HPPL.

Source gives you control. It's statically typed, so you can read your code more easily. It can assume types, so it's not needlessly verbose. You can control how it compiles through directives.

Source is flexible. It provides data structures and user types. You can define methods for data types anywhere. You can organise your code into packages. Source even can handle cyclic dependencies!

Source has tools. Compile it into HPPL from the command line, or use SourceBench to write and compile code on the fly. Use SourceBox to run your code on your PC. Run SourceLine to interactively execute Source code.

Source isn't done yet. The core libraries still need implemented, not to mention a bunch of features such as custom structs and classes. In the future, it will be able to compile to a bunch of places, not just HPPL. I wouldn't describe it as 'usable' yet. But stay tuned!

Anyways, the important bit: The link. Check out the source code at:

https://github.com/iconmaster5326/Source

Want to download Source? Want to learn more? Check out the wiki at:

https://github.com/iconmaster5326/Source/wiki

The wiki has downloads, documentation, and tutorials.

49
- Pointers or anonymous functions (or just passing functions like variables) would be a godsend. (I know it's a bit like C, but it works. I'd like to stay functional and still modify state, but I can't do that from a function without lists being parsed or global vars, which are icky and hardcoded. Pointers would allow pass-by-refrence.)

Well, you can pass around global functions like this:

Code: [Select]
FUNC1()
BEGIN
 MSGBOX("Function One!!");
END;


FUNC2()
BEGIN
 MSGBOX("Function Two.");
END;


EXPORT PASSITAROUND()
BEGIN
 LOCAL C,L={"FUNC1","FUNC2"},A;
 A:=CHOOSE(C,"Choose 1",L);
 EXPR(L(A)+"()");
END;



You can execute multiple statements in EXPR too, I believe, so there's local functions for you, I guess.


EDIT: While I'm here, I might as well add a bug I found. Quoting is fun, and by fun I mean always buggy. This program crashes, but ONLY on my emulator:


Code: [Select]
EXPORT CRASHHYPE()
BEGIN
 RETURN MAKELIST('I+1',I,1,10);
END;


I know it shouldn't work even if it doesn't crash, but I had to try it.

50
HP Calculators / Re: TETRIS for the HP Prime!
« on: June 25, 2014, 04:58:54 pm »
Regarding the high score being reset, there is a way to do this but you will have to access the variable indirectly.

Code: [Select]
init_highscore()
begin
  local temp="_tetrisHS:={{"Player1" 12345},{"Player2",234}};"; // make sure that you initialize properly; change list to whatever you use
  CAS(temp); // evaluates string inside temp as if done from CAS command line; creates _tetrisHS variable
end;

// get the n-th high score
get_highscore(n)
begin
  local temp="_tetrisHS(" + n ")";
  iferr
    local score=CAS(temp);
  then
    init_highscore(); // make sure this runs properly or you end up with an infinite loop
    get_highscore(n);
  end;
  return(score); // return a list consisting of something like {"PlayerName" 1234}
end;

You can create a similar procedure for storing high scores. Indirection will not require you to have the variable initialized within your source code. Thus when you edit the source, the variable _tetrisHS will remain intact.

It's a good idea, but isn't the CAS memory volatile? I've lost data in CAS without warning before, myself. I'm still slightly apprehensive about adding CAS code into things; I've crashed messily pretty much all the time I've tried to use CAS functions in my code...

51
News / Re: New HP Prime OS Version: 2014.0331
« on: June 24, 2014, 08:12:40 am »
A new OS version?? Every time I get around to learning there's a new one out, it's like Christmas and my birthday at the same time! It's nice to see such an open changelog and a continual development process.

Okay, let's see what in the new version...

PINCH TO ZOOM. SICK.

The Geometry app is even better, not that it wasn't already the best oncalc geometry app I've ever seen.

Custom color selection is nice. We needed that.

The new form of INPUT looks great. Good calculators have good dialog systems. It was why I worked with so much TI-89 coding, really.

Apparently, my calculator hardware can't do wireless?? That's concerning, and would have been nice to know at, you know, some point.

Anyways, with summer in full swing, perhaps I should really look into more HPP programming...


EDIT: I found some more stuff.


When you get an error in your program, you can conjure up the line it occurred on with a new selection. It's slightly useful, I guess.


You have the choice to make a CAS function in the New Program screen too. Interesting.

52
HP Calculators / Re: TETRIS for the HP Prime!
« on: April 10, 2014, 03:53:28 pm »
That and highscores get wiped out if I accidentally open the code, but that's more an HP Prime bug (or annoying feature) than a game issue.

Myself, I tied my Tetris to a user-key so I never have to risk going into the program menu for it. Another solution on my end is to have a separate program that just holds variables (luckily, we can reference variables from other programs), so changing the code doesn't do that.

53
Well, I am glad you are liking it more. Here is something to ponder on for you though.

The reality is this - there were simply much higher priority items in the initial development and releases needing focused attention and polish. This means there are definitely some holes in the language (to name a few - getting the width of a string, being able to print something as a user in a 2d formula format, or a much nicer terminal) yet you already have what I think is the fastest user language on any calculator (excluding assembly and things that need a computer to do), easy to learn, and yet extremely capable programming language. There are TONS of things that I would personally like to do in the editor, UI, language, and so on to really make it shine.

Ah yes, I might of guessed that your schedule is a tad... Tight. I'm okay with that! I'll wait as long as I need to... It'll be worth the wait! And besides, the language is pretty great right now, as you said. I can't wait to see what HP releases next!

54
There's a new firmware? O.O

Well, new to me. Apparently, it's been available since 2013!

55
VARS->HOME is where most items of interest will reside. Yes, they are in variables. Note however that some can be overridden by application variables (AAngle takes priority over HAngle) and so to do things properly you need to handle those.

How did I not notice that?? Silly me.

A suggestion! I've also have been having trouble when coding recently with aligning my text on screen. I want ti centered, but I can't figure out how big a string will be on the screen! A function to give me the width of a given string of a given font would be nice for my GUI-using programs.

I have to say, though, with the new firmware, I'm going great guns on programming! It's actually sorta nice to work in.

56
HP Calculators / Re: Let's hack the HP Prime!
« on: April 05, 2014, 08:04:41 am »
I just realized something. Recall the SDK OS version, and how it came with usbtool.exe to manually upload firmware to it? Well, I wonder if it'll take modified firmware files without complaint.

57
HP Calculators / Re: TETRIS for the HP Prime!
« on: April 05, 2014, 07:55:36 am »

EDIT: I dunno if that's a bug, but for me the entire game has inverted colors O.O (I don't know for the pieces, though. Just everything else is inverted, such as white background and black text)
Hahaha, no, you're just playing it with a light color scheme on. Myself, I'm a fan of Dark, so I took the screenshots in that mode.

58
HP Calculators / Re: Let's hack the HP Prime!
« on: April 04, 2014, 08:20:22 pm »
The main issue, though, is that making a new OS is incredibly hard. Even on the 83+, after 15 years there are still no third-party OS other than games and unfinished OSes with limited functionality. http://www.ticalc.org/pub/83plus/os/

Well, I'd assume we can start out by figuring out how to send it slightly modified versions of the real OS, and then work our way up to the big stuff. Change a string in the help file, figure out the new CRC, send it. Stuff like that.
Writing a new OS at this point would be impossible. We know what the architecture is, but we don't know anything about the internals; what pieces of memory are linked to hardware, for example.

59
It's been TOO LONG. SO here's some more bugs! Enjoy!

Today's bug: I have a bug with the INPUT command in my new Tetris game. My physical calculator turns off whenever it reaches it. It just turns off. I turn it back on, and program execution continues like normal, INPUT command succeeding and everything.

Today's suggestion: I can't find any functions to alter system settings. Are they in predefined variables, or functions, or what? I'd like to be able to, for example, switch angle modes to the correct one in a program.

60
HP Calculators / Re: Let's hack the HP Prime!
« on: April 04, 2014, 04:06:11 pm »
Thanks to bb010g for posting this link on IRC http://ried.cl/en/franqueando-los-secretos-del-hardware-mediante-ingenieria-inversa/

Maybe that could be useful for Prime hacking?

WOW. This could be the breakthrough. For one, we could watch the USB port when, say, a new firmware is being installed...

And this article also seems to imply that HP ignores CRCs when transferring. If they ignore checking with firmware, our job could be a lot simpler.

Pages: 1 2 3 [4] 5 6