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

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.

Show posts Menu

Messages - PT_

#241
Programs and Utilities / Re: ICE Compiler
August 11, 2016, 10:28:43 AM
Thanks :)

Time for some updates. This week I came back from my holiday, which means I had some time for programming again. And yes, of course, I picked up ICE to start with, outside of some small projects. I'm currently working on 4 parts:
- GUI
- Optimization
- Auto-optimization
- Add custom tokens.

The first part, the GUI, is halfway done, I still need to get all the programs from the VAT, starting with [\i], and display them, and of course select one. The second point is just underway, many thanks to grosged who gave me some tips, and now I can save about 100 bytes, maybe even more. I'm about to start with point 3, the auto-opt. For example I have this peace of code: Repeat A=5
ICE now compiles that into ld a, (ix+variableA)
sub a, 5
add a, $FF
sbc a, a
inc a
or a
jp z, ******

Well, it could be MUCH shorter!
ld a, (ix+variableA)
sub a, 5
jp z, ******

This will be done at the auto-opt part, and I guess it can optimize much stuff! :)

Last part is the custom tokens, or a replacement of uncommon tokens. I've posted earlier how I gonna do that, and I'm only struggling with the extended keypresses for tokens.
Side note, I want to 'create' these tokens:
ExecHex(
Sprite(
Rect(
ReadByte(
ReplaceByte(
AddByte(
DeleteByte(
SetupPrgm(
CreateVar(
ArchiveVar(
UnArchiveVar(
DeleteVar(
Inc(
Dec(

Wanna see things added? Let me know, even if you have questions what they can do! :)
#242
Quote from: DJ Omnimaga on August 05, 2016, 06:44:10 PM
Quote from: PT_ on August 05, 2016, 12:22:35 PM
54. You are making a new programming language at the calculator but you're too lazy to learn another real language.
But then how do you make the new language if you don't know any other? O.O
I mean a real language, like English, Spanish... :P
#243
54. You are making a new programming language at the calculator but you're too lazy to learn another real language.
#244
Quote from: DJ OmnimagaLast month, ICE language won, which is why it's not included in July's poll.
:banghead:
#245
Programs and Utilities / Re: ICE Compiler
July 18, 2016, 02:35:42 PM
Well, the first step is made to my own custom tokens!!! (Btw, after inserting it in the program, it crashes :()
#246
Programs and Utilities / Re: ICE Compiler
July 14, 2016, 08:55:04 PM
Time for some important notes/question.

As promised, ICE v1.1 is open source. You can download/view it at https://github.com/PeterTillema/ICE. There is currently no license, but please don't copy/share it, as normal. I hope to find a good one soon :)

I'm going abroad for about 3 weeks, so then I can't work on it.

I will split the main to-do-list in 2 parts. The first part is more focused on compiling, errors, and a good GUI. The second part is more focused on adding stuff, and customs tokens.

That said, about customs tokens, I have some interesting questions for you guys. First, let me explain how I want to do this. What I need: 3 hooks: GetCSC, Menu and Token hook. My goal was
1) check if you are in the program editor
2) if so, check if you pressed [TRACE]
3) if so, force the OS to being [PRGM] pressed
4) set a special bit
5) Menu hook -> bit set, my own menu with
6) customs tokens.

Now some questions:
- if you have the token hook, and you change DE (token number), would it still work somehow?
- when the OS displays a menu, and it reads a token to be displayed as an option, would the Tokenhook run?
- if you enable the recall queue in the program editor, and you insert a *non-existent* token for some reason, would it run the Tokenhook? (call _Get_Tok_Strng or call _GetTokStrng?)
- the Wiki says about the Tokenhook, that you can point hl to the string. Would it start with the string length, or should it be null-terminated?

Thanks in advance! :)
#247
General Help & Troubleshooting / Re: Change OS menu
July 14, 2016, 05:30:23 AM
*bump* anyone? :)
#248
gg
Thanks everyone for voting :)
#249
General Help & Troubleshooting / Change OS menu
July 12, 2016, 05:32:37 AM
Yo guys! While I was working a bit around with hooks and menu's, I was trying to change a menu completely. Let's say I want to add a submenu at EDIT->PRGM. What is the best way to do that? I can either make my own one, chopping off the standard menu, but the submenu COLORS would be very hard to replicate.

Another way is to increment the amount of submenu's when the hook is for the first time called (a=04h), but then the text will show up incorrectly, as it has an extra submenu.

My latest thought was, before drawing the first option, display the extra submenu, and increment the amount of submenu's, but I haven't tried it. Any thoughts? Thanks in advance!
#250
Quote from: Adriweb on July 09, 2016, 09:04:14 AM
it's been around way longer than ICE, so... ^^
Yeah, that ICE of about 2 months old is equal to an emulator of more than 6 months old. Says more about ICE than about CEmu ^^ :trollface:
#251
CEmu or ICE? Not really hard to choose :trollface: 
#252
Programs and Utilities / Re: ICE Compiler
July 08, 2016, 05:32:41 AM
Quote from: Cumred_Snektron on July 07, 2016, 09:08:20 PM
Very nice :)
Are you going to implement variables of more letters someday too?
Thanks :)
No, only lists, which is equal to a bunch of 'variables'. I can't add more variables if they don't exists :P
Quote from: DJ Omnimaga on July 07, 2016, 09:42:53 PM
Great! This is v1.1, right?
Thanks :) Yeah, sure.

Epharius pointed me to a thing that the compiled program should be a protected program. I thought that was it already, because I had the filename as .db ProtProgObj, "VARNAME", 0 but I used the wrong call to create it. Not important enough to update though ;)
#253
Programs and Utilities / Re: ICE Compiler
July 07, 2016, 06:16:30 PM
Okay..... IT'S FINALLY READYYYYYY :) :) :D
Compiling is now much easier (not faster), and better understandable.
The download should be in the first post, but.... the zip is too large... Download it here:
https://www.cemetech.net/programs/index.php?mode=file&path=/84pce/asm/ICE.zip (once it's accepted)
or here:
https://tiplanet.org/forum/archives_voir.php?id=587211

"ICE Compiler is a program that compiles TI-BASIC-like language to ASM, the machine code. Create insane games, use the color screen, and make the step to ASM smaller! Speed up your BASIC programs and it's super easy to use! Type your program in the normal editor, compile it within seconds, and you have hours of fun! It doesn't require any shell."

Have fun and don't hesitate to post anything!

Also, it will be open-source, I will upload it soon to GitHub


#254
Programs and Utilities / Re: ICE Compiler
July 07, 2016, 03:01:44 PM
Quote from: DJ Omnimaga on July 07, 2016, 03:52:53 AM
Can multiple loops or blocks be nested?


As for Axioms, you could always add support for inline ASM and have people type the hexadecimal inside the Asm() command or something.
Yep. There is a limited count to them, due to the stack, and because I move the stack temporary to vRAM, you can nest about 15000 loops or so. Enough? :trollface:

Asm(<hex> is already supported. And for Axioms, I've zero idea about how they works etc.. so yeah, I doubt I will implement it in the next X versions.


New update: I replaced a big part of the compiler. Instead of using register de as a pointer to the program data (zero safety), I use the OS calls + memory locations: curPC, endPC, _CurFetch and _IncFetch. This takes more time (1/100 s vs 1/101 s :P) but is much safer, and easier to use.
#255
Programs and Utilities / Re: ICE Compiler
July 06, 2016, 12:51:53 PM
Quote from: Cumred_Snektron on July 06, 2016, 11:52:01 AM
Does stuff like

A*3->B*6->C

work too?
Sure :trollface:  that always saves space and speed:)
Powered by EzPortal