Greyscale tetris for ti-83\84

A forum where you can announce your awesome project(s).

Moderator: MaxCoderz Staff

User avatar
tr1p1ea
Maxcoderz Staff
Posts: 4141
Joined: Thu 16 Dec, 2004 10:06 pm
Location: I cant seem to get out of this cryogenic chamber!
Contact:

Post by tr1p1ea »

Simplest way to get it working is to extract the z88dk to some directory, then navigate to the bin sub directory and create a file called 'hello.c' which would contain:

Code: Select all

#pragma string name Hello World
#pragma data icon 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00;

#include <stdio.h>

main() {
	// print string
	printf("Hello World!");

	// wait for keypress
	while( getk() == 0 ) {
	}
}
Save it and you would compile it from the command line like this:

Code: Select all

zcc +ti8xansi -startup=1 -o hello.bin hello.c
Then you would use a program like 'devpac8x.com' to link it:

Code: Select all

devpac8x hello
You should now have an 83+/84+ Ion compatible program that will display 'Hello World!', wait for a keypress and then exit.

Setting up your environment vars properly would make things easier of course.
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."
Image
Image
cjgone
Regular Member
Posts: 83
Joined: Tue 18 Apr, 2006 5:33 am
Location: Washington->UC Berkeley '15

Post by cjgone »

Thanks tr1p. :D


Sweet, hello world in 3,402 bytes. :D




Just wondering... If I call a function with parameters, and I want to retrieve them in assembly language, how would I do that? Are they on the stack?
User avatar
driesguldolf
Extreme Poster
Posts: 395
Joined: Thu 17 May, 2007 4:49 pm
Location: $4080
Contact:

Post by driesguldolf »

cjgone wrote:Sweet, hello world in 3,402 bytes. :D
WTF?!? 3,402 bytes? ROFL it probabely never heard of B_CALL()s... It probabely stores its own font as well :P
Liazon
Calc Guru
Posts: 962
Joined: Thu 27 Oct, 2005 8:28 pm

Post by Liazon »

that is kinda a lot... O.o
Image Image Image
CoBB
MCF Legend
Posts: 1601
Joined: Mon 20 Dec, 2004 8:45 am
Location: Budapest, Absurdistan
Contact:

Post by CoBB »

The culprit must be the printf() function, which is infamous for its size. It must be avoided at all costs.
cjgone
Regular Member
Posts: 83
Joined: Tue 18 Apr, 2006 5:33 am
Location: Washington->UC Berkeley '15

Post by cjgone »

Luckily, that wasn't the "optimized" version. :D




(Yup, it uses its own font :P)
Post Reply