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

Topics - PT_

#1
As an example to show all the features of ICE, including tilemaps, sprites, pointers, math, file i/o etc, I decided to make The World Hardest Game CE. So far I've only created the tileset and the first 12 levels and started with the game. You can always grab the source from SourceCoder3:
http://sc.cemetech.net/?hash=4zg9HFHQTJGb2FRzQFxn6OZa9Zcb
As you can see, there's almost nothing done, but I will spend a lot of time into finishing this file, which will be included in every ICE release to be an example.
Stay tuned! :)
#2
Contests / Code Golf Belgium Numbers
August 16, 2017, 06:37:13 PM
Hello ladies and gentlemen!

It was a rather long time ago that Code Golf - The Reboot was active, and I enjoyed it so much, that I decided it would be fun to pick that up again. So here I am with a new task. Don't know what Code Golf is? Check some old topics. You have one week to complete this task, and entries should be submitted by sending a PM to me. Without any further ado, here is your task:

Write a program that inputs a positive integer and outputs the Belgium k-number of the input. Of course, you have no idea what a Belgium k-number is, so let me explain that first. Let k be one of the integers 0-9. The input N has the Belgium k-number, if N occurs in the increasing sequence which starts with k, and the difference between 2 consecutive numbers in the sequence are the same as the digits of N. See this for a better explanation. Let me give an example.

k = 7, N = 85
Sequence starts with 7
7  + 8 = 15
15 + 5 = 20
20 + 8 = 28
28 + 5 = 33
33 + 8 = 41
41 + 5 = 46
46 + 8 = 54
54 + 5 = 59
59 + 8 = 67
67 + 5 = 72
72 + 8 = 80
80 + 5 = 85
STOP

As you can see, 85 is in the sequence (7, 15, 20, 28, 33..), which means 85 as Belgium k-number 7.

Other example:
k = 7, N = 152
Sequence starts with 7
7  + 1 = 8
8  + 5 = 13
13 + 2 = 15
15 + 1 = 16
16 + 5 = 21
21 + 2 = 23
23 + 1 = 24
...


Providing that ANY input N has at least 1 Belgium k-number, find one of the Belgium k-numbers with any input.

Good luck! :)

I've no idea if this is a simple or a hard task, we will see later!

Sorry, didn't realize there are already 2 open contests at CW :(
#3
First of all, yay, 1337 posts at Cemetech  8) Now I'm part of the elite :D

Second, less important (jk), I want to post about a new game I'm making in C: CurveFever CE. This is a port of the rather popular online game CurveFever, which I played a lot in the past, together with my brother. Just because of my 1337th post I wanted to release something new, or create a new game, or whatever, so this is the result:



Source:
https://github.com/PeterTillema/CurveFever-CE

Basically, you have to control a 'snake', by holding down a left and a right key (you should be able to set the keys in a menu) to move through the field, and trying to survive as long as possible. You can block others if you move well enough, and in the future I will add powerups as well, to slow down others, or move them the other way around... There will be a score board at the right, which needs to be added as well.

My intention was to make it for 4 players, all at one calc (oh boy, that's gonna be fun), but I'm not sure if that's feasible, especially with such small field. In the far future I might even add linking, that you can play 1v1 at 2 calculators. I've added in a timer to make sure you have a constant FPS, I set that now at 30 FPS which should be enough.

Anyway, enjoy the screenshots I will post in the future and if you have questions, suggestions, comments, hate comments or you just like it, feel free to post it! :)
#4
Web / Listen to MP3 files but not download them
April 15, 2017, 05:00:57 PM
Situation: my dad wants to host a paid service, where people can pay for his own music to listen online. However, they should not have the possibility to download them, because the service is paid. I tried several tricks to hide them, or making it really hard to find. I tried htaccess, but if I then block the MP3, <audio> doesn't work anymore, so that doesn't help. Another idea was to copy the MP3 to a temp folder, load it in the <audio> tag, and then immediately remove the folder, but I can't get that working yet + an experienced person can easily remove the JS code to remove the folder. Also, in HTML5, there is an option to download the MP3 IMMEDIATELY. I can remove that with CSS, but again, an experienced user can display it again, and download it.

@c4ooo said I can maybe stream it, so downloading them second by second, which might work, so I might give that a try.

Any more ideas? :)
#5
Other / [DUTCH ONLY] AIVD Christmaspuzzle 2016
January 13, 2017, 10:04:03 PM
[Only for Dutch people :)]

Zijn er mensen hier die nog bezig zijn geweest met de AIVD Kerstpuzzel 2016? Ik, mijn broer en een vriend van hem zijn nog op zoek naar de volgende antwoorden: 7b, 9-13, 15, 18, 21, 23, 24c, 25c, antwoord op 27. Zou wel leuk zijn als we wat hints en/of tips kunnen uitwisselen :D
#6
    Say hello to my newest game! :D





Currently not much done, but that comes with the time :)

It is written in C, as that goes the fastest, looking at the fact this will be a really large program..
I already have an idea about an AI, and hopefully when this program sees the finish line, that USB is somewhat documented, that I can add multiplayer.

To-Do list:
[list=1]
  • Make images of all the buildings/soldiers/villagers, and make them fit into my tiles (catch them from AoE II)
    • Buildings 1/25
    • Soldiers/villagers 0*8/40*8
    [/color]
  • Gameplay GUI
    • Minimap
    • Amount of max villagers/villagers
    • Tiles
    • Chat
    • Extra options
    [/color]
  • Be able to create soldiers/villagers at the town center/barracks etc
    • Check if enough resources, stand-by place
    [/color]
  • Move people to certain places
    • Requires shortest path finding algorithm
    [/color]
  • Gathering resources
    • Disappear resource if empty
    • (Animated villagers)
    [/color]
  • Building/Fighting
    • Check if enough resources/health
    [/color]
  • AI
    • Write a website/.exe file to make an AI yourself
    [/color]
  • Multiplayer
    • Only if USB is somewhat documented
[/color]

Btw:
:P
#7
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!
#8
While I was a bit working on some ASM for mr womp womp's and my project, I thought of a *good* way to have 1 ASM program, while still keeping the compability with the CSE and the CE. The main difference between that too, is the 2- or 3-byte registers. So I thought of a way to detect whether it is an CE or an CSE.
Code:
21000000
23
23
01FFFF00
09
DAXXXX00

When running this on the CSE, it will be parsed as this:
ld hl, 0 \ nop
inc hl
inc hl
ld bc, $FFFF \ nop
add hl, bc
jp c, XXXX \ nop

Since 2+$FFFF > $FFFF, it will always jump to address XXXX. In the meantime, when running at the CE, it will look like this:
ld hl, 0
inc hl
inc hl
ld bc, $FFFF00
add hl, bc
jp c, XXXX00

But since 2+$FFFF00 < $FFFFFF, this code will never jump to address XXXX00, so that address may be *random*. Now let's practice. Let's say I want to display HL where HL is equal to $1234.
The code for this is ld hl, $1234[00]
bcall(_DispHL) or call _DispHL

When compiling for the CE, this would be 21003412
CDE01E02
or something like that. For the CSE, it will look like this:
213412
EFFE44

Now let's combine this into 1 program. Our frame was this:
21000000
23
23
01FFFF00
09
DAXXXX00

Now let's expand this. Since the calc will jump when overflow, thus when executing from the CSE, the code after the jump (NOT the jump-location) should be for the CE. So it would look like this:
21000000
23
23
01FFFF00
09
DAXXXX00
21003412
CDE01E02
C9
_Lbl_XXXX:
213412
EFFE44
C9

The last task is to figure out what the address of _Lbl_XXXX is. Just count the bytes of the code for the CE, and the bytes of the frame, and at that to _UserMem, or $0BA6, if I'm right. In my case, it would be this:
XXXX = $A623. Thus, my  final code would look like this:
21000000
23
23
01FFFF00
09
DA23A600
21003412
CDE01E02
C9
213412
EFFE44
C9

Now, let's final running this on the CSE, would look like this: http://www.rafb.me/results/w8XJmL37.html
And at the CE: http://www.rafb.me/results/M1izML20.html
Note that the stuff that can crash, will never happen.

Hope that this helps to develop cross-compatible games! :D
#9
Programs and Utilities / [TI-84+CE] ICE Compiler
March 25, 2016, 08:14:17 AM
Hello everyone!

I can imagine many, many people are waiting for this post, but yeah, one must be the first to start such project ;)
I want to introduce this program:

ICE - an interpreter/compiler of CE-BASIC

Hooray! It would look like Axe Parser, but then for the newest calculator, the TI-84+CE.
Now are there many people who have questions, about what is possible with it, how long would it take to complete, what are the pros/cons?
Let me answer some questions.

What is ICE?
ICE is an interpreter/compiler of CE-BASIC. Normally, the OS reads a BASIC programs, and compiles it to some ASM commands, and then execute it. ICE does almost the same, but only read it, and compiles it to ASM commands, but instead of executing, it stores them into another program! In that way, you can turn your BASIC program into an ASM one, which is 1000x faster.

Why ICE?
Because I want to make a cool project (and not only games), and I think this program would be very useful for many people, so I decided to give it a try :)

What is possible with ICE?
I've no details yet, because I'm in an early stage, but I want to make it possible to keep it as BASIC as possible. I mean, you should be able in the future to compile all the BASIC programs to ASM. I never gonna reach that.... Like Axe Parser, it doesn't work with the TI-OS variables, because they are sloooowwwww. Instead, all the variables are in the RAM.

What are the pros and cons of ICE?
You can compile almost all the BASIC programs to ASM, which is 1000x faster. Since the CE has a memory-mapped screen, I'm going to implement a bunch of graph routines as well. A disadvantage is that you're a bit limited with the BASIC commands. I hope I can explain this later

When will you finish it?
In these weeks, I'm busy with school stuff, so I can't really do something with programming. But after that, I hope to finish it as fast as possible. Depending on the difficulties, I hope to finish it in some monts :)

How works ICE?
The hardest part is to express a string (and eventually store it to a variable). I will implement the Shunting-Yard-Algorithm for that (I will explain later). Once I got that ready, I need to write routines that replaces BASIC commands, like ClrHome would be call _HomeUp / call _ClrTxtShdw or whatever. Once THAT is ready, or enough of them, I will release a beta :)`

How smart is ICE?
For now, it is pretty smart, and by "smart" I mean, that if you display 2 strings which are exactly the same, it will be only once in RAM, an example:
Disp "ICE","ICE"
would be this:
   call _NewLine
   ld hl, _pointer_disp_0
   call _PutS
   call _NewLine
   ld hl, _pointer_disp_0
   call _PutS
   ret

_pointer_disp_0:
   .db "ICE", 0

which saves some RAM.

Example of Shunting-Yard-Algorithm:
Let's say I have this code:
F/2+3->A
The algorithm converts this to:
F 2 / 3 + A ->
Now I gonna read this sentence, and convert it to this (for example code)
   ld a, (address_of_variable_F)
// Now I now that I need to divide A by 2, which is a power of 2, so just rotate the byte
   or a
   rra
// Now to add 3, which is a value, not a variable
   add a, 3
// Now store it to variable A, so
   ld (address_of_variable_A), a

This is basically how the algorithm works, but then a bit more complicated :P especially when you have a long string.

Progress:
As some of you may know, it's very hard to work in ASM :P. That is why I decided to first create this in PHP (that's why I asked how to read .8xp with PHP). After I finished that, I will port it to ASM. I'm now in the stage for developing the Shunting-Yard-Algorithm, which is the main and hardest part.

I know,  there are still a ton of questions, so feel free to ask anything if you don't understand it, or whatever you want to say! :)


Psst, don't mind my English, I'm only a sweet Dutch boy :D


Originally posted on Cemetech: https://www.cemetech.net/forum/viewtopic.php?t=12616






Current version: 1.2.1
========DOWNLOAD========
Download ICE Compiler
Powered by EzPortal