C compiler

PM development, programming, hacking and all that fun stuff.
Lupin
Team Pokémé
Posts: 94
Joined: January 10th, 2005, 13:06

Re: C compiler

Post by Lupin »

Just coded a C version of my 6 color LCD demo... It can either be compiled with or without inline ASM. It's of course a lot slower without inline ASM. But even with inline ASM it's not looking as good as the ASM only version.

Still need to use a workaround to write to memory addresses (wcp function).

Why the "__rom" prefix for ROM arrays? I think it's common to move everything with "const" prefix into ROM.
Attachments
6color_c.zip
6 color demo in C
(34.63 KiB) Downloaded 1111 times
zoranc
Posts: 298
Joined: August 13th, 2010, 18:13
Contact:

Re: C compiler

Post by zoranc »

some fix with mul/div by const power of 2.

added a makefile.

added font created by friend of me who gave me permission to use it.

enjoy!
Attachments
vbccpm_0012.zip
Version 0.012
(292.71 KiB) Downloaded 1070 times
zoranc
Posts: 298
Joined: August 13th, 2010, 18:13
Contact:

Re: C compiler

Post by zoranc »

Another day another release. This time chars are supported too! :D

@Lupin: your 6-color demo now runs in pure C too but of course it looks ugly with that speed.
Attachments
vbccpm_0013.zip
(292.55 KiB) Downloaded 1087 times
Lupin
Team Pokémé
Posts: 94
Joined: January 10th, 2005, 13:06

Re: C compiler

Post by Lupin »

Good job zoranc, thank you. I think will write a new asm startup file which will initialize the global ram variables.

Time to implement more PM specific functions...
zoranc
Posts: 298
Joined: August 13th, 2010, 18:13
Contact:

Re: C compiler

Post by zoranc »

Another day another bomb, ops I mean version. Version 0.0014 first more or less functionally complete. I'll be happy to receive your bug reports!

New in this version is: initialization of global ans static variables and arrays, pm.h file for PM registers, starting position of the RAM variables can be set and last one is the awesome -help command line option. ;-)

Enjoy!
Z
.
Attachments
vbccpm_0014.zip
(294.91 KiB) Downloaded 1254 times
zoranc
Posts: 298
Joined: August 13th, 2010, 18:13
Contact:

Re: C compiler

Post by zoranc »

TADA: Version 0.015 on your attention. This time only change is the obsoleted __rom attribute, use const instead. ;-)

At this point all of the items on the TODO list are either involving or non essential, so I'll name it alpha 1 version.

It is still full of bugs. Most notable ones: 1. comparison of unsigned numbers, 2 char/short on the stack make problems.
Attachments
vbccpm_0015.zip
(294.76 KiB) Downloaded 1202 times
Lupin
Team Pokémé
Posts: 94
Joined: January 10th, 2005, 13:06

Re: C compiler

Post by Lupin »

hey zoranc, nice job. i wrote a small example to control the PRC. But i just noticed that there is no way to align arrays in memory. The PRC needs tiles to be aligned at 8 byte boundard and sprites at 64 bytes boundary. Please consider adding an option to do that. Attached you can find the code, it works but the gfx is wrongly aligned. Please put that on top of your list :)

Chars are still causing trouble (i think when writing chars to ints).

Good job, keep it up!
Attachments
prc_test.zip
(15.74 KiB) Downloaded 1202 times
zoranc
Posts: 298
Joined: August 13th, 2010, 18:13
Contact:

Re: C compiler

Post by zoranc »

Seems I spam this site the most... :oops: I use it as both release and change-log history.

Anyway ver. 0.016 features some fixes of unsigned comparison and also of short int handling. Also there is a new demo included with tile-map usage. :mrgreen:
Attachments
vbccpm_0016.zip
(295.02 KiB) Downloaded 1214 times
User avatar
YasaSheep
Posts: 205
Joined: November 20th, 2005, 04:04
Location: Portland (Also the discord)
Contact:

Re: C compiler

Post by YasaSheep »

When you're producing content, I'm sure nobody minds. ;]
zoranc
Posts: 298
Joined: August 13th, 2010, 18:13
Contact:

Re: C compiler

Post by zoranc »

Too bad we post simultaneously. I read you mind so fixed chars and alignment. Well in this revision is the 64 alignment too.
Attachments
vbccpm_0017.zip
(295.54 KiB) Downloaded 1234 times
Post Reply