CPCWiki forum

General Category => Programming => Topic started by: ronaldo on 13:59, 11 May 15

Title: #CPCtelera 1.4.2. release
Post by: ronaldo on 13:59, 11 May 15
(https://github.com/lronaldo/cpctelera/blob/master/cpctelera/docs/images/cpct_logo.png?raw=true) (http://lronaldo.github.io/cpctelera/)

Main project page: CPCtelera: Astonishing fast Amstrad CPC game engine (http://lronaldo.github.io/cpctelera/)
 
Hi guys,

   I am very excited to finally announce the official release of #CPCtelera 1.0. (https://github.com/lronaldo/cpctelera/releases/tag/v1.0.0) game development library for Amstrad CPC. #CPCtelera is mainly for C programmers (and also for assembly programmers), and comes with a complete development framework (build system and tools for content authoring). Here is everything that CPCtelera gives to you,

Low-level programming API functionalities:
Project creation, management and integrated build system with tools:
Authoring tools and command line tools for format conversions:Everything in one complete product and with a fully detailed reference manual (http://lronaldo.github.io/cpctelera/files/readme-txt.html), and complete documented source code (https://github.com/lronaldo/cpctelera/tree/master/cpctelera/src) under GPL v3 License (http://lronaldo.github.io/cpctelera/files/license-txt.html).
Although this is just the first release, we are very happy to be able to give you a complete product for easy game production. We hope to evolve this game library over time to boost CPC game production. We really want to see much more games being released every year for our beloved CPCs! It is time to start now! :D

Enjoy! :D
P.S.: News published on spanish RetroManiac Magazine (http://retromaniacmagazine.blogspot.com.es/2015/05/la-nueva-libreria-cpctelera-hara-que.html).
Some screenshots and a video running on a real Amstrad CPC:


(https://raw.githubusercontent.com/lronaldo/cpctelera/master/cpctelera/docs/images/cpctelera_s0.png)(https://raw.githubusercontent.com/lronaldo/cpctelera/master/cpctelera/docs/images/cpctelera_s1.png)(https://raw.githubusercontent.com/lronaldo/cpctelera/master/cpctelera/docs/images/cpctelera_s2.png)
(https://raw.githubusercontent.com/lronaldo/cpctelera/master/cpctelera/docs/images/cpctelera_s3.png)(https://raw.githubusercontent.com/lronaldo/cpctelera/master/cpctelera/docs/images/cpctelera_s4.png)
(https://raw.githubusercontent.com/lronaldo/cpctelera/master/cpctelera/docs/images/cpctelera_s5.png)(https://raw.githubusercontent.com/lronaldo/cpctelera/master/cpctelera/docs/images/cpctelera_s6.png)(https://raw.githubusercontent.com/lronaldo/cpctelera/master/cpctelera/docs/images/cpctelera_s7.png)

[youtube]K9ZupsChNr4[/youtube]
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: seanb on 14:26, 11 May 15
Now someone can finally make a decent outrun game for the amstrad
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: Gryzor on 17:05, 11 May 15
Niiice! Indeed I hope it helps people create more! I'll be watching this :)
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: Trebmint on 17:57, 11 May 15
This is great stuff. I will definitely have a look even though I'm doing a competing game tool.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 18:53, 11 May 15
This is great stuff. I will definitely have a look even though I'm doing a competing game tool.
Wow! Didn't know there where other people creating similar tools. That's always nice :D. The more sugar for Alan, the sweeter  8) .

Any way to know more about what you are doing? We may help each other :D
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: TFM on 19:05, 11 May 15
Very interesting project, you put a lot of effort in. Thumbs up!  :) :) :)
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: andycadley on 20:58, 11 May 15
Interesting. Shame about the cygwin requirement, as that pretty much makes it a no go, but always interesting to see new development tools. Hopefully some cool stuff will arise from this.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: Ygdrazil on 21:05, 11 May 15

Heh!


Why is Cygwin a no go?


/Ygdrazil

Interesting. Shame about the cygwin requirement, as that pretty much makes it a no go, but always interesting to see new development tools. Hopefully some cool stuff will arise from this.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: andycadley on 21:20, 11 May 15
Why is Cygwin a no go?
Among the gazillion problems it has, primarily it's the enormous security holes it creates by butchering ACLs so they aren't in the correct order (a massive fudge to try and mimic Unix's 'everyone else' permission) that puts it right near the top of my "never install" list.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: Ygdrazil on 21:22, 11 May 15

Okay! Was not aware of that  :o


/Ygdrazil

Among the gazillion problems it has, primarily it's the enormous security holes it creates by butchering ACLs so they aren't in the correct order (a massive fudge to try and mimic Unix's 'everyone else' permission) that puts it right near the top of my "never install" list.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: Ygdrazil on 21:29, 11 May 15

I don't think competing is quite the right term!


CPCtelera is for 'native' CPC!


Yours is for SymbOS exclusive  :D


But nice development anyway, can't wait to see what comes out of it!


/Ygdrazil

This is great stuff. I will definitely have a look even though I'm doing a competing game tool.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 21:46, 11 May 15
Among the gazillion problems it has, primarily it's the enormous security holes it creates by butchering ACLs so they aren't in the correct order (a massive fudge to try and mimic Unix's 'everyone else' permission) that puts it right near the top of my "never install" list.

Well, then you should use something like BSD as your main OS, as Windows is itself a big security hole ;)

We have not tryied it, but CPCtelera should work on BSD, like it does on Linux and OSX. Someone willing to make the test?  8)

You have plenty of options if you don't want to use Cygwin. One of them is using a virtual machine with Linux. You also may use an OSX or even a Raspberry Pi (it works flawlessly on Raspbian and ARM machines). ;)

We cannot give you more options. If that is not enough for you, I can only say sorry, but we cannot cope with more platform work in less time.

Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: Prodatron on 21:53, 11 May 15
@ronaldo (http://www.cpcwiki.eu/forum/index.php?action=profile;u=1227): I am very impressed! A complete framework for CPC games, that's very cool!

I don't think competing is quite the right term!
CPCtelera is for 'native' CPC!
Yours is for SymbOS exclusive  :D
That's true, the intersections are different, the one is for all CPCs, the other one is for all computer plattforms running SymbOS :)
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: Trebmint on 22:02, 11 May 15
I don't think competing is quite the right term!


CPCtelera is for 'native' CPC!


Yours is for SymbOS exclusive  :D


But nice development anyway, can't wait to see what comes out of it!


/Ygdrazil
I didnt mean compete. What I plan is a drag and drop game creator, so we're aiming at different people. This framework looks good, and with a map/sprite editor combined would be a killer app for a good z80 coder
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 22:04, 11 May 15
@ronaldo (http://www.cpcwiki.eu/forum/index.php?action=profile;u=1227): I am very impressed! A complete framework for CPC games, that's very cool!

Thank you! It's more than an honor having such an opinion from you, man. My project is not more than a little baby compared to your production :D

This framework looks good, and with a map/sprite editor combined would be a killer app for a good z80 coder

It already has one. It includes an updated version of Retro Game Asset Studio, with ability to directly export sprites and maps in CPCtelera C Array format ;)
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: Trebmint on 22:17, 11 May 15
Thank you! It's more than an honor having such an opinion from you, man. My project is not more than a little baby compared to your production :D

It already has one. It includes an updated version of Retro Game Asset Studio, with ability to directly export sprites and maps in CPCtelera C Array format ;)
Very cool. Have you thought about doing a youtube video.
Maybe its time we introduced the Wiki Game competition?
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 22:43, 11 May 15
Very cool. Have you thought about doing a youtube video.
Maybe its time we introduced the Wiki Game competition?
Do you mean a youtube showing demo examples created with CPCtelera? I have just created this one showing hardware scroll capabilities
[youtube]dr_D9bcMwmE[/youtube]

Is this what you referred to? Or you wanted something like me doing programming?

For those curious, this is the source code for this example (https://github.com/lronaldo/cpctelera/blob/master/examples/advanced/hwscroll/src/main.c).

With respect to competitions, we expect to be anouncing #CPCRetroDev 2015 next month, and with a handful of prizes ;) .
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: EgoTrip on 23:05, 11 May 15
Can someone write a Game Maker style editor for Windows, so idiots like me can make games easier?
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 00:09, 12 May 15
Can someone write a Game Maker style editor for Windows, so idiots like me can make games easier?

I wish I could press a button and get a fresh "Amstrad CPC Game Maker", but it is not that easy  :-[ . Maybe, if you wait enough time, our developments with CPCtelera could create something similar (would be awesome). But that lives in the future right now.

Other thing you could do is pay our wages for next 6 to 10 months and we will be happily creating this for Amstrad 8 hours a day  :D .
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: EgoTrip on 00:15, 12 May 15
Of course I don't mind waiting. I didn't mean like I want it today (although that would be good).

AGD exists for the CPC but it's extremely limited and very buggy. I can't do what I want with it, but my actual coding skills are on par with Ed Milliband's political skills, or a tories integrity. IE practically non existent.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: AMSDOS on 12:19, 13 May 15
Can someone write a Game Maker style editor for Windows, so idiots like me can make games easier?


Can't you not follow the BASIC Platform Demonstration that @ronaldo (http://www.cpcwiki.eu/forum/index.php?action=profile;u=1227) helped me with? I guess to understand the Array can help a long way in understanding those kinds of games & maze games are not much different except for how the controls behave.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ssr86 on 13:06, 13 May 15
Of course I don't mind waiting. I didn't mean like I want it today (although that would be good).

AGD exists for the CPC but it's extremely limited and very buggy. I can't do what I want with it, but my actual coding skills are on par with Ed Milliband's political skills, or a tories integrity. IE practically non existent.
My opinion is that without some actual programming every such ready "maker" tool will be quite limited...
I haven't used any such tools yet, but I don't think that one could do "what he wants" with them.
You will be always limited to what the author implemented. And most probably he had to sacrifice functionality because of simplicity (so that everything is paramtrized).
You will have to learn some coding and tools such as CPCtelera allow you to use C which should be much easier (than asm) to learn for beginners (and is more practical than basic).
 
I find it frustrating that so much people on forums say they "suck at coding", but have they really tried?...
It takes time to learn, but don't say you "suck" at something before really trying.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 13:31, 13 May 15
@ssr86 (http://www.cpcwiki.eu/forum/index.php?action=profile;u=943) I agree with you mostly, and I also think most of the people would find that doing some average C programming is not that difficult (requiring time and training, though). However, I also find out every day that there are lots of people that love using the right-half of their brains much more than their left-half. Such people tend to be extremely creative, but not so skilled on logic and abstract thinking.

This way of using the brain normaly finds programming kind of a difficult and not rewarding task. They may learn how to program, but won't usually enjoy it, and prefer doing other things. Some of them will express this feeling as "programming sucks" or similar.

It actually doesn't mind to me how they express their feeling. I think that giving these people right tools to express their creativity is good for all of us. Even if these tools are much more limited (which is unavoidable), the thing is that all of us benefit from the creation-share cycle.

I certainly would like CPCtelera to offer several levels of abstraction to either programmers and designers, letting users choose and pair their abilities and desires with the right abstraction level and tools. That would draw more people to create new productions for CPC, and make all of us benefit from that. It seems like a utopia, but I would love to continue developing in that direction :).

And, of course, if we could help people like @EgoTrip (http://www.cpcwiki.eu/forum/index.php?action=profile;u=337) to improve their skills during this journey, much better :).
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: EgoTrip on 15:59, 13 May 15
Just because one person can do something doesn't mean everyone can. I have tried and tried to get my head around coding but it just confuses the hell out of me. Usually when I try to learn something, eventually it "clicks" and I get it. But the click has never happened with ASM. My BASIC is pretty weak too. My brain is simply not wired to handle it.

Tools like Game Maker are easier to use because of the way they utilise rooms and objects and stuff, sure I have to put code in each object to make it work, the GML is actually quite easy to understand and get working. This is what I want. An environment where I can create rooms and objects and stuff, and a simple language that lets me use the routines. Then outputs a binary. That way I can concentrate on the creative side.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 16:02, 13 May 15
@EgoTrip (http://www.cpcwiki.eu/forum/index.php?action=profile;u=337): in the meantime, while waiting for tools to evolve, if your designing skills are good, you can always "hire" a programmer to aid you in the creation of great stuff  ;)
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: EgoTrip on 16:58, 13 May 15
@EgoTrip (http://www.cpcwiki.eu/forum/index.php?action=profile;u=337): in the meantime, while waiting for tools to evolve, if your designing skills are good, you can always "hire" a programmer to aid you in the creation of great stuff  ;)

Nah, nobody can be bothered to see a project through, can't rely on anyone really.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ssr86 on 17:29, 13 May 15
[...] can't rely on anyone really.
I've also learnt that :'(
It's sad but seems painfully true (especially on smaller "scenes")
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: mahlemiut on 03:23, 14 May 15
Can't build it myself, unfortunately...

Code: [Select]
##> Header file 'boost/graph/adjacency_list.hpp' not found in the system. boost/graph/adjacency_list.hpp is part of libboost, which is required for building SDCC. Please, install boost / libboost-dev / libboost-devel or similar in your system and run setup again.
I installed libboost-dev, and checked the that include file exists (it does, in /usr/include), and it still doesn't care.

Some way to add an include directory?
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: TFM on 04:27, 14 May 15
@EgoTrip (http://www.cpcwiki.eu/forum/index.php?action=profile;u=337): in the meantime, while waiting for tools to evolve, if your designing skills are good, you can always "hire" a programmer to aid you in the creation of great stuff  ;)


Hi Ronaldo. He actually did a really great and funny game for the 2013 ROM competition.


But let me put my 3 Pfennige to this topic. I don't think that people have a lack of ideas what to make. Personally I think the lack of time is the biggest issue. And I don't know a single coder who has not lots of ideas by himself / herself; only time is the limit.  :)
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 11:26, 14 May 15
I installed libboost-dev, and checked the that include file exists (it does, in /usr/include), and it still doesn't care.

@mahlemiut (http://www.cpcwiki.eu/forum/index.php?action=profile;u=89): Please, tell me which SO and version are you using, and how did you install libboost-dev.

The shell script tests that libboost is working by compiling a small code sample. If it does not compile, it means that something is wrong with your installation. Normally, that means that you do not have installed libboost-dev, but it certainly could be other things. Installing libboost-dev should have created boost/graph/adjacency_list.hpp inside /usr/include, and that's its right place. But having the header is not enough (you also must have libboost_graph.a and libboost_graph.so under /usr/lib, for instance. (I assume that you are using a Linux, am I right?)

@TFM (http://www.cpcwiki.eu/forum/index.php?action=profile;u=179): I agree with you :). I didn't meant to say that people is lacking ideas, just giving what was intended to be a "funny-friendly suggestion" for @EgoTrip (http://www.cpcwiki.eu/forum/index.php?action=profile;u=337), not something propperly serious. My english writting skills are limited though :).
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: Trebmint on 11:34, 14 May 15
I guess the issue is that the level of access to being able to produce a good CPC game is Asm, or with a Framework like this C. That cuts a lot of very creative people off from producing anything. I'm thinking of people like carniviac who is clearly an amazingly talented artist who would like to code a game but is in fact limited to making a Amstrad like game for a PC with tools such as GameMaker.


ego is correct in that although we consider ourself a community, using others for a project often results in despair. its difficult for one person to motivate themself to see through a project... and that gets harder the more people that are involved.



CPCtelara actually helps with speed developing, and is another little step for those with less hardware/z80 knowledge. Things like AGD also offer hope, so perhaps one day we will actually gather the tools enough to be able crack this issue for good. I hope we see CPCtelera develop on and on as it has an amazing potential imho
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: Ygdrazil on 12:31, 14 May 15

Ditto!  :)

I've also learnt that :'(
It's sad but seems painfully true (especially on smaller "scenes")
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: AMSDOS on 13:01, 14 May 15
Just because one person can do something doesn't mean everyone can. I have tried and tried to get my head around coding but it just confuses the hell out of me. Usually when I try to learn something, eventually it "clicks" and I get it. But the click has never happened with ASM. My BASIC is pretty weak too. My brain is simply not wired to handle it.


What language do you normally use?
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: FloppySoftware on 17:03, 14 May 15
I don't think that people have a lack of ideas what to make. Personally I think the lack of time is the biggest issue. And I don't know a single coder who has not lots of ideas by himself / herself; only time is the limit.  :)

You're totally right.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: KaosOverride on 17:50, 14 May 15
I don't think that people have a lack of ideas what to make. Personally I think the lack of time is the biggest issue. And I don't know a single coder who has not lots of ideas by himself / herself; only time is the limit.  :)

I can be an example, if I had few time before, now I'm father of a 1 month child and my time is almost for him  :o

No time for hardware experiments (Wiznet prototype board, etc...) and very little to advance with my capriceRPI2 port  :(

But at the good side, I have a heir for my CPC empire!!!!! Some years later he will enjoy with the good old games!!!
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: mahlemiut on 01:54, 15 May 15
I use Ubuntu 10.04 (yes, I know it's old), and libboost-dev is installed from the standard repository.

The header is located at /usr/include/boost/graph/adjacency_list.hpp
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: mahlemiut on 01:40, 17 May 15
Update, due to the server crash:

While building SDCC:
Code: [Select]
gcc -DHAVE_CONFIG_H -I. -I/home/bsr/cpctelera-master/cpctelera/tools/sdcc-3.4.3/src/support/sdbinutils/binutils  -I. -I/home/bsr/cpctelera-master/cpctelera/tools/sdcc-3.4.3/src/support/sdbinutils/binutils -I../bfd -I/home/bsr/cpctelera-master/cpctelera/tools/sdcc-3.4.3/src/support/sdbinutils/binutils/../bfd -I/home/bsr/cpctelera-master/cpctelera/tools/sdcc-3.4.3/src/support/sdbinutils/binutils/../include -DLOCALEDIR="\"/home/bsr/cpctelera-master/cpctelera/tools/sdcc-3.4.3/share/locale\"" -Dbin_dummy_emulation=bin_vanilla_emulation  -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -O3 -fsigned-char -MT arparse.o -MD -MP -MF .deps/arparse.Tpo -c -o arparse.o `test -f arparse.c || echo /home/bsr/cpctelera-master/cpctelera/tools/sdcc-3.4.3/src/support/sdbinutils/binutils/`arparse.c
In file included from /home/bsr/cpctelera-master/cpctelera/tools/sdcc-3.4.3/src/support/sdbinutils/binutils/../include/alloca-conf.h:1,
                 from /home/bsr/cpctelera-master/cpctelera/tools/sdcc-3.4.3/src/support/sdbinutils/binutils/sysdep.h:25,
                 from arparse.y:30:
./config.h:7:4: error: #error config.h must be #included before system headers
make[7]: *** [arparse.o] Error 1

OS is 64-bit.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 12:20, 18 May 15
@mahlemiut (http://www.cpcwiki.eu/forum/index.php?action=profile;u=89): I don't know where exactly is your problem. I've downloaded and installed a fresh ubuntu 10.04 desktop AMD64 and everything works for me. These have been my steps:
Code: [Select]
sudo apt-get install build-essential bison flex libboost-dev
wget https ://github.com/lronaldo/cpctelera/archive/v1.0.1.zip
unzip v1.0.1.zip
cd cpctelera-master/
./setup.sh

I did this and found no problem at all.

I suggest, if you haven't done it already, that you delete the folder and follow the steps (except installing ubuntu). Maybe something meshed up during previous install. I cannot think of anything else, as I cannot reproduce the problem on a fresh install.

PD: Again, remove the additional space between https and ://github.... Had to add it to prevent the forum filter from adding tags inside the code tag.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: TCMSLP on 17:08, 18 May 15
This looks very impressive and may finally give me the tools I need to start developing on the CPC!

Can anyone provide an indicator to speed difference between code compiled from C and ASM?   I know ASM will likely still be faster, but how much so?
Are the cpctelera funtions/libs reasonably efficient?

Regardless, it's going to be significantly faster than basic.  I'm looking forward to having a play :D

Steve
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: arnoldemu on 20:58, 18 May 15
@TCMSLP (http://www.cpcwiki.eu/forum/index.php?action=profile;u=696): A lot of the library code is implemented as assembler.

I assume you'll write a lot of your game logic in C?

Do expect it to be slower than assembler, I can't say how much, but you can get an idea if you look at the assembly listing generated by SDCC. Perhaps 15% slower??

The SDCC compiler is improving in it's code generation.

The advantage you could have with C, apart from being easier to code than directly in assembler, is that you can modify the way you do things and choose different algorithms which would take longer in assembler.

I think it's definitely worth giving a go. I've got another game in development and that uses SDCC, C and library code.

I think in another thread I posted some tips on how to modify your C code to force SDCC to generate better code.

Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 19:57, 19 May 15
Can anyone provide an indicator to speed difference between code compiled from C and ASM?   I know ASM will likely still be faster, but how much so?
Are the cpctelera funtions/libs reasonably efficient?
CPCtelera's functions have been implemented with speed in mind. They are very fast. One can never be sure that they are fully optimized, but they at least you can safely assume that they are optimized a great deal. We have a very slow development cycle, because we want to meet some quality standards (optimization, code explanation, documentation...).

Also, take into account that CPCtelera lets you program in C and Assembly (or a mix of them!). Therefore, you can always start programming in C and then continue learning some assembly and go improving your productions :).

Moreover, one great thing in CPCtelera is that it only includes the code for the functions you use in your final binary. So, you don't have to do complicated copy/paste/restructure cycles to ensure that your binaries are not too heavy :).

Also, @arnoldemu (http://www.cpcwiki.eu/forum/index.php?action=profile;u=122)'s explanations could help you a great deal into creating better C code to make SDCC produce faster assembler. All the tools are ready for you to start: whenever you wanted, we are waiting impatient to see new productions appear :D
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: mahlemiut on 05:03, 21 May 15
Ok, tried building SDCC separately, same error occurs.  Downloaded the SDCC 3.4.0 source on its own, also gives the same error.  Clearly the issue is with SDCC. :(
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 13:36, 21 May 15
@mahlemiut (http://www.cpcwiki.eu/forum/index.php?action=profile;u=89): Have you tried the exact steps I wrote in my last post? I have done them and everything works fine on a fresh install of Ubuntu 10.04 AMD64. It seems a configuration problem on your installation. If you already tried the steps, maybe you can try this upgrading your installation before:
Code: [Select]
sudo apt-get update
sudo apt-get upgrade
Be sure to have build-essential installed, as the error you show seems from autotools.

I do not exactly now what else to look for, specially knowing that everything builds on a fresh install. You may have a configuration change in autotools, or some symbolic link, but it is quite rare. Please, confirm me that you have tried the steps I gave you before looking for something else.

PD: Downloading SDCC apart is not recommended, as SDCC included with CPCtelera has been modified by us to build faster and work in many systems.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: mahlemiut on 03:05, 22 May 15
build-essential is installed (v11.4build1)

I tried SDCC 3.4.0 to see if it could be built, but it does appear to suffer the same issue.

I have an Arch Linux VM that I can try to build on also, but not having much luck anyone, but the issues there could be caused by a bad upgrade (ran out of disk space during upgrade), am still working through it currently.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: mahlemiut on 04:55, 22 May 15
This happens on Arch Linux, which makes no sense:
Code: [Select]
> Checking required libraries...
>>> Looking for 'boost/graph/adjacency_list.hpp'.../usr/include/boost/functional/hash/hash_fwd.hpp:30:21: error: missing binary operator before token "("
/usr/include/boost/type_traits/config.hpp:29:23: error: missing binary operator before token "("
/usr/include/boost/type_traits/config.hpp:60:21: error: missing binary operator before token "("
/usr/include/boost/mpl/aux_/config/adl.hpp:29:28: error: missing binary operator before token "("
...and dozens more of the same error.

EDIT: Sorted this out now, needed to re-install boost and boost-libs completely
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: Singaja on 17:06, 23 May 15
No problems installing on OS X Yosemite 10.10.4 (beta). The needed dependency was boost , which I installed through brew package manager.
I love the install script delayed text display animation, it's adorable. Cheers


Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 05:31, 25 May 15
Quote from: mahlemiut
EDIT: Sorted this out now, needed to re-install boost and boost-libs completely

@mahlemiut (http://www.cpcwiki.eu/forum/index.php?action=profile;u=89): I understand that this means you got it working on Arch, isn't it?

I love the install script delayed text display animation, it's adorable. Cheers
Thank you, @Singaja (http://www.cpcwiki.eu/forum/index.php?action=profile;u=1284) :D . And thank you for testing also. We have expent a lot of time testing on OSX and it is always a pleasure to know that it works on different versions :) .
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: mahlemiut on 01:51, 27 May 15
@mahlemiut (http://www.cpcwiki.eu/forum/index.php?action=profile;u=89): I understand that this means you got it working on Arch, isn't it?

Yes, it builds fine on Arch now.  Only other issue is most of the tools are Windows-based, tried to run Arkos and RGAS in Mono, but that didn't work, and I don't have .NET installed via Wine currently (limited disk space).
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: arnoldemu on 11:16, 27 May 15
Is source to RGAS available?

I've had experience making a c# app run on mac using mono.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 12:54, 27 May 15
No, source is not available, but Lachlan has been working on it since I asked him to include RGAS in CPCtelera. RGAS runs well on Mono > 4.0. However, Linux distros normally include 3.x versions of Mono.

I usually run RGAS under wine, which uses a more updated version of Mono. There RGAS runs well. Arkos Tracker, however, only runs well under Windows. I generally use a Virtual Machine for that.

I agree in that it will be nice for all tools to grow and have better compatibility but that depends on each author, their available time and many other things. If you wish, you can ask them about better support or new features. Other idea would be to develop new tools or to include other tools with CPCtelera. If authors of the tools want, I'm more than happy to include them with CPCtelera.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: mahlemiut on 03:09, 28 May 15
Yeah, I only have Mono 2.6.  I could install .NET 4.0 via Wine, which should get around Wine telling you that you should use Mono for .NET apps.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 15:24, 28 May 15
@mahlemiut (http://www.cpcwiki.eu/forum/index.php?action=profile;u=89): I don't recommend you doing that. If you have limited resources, it could be better for you to find different tools to use, or use them under Windows. RGAS works well under wine, but Arkos Tracker does not.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: mahlemiut on 10:39, 29 May 15
Yeah, WYZTracker runs fine in Mono for me, I could use that as a replacement.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: TFM on 22:25, 01 June 15
@ronaldo (http://www.cpcwiki.eu/forum/index.php?action=profile;u=1227) : One question: Does the CPCtelera need parts of the OS or does it run independent?

Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 22:27, 01 June 15
It runs independent from OS and firmware. As one of its aims is maximizing performance, it runs completely low-level: directly over hardware.

However, you may write software that uses firmware aswell: all you have to do is not calling cpct_disableFirmware() :) . In fact, you have a little example using printf and the standard (https://github.com/lronaldo/cpctelera/blob/master/examples/easy/stdc/src/main.c) library included.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: TFM on 22:31, 01 June 15
Sounds pretty cool! I think you can guess why I ask. It would be ideal for FutureOS, which provides any kind of freedom to the user (free zero page and RSTs, free usage of 2nd Z80 register set, free selection of IM and so on). It would be great to make it target OS regarding disc speed and memory management.  :)  Just wished I had more time .  :)
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 22:39, 01 June 15
So, do you mean having some specific, say "API calls" to ask OS for memory and resource access? That could be really nice. If anyone wants to implement them, they could be like a new module inside CPCtelera, available for those wanting to use it.

The way CPCtelera is designed, it could be expanded ad-infinitum. In the end, only the functions that you use are included in the final binary. Therefore, if CPCtelera is to include modules for FutureOS, CP/M or any other OS or Middleware, it is always possible without affecting the rest of its functionalities :) .
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: TFM on 22:44, 01 June 15
Yes, things like:
- How much Expansion RAM is there?
- Allocate RAM and tell me where it is (physical I/O address etc.)
- Free RAM
- Load data bigger than 64 KB in one piece
- and so on...  :)


But also stuff like clear screen very quick (using PUSH) and other API functions just to speed it up and keep CPCtelera lighter (which is only needed when RAM is small).  :)
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 01:02, 07 June 15
CPCtelera github master (https://github.com/lronaldo/cpctelera) version now:
Version 1.1. (https://github.com/lronaldo/cpctelera/releases/tag/v1.1) has been released  :)
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ervin on 07:20, 19 June 15
FINALLY managed to get cpctelera installed successfully (on Windows 7)!
Took some messing about with Cygwin, but I got there in the end.

I've had a look at some of the examples so far... this is REALLY impressive stuff.
I can't wait to start coding in it!

Thanks so much for your amazing efforts in creating this incredible tool.
Just wondering, what does "telera" mean?

[EDIT] One more question, if I may!  8)
When a new version of cpctelera is released, do we need to run setup.sh again?

Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ervin on 16:33, 19 June 15
Well, so far I have been unable to run cpct_mkproject (in windows 7).
It's as if no paths have been set in my system, and the cygwin window doesn't know where to find anything.
 :(

I don't know anything about linux, so I'm a bit hesitant to create a virtual linux system just for cpctelera...
Has anyone here successfully got cpctelera running properly under windows? Anyone got any tips?

[EDIT] I can get cpct_mkproject running when I give bash the full path to it, but that's not what the cpctelera docs say...
Even after I get cpct_mkproject working, and create a new project folder, I can't run Makefile in that folder - it says "command not found" for the lines with "include".

I had similar problems just getting setup.sh to work when I first installed cpctelera.

This section:
## Main Paths
SETUP_PATH=j:/dropbox/cpctelera
CPCT_MAIN_DIR=${SETUP_PATH}/cpctelera
CPCT_TOOLS_DIR=${CPCT_MAIN_DIR}/tools
CPCT_SCRIPTS_DIR=${CPCT_TOOLS_DIR}/scripts


I had to change the SETUP_PATH to explicitly point to the location where cpctelera is installed, in order for anything in the script to run.

Is this normal behaviour for a correctly installed cygwin?
I have no idea what I'm doing wrong.

Can anyone help?
 :'(

[EDIT #2] I successfully compiled a test program!
Silly me - I missed the bit in the docs that say, type "make".
I tried that, and it worked!

Sorry everyone for the confusion.
 :-[

I guess this is a good example of what happens when instructions aren't followed accurately.
I'm going to restore the original setup.sh, and run it from within the cygwin window, as per the instructions in cpctelera's documentation.
Hopefully that will fix my path problems. Fingers crossed!

This has all been quite embarrassing... I consider myself to be an above-average computer user, yet I stumbled with this.
Ah well, you live and you learn, eh?

Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 17:07, 19 June 15
Sorry @Ervin, I'm out and was waiting to properly answer your questions when arriving home. I'll try to answer you from my mobile:
 
Please, feel free to ask anything you need. Sometimes it will take me some time to reply, but I'll try to reply to everything :)
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ervin on 17:15, 19 June 15
That's ok, no problems at all regarding the wait.
We've all got lots of things to attend to outside of this forum - there's no rush.
 8)

Thanks for your reply - that's very useful information.
The reason for the name is very interesting too.

I'm comfortable now with the environment, and "make" works very nicely.

I still need to explicitly tell bash where to find cpct_mkproject, but I can deal with that.
It's not a command I'll need daily, so it's no big deal.

Thanks once again.

Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 17:19, 19 June 15
You're welcome :). Please, have a look at my last post, as I was editing it while you posted ;)
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ervin on 17:23, 19 June 15
Ah, ok.

Because I had originally modified setup.sh, it may be possible that I messed up path associations?
I'll do a full cpctelera reinstall tomorrow night (with the correct steps!), and let you know how I go.

Thanks again!
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 17:30, 19 June 15
I'd have to carefully look at it to ensure that was actually the problem, but I'd bet on it.

Did you run setup.sh from outside it's folder the first time?  (Like running the command cpctelera/setup.sh) It's important to run it from inside its path, as stated in the how to, to ensure paths are properly detected and set up.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ervin on 02:02, 20 June 15
Alrighty, I've deleted the cpctelera folder (is that all that is required to uninstall it?), and now I'm installing it to a different drive.

I ran setup.sh the correct way, but, just as before, I've had to run it twice, as the first time I get an unrecoverable error when it gets to Building Compilation Tools. On the 2nd run, it is now on the way to a successful installation. I'll report back when it has finished, after I've tried cpct_mkproject.  8)

[EDIT] Ok, setup completed successfully, but I still need to use the full path to cpct_mkproject for it to run. But that's ok, no big deal.
Once the new project was created, "make" worked perfectly inside the project folder.

I'm very excited to start creating stuff with this!

 
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 02:39, 20 June 15
So, you are using Cygwin under Windows 7, isn't it? Where is Cygwin installed? And where is CPCtelera installed? Cygwin32 or Cygwin64?

Could you please tell me which is the unrecoverable error that you mention?

Could you please paste the result of this commands?
Code: [Select]
  cat ~/.bashrc
Code: [Select]
  echo $PATH

If you could provide me with this information, I could continue tracking what happens and that may help other users :).

(Note: you can install another CPCtelera in a different folder and run setup, as CPCtelera is only its folder and contents. Uninstalling is just deleting the folder).
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ervin on 12:20, 20 June 15
Yes, I'm using cygwin under windows 7 (32-bit).

Cygwin is in C:\cygwin\
If I remember correctly, it was the default installation location offered during cygwin's install.

cpctelera is installed on another drive in D:\cpctelera\

For the unrecoverable error, have a look at the first screenshot in this section of your website:
CPCtelera Reference Manual - . . (http://lronaldo.github.io/cpctelera/files/readme-txt.html#Screenshots)

In that screenshot, it is up to 11% of the "Building compilation tools" process.
The first time I ran setup.sh, it was on 0% for a short while, then it reported an unrecoverable error.
The 2nd time I ran setup.sh, it successfully got through the "Building compilation tools" process.

Here are the results of the 1st command you asked me to try:

Code: [Select]
# To the extent possible under law, the author(s) have dedicated all
# copyright and related and neighboring rights to this software to the
# public domain worldwide. This software is distributed without any warranty.
# You should have received a copy of the CC0 Public Domain Dedication along
# with this software.
# If not, see <[url=http://creativecommons.org/publicdomain/zero/1.0/>]http://creativecommons.org/publicdomain/zero/1.0/>[/url];;;;.

# base-files version 4.2-3

# ~/.bashrc: executed by bash(1) for interactive shells.

# The latest version as installed by the Cygwin Setup program can
# always be found at /etc/defaults/etc/skel/.bashrc

# Modifying /etc/skel/.bashrc directly will prevent
# setup from updating it.

# The copy in your home directory (~/.bashrc) is yours, please
# feel free to customise it to create a shell
# environment to your liking.  If you feel a change
# would be benifitial to all, please feel free to send
# a patch to the cygwin mailing list.

# User dependent .bashrc file

# If not running interactively, don't do anything
[[ "$-" != *i* ]] && return

# Shell Options
#
# See man bash for more options...
#
# Don't wait for job termination notification
# set -o notify
#
# Don't use ^D to exit
# set -o ignoreeof
#
# Use case-insensitive filename globbing
# shopt -s nocaseglob
#
# Make bash append rather than overwrite the history on disk
# shopt -s histappend
#
# When changing directory small typos can be ignored by bash
# for example, cd /vr/lgo/apaache would find /var/log/apache
# shopt -s cdspell

# Completion options
#
# These completion tuning parameters change the default behavior of bash_completion:
#
# Define to access remotely checked-out files over passwordless ssh for CVS
# COMP_CVS_REMOTE=1
#
# Define to avoid stripping description in --option=description of './configure --help'
# COMP_CONFIGURE_HINTS=1
#
# Define to avoid flattening internal contents of tar files
# COMP_TAR_INTERNAL_PATHS=1
#
# Uncomment to turn on programmable completion enhancements.
# Any completions you add in ~/.bash_completion are sourced last.
# [[ -f /etc/bash_completion ]] && . /etc/bash_completion

# History Options
#
# Don't put duplicate lines in the history.
# export HISTCONTROL=$HISTCONTROL${HISTCONTROL+,}ignoredups
#
# Ignore some controlling instructions
# HISTIGNORE is a colon-delimited list of patterns which should be excluded.
# The '&' is a special pattern which suppresses duplicate entries.
# export HISTIGNORE=$'[ \t]*:&:[fb]g:exit'
# export HISTIGNORE=$'[ \t]*:&:[fb]g:exit:ls' # Ignore the ls command as well
#
# Whenever displaying the prompt, write the previous line to disk
# export PROMPT_COMMAND="history -a"

# Aliases
#
# Some people use a different file for aliases
# if [ -f "${HOME}/.bash_aliases" ]; then
#   source "${HOME}/.bash_aliases"
# fi
#
# Some example alias instructions
# If these are enabled they will be used instead of any instructions
# they may mask.  For example, alias rm='rm -i' will mask the rm
# application.  To override the alias instruction use a \ before, ie
# \rm will call the real rm not the alias.
#
# Interactive operation...
# alias rm='rm -i'
# alias cp='cp -i'
# alias mv='mv -i'
#
# Default to human readable figures
# alias df='df -h'
# alias du='du -h'
#
# Misc
# alias less='less -r'                          # raw control characters
# alias whence='type -a'                        # where, of a sort
# alias grep='grep --color'                     # show differences in colour
# alias egrep='egrep --color=auto'              # show differences in colour
# alias fgrep='fgrep --color=auto'              # show differences in colour
#
# Some shortcuts for different directory listings
# alias ls='ls -hF --color=tty'                 # classify files in colour
# alias dir='ls --color=auto --format=vertical'
# alias vdir='ls --color=auto --format=long'
# alias ll='ls -l'                              # long list
# alias la='ls -A'                              # all but . and ..
# alias l='ls -CF'                              #

# Umask
#
# /etc/profile sets 022, removing write perms to group + others.
# Set a more restrictive umask: i.e. no exec perms for others:
# umask 027
# Paranoid: neither group nor others have any perms:
# umask 077

# Functions
#
# Some people use a different file for functions
# if [ -f "${HOME}/.bash_functions" ]; then
#   source "${HOME}/.bash_functions"
# fi
#
# Some example functions:
#
# a) function settitle
# settitle ()
# {
#   echo -ne "\e]2;$@\a\e]1;$@\a";
# }
#
# b) function cd_func
# This function defines a 'cd' replacement function capable of keeping,
# displaying and accessing history of visited directories, up to 10 entries.
# To use it, uncomment it, source this file and try 'cd --'.
# acd_func 1.0.5, 10-nov-2004
# Petar Marinov, http:/geocities.com/h2428, this is public domain
# cd_func ()
# {
#   local x2 the_new_dir adir index
#   local -i cnt
#
#   if [[ $1 ==  "--" ]]; then
#     dirs -v
#     return 0
#   fi
#
#   the_new_dir=$1
#   [[ -z $1 ]] && the_new_dir=$HOME
#
#   if [[ ${the_new_dir:0:1} == '-' ]]; then
#     #
#     # Extract dir N from dirs
#     index=${the_new_dir:1}
#     [[ -z $index ]] && index=1
#     adir=$(dirs +$index)
#     [[ -z $adir ]] && return 1
#     the_new_dir=$adir
#   fi
#
#   #
#   # '~' has to be substituted by ${HOME}
#   [[ ${the_new_dir:0:1} == '~' ]] && the_new_dir="${HOME}${the_new_dir:1}"
#
#   #
#   # Now change to the new dir and add to the top of the stack
#   pushd "${the_new_dir}" > /dev/null
#   [[ $? -ne 0 ]] && return 1
#   the_new_dir=$(pwd)
#
#   #
#   # Trim down everything beyond 11th entry
#   popd -n +11 2>/dev/null 1>/dev/null
#
#   #
#   # Remove any other occurence of this dir, skipping the top of the stack
#   for ((cnt=1; cnt <= 10; cnt++)); do
#     x2=$(dirs +${cnt} 2>/dev/null)
#     [[ $? -ne 0 ]] && return 0
#     [[ ${x2:0:1} == '~' ]] && x2="${HOME}${x2:1}"
#     if [[ "${x2}" == "${the_new_dir}" ]]; then
#       popd -n +$cnt 2>/dev/null 1>/dev/null
#       cnt=cnt-1
#     fi
#   done
#
#   return 0
# }
#
# alias cd=cd_func

And here are the results of the 2nd command:

Code: [Select]
/usr/local/bin:/usr/bin:/cygdrive/c/ProgramData/Oracle/Java/javapath:/cygdrive/c/Program Files/NVIDIA Corporation/PhysX/Common:/cygdrive/c/Program Files/AMD APP/bin/x86:/cygdrive/c/Program Files/Common Files/Microsoft Shared/Windows Live:/cygdrive/c/Windows/system32:/cygdrive/c/Windows:/cygdrive/c/Windows/System32/Wbem:/cygdrive/c/Windows/System32/WindowsPowerShell/v1.0:/cygdrive/c/Program Files/ATI Technologies/ATI.ACE/Core-Static:/cygdrive/c/Program Files/Smart Projects/DVDVob2Mpg:/cygdrive/c/Program Files/Git/bin:/cygdrive/c/Program Files/nodejs:/cygdrive/c/Program Files/nodejs/bin:/cygdrive/c/Program Files/QuickTime/QTSystem:/cygdrive/c/Program Files/Skype/Phone:/cygdrive/c/Program Files/Common Files/Microsoft Shared/Windows Live:/cygdrive/c/Users/Ervin Pajor/AppData/Roaming/npm:%%%CPCTELERA_PATH%%%

I hope that helps.
 :)
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 14:44, 20 June 15
Yes, it helps. I see what is the origin of the problem: installing CPCtelera (http://lronaldo.github.io/cpctelera) on a folder outside Cygwin. The natural way to install software that is going to be used under Cygwin is inside c:\cygwin, which is a folder that mimics Linux folder structure. Although it is possible for Cygwin to access folders outside its folder structre (using the route /cygdrive), it is generally a bad idea. I'm going to test it now to reproduce the problem and decide if I can do something.

You have an aditional problem with your folders, as your user name has a space in the middle. If you see your $PATH variable contents, you'll see things like this:
Code: [Select]
/cygdrive/c/Users/Ervin Pajor/
This will lead to problems under Cygwin, cause all POSIX operative systems use spaces as parameter separators. So, if some command receives the previous path as parameter it will interpret it as 2 parameters ("/cygdrive/c/Users/Ervin" and "Pajor/").

While I check for a more general solution, you can solve your problem changing your Cygwin $HOME folder to a spaces-free one, and then installing CPCtelera (http://lronaldo.github.io/cpctelera) under it. I tell you how to do it.

To change your $HOME, first create a new $HOME folder:
Then edit your /etc/passwd file (which should be located at c:/cygwin/etc/passwd. Preferably use a nice editor, something like sublime, notepad++, code::blocks... notepad.exe is not recommended.
Once you have done this, you can now download CPCtelera (http://lronaldo.github.io/cpctelera) to c:\cygwin\home\mynewhome, uncompress and install it normally. Then everything should work as expected.
If you wanted to have thins in another drive (like D:), I suggest you to directly install Cygwin to that new drive, then follow this process.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: arnoldemu on 15:08, 20 June 15
How about a installer for windows? The current setup seems quite complex. There are free installer making tools for windows.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: arnoldemu on 15:09, 20 June 15
How about a installer for windows? The current setup seems quite complex. There are free installer making tools for windows.
inno setup is the one I am thinking of.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 15:21, 20 June 15
A setup for Windows will be nice, but someone should have enough time for creating and maintaining it. If you like to create it, you have my deepest blessing :D. The only problem you have here is being careful to respect cygwin intellectual property. I'm unsure on the correct way to manage it. I think you should ask the user for downloading and installing it, and you may have to interface with the installer.

Actually, @Ervin problems are not due to a complex setup, but to his customized installation. In a normal installation you only have 3 steps: install cygwin along with required libraries, downloading CPCtelera and running setup.sh.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: arnoldemu on 15:59, 20 June 15
Understood. My experience shows that having an installer for windows makes it really easy. I know it takes time to make one.
I have made some before..

I have just installed cpctelera on linux. It was a good experience. :)

The installation script is really nice. It checked all the necessary libs and told me if I had any missing. It told me which lib to install and I followed the instructions.
It then built the tools. It was painless and didn't require sudo :)




Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ervin on 17:51, 20 June 15
Yes, it helps. I see what is the origin of the problem: installing CPCtelera (http://lronaldo.github.io/cpctelera) on a folder outside Cygwin. The natural way to install software that is going to be used under Cygwin is inside c:\cygwin, which is a folder that mimics Linux folder structure. Although it is possible for Cygwin to access folders outside its folder structre (using the route /cygdrive), it is generally a bad idea. I'm going to test it now to reproduce the problem and decide if I can do something.

You have an aditional problem with your folders, as your user name has a space in the middle. If you see your $PATH variable contents, you'll see things like this:
Code: [Select]
/cygdrive/c/Users/Ervin Pajor/
This will lead to problems under Cygwin, cause all POSIX operative systems use spaces as parameter separators. So, if some command receives the previous path as parameter it will interpret it as 2 parameters ("/cygdrive/c/Users/Ervin" and "Pajor/").

While I check for a more general solution, you can solve your problem changing your Cygwin $HOME folder to a spaces-free one, and then installing CPCtelera (http://lronaldo.github.io/cpctelera) under it. I tell you how to do it.

To change your $HOME, first create a new $HOME folder:
  • Open a cygwin terminal
  • type "make ../mynewhome" to create mynewhome/ folder at the same folder level that your previous $HOME, hence the ".." (you can change mynewhome for whatever you like)
Then edit your /etc/passwd file (which should be located at c:/cygwin/etc/passwd. Preferably use a nice editor, something like sublime, notepad++, code::blocks... notepad.exe is not recommended.
  • Inside the file, you should see a line similar to this one:
  • Erwin Pajor:unused:1001:513:U-YourMachineName\Erwin Pajor,S-1-5-21-2509020925-448908704-405948793-1001:/home/Erwin Pajor:/bin/bash
  • Change /home/Erwin Pajor by /home/mynewhome
  • Close Cygwin terminal and open a new one
  • If you did it well, the command "pwd" should tell you that you are now at "/home/mynewhome"
Once you have done this, you can now download CPCtelera (http://lronaldo.github.io/cpctelera) to c:\cygwin\home\mynewhome, uncompress and install it normally. Then everything should work as expected.
If you wanted to have thins in another drive (like D:), I suggest you to directly install Cygwin to that new drive, then follow this process.

Thanks so much for taking the time to put all that information together.

Unfortunately I had all sorts of problems with the home folder in cygwin.  :(

After a quick bit of research, I learned that "mkdir" is the command to create a new folder.
Then I couldn't find the /etc/passwd file. It turns out that it is no longer created during cygwin installation. I managed to find a page that talked about being able to generate it, but that gave me problems as well.

In the end I gave up on that idea, and decided to change my windows account name. This involved further research, as it's not as simple as just changing the account name.
I now have a home folder called "ErvinPajor", without the space.  8)

Then I unzipped cpctelera into C:\cygwin\home\ErvinPajor\cpctelera\
In the cygwin terminal I navigated to that folder and typed /.setup.sh

Setup began running nicely until it got to the "Building compilation tools" step, where it again failed with this error:

#########################
## UNRECOVERABLE ERROR ##
#########################
##> There was an error building CPCtelera tools. Please, check '/home/ErvinPajor/cpctelera/cpctelera/logs/tool_building.log' for details. Aborting.

Typing ./setup.sh one more time allowed it to continue successfully. It is up to 7% right now...
(Unfortunately I foolishly forgot to take a copy of tool_building.log before re-running setup.sh - and now of course the log contains info about the successful install).

[EDIT] It has finished installing.
I immediately tried cpct_mkproject (without the full path to it), and it worked! YES!!!  :D :D :D
Then I navigated inside the newly created folder, typed "make", and that worked as well!

So, apart from the problems with the space in my windows user account name, and then having to run setup.sh twice, it looks like things should be ok now!

Thanks again for all of your help.
Your support has been brilliant.

Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 19:22, 20 June 15
Well man, I'm sorry for not being clear sometimes. I've been using Linux for such a long time that I sometimes forget that things are not obvious for non-Linux users.

When I asked you to edit /etc/passwd, I forgot to tell you that the file should be in c:\cygwin\etc\passwd. If the file is not there, you may easily create it with this command:
Code: [Select]
mkpasswd > /etc/passwdwhich runs the mkpasswd cygwin utility for creating the contents of a passwd file out of windows users, and the "> /etc/passwd" part redirects what mkpasswd outputs to the file /etc/passwd (mkpasswd outputs to terminal, by default)

Sorry for driving you to change username in Windows and those things.

If you can, I'm very interested in the logfile created when you get the first unrecoverable error. I'm completely puzzled and don't actually know what kind of error could you get that vanishes the second time you run setup.sh. Up to now, haven't seen that behaviour in any of our tests.

If you run out of space on your main C: unit, I recommend you to uninstall cygwin and reinstall it to D: (or other drive). It will be better, as Cygwin itself takes much much more space than CPCtelera (http://lronaldo.github.io/cpctelera).

PD: I'm working on dealing with spaces in folder names in setup.sh, but there is a big problem. SDCC's configuration scripts do not accept folders with spaces (and I don't know how did they come to accept yours, may be they finally installed to a different folder). I can easily sort out my code, but I think it can be painful to modify SDCC for this.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ervin on 14:38, 21 June 15
All good, nothing to worry about.  8)
I've now learned a *little* bit about linux, and learning new stuff is always good.

I don't think you should worry too much about the spaces in a windows user account name.
Cpctelera users on windows can always run linux in virtualbox if changing user account name is too hard.
My cpctelera installation is working beautifully now, and I'm very happy.

Anyway, as a test, I deleted my cpctelera install, and reinstalled it, so I could get the details of the unrecoverable error during setup.sh.
Here is the tool_building.log file.

(Running setup.sh for the second time fixes it, so perhaps something is in the wrong order? Something to do with pod2man?)

Code: [Select]
make: Entering directory '/home/ErvinPajor/cpctelera/cpctelera/tools'
[ToolMaker] Building  2cdt...
make[1]: Entering directory '/home/ErvinPajor/cpctelera/cpctelera/tools/2cdt'
Creating obj/ intermediate folder...
gcc -O3 -fsigned-char -DUNIX src/2cdt.c -c -o obj/2cdt.o
src/2cdt.c:769:14: warning: ‘optarg’ redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
 extern char *optarg;
              ^
gcc -O3 -fsigned-char -DUNIX src/tzxfile.c -c -o obj/tzxfile.o
gcc  obj/2cdt.o  obj/tzxfile.o -o bin/2cdt  -s 
make[1]: Leaving directory '/home/ErvinPajor/cpctelera/cpctelera/tools/2cdt'
[ToolMaker] Building  hex2bin-2.0...
make[1]: Entering directory '/home/ErvinPajor/cpctelera/cpctelera/tools/hex2bin-2.0'
Creating directory obj...
mkdir -p obj
gcc -c -std=gnu99 -O3 -fsigned-char -Wall -pedantic src/hex2bin.c -o obj/hex2bin.o
gcc -c -std=gnu99 -O3 -fsigned-char -Wall -pedantic src/common.c -o obj/common.o
gcc -c -std=gnu99 -O3 -fsigned-char -Wall -pedantic src/libcrc.c -o obj/libcrc.o
gcc -c -std=gnu99 -O3 -fsigned-char -Wall -pedantic src/binary.c -o obj/binary.o
gcc -std=gnu99 -O3 -fsigned-char -Wall -pedantic -o bin/hex2bin  obj/hex2bin.o  obj/common.o  obj/libcrc.o  obj/binary.o
gcc -c -std=gnu99 -O3 -fsigned-char -Wall -pedantic src/mot2bin.c -o obj/mot2bin.o
gcc -std=gnu99 -O3 -fsigned-char -Wall -pedantic -o bin/mot2bin  obj/mot2bin.o  obj/common.o  obj/libcrc.o  obj/binary.o
pod2man src/hex2bin.pod > bin/hex2bin.1
/bin/sh: pod2man: command not found
Makefile:23: recipe for target 'bin/hex2bin.1' failed
make[1]: *** [bin/hex2bin.1] Error 127
make[1]: Leaving directory '/home/ErvinPajor/cpctelera/cpctelera/tools/hex2bin-2.0'
Makefile:56: recipe for target 'hex2bin-2.0' failed
make: *** [hex2bin-2.0] Error 2
make: Leaving directory '/home/ErvinPajor/cpctelera/cpctelera/tools'
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 21:59, 21 June 15
Thank you very much for your testing, @ervin (http://www.cpcwiki.eu/forum/index.php?action=profile;u=82) :) . This problem turns out to be inocuous and much simpler than I thought. It should be fixed now in the latest version of cpctelera (https://github.com/lronaldo/cpctelera/archive/master.zip). If you could test it and report if it works, it'd be very nice :) .

The problem is just as easy as the utility "pod2man" is not included by default with latest versions of Cygwin. The first time you run, the pod2man command fails, but a hex2bin.1 output file is created (this file should contain hex2bin manual). The second time you run, as hex2bin.1 is already created, pod2man is not executed, so the execution continues without any more problems.

As generating hex2bin manual documentation is not required, I have just removed this step. It could be easily enabled by those wanting to have it generated, just uncommenting a line in hex2bin's Makefile. However, if someone wants to do this, pod2man should be previously installed.

Thank you very much for you help, @Ervin :)
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 01:06, 22 June 15
Thanks to your help, @ervin (http://www.cpcwiki.eu/forum/index.php?action=profile;u=82), I have made a new release of CPCtelera. (https://github.com/lronaldo/cpctelera/releases/tag/v1.1.1) It is just a bugfix release, but required after addressing the problems you have discovered in your tests :) .

Thank you :)
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ervin on 03:13, 22 June 15
My pleasure.
 8)

Thanks for mentioning me in the change notes - that's very nice of you.

I uninstalled cpctelera, and then installed this new version.
It all went very well, and installed correctly on the first run of setup.sh.  ;D

I think the only things to change now are to make some things very clear in the installation instructions for Windows users:
- after Cygwin is installed, open the Cygwin terminal, so that the user has a home folder automatically created
- cpctelera must be unzipped into C:\cygwin\home\username\ (assuming cygwin is in C:\cygwin\)
- ensure that ./setup.sh is run from the cygwin terminal, after the user has navigated to C:\cygwin\home\username\cpctelera\
- close the Cygwin terminal, then re-open it for final associations to be made

Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ervin on 17:09, 24 June 15
Hi Ronaldo.

I'm not sure if I've discovered a little bug, or if I'm doing something wrong.

When I use cpct_drawCharM1_f or other similar functions, if the last parameter is over 127, I get a warning during compilation saying "warning 158: overflow in implicit constant conversion".
The program still works, but I thought I'd mention it.

Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 19:37, 24 June 15
When I use cpct_drawCharM1_f or other similar functions, if the last parameter is over 127, I get a warning during compilation saying "warning 158: overflow in implicit constant conversion".
The program still works, but I thought I'd mention it.

That's not actually a bug, but just a type-conversion warning from C. As you can see in the definition of cpct_drawCharM1_f (http://lronaldo.github.io/cpctelera/files/strings/cpct_drawCharM1_f-s.html), the last parameter is a signed char (i8). That means its values range from -128 to +127. If you give a 128 as parameter, it is implicitly converted to its equivalent negative value, because it overflows the range. It is actually unimportant, because the value of its 8-bits remain unchanged, and that's what is used in the function to draw the character.

However, to prevent this warning, I've changed the C type for this parameter to unsigned char (u8). :).
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ervin on 02:04, 25 June 15
Thanks ronaldo.
Really great!
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: lachlank on 00:49, 26 June 15
Is source to RGAS available?

I've had experience making a c# app run on mac using mono.


Hello I'm the author of RGAS. Although it is not explicitly "open source" I am happy for others to contribute or view the source in order to further and improve the system. It is written in VB.Net, not c# but if you know much about .Net you will know c# and vb are virtually identical and interchangeable. It is stored in a TFS repository on Visual Studio online so it easy for me to add other users. Unfortunately it has been through a major rewrite so is quite messy in places.


I found numerous issues with running under Mono, where the implementation of the underlying framework is subtly different to the MS implementation. As such I would recommend running under Wine (which Ronaldo has reported as working well), as you can install the official MS framework. I feel there is not much point trying to tidy it up for Mono as Microsoft have announced they will move .Net to open source, they have already released a lot, and the Mono team are switching to using this which should give full compatibility in future.


I am not a Linux guy and do all my work on Windows. I can report that having used CPCTelera for a while now under Cygwin that it works brilliantly and I had no issues setting it up. A tip I would give if you are doing C coding is to try Microsoft's new text editor, VS Code (https://www.visualstudio.com/en-us/products/code-vs.aspx). This is cross platform and will run on Linux and Mac. It is intended as an alternative to Notepad++, Sublime etc. Even though it is new it is brilliant and has replaced Notepad++ for me. It has Git support built in so I can push, pull, compare etc from the one program.


Another useful tip with CPCTelera, which I can thank Ronaldo for, is to create a script to run WinApe with your disk image and autoplay, such as:



#!/bin/bash
D:/Downloads/WinAPE20A17/WinApe.exe "C:\cygwin64\home\Jimmy\game\game.dsk" /A


I have had a resurgence of interest in CPC development with the relase of CPCTelera and have been making many useful additions to RGAS. I have decided that CPCTelera will be the official release point for RGAS, and I will send Ronaldo the latest versions as I release them for inclusion. For example, the latest version adds:
Lachlan






















Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: TFM on 01:05, 26 June 15
It would be awesome to have such a system (both of them of course!) on a real CPC running.  :)
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 22:33, 26 June 15
It would be awesome to have such a system (both of them of course!) on a real CPC running.  :)
Would be much more than awesome! That would mean having SDCC and UNIX tools working on a CPC! :D
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: TFM on 22:44, 26 June 15
We got Small-C and Z3Plus on CPC already. It's not that different.  ;)
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 22:45, 27 June 15
I've added and configured SDCC 3.5.0 to CPCtelera. It is still in a separate branch under test, but I can confirm that it works flawlessly on Arch Linux.

If some of you could test this version on different platforms (OSX, Cygwin32 and Cygwin64, preferably) it would be very nice to know if there is still something to fix or not :) .

You can see this SDCC 3.5.0 adition on Github (https://github.com/lronaldo/cpctelera/tree/sdcc35).
 
And to test it you have to get the repository and switch to sdcc35 branch:
Code: [Select]
git clone https: //github.com/lronaldo/cpctelera]lronaldo/cpctelera · GitHub
cd cpctelera/
git checkout sdcc35
./setup.sh
Thank you, and hope you enjoy it :D

Note: There is a space intentionally between https and //github.com... to prevent code section to add an [ url ] [ /url ] tag.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: lachlank on 12:49, 29 June 15
Just going to take the opportunity in this useful thread to mention that I have updated RGAS.zip on the wiki page (http://www.cpcwiki.eu/index.php/Retro_Game_Asset_Studio) to the latest version and hopefully this version will be included in CPCTelera in due course if it passes Ronaldo's quality bar.


And also another thanks to Ronaldo for putting together the tools and functions in CPCTelera to create a super user-friendly development environment that is also productive. Although I am pleased to have written games purely in asm, just as a personal milestone, the reality is it's not fun and needs total immersion for hours/days/weeks, as well as the kind of peace and quiet not afforded by kids running around. C by comparison is a breeze and a joy to work with for the CPC. I have had a resurgence of enthusiasm that would've been impossible otherwise. So thanks again.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 13:08, 29 June 15
There you go: RGAS 0.100 added to CPCtelera master branch (https://github.com/lronaldo/cpctelera/commit/664788c00c7d86e514e33760eb6f89f90cd69439).  :D

Thank you very much for your kind comments :). I'm glad to see that CPCtelera is useful for you, even been so young. I hope it grows to be more mature, useful and productive for more people :).

And, of course, I'm impatient to see your projects grow and become great games for our hungry CPCs :D
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: TFM on 18:25, 29 June 15
lthough I am pleased to have written games purely in asm, just as a personal milestone, the reality is it's not fun and needs total immersion for hours/days/weeks, as well as the kind of peace and quiet not afforded by kids running around. C by comparison is a breeze and a joy to work with for the CPC. I have had a resurgence of enthusiasm that would've been impossible otherwise. So thanks again.


Good to hear.  :) :)  On the other hand coding in C would be a pain in the behind for me. In ASM I have my libraries ready, I can do everything much more quick than in C. Of course a totally new project would need more time, but that's probably true for C too.  :)
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 19:06, 29 June 15

 On the other hand coding in C would be a pain in the behind for me. In ASM I have my libraries ready, I can do everything much more quick than in C. Of course a totally new project would need more time, but that's probably true for C too.  :)
That's why CPCtelera (http://lronaldo.github.io/cpctelera) includes also assembly bindings and compiles assembly files. It is able to compile C and Assembly files directly (without any configuration) and even mix the two of them :).

In fact, now that I have to do a second review cycle of all the functions included, I will improve C and Assembly bindings to gain some cycles and bytes on both of them :).

It would be awesome that experience assembly programmers like you, @TFM (http://www.cpcwiki.eu/forum/index.php?action=profile;u=179) could have some time to contribute to the project. If you already have some useful assembly routines, that would be really helpful for CPCtelera (http://lronaldo.github.io/cpctelera) :). That'd be, of course, if your code is valid for publishing (I mean, if there is nothing preventing you from freeing your code).
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: TFM on 20:22, 29 June 15
It would be awesome that experience assembly programmers like you, @TFM (http://www.cpcwiki.eu/forum/index.php?action=profile;u=179) could have some time to contribute to the project. If you already have some useful assembly routines, that would be really helpful for CPCtelera (http://lronaldo.github.io/cpctelera) :) . That'd be, of course, if your code is valid for publishing (I mean, if there is nothing preventing you from freeing your code).


Great idea! To be honest, 99% of all I code I do for FutureOS, which make it way more easy for me. If you could target FutureOS as environment, then I could gladly contribute lots of sources. The source of all my applications is free of course. If somebody needs a particular thing, just PM me.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ervin on 07:41, 01 July 15
I've added and configured SDCC 3.5.0 to CPCtelera. It is still in a separate branch under test, but I can confirm that it works flawlessly on Arch Linux.

If some of you could test this version on different platforms (OSX, Cygwin32 and Cygwin64, preferably) it would be very nice to know if there is still something to fix or not :) .

You can see this SDCC 3.5.0 adition on Github (https://github.com/lronaldo/cpctelera/tree/sdcc35).
 
And to test it you have to get the repository and switch to sdcc35 branch:
Code: [Select]
git clone https: //github.com/lronaldo/cpctelera]lronaldo/cpctelera · GitHub
cd cpctelera/
git checkout sdcc35
./setup.sh
Thank you, and hope you enjoy it :D

Note: There is a space intentionally between https and //github.com... to prevent code section to add an [ url ] [ /url ] tag.

Thanks ronaldo.
I've installed it, and it looks good!

Just one thing - during compilation, I get warnings that I wasn't getting before.
(My source code has not changed).

Code: [Select]
[test1] Linking binary file
/home/u372461/cpctelera/cpctelera/tools/sdcc-3.5.0/bin/sdcc -mz80 --no-std-crt0 -Wl-u --code-loc 0x4000 --data-loc 0 -l/home/u372461/cpctelera/cpctelera/cpctelera.lib obj/main.rel obj/tiles.rel -o "obj/test1.ihx"
?ASlink-Warning-Definition of public symbol '_cpct_memset' found more than once:
   Library: '/home/u372461/cpctelera/cpctelera/cpctelera.lib', Module: 'cpct_memset.rel'
   Library: '/home/u372461/cpctelera/cpctelera/cpctelera.lib', Module: 'cpct_memset_cbinding.rel'

Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: mr_lou on 09:05, 01 July 15
As I'm about to start coding a 4-player game-idea I have, I have downloaded CPCTelera, just to take a look at it.
My other options are either BASIC with RSX or B-ASIC targeting only the plus machines.

Here are some questions and feedback I thought of while looking at CPCTelera. Downloaded the ZIP file.

docs/index.html redirects to files/read-me.html which doesn't exist.
(The manual has the same link to that file on "CPCtelera Reference Manual").

I see there are Arkos functions here. I use STarKos. Are those two still compatible. Will the Arkos functions work fine with my STarKos track that I made on my CPC?

Is there really no drawSprite(sprite, x, y) function available? Are we supposed to make that ourselves, e.g. with a table look-up if we want?

The install script was very nice, and went completely without problems, which is very rare for me when it comes to gcc compiling stuff.

Unfortunately I have to go to work now, so I'll have to wait till I get home to look at the examples.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 14:39, 01 July 15
docs/index.html redirects to files/read-me.html which doesn't exist.
(The manual has the same link to that file on "CPCtelera Reference Manual").

Yes, you are right. Thank you for reporting :). I'll have a look to it later to see what happens. Meanwhile, you can always use online version of the reference manual (http://lronaldo.github.io/cpctelera/files/readme-txt.html), which works well.

I see there are Arkos functions here. I use STarKos. Are those two still compatible. Will the Arkos functions work fine with my STarKos track that I made on my CPC?
If I'm not mistaken, STarKos sounds can be opened with Arkos Tracker and then saved as binary, which is the same you would do with a song directly created with Arkos. You finally use the binary in your program. You have cpct_bin2c utility for converting the binary to a C Array to be included in your project.

Is there really no drawSprite(sprite, x, y) function available? Are we supposed to make that ourselves, e.g. with a table look-up if we want?
There is no direct drawSprite function using x, and y coordinates, but you may do the same quite easily with this 2 functions:
Code: [Select]
u8* pvmem;   // Pointer to video memory location to write your sprite
pvmem = cpct_getScreenPtr((u8*)0xC000, x, y);
cpct_drawSprite(sprite, pvmem, width, height);
drawSprite functions are tought to be generic: you can use them to draw either on the video memory or on a backbuffer placed anywhere in memory. That's why they ask you for a memory address instead of x, y coordinates. Moreover, cpct_getScreenPtr() can also be used to calculate memory addresses for a given screen buffer anywhere in memory: that's why it asks for a pointer to the start of video memory.

You have a lot of code that does this in the examples :).

If you wanted to have a cpct_drawSprite(sprite, x, y) function, you can create it by yourself, either as a function or as a macro, like this:
Code: [Select]
// Macro that draws an sprite at a given X,Y location (in bytes) on the main screen
#define DRAWSPRITE(SP, X, Y) cpct_drawSprite((SP), cpct_getScreenPtr((u8*)0xC000, (X), (Y)), width, height)
//.....
//..... Anywhere in your code....
DRAWSPRITE(sprite, x, y);
This may suit your needs :).
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 15:06, 01 July 15
Just one thing - during compilation, I get warnings that I wasn't getting before.
(My source code has not changed).
Code: [Select]
[test1] Linking binary file
/home/u372461/cpctelera/cpctelera/tools/sdcc-3.5.0/bin/sdcc -mz80 --no-std-crt0 -Wl-u --code-loc 0x4000 --data-loc 0 -l/home/u372461/cpctelera/cpctelera/cpctelera.lib obj/main.rel obj/tiles.rel -o "obj/test1.ihx"
?ASlink-Warning-Definition of public symbol '_cpct_memset' found more than once:
   Library: '/home/u372461/cpctelera/cpctelera/cpctelera.lib', Module: 'cpct_memset.rel'
   Library: '/home/u372461/cpctelera/cpctelera/cpctelera.lib', Module: 'cpct_memset_cbinding.rel'
If you have updated from git with a git pull or similar and you have not recompiled the library, this may be normal. It also may be due to not having the latest version.

Its easy to solve it recompiling cpctelera library:
Code: [Select]
cd $CPCT_HOME
make clean && make
If nothing odd is messing things up, that should make your warnings disappear. You may have to substitute $CPCT_HOME by the folder where cpctelera library is installed, if $CPCT_HOME environment variable is not defined in your system.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ervin on 17:01, 01 July 15
If you have updated from git with a git pull or similar and you have not recompiled the library, this may be normal. It also may be due to not having the latest version.

Its easy to solve it recompiling cpctelera library:
Code: [Select]
cd $CPCT_HOME
make clean && make
If nothing odd is messing things up, that should make your warnings disappear. You may have to substitute $CPCT_HOME by the folder where cpctelera library is installed, if $CPCT_HOME environment variable is not defined in your system.

Thanks ronaldo.
Unfortunately that didn't fix it.
 :(

"make clean && make" appeared to work, but I still get the warnings at compilation.

So I had a look through the cpctelera src folders, and found that every file in all the folders is date-stamped yesterday.
All the files except for one: memutils/cpct_memset.s

That file is date-stamped 24 June 2015.
I moved the file to a different part of my hard drive (outside of the cygwin and cpctelera folders), re-ran "make clean && make", but the warnings still happen during compilation.
Weird.

Anyway, I know you are very busy, and this isn't urgent or critical, so please don't worry too much about it for now.
 :)

Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 18:14, 01 July 15
@ervin (http://www.cpcwiki.eu/forum/index.php?action=profile;u=82), have you updated to latest version previous to do this? Compare cpc_memset* files with the ones at Github (https://github.com/lronaldo/cpctelera/tree/master/cpctelera/src/memutils) for differences. It does  seem like an update problem.

Moving source code files out is not a good idea, unless you know exactly what you are changing.

EDIT: Ok, I know what it is :) . If you have these 2 source files:
You should delete cpct_memset.s. That's the outdated file. git should have thought it was changed, and it has kept it when updating, creating the conflict. cpct_memset.asm is the new file for cpct_memset.s.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ervin on 02:32, 02 July 15
@ervin (http://www.cpcwiki.eu/forum/index.php?action=profile;u=82), have you updated to latest version previous to do this? Compare cpc_memset* files with the ones at Github (https://github.com/lronaldo/cpctelera/tree/master/cpctelera/src/memutils) for differences. It does  seem like an update problem.

Moving source code files out is not a good idea, unless you know exactly what you are changing.

EDIT: Ok, I know what it is :) . If you have these 2 source files:
  • cpctelera/src/memutils/cpct_memset.s
  • cpctelera/src/memutils/cpct_memset.asm
You should delete cpct_memset.s. That's the outdated file. git should have thought it was changed, and it has kept it when updating, creating the conflict. cpct_memset.asm is the new file for cpct_memset.s.

Hmmm, the warning still happens.
I've deleted cpc_memset.s, and I ran "make clean && make".
And I've emptied my project's obj folder just to be sure.

But it's ok - it's not breaking my program or anything.
Please don't worry to much about it for now.

Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 14:56, 02 July 15
You don't have to manually empty obj folders. "make clean" does it automatically for you :).

Have you checked that cpct_memset* files contain the same as github files (https://github.com/lronaldo/cpctelera/tree/master/cpctelera/src/memutils) and you don't have files that are not listed on github?

I'm unable to reproduce the warning either on Windows, Linux or Mac, and it makes no sense at all with the latest version of the code.

The final thing you can do is reinstalling cpctelera to ensure you have the latest version of everything.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ervin on 17:40, 02 July 15
You don't have to manually empty obj folders. "make clean" does it automatically for you :) .

Have you checked that cpct_memset* files contain the same as github files (https://github.com/lronaldo/cpctelera/tree/master/cpctelera/src/memutils) and you don't have files that are not listed on github?

I'm unable to reproduce the warning either on Windows, Linux or Mac, and it makes no sense at all with the latest version of the code.

The final thing you can do is reinstalling cpctelera to ensure you have the latest version of everything.

Thanks ronaldo.
A complete reinstall of cpctelera has fixed it!
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: mr_lou on 18:19, 05 July 15
Small suggestion:
Rename the headline "Sprites" in the reference manual to "Graphics".
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 19:45, 05 July 15
@mr_lou (http://www.cpcwiki.eu/forum/index.php?action=profile;u=96): why exactly do you suggest doing that?
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: mr_lou on 19:56, 05 July 15
@mr_lou (http://www.cpcwiki.eu/forum/index.php?action=profile;u=96): why exactly do you suggest doing that?

Because the chapter isn't only about sprites. At the moment it also contains a drawSolidBox() function, and in time you might add more, like e.g. a drawCircle() or what do I know. General graphical stuff.
One might also argue that "drawTile" isn't about sprites either.

Anyway, just a suggestion.

I've managed to compile my first little test, and so far I'm impressed. Very easy to get started. Creating a new project is easy, and compiling + creating a dsk is easy too.
Crazy fast text output. This is a great framework.
I think I'll start my game with CPCTelera too.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: arnoldemu on 20:27, 05 July 15
@ronaldo (http://www.cpcwiki.eu/forum/index.php?action=profile;u=1227): cpctelera is a nice game development environment.
If I wanted to use it with another library such as cpcrslib or my own sdcc libraries how is that supported? Do I need to edit the makefile
to make the library and link it in?

I think of cpctelera a bit like visual studio because it has a nice makefile generation script, nice tools and it's own library of cuntions so makes it easy to build programs.

I think if it would support other libraries that would make it more powerful and because the other libraries give the user a choice about the functions they want to use.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 21:01, 05 July 15
@arnoldemu (http://www.cpcwiki.eu/forum/index.php?action=profile;u=122): as you have all source code included with CPCtelera (http://lronaldo.github.io/cpctelera), it is not difficult to add functions or even complete libraries to the project. For instance, if you wanted to link CPCRSLib along with your project, you can do it for a given individual CPCtelera (http://lronaldo.github.io/cpctelera) project modifying the file cfg/build_config.mk:
Code: [Select]
##
## This line configures include directories for the project. Add -I<NewDirectory> to add an include folder where headers for a library reside.
##
Z80CCINCLUDE  := -I$(CPCT_SRC)
##
## This line configures linking for the project. Add -l<YourLibHere> to link with another library
##
Z80CCLINKARGS := -mz80 --no-std-crt0 -Wl-u \
                 --code-loc $(Z80CODELOC) \
                 --data-loc 0 -l$(CPCT_LIB)


You can do this either with CPCRSLib,  with your own library, with both of them... whatever you like :)

Personally, I didn't think of a way of including new libraries because of the way CPCtelera (http://lronaldo.github.io/cpctelera) library is constructed. Right now, your final binary only includes the concrete functions you use and their requirements. The functions you don't use are never added to your binary.

Taking this into account, CPCtelera (http://lronaldo.github.io/cpctelera) can include hundreds of functions by itself, either developed by me or contributed by anyone. There is no need to have distinct libraries and force the user to select. The user just goes to the reference manual and uses the desired functions. I think is much easier this way. Moreover, there is no need to split functionalities asking the user to pick the set of functionalities included in one versus other library. All functionalities can be together, grouped by modules just for clarity, and the user picks and uses.

Also take into account that you can directly add assembly files to your project (in ASZ80 syntax) and they will be compiled and included in your binary. That may suit your needs depending on your project requirements.

However, as you see, everything is open and easy to modify. If you have a different point of view you can easily add other libraries and use them. It's up to your needs :) . I have no plans right now to include other libraries along with CPCtelera (http://lronaldo.github.io/cpctelera), but I will happily include contributions to the library. If you have some assembly functions that you think could be included, that would be amazing :) . Of course, as I always do, any contribution is placed on authors file as this is not a 1-man project: I'm just one more developer, and this project rests in the work of lots of people :) .
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 21:07, 05 July 15
Because the chapter isn't only about sprites. At the moment it also contains a drawSolidBox() function, and in time you might add more, like e.g. a drawCircle() or what do I know. General graphical stuff.
I agree with your considerations, but I always battle against myself when dealing with naming :). Somethines I also thing that VIDEO items should also be included along with "Graphics".

I'll give it a thought for next release. I might rename o even reorder groups. I'll consider your suggestion, thanks :).

Thank you very much for your appreciation. There is nothing more rewarding in developing this framework that being it useful for people. Thanks :)
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: mr_lou on 21:13, 05 July 15
Right now, your final binary only includes the concrete functions you use and their requirements. The functions you don't use are never added to your binary.

I was just about to ask that question.
Very awesome! This looks more and more intriguing.

Yes, the names are always tricky. Thinking a bit more about it, the "Strings" section also kinda belongs under "Graphics".
So.... after some more thinking, maybe the headlines are actually fine the way they are...
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: mr_lou on 21:14, 05 July 15
Regarding TotO's Multiplay board.

It's read from BASIC using INP(&F990) and INP(&F991)

It's probably not CPCTelera specific, but I'm gonna ask anyway. How would I read these ports in CPCTelera?
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 21:52, 05 July 15
It's read from BASIC using INP(&F990) and INP(&F991)
It's probably not CPCTelera specific, but I'm gonna ask anyway. How would I read these ports in CPCTelera?
Right now, there is no function for directly reading ports in CPCtelera (http://lronaldo.github.io/cpctelera). However, you can easily add one to your project. Add a file called readport.s to your project src/ folder with these contents:
Code: [Select]
_readPort::
    pop af
    pop bc
    push bc
    push af
    in  l, (c)
    ret
Then, to use this function anywere in your C code, you need to declare it as extern, like this:
Code: [Select]
extern u8 readPort(u16 port);
You can place this declaration either on an include file or directly in the C file that calls the function.

Finally, you just call the function normally:
Code: [Select]
   u8 bytes[2];

   bytes[0] = readPort(0xF990);
   bytes[1] = readPort(0xF991);
And there you go :)
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: FloppySoftware on 22:23, 05 July 15
Humm...
Ronaldo, just a small question.  ;)
This programming framework could be easily adapted to build binaries for other platforms like... say, CP/M or the Amstrad PCW?  ???
 
 
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 22:29, 05 July 15
Taking into account that binaries generated are Z80 binaries, I assume they should be compatible. I have generated binaries for neither of them, but they should differ on the header, am I right?
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: FloppySoftware on 22:38, 05 July 15
Taking into account that binaries generated are Z80 binaries, I assume they should be compatible. I have generated binaries for neither of them, but they should differ on the header, am I right?

Right.  :D
 
For me, a standard CP/M header would be fine for both (CP/M and PCW).
 
Not too much problem, I believe.
 
And the plain CP/M binary, should be compatible with the CPCs (and other Z80 computers), running CP/M (not a bad idea).
 
I will have a look, then.
 
Thanks!
 
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 22:44, 05 July 15
Then to produce CP/M binaries the change would be to add the appropriate header when creating DSKs and CDTs. That shouldn't be so difficult. Check for global_functions.mk file (https://github.com/lronaldo/cpctelera/blob/master/cpctelera/cfg/global_functions.mk). There are two macros CREATEDSK and CREATECDT. They rely on iDSK and 2CDT programs. Adding a new macro like CREATECPMDSK or similar could be used, that calls appropriate programs for adding header to binary file and creating the DSK.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: Paulo Garcia on 17:58, 06 July 15

Hey

About the question to link CPCRSLIB with CPCtelera. Is it possible to someone summarize where CPCTelera overlaps CPCRSLIB, or why I should choose to use both (where they complement each other) ?


Being completely new to Amstrad development, I hope someone can bring some light to this.


Thanks




Paulo
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: mr_lou on 15:33, 09 July 15
I have a question to @ronaldo (http://www.cpcwiki.eu/forum/index.php?action=profile;u=1227) (although it might be SDCC related rather than CPCTelera related)....

I'm doing this:
Code: [Select]
if (cpct_isKeyPressed(Joy0_Up)) doStuff();
if (cpct_isKeyPressed(Joy0_Left)) doSomeOtherStuff();
if (cpct_isKeyPressed(Joy0_Right)) doSomethingElse();

When I compile that, it says to me:
src/main.c:53: warning 110: conditional flow changed by optimizer: so said EVELYN the modified DOG
src/main.c:54: warning 110: conditional flow changed by optimizer: so said EVELYN the modified DOG

Experimenting, I tried changing my code to this:
Code: [Select]
if (cpct_isKeyPressed(Joy0_Up)) doStuff();
else if (cpct_isKeyPressed(Joy0_Left)) doSomeOtherStuff();
else if (cpct_isKeyPressed(Joy0_Right)) doSomethingElse();

Then warnings are gone.

So... it appears it requires me to use "else if" - as if a joystick can only either be up or left or right...
But a joystick can easily be both up and right, or both up and left.

Any thoughts?
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: FloppySoftware on 16:12, 09 July 15
It seems you have two options:
1. Disable the SDCC optimizations in full (bad option, if you want the other optimizations that SDCC does).
2. Declare the variables Joy0_Up, etc. as volatile.
 
Hope this helps.
 
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: mr_lou on 16:28, 09 July 15
2. Declare the variables Joy0_Up, etc. as volatile.

But the variable Joy0_Up (and the others) are CPCTelera keyID's. Meaning, they're declared by CPCTelera.

I'll wait for a comment from @ronaldo (http://www.cpcwiki.eu/forum/index.php?action=profile;u=1227). Maybe it is him who should declare them as volatile inside his framework?
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 19:06, 09 July 15
Sorry, guys. These days I'm presenting some work in a spanish conference (JENUI 2015) and have extremely limited time.

@Paulo Garcia (http://www.cpcwiki.eu/forum/index.php?action=profile;u=1440): CPCRSLib has some functionalities that CPCtelera doesn't. CPCRSLib was developed years ago and was more focused on functionality. CPCtelera is very young and is mainly focused on code quality, documentation and usability. It takes way longer for any given functionality to be implemented for CPCtelera simply because there are much more requisites (mainly usability and documentation). Said this, a coder having experience with CPCRSLib may want to continue using it because it has these extra functions, and the coder is used or has previous code developed for it.

@mr_lou (http://www.cpcwiki.eu/forum/index.php?action=profile;u=96): this warning does not normally represent a problem. What it is saying to you is that the optimizer has found a different way of implementing your logic to make it faster. That can happen, for instance, if one of your "doStuff()" functions is still a placeholder with nothing inside or, if that function has an code flow that does nothing in general or under some assumptions. I would need to analize your code for understanding better your personal case.

@FloppySoftware (http://www.cpcwiki.eu/forum/index.php?action=profile;u=1162), @mr_lou (http://www.cpcwiki.eu/forum/index.php?action=profile;u=96): Joy0_Up and other keyID values are constants. It does not make sense at all to declare them as volatile, as they shouldn't change at all and the compiler may implement them with fixed values in the code (not with a given value stored at a given memory location). Even if that was legal, it would be fatal, as it would destroy compiler possibilities to optimize based on those values being constants.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: Carnivius on 19:13, 09 July 15
I feel like an idiot for asking but how do you even get this running?  I downloaded the main file and unzipped it but not sure what I do with it.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 19:28, 09 July 15
@Carnivac (http://www.cpcwiki.eu/forum/index.php?action=profile;u=50): Have you had a look to the online manual? It has install instructions (http://lronaldo.github.io/cpctelera/files/readme-txt.html#Installing_CPCtelera)

I prefer you following them to know if they have any mistake or can be better explained in any way  :)
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: Carnivius on 20:11, 09 July 15
I got as far as
Quote
4. Launch setup.sh
./setup.sh

and got
Quote
'.' is not recognized as an internal or external command, operable program or batch file.

Am I even doing this in the right thing.  It said enter this stuff into the terminal and I don't know what a terminal is but the commands looked like lil DOS-type CMD thingy so I was using that.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: mr_lou on 20:28, 09 July 15
Am I even doing this in the right thing.  It said enter this stuff into the terminal and I don't know what a terminal is but the commands looked like lil DOS-type CMD thingy so I was using that.

The ./setup.sh is a Linux thing.
Are you trying to run it under Windows?
According to the install instructions, you need Cygwin to install on Windows. Did you download and install Cygwin?
Or what OS are you using?
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: Carnivius on 20:30, 09 July 15
The ./setup.sh is a Linux thing.
Are you trying to run it under Windows?
According to the install instructions, you need Cygwin to install on Windows. Did you download and install Cygwin?
Or what OS are you using?

I installed that cygwin thing but I didn't know what it was or what it had to do with the running cpctelera bit.   Ugh.  I thought I'd had my last experiences of running linux related stuff years ago...

am trying to run this on Windows 7  64bit home thingy.


ok now i i look at my start menu i see cygwin put a folder and put cygwin terminal in it.  ok i'll try that.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: Carnivius on 20:34, 09 July 15
ok next problem

Quote
This setup script will help you configure CPCtelera in your system.

===============================================================
== 1: CPCtelera initial tests
===============================================================
> Checking directory structure... [ OK ]
> Checking important files....... [ OK ]
> Checking required commands...
>>> Looking for 'gcc'... [ OK ]
>>> Looking for 'g++'... [ OK ]
>>> Looking for 'make'...

#########################
## UNRECOVERABLE ERROR ##
#########################
##> Command 'make' not found installed in the system. make is required for all C                            PCtelera's build systems. Please, install it an run setup again.


pc@TARDIS ~/cpctelera
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: mr_lou on 20:48, 09 July 15
ok next problem

Well, it's been lots of years since I touched Windows.
But according to the installation guide, those packages should be installed when you installed Cygwin.
Sorry I can't help.
It's clear that the install script complains that the "make" program is missing. Should be a part of Cygwin as far as I understand. But I suppose you could search for "make" elsewhere online.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: Paulo Garcia on 20:59, 09 July 15
I don't think make is installed by default. Check this Stack Overflow answer that will probably help you: c++ - Cygwin Make bash command not found - Stack Overflow (http://stackoverflow.com/questions/4828388/cygwin-make-bash-command-not-found)


I hope that helps


Paulo
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: Carnivius on 21:10, 09 July 15
Ok i ran the cygwin setup again and looked for make and select the make gnu thingy cos the other ones were gnus too.

Quote
> Checking directory structure... [ OK ]
> Checking important files....... [ OK ]
> Checking required commands...
>>> Looking for 'gcc'... [ OK ]
>>> Looking for 'g++'... [ OK ]
>>> Looking for 'make'... [ OK ]
>>> Looking for 'bison'... [ OK ]
>>> Looking for 'flex'... [ OK ]
> Checking required libraries...
>>> Looking for 'boost/graph/adjacency_list.hpp'... [ OK ]
>>> Looking for 'libintl.h'... [ OK ]
Everything seems to be OK.

===============================================================
== 2: Building CPCtelera tools, z80 library and examples
===============================================================
> Proceeding to build required tools to build and manage CPCtelera and other software for Amstrad CPC (This might take a while, depending on your system):
>>> Building compilation tools:                                     1%

Progress!   Seems busy now building stuffs.  I go play PS4 while it does that.   Thanks for help.  I will probably require more.  :)
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 21:22, 09 July 15
@Carnivac (http://www.cpcwiki.eu/forum/index.php?action=profile;u=50): sorry, man. I should make an additional document with install instruction for non-Linux programmers. I think I'll make a video.

Take a look at the instructions I left you on the previous link. There is a list of software requirements you have to tell cygwin to install. Make is just one of them, but you require more stuff.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: Carnivius on 21:35, 09 July 15
@Carnivac (http://www.cpcwiki.eu/forum/index.php?action=profile;u=50): sorry, man. I should make an additional document with install instruction for non-Linux programmers. I think I'll make a video.

Take a look at the instructions I left you on the previous link. There is a list of software requirements you have to tell cygwin to install. Make is just one of them, but you require more stuff.

You're right. 
Quote
  • gcc-core, gcc-g++, make
  • bison, flex, libboost-devel, libintl-devel
I don't know how I missed 'make' before. I sorry. :(
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 21:59, 09 July 15
@Has it finally installed itself propperly?

If you need anything just ask, and I'll try to answer ASAP :) (though I'm in the middle of a trip)
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: Carnivius on 23:27, 09 July 15
Thanks

Trying to figure out Retro Game Asset Studio.   I imported a sprite I did in Paint Shop Pro but the colours got messed up so I went and changed the palette in RGAS to match the sprite... imported again...and the palette got all messed up again making colours 'available' that I had clearly removed from the choice of 16.  Getting bit frustrated.  ???

ok getting there...  slowly... i wanna start with a simple lil project. 
 
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: lachlank on 00:53, 10 July 15
Thanks

Trying to figure out Retro Game Asset Studio.   I imported a sprite I did in Paint Shop Pro but the colours got messed up so I went and changed the palette in RGAS to match the sprite... imported again...and the palette got all messed up again making colours 'available' that I had clearly removed from the choice of 16.  Getting bit frustrated.  ???

ok getting there...  slowly... i wanna start with a simple lil project.


If you have any issues with RGAS just email me the file you're trying to import and I'll take a look (lachlankeown at gmail).





Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: lachlank on 01:29, 10 July 15
This is probably not the right place, but I thought it would be useful to start a collection of useful functions for CPCTelera. In due course the more common may become candidates to be included in the core library itself.


Firstly I have a function for printing mode 0 characters of width 4 pixels on screen, without using firmware. I have also attached the RGAS file so you can change colours (right-click foreground/background colour tool button). NOTE this function only prints upper case characters within the ascii range 32(Space) - 90(Z). If you pass a string with characters outside this range you will get a sprite from elsewhere in memory i.e. garbage.
Code: [Select]

void printString(u8 *str, u8 x, u8 y) {   
   u8* scrAddr = cpct_getScreenPtr ((void *) 0xC000, x, y);   
   
   while (*str > 0) {
      u8 *charSprite = G_Chars + ((*str - 32) * 16);
     
     
      cpct_drawSprite (charSprite, scrAddr, 2, 8);
     
      str++;
      scrAddr += 2;
     
   }   
   
}



const unsigned char G_Chars[944] = {
   0xF3, 0xF3, 0xF3, 0xF3,0xF3, 0xF3,0xF3, 0xF3,0xF3, 0xF3,0xF3, 0xF3,
   0xF3, 0xF3, 0xF3, 0xF3,0xD1, 0xF3,0xF1, 0xF3,0xD1, 0xF3,0xD1, 0xF3,
   0xF3, 0xF3, 0xF9, 0xF3,0xD1, 0xF3,0xF3, 0xF3,0xD1, 0xD1,0xF1, 0xF1,
   0xD1, 0xD1, 0xF3, 0xF3,0xF3, 0xF3,0xF3, 0xF3,0xF3, 0xF3,0xF3, 0xF3,
   0xF3, 0xF3, 0xF3, 0xF1,0xE2, 0xD1,0xC0, 0xD1,0xCF, 0xDB,0xFC, 0xF3,
   0xD1, 0xF3, 0xF3, 0xF3,0xE2, 0xF3,0xF0, 0xF1,0xC0, 0xF3,0xC0, 0xD1,
   0xE7, 0xDB, 0xFC, 0xF9,0xE2, 0xF3,0xF3, 0xF3,0xF3, 0xF3,0xF2, 0xF3,
   0xC0, 0xD1, 0xC0, 0xD1,0xCF, 0xDB,0xF6, 0xF3,0xF3, 0xF3,0xF3, 0xF3,
   0xE2, 0xF3, 0xF0, 0xF1,0xC0, 0xD1,0xC0, 0xD1,0xCF, 0xDB,0xFC, 0xF9,
   0xC0, 0xD1, 0xF3, 0xF3,0xE2, 0xF3,0xF2, 0xF3,0xD1, 0xF3,0xF3, 0xF3,
   0xF3, 0xF3, 0xF3, 0xF3,0xF3, 0xF3,0xF3, 0xF3,0xC0, 0xF3,0xF1, 0xF3,
   0xD1, 0xF3, 0xD1, 0xF3,0xDB, 0xF3,0xF9, 0xF3,0xC0, 0xF3,0xF3, 0xF3,
   0xE2, 0xD1, 0xF3, 0xF1,0xF3, 0xD1,0xF3, 0xD1,0xF3, 0xDB,0xF3, 0xF9,
   0xE2, 0xD1, 0xF3, 0xF3,0xC0, 0xD1,0xF0, 0xF1,0xC0, 0xD1,0xC0, 0xD1,
   0xCF, 0xDB, 0xFC, 0xF9,0xC0, 0xD1,0xF3, 0xF3,0xE2, 0xF3,0xF0, 0xF1,
   0xC0, 0xD1, 0xC0, 0xD1,0xE7, 0xF3,0xF6, 0xF3,0xC0, 0xD1,0xF3, 0xF3,
   0xF3, 0xF3, 0xF3, 0xF3,0xF3, 0xF3,0xF3, 0xF3,0xE7, 0xF3,0xF6, 0xF3,
   0xD1, 0xF3, 0xF3, 0xF3,0xF3, 0xF3,0xF3, 0xF3,0xF3, 0xF3,0xC0, 0xD1,
   0xF3, 0xF3, 0xF3, 0xF3,0xF3, 0xF3,0xF3, 0xF3,0xF3, 0xF3,0xF3, 0xF3,
   0xF3, 0xF3, 0xF3, 0xF3,0xF3, 0xF3,0xF9, 0xF3,0xD1, 0xF3,0xF3, 0xF3,
   0xF3, 0xD1, 0xF3, 0xF1,0xE2, 0xD1,0xE2, 0xF3,0xCF, 0xF3,0xF9, 0xF3,
   0xD1, 0xF3, 0xF3, 0xF3,0xC0, 0xD1,0xF1, 0xF1,0xD1, 0xD1,0xD1, 0xD1,
   0xDB, 0xDB, 0xF9, 0xF9,0xC0, 0xD1,0xF3, 0xF3,0xE2, 0xF3,0xF2, 0xF3,
   0xE2, 0xF3, 0xE2, 0xF3,0xE7, 0xF3,0xF6, 0xF3,0xE2, 0xF3,0xF3, 0xF3,
   0xC0, 0xD1, 0xF1, 0xF1,0xF3, 0xD1,0xC0, 0xD1,0xDB, 0xF3,0xF9, 0xF9,
   0xC0, 0xD1, 0xF3, 0xF3,0xC0, 0xD1,0xF1, 0xF1,0xF3, 0xD1,0xE2, 0xD1,
   0xF3, 0xDB, 0xF9, 0xF9,0xC0, 0xD1,0xF3, 0xF3,0xD1, 0xF3,0xF1, 0xF3,
   0xC0, 0xF3, 0xC0, 0xD1,0xE7, 0xF3,0xF6, 0xF3,0xE2, 0xF3,0xF3, 0xF3,
   0xC0, 0xD1, 0xF1, 0xF3,0xD1, 0xF3,0xC0, 0xD1,0xF3, 0xDB,0xF9, 0xF9,
   0xC0, 0xD1, 0xF3, 0xF3,0xC0, 0xD1,0xF1, 0xF3,0xD1, 0xF3,0xC0, 0xD1,
   0xDB, 0xDB, 0xF9, 0xF9,0xC0, 0xD1,0xF3, 0xF3,0xC0, 0xD1,0xF1, 0xF1,
   0xF3, 0xD1, 0xF3, 0xD1,0xF3, 0xDB,0xF3, 0xF9,0xF3, 0xD1,0xF3, 0xF3,
   0xC0, 0xD1, 0xF1, 0xF1,0xD1, 0xD1,0xC0, 0xD1,0xDB, 0xDB,0xF9, 0xF9,
   0xC0, 0xD1, 0xF3, 0xF3,0xC0, 0xD1,0xF1, 0xF1,0xD1, 0xD1,0xC0, 0xD1,
   0xF3, 0xDB, 0xF3, 0xF9,0xF3, 0xD1,0xF3, 0xF3,0xF3, 0xF3,0xF2, 0xF3,
   0xE2, 0xF3, 0xF3, 0xF3,0xE7, 0xF3,0xF6, 0xF3,0xF3, 0xF3,0xF3, 0xF3,
   0xF3, 0xF3, 0xF2, 0xF3,0xE2, 0xF3,0xF3, 0xF3,0xE7, 0xF3,0xF6, 0xF3,
   0xD1, 0xF3, 0xF3, 0xF3,0xF3, 0xD1,0xF3, 0xF1,0xE2, 0xF3,0xC0, 0xF3,
   0xE7, 0xF3, 0xF3, 0xF9,0xF3, 0xD1,0xF3, 0xF3,0xF3, 0xF3,0xF3, 0xF3,
   0xC0, 0xD1, 0xF3, 0xF3,0xCF, 0xDB,0xF3, 0xF3,0xF3, 0xF3,0xF3, 0xF3,
   0xD1, 0xF3, 0xF1, 0xF3,0xE2, 0xF3,0xE2, 0xD1,0xE7, 0xF3,0xF9, 0xF3,
   0xD1, 0xF3, 0xF3, 0xF3,0xC0, 0xD1,0xF1, 0xF1,0xF3, 0xD1,0xE2, 0xD1,
   0xE7, 0xF3, 0xF3, 0xF3,0xE2, 0xF3,0xF3, 0xF3,0xE2, 0xF3,0xF2, 0xF3,
   0xE2, 0xF3, 0xC0, 0xD1,0xE7, 0xF3,0xF6, 0xF3,0xE2, 0xF3,0xF3, 0xF3,
   0xC0, 0xD1, 0xF1, 0xF1,0xD1, 0xD1,0xD1, 0xD1,0xCF, 0xDB,0xF9, 0xF9,
   0xD1, 0xD1, 0xF3, 0xF3,0xC0, 0xD1,0xF1, 0xF1,0xD1, 0xD1,0xC0, 0xF3,
   0xDB, 0xDB, 0xF9, 0xF9,0xC0, 0xD1,0xF3, 0xF3,0xC0, 0xD1,0xF1, 0xF1,
   0xD1, 0xF3, 0xD1, 0xF3,0xDB, 0xF3,0xF9, 0xF9,0xC0, 0xD1,0xF3, 0xF3,
   0xC0, 0xF3, 0xF1, 0xF1,0xD1, 0xD1,0xD1, 0xD1,0xDB, 0xDB,0xF9, 0xF9,
   0xC0, 0xF3, 0xF3, 0xF3,0xC0, 0xD1,0xF1, 0xF3,0xD1, 0xF3,0xC0, 0xD1,
   0xDB, 0xF3, 0xF9, 0xF3,0xC0, 0xD1,0xF3, 0xF3,0xC0, 0xD1,0xF1, 0xF3,
   0xD1, 0xF3, 0xC0, 0xD1,0xDB, 0xF3,0xF9, 0xF3,0xD1, 0xF3,0xF3, 0xF3,
   0xC0, 0xD1, 0xF1, 0xF3,0xD1, 0xF3,0xD1, 0xD1,0xDB, 0xDB,0xF9, 0xF9,
   0xC0, 0xD1, 0xF3, 0xF3,0xD1, 0xD1,0xF1, 0xF1,0xD1, 0xD1,0xC0, 0xD1,
   0xDB, 0xDB, 0xF9, 0xF9,0xD1, 0xD1,0xF3, 0xF3,0xC0, 0xD1,0xF2, 0xF3,
   0xE2, 0xF3, 0xE2, 0xF3,0xE7, 0xF3,0xF6, 0xF3,0xC0, 0xD1,0xF3, 0xF3,
   0xE2, 0xD1, 0xF3, 0xF1,0xF3, 0xD1,0xF3, 0xD1,0xF3, 0xDB,0xF9, 0xF9,
   0xC0, 0xD1, 0xF3, 0xF3,0xD1, 0xD1,0xF1, 0xF1,0xC0, 0xF3,0xC0, 0xF3,
   0xDB, 0xDB, 0xF9, 0xF9,0xD1, 0xD1,0xF3, 0xF3,0xD1, 0xF3,0xF1, 0xF3,
   0xD1, 0xF3, 0xD1, 0xF3,0xDB, 0xF3,0xF9, 0xF3,0xC0, 0xD1,0xF3, 0xF3,
   0xD1, 0xD1, 0xF0, 0xF1,0xC0, 0xD1,0xC0, 0xD1,0xDB, 0xDB,0xF9, 0xF9,
   0xD1, 0xD1, 0xF3, 0xF3,0xD1, 0xD1,0xF0, 0xF1,0xC0, 0xD1,0xC0, 0xD1,
   0xCF, 0xDB, 0xFC, 0xF9,0xD1, 0xD1,0xF3, 0xF3,0xC0, 0xD1,0xF1, 0xF1,
   0xD1, 0xD1, 0xD1, 0xD1,0xDB, 0xDB,0xF9, 0xF9,0xC0, 0xD1,0xF3, 0xF3,
   0xC0, 0xD1, 0xF1, 0xF1,0xD1, 0xD1,0xD1, 0xD1,0xCF, 0xDB,0xF9, 0xF3,
   0xD1, 0xF3, 0xF3, 0xF3,0xC0, 0xD1,0xF1, 0xF1,0xD1, 0xD1,0xD1, 0xD1,
   0xCF, 0xDB, 0xFC, 0xF3,0xC0, 0xD1,0xF3, 0xF3,0xC0, 0xD1,0xF1, 0xF1,
   0xD1, 0xD1, 0xD1, 0xD1,0xCF, 0xF3,0xF9, 0xF9,0xD1, 0xD1,0xF3, 0xF3,
   0xC0, 0xD1, 0xF1, 0xF1,0xD1, 0xF3,0xC0, 0xD1,0xF3, 0xDB,0xF9, 0xF9,
   0xC0, 0xD1, 0xF3, 0xF3,0xC0, 0xD1,0xF2, 0xF3,0xE2, 0xF3,0xE2, 0xF3,
   0xE7, 0xF3, 0xF6, 0xF3,0xE2, 0xF3,0xF3, 0xF3,0xD1, 0xD1,0xF1, 0xF1,
   0xD1, 0xD1, 0xD1, 0xD1,0xDB, 0xDB,0xF9, 0xF9,0xC0, 0xD1,0xF3, 0xF3,
   0xD1, 0xD1, 0xF1, 0xF1,0xD1, 0xD1,0xD1, 0xD1,0xCF, 0xDB,0xF6, 0xF3,
   0xE2, 0xF3, 0xF3, 0xF3,0xD1, 0xD1,0xF1, 0xF1,0xD1, 0xD1,0xD1, 0xD1,
   0xCF, 0xDB, 0xFC, 0xF9,0xD1, 0xD1,0xF3, 0xF3,0xD1, 0xD1,0xF1, 0xF1,
   0xC0, 0xD1, 0xE2, 0xF3,0xCF, 0xDB,0xF9, 0xF9,0xD1, 0xD1,0xF3, 0xF3,
   0xD1, 0xD1, 0xF1, 0xF1,0xD1, 0xD1,0xC0, 0xD1,0xE7, 0xF3,0xF6, 0xF3,
   0xE2, 0xF3, 0xF3, 0xF3,0xC0, 0xD1,0xF3, 0xF1,0xE2, 0xD1,0xE2, 0xF3,
   0xCF, 0xF3, 0xF9, 0xF3,0xC0, 0xD1,0xF3, 0xF3};




Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: lachlank on 01:41, 10 July 15
Nextly a function to set the stack location. This is useful if you are doing double-buffering with the page 0x8000. Although a small stack will fit in the empty space before 0xC000, any complex functions will rapidly push this into the visible area, in which case a good choice for stack location is 0x8000. Note this must be called from main(), or from an inline function called from main (i.e. when the stack is empty). And probably after disabling firmware.


Code: [Select]
// in c code
extern void SetStack();


void main() {
   SetStack();
   ...
}


; in assembly (.s file).

.area _CODE


_SetStack::
pop hl ; preserve return address in main()
ld sp, #0x8000 ; whatever address you want stack to start at
jp (hl) ; return



Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: FloppySoftware on 01:41, 10 July 15
Sorry, guys. These days I'm presenting some work in a spanish conference (JENUI 2015) and have extremely limited time.

@Paulo Garcia (http://www.cpcwiki.eu/forum/index.php?action=profile;u=1440): CPCRSLib has some functionalities that CPCtelera doesn't. CPCRSLib was developed years ago and was more focused on functionality. CPCtelera is very young and is mainly focused on code quality, documentation and usability. It takes way longer for any given functionality to be implemented for CPCtelera simply because there are much more requisites (mainly usability and documentation). Said this, a coder having experience with CPCRSLib may want to continue using it because it has these extra functions, and the coder is used or has previous code developed for it.

@mr_lou (http://www.cpcwiki.eu/forum/index.php?action=profile;u=96): this warning does not normally represent a problem. What it is saying to you is that the optimizer has found a different way of implementing your logic to make it faster. That can happen, for instance, if one of your "doStuff()" functions is still a placeholder with nothing inside or, if that function has an code flow that does nothing in general or under some assumptions. I would need to analize your code for understanding better your personal case.

@FloppySoftware (http://www.cpcwiki.eu/forum/index.php?action=profile;u=1162), @mr_lou (http://www.cpcwiki.eu/forum/index.php?action=profile;u=96): Joy0_Up and other keyID values are constants. It does not make sense at all to declare them as volatile, as they shouldn't change at all and the compiler may implement them with fixed values in the code (not with a given value stored at a given memory location). Even if that was legal, it would be fatal, as it would destroy compiler possibilities to optimize based on those values being constants.

Oh, sorry, I thought they were simple variables, not constants.

In this case, I would have a look to the generated Z80 code, to check possible problems.

Enviado desde mi GT-S6500D usando Tapatalk 2

Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: Carnivius on 02:12, 10 July 15

If you have any issues with RGAS just email me the file you're trying to import and I'll take a look (lachlankeown at gmail).

Cheers.  Will do. :)
It's a neat program.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ervin on 03:12, 10 July 15
This is probably not the right place, but I thought it would be useful to start a collection of useful functions for CPCTelera. In due course the more common may become candidates to be included in the core library itself.


Firstly I have a function for printing mode 0 characters of width 4 pixels on screen, without using firmware. I have also attached the RGAS file so you can change colours (right-click foreground/background colour tool button). NOTE this function only prints upper case characters within the ascii range 32(Space) - 90(Z). If you pass a string with characters outside this range you will get a sprite from elsewhere in memory i.e. garbage.
Code: [Select]

void printString(u8 *str, u8 x, u8 y) {   
   u8* scrAddr = cpct_getScreenPtr ((void *) 0xC000, x, y);   
   
   while (*str > 0) {
      u8 *charSprite = G_Chars + ((*str - 32) * 16);
     
     
      cpct_drawSprite (charSprite, scrAddr, 2, 8);
     
      str++;
      scrAddr += 2;
     
   }   
   
}



const unsigned char G_Chars[944] = {
   0xF3, 0xF3, 0xF3, 0xF3,0xF3, 0xF3,0xF3, 0xF3,0xF3, 0xF3,0xF3, 0xF3,
   0xF3, 0xF3, 0xF3, 0xF3,0xD1, 0xF3,0xF1, 0xF3,0xD1, 0xF3,0xD1, 0xF3,
   0xF3, 0xF3, 0xF9, 0xF3,0xD1, 0xF3,0xF3, 0xF3,0xD1, 0xD1,0xF1, 0xF1,
   0xD1, 0xD1, 0xF3, 0xF3,0xF3, 0xF3,0xF3, 0xF3,0xF3, 0xF3,0xF3, 0xF3,
   0xF3, 0xF3, 0xF3, 0xF1,0xE2, 0xD1,0xC0, 0xD1,0xCF, 0xDB,0xFC, 0xF3,
   0xD1, 0xF3, 0xF3, 0xF3,0xE2, 0xF3,0xF0, 0xF1,0xC0, 0xF3,0xC0, 0xD1,
   0xE7, 0xDB, 0xFC, 0xF9,0xE2, 0xF3,0xF3, 0xF3,0xF3, 0xF3,0xF2, 0xF3,
   0xC0, 0xD1, 0xC0, 0xD1,0xCF, 0xDB,0xF6, 0xF3,0xF3, 0xF3,0xF3, 0xF3,
   0xE2, 0xF3, 0xF0, 0xF1,0xC0, 0xD1,0xC0, 0xD1,0xCF, 0xDB,0xFC, 0xF9,
   0xC0, 0xD1, 0xF3, 0xF3,0xE2, 0xF3,0xF2, 0xF3,0xD1, 0xF3,0xF3, 0xF3,
   0xF3, 0xF3, 0xF3, 0xF3,0xF3, 0xF3,0xF3, 0xF3,0xC0, 0xF3,0xF1, 0xF3,
   0xD1, 0xF3, 0xD1, 0xF3,0xDB, 0xF3,0xF9, 0xF3,0xC0, 0xF3,0xF3, 0xF3,
   0xE2, 0xD1, 0xF3, 0xF1,0xF3, 0xD1,0xF3, 0xD1,0xF3, 0xDB,0xF3, 0xF9,
   0xE2, 0xD1, 0xF3, 0xF3,0xC0, 0xD1,0xF0, 0xF1,0xC0, 0xD1,0xC0, 0xD1,
   0xCF, 0xDB, 0xFC, 0xF9,0xC0, 0xD1,0xF3, 0xF3,0xE2, 0xF3,0xF0, 0xF1,
   0xC0, 0xD1, 0xC0, 0xD1,0xE7, 0xF3,0xF6, 0xF3,0xC0, 0xD1,0xF3, 0xF3,
   0xF3, 0xF3, 0xF3, 0xF3,0xF3, 0xF3,0xF3, 0xF3,0xE7, 0xF3,0xF6, 0xF3,
   0xD1, 0xF3, 0xF3, 0xF3,0xF3, 0xF3,0xF3, 0xF3,0xF3, 0xF3,0xC0, 0xD1,
   0xF3, 0xF3, 0xF3, 0xF3,0xF3, 0xF3,0xF3, 0xF3,0xF3, 0xF3,0xF3, 0xF3,
   0xF3, 0xF3, 0xF3, 0xF3,0xF3, 0xF3,0xF9, 0xF3,0xD1, 0xF3,0xF3, 0xF3,
   0xF3, 0xD1, 0xF3, 0xF1,0xE2, 0xD1,0xE2, 0xF3,0xCF, 0xF3,0xF9, 0xF3,
   0xD1, 0xF3, 0xF3, 0xF3,0xC0, 0xD1,0xF1, 0xF1,0xD1, 0xD1,0xD1, 0xD1,
   0xDB, 0xDB, 0xF9, 0xF9,0xC0, 0xD1,0xF3, 0xF3,0xE2, 0xF3,0xF2, 0xF3,
   0xE2, 0xF3, 0xE2, 0xF3,0xE7, 0xF3,0xF6, 0xF3,0xE2, 0xF3,0xF3, 0xF3,
   0xC0, 0xD1, 0xF1, 0xF1,0xF3, 0xD1,0xC0, 0xD1,0xDB, 0xF3,0xF9, 0xF9,
   0xC0, 0xD1, 0xF3, 0xF3,0xC0, 0xD1,0xF1, 0xF1,0xF3, 0xD1,0xE2, 0xD1,
   0xF3, 0xDB, 0xF9, 0xF9,0xC0, 0xD1,0xF3, 0xF3,0xD1, 0xF3,0xF1, 0xF3,
   0xC0, 0xF3, 0xC0, 0xD1,0xE7, 0xF3,0xF6, 0xF3,0xE2, 0xF3,0xF3, 0xF3,
   0xC0, 0xD1, 0xF1, 0xF3,0xD1, 0xF3,0xC0, 0xD1,0xF3, 0xDB,0xF9, 0xF9,
   0xC0, 0xD1, 0xF3, 0xF3,0xC0, 0xD1,0xF1, 0xF3,0xD1, 0xF3,0xC0, 0xD1,
   0xDB, 0xDB, 0xF9, 0xF9,0xC0, 0xD1,0xF3, 0xF3,0xC0, 0xD1,0xF1, 0xF1,
   0xF3, 0xD1, 0xF3, 0xD1,0xF3, 0xDB,0xF3, 0xF9,0xF3, 0xD1,0xF3, 0xF3,
   0xC0, 0xD1, 0xF1, 0xF1,0xD1, 0xD1,0xC0, 0xD1,0xDB, 0xDB,0xF9, 0xF9,
   0xC0, 0xD1, 0xF3, 0xF3,0xC0, 0xD1,0xF1, 0xF1,0xD1, 0xD1,0xC0, 0xD1,
   0xF3, 0xDB, 0xF3, 0xF9,0xF3, 0xD1,0xF3, 0xF3,0xF3, 0xF3,0xF2, 0xF3,
   0xE2, 0xF3, 0xF3, 0xF3,0xE7, 0xF3,0xF6, 0xF3,0xF3, 0xF3,0xF3, 0xF3,
   0xF3, 0xF3, 0xF2, 0xF3,0xE2, 0xF3,0xF3, 0xF3,0xE7, 0xF3,0xF6, 0xF3,
   0xD1, 0xF3, 0xF3, 0xF3,0xF3, 0xD1,0xF3, 0xF1,0xE2, 0xF3,0xC0, 0xF3,
   0xE7, 0xF3, 0xF3, 0xF9,0xF3, 0xD1,0xF3, 0xF3,0xF3, 0xF3,0xF3, 0xF3,
   0xC0, 0xD1, 0xF3, 0xF3,0xCF, 0xDB,0xF3, 0xF3,0xF3, 0xF3,0xF3, 0xF3,
   0xD1, 0xF3, 0xF1, 0xF3,0xE2, 0xF3,0xE2, 0xD1,0xE7, 0xF3,0xF9, 0xF3,
   0xD1, 0xF3, 0xF3, 0xF3,0xC0, 0xD1,0xF1, 0xF1,0xF3, 0xD1,0xE2, 0xD1,
   0xE7, 0xF3, 0xF3, 0xF3,0xE2, 0xF3,0xF3, 0xF3,0xE2, 0xF3,0xF2, 0xF3,
   0xE2, 0xF3, 0xC0, 0xD1,0xE7, 0xF3,0xF6, 0xF3,0xE2, 0xF3,0xF3, 0xF3,
   0xC0, 0xD1, 0xF1, 0xF1,0xD1, 0xD1,0xD1, 0xD1,0xCF, 0xDB,0xF9, 0xF9,
   0xD1, 0xD1, 0xF3, 0xF3,0xC0, 0xD1,0xF1, 0xF1,0xD1, 0xD1,0xC0, 0xF3,
   0xDB, 0xDB, 0xF9, 0xF9,0xC0, 0xD1,0xF3, 0xF3,0xC0, 0xD1,0xF1, 0xF1,
   0xD1, 0xF3, 0xD1, 0xF3,0xDB, 0xF3,0xF9, 0xF9,0xC0, 0xD1,0xF3, 0xF3,
   0xC0, 0xF3, 0xF1, 0xF1,0xD1, 0xD1,0xD1, 0xD1,0xDB, 0xDB,0xF9, 0xF9,
   0xC0, 0xF3, 0xF3, 0xF3,0xC0, 0xD1,0xF1, 0xF3,0xD1, 0xF3,0xC0, 0xD1,
   0xDB, 0xF3, 0xF9, 0xF3,0xC0, 0xD1,0xF3, 0xF3,0xC0, 0xD1,0xF1, 0xF3,
   0xD1, 0xF3, 0xC0, 0xD1,0xDB, 0xF3,0xF9, 0xF3,0xD1, 0xF3,0xF3, 0xF3,
   0xC0, 0xD1, 0xF1, 0xF3,0xD1, 0xF3,0xD1, 0xD1,0xDB, 0xDB,0xF9, 0xF9,
   0xC0, 0xD1, 0xF3, 0xF3,0xD1, 0xD1,0xF1, 0xF1,0xD1, 0xD1,0xC0, 0xD1,
   0xDB, 0xDB, 0xF9, 0xF9,0xD1, 0xD1,0xF3, 0xF3,0xC0, 0xD1,0xF2, 0xF3,
   0xE2, 0xF3, 0xE2, 0xF3,0xE7, 0xF3,0xF6, 0xF3,0xC0, 0xD1,0xF3, 0xF3,
   0xE2, 0xD1, 0xF3, 0xF1,0xF3, 0xD1,0xF3, 0xD1,0xF3, 0xDB,0xF9, 0xF9,
   0xC0, 0xD1, 0xF3, 0xF3,0xD1, 0xD1,0xF1, 0xF1,0xC0, 0xF3,0xC0, 0xF3,
   0xDB, 0xDB, 0xF9, 0xF9,0xD1, 0xD1,0xF3, 0xF3,0xD1, 0xF3,0xF1, 0xF3,
   0xD1, 0xF3, 0xD1, 0xF3,0xDB, 0xF3,0xF9, 0xF3,0xC0, 0xD1,0xF3, 0xF3,
   0xD1, 0xD1, 0xF0, 0xF1,0xC0, 0xD1,0xC0, 0xD1,0xDB, 0xDB,0xF9, 0xF9,
   0xD1, 0xD1, 0xF3, 0xF3,0xD1, 0xD1,0xF0, 0xF1,0xC0, 0xD1,0xC0, 0xD1,
   0xCF, 0xDB, 0xFC, 0xF9,0xD1, 0xD1,0xF3, 0xF3,0xC0, 0xD1,0xF1, 0xF1,
   0xD1, 0xD1, 0xD1, 0xD1,0xDB, 0xDB,0xF9, 0xF9,0xC0, 0xD1,0xF3, 0xF3,
   0xC0, 0xD1, 0xF1, 0xF1,0xD1, 0xD1,0xD1, 0xD1,0xCF, 0xDB,0xF9, 0xF3,
   0xD1, 0xF3, 0xF3, 0xF3,0xC0, 0xD1,0xF1, 0xF1,0xD1, 0xD1,0xD1, 0xD1,
   0xCF, 0xDB, 0xFC, 0xF3,0xC0, 0xD1,0xF3, 0xF3,0xC0, 0xD1,0xF1, 0xF1,
   0xD1, 0xD1, 0xD1, 0xD1,0xCF, 0xF3,0xF9, 0xF9,0xD1, 0xD1,0xF3, 0xF3,
   0xC0, 0xD1, 0xF1, 0xF1,0xD1, 0xF3,0xC0, 0xD1,0xF3, 0xDB,0xF9, 0xF9,
   0xC0, 0xD1, 0xF3, 0xF3,0xC0, 0xD1,0xF2, 0xF3,0xE2, 0xF3,0xE2, 0xF3,
   0xE7, 0xF3, 0xF6, 0xF3,0xE2, 0xF3,0xF3, 0xF3,0xD1, 0xD1,0xF1, 0xF1,
   0xD1, 0xD1, 0xD1, 0xD1,0xDB, 0xDB,0xF9, 0xF9,0xC0, 0xD1,0xF3, 0xF3,
   0xD1, 0xD1, 0xF1, 0xF1,0xD1, 0xD1,0xD1, 0xD1,0xCF, 0xDB,0xF6, 0xF3,
   0xE2, 0xF3, 0xF3, 0xF3,0xD1, 0xD1,0xF1, 0xF1,0xD1, 0xD1,0xD1, 0xD1,
   0xCF, 0xDB, 0xFC, 0xF9,0xD1, 0xD1,0xF3, 0xF3,0xD1, 0xD1,0xF1, 0xF1,
   0xC0, 0xD1, 0xE2, 0xF3,0xCF, 0xDB,0xF9, 0xF9,0xD1, 0xD1,0xF3, 0xF3,
   0xD1, 0xD1, 0xF1, 0xF1,0xD1, 0xD1,0xC0, 0xD1,0xE7, 0xF3,0xF6, 0xF3,
   0xE2, 0xF3, 0xF3, 0xF3,0xC0, 0xD1,0xF3, 0xF1,0xE2, 0xD1,0xE2, 0xF3,
   0xCF, 0xF3, 0xF9, 0xF3,0xC0, 0xD1,0xF3, 0xF3};





That's fantastic! Thanks for uploading it.
I was actually thinking about the need for such a feature just last night (and wondering how on earth to do it)!

Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ervin on 04:03, 10 July 15
I've gotta say... it's great to see so much interest in cpctelera!
It's an absolutely *outstanding* dev tool.

Who knows... it may usher in a new era of cpc homebrew.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: mr_lou on 07:25, 10 July 15
If you have any issues with RGAS just email me the file you're trying to import and I'll take a look (lachlankeown at gmail).

We had some issues with importing graphics. RGAS seemed to always crash for some reason when trying to import a GIF or a PNG that was saved from Photoshop.
But then we learned that it could be imported from clipboard instead, and that procedure has been problem free.  :)
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: mr_lou on 08:14, 10 July 15
I've gotta say... it's great to see so much interest in cpctelera!
It's an absolutely *outstanding* dev tool.
Agreed.  :)
This is actually the 2nd time in my life I'm looking at C.
The first time was also in relation to an Amstrad CPC game project we (girlfriend and me) did in 2009, called Sort'em (http://cpc-power.com/index.php?page=detail&num=2214). (Amstrad CPC version of a cellphone game we made back in 2006 (http://www.lublu.dk/index.php?sideid=317&listepostnr=0) and in 2013 made a more modern version for Android called Pirate Diamonds (http://piratediamonds.com/)).
Back then in 2009 I used Z88DK (http://www.z88dk.org/forum/) and CPCRSLIB (http://www.amstrad.es/programacion/cpcrslib.html), which was also rather fun.
CPCWiki page about CPCRSLIB (http://www.cpcwiki.eu/index.php/CPCRSlib).
CPCWiki page about Z88DK (http://www.cpcwiki.eu/index.php/Z88DK).

I find it slightly funny that my only C experience comes from Amstrad CPC game-development.  :)
Like you, I'm also (still) trying to understand pointers and why/when to use extern variables.  :)

Who knows... it may usher in a new era of cpc homebrew.
That would be awesome.
For the project we're working on now with CPCTelera, I really wanted to use BASIC, in order to be able to code directly on the CPC. But as I quickly learned it wasn't fast enough, I turned to CPCTelera.
It may just be my imagination, but I think SDCC / CPCTelera gives a better performance than Z88DK did back in 2009.

I think the oldtime coders will prefer sticking with Assembler and/or Z88DK because it resembles their coding style the most.
Otherwise they'll use SDCC with NoRecess' tools in order to convert the "SDCC Assembler" syntax into Maxam syntax before compiling with Pasmo.

I think only guys like you and me, with no prior experience with CPC development will truly embrace SDCC / CPCTelera. Coming from Java myself, I just prefer writing numbers like "0xc000" instead of "#C000". I know that's probably a silly detail, but it matters.
The only problem we can run into, is when/if we need help with adding some Assembler functions. Most CPC Assembler coders are only familir with Maxam style, and SDCC does a few things differently, which might discourage oldtimers from trying to help out.

Fortunately our game is coming along nicely too without any issues so far.  :)
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ervin on 09:18, 10 July 15
Agreed.  :)
This is actually the 2nd time in my life I'm looking at C.
The first time was also in relation to an Amstrad CPC game project we (girlfriend and me) did in 2009, called Sort'em (http://cpc-power.com/index.php?page=detail&num=2214). (Amstrad CPC version of a cellphone game we made back in 2006 (http://www.lublu.dk/index.php?sideid=317&listepostnr=0) and in 2013 made a more modern version for Android called Pirate Diamonds (http://piratediamonds.com/)).
Back then in 2009 I used Z88DK (http://www.z88dk.org/forum/) and CPCRSLIB (http://www.amstrad.es/programacion/cpcrslib.html), which was also rather fun.
CPCWiki page about CPCRSLIB (http://www.cpcwiki.eu/index.php/CPCRSlib).
CPCWiki page about Z88DK (http://www.cpcwiki.eu/index.php/Z88DK).

I find it slightly funny that my only C experience comes from Amstrad CPC game-development.  :)
Like you, I'm also (still) trying to understand pointers and why/when to use extern variables.  :)
That would be awesome.
For the project we're working on now with CPCTelera, I really wanted to use BASIC, in order to be able to code directly on the CPC. But as I quickly learned it wasn't fast enough, I turned to CPCTelera.
It may just be my imagination, but I think SDCC / CPCTelera gives a better performance than Z88DK did back in 2009.

I think the oldtime coders will prefer sticking with Assembler and/or Z88DK because it resembles their coding style the most.
Otherwise they'll use SDCC with NoRecess' tools in order to convert the "SDCC Assembler" syntax into Maxam syntax before compiling with Pasmo.

I think only guys like you and me, with no prior experience with CPC development will truly embrace SDCC / CPCTelera. Coming from Java myself, I just prefer writing numbers like "0xc000" instead of "#C000". I know that's probably a silly detail, but it matters.
The only problem we can run into, is when/if we need help with adding some Assembler functions. Most CPC Assembler coders are only familir with Maxam style, and SDCC does a few things differently, which might discourage oldtimers from trying to help out.

Fortunately our game is coming along nicely too without any issues so far.  :)

Yeah, this is my first time using C!
It's pretty hard going at first (I'm used to various BASIC dialects, SQL Server, and z80 assembler!!!), but every day it becomes more and more natural.

Sort'em looks very interesting. I'll have to give that a go soon.
 :)

I've read that SDCC gives considerably better performance than z88dk in many cases.
Have a look at this:
SDCC vs z88dk: Comparing size and speed (http://www.cpcmania.com/Docs/Programming/SDCC_vs_z88dk_Comparing_size_and_speed.htm)

I've actually done a bit of CPC development over the last few years, generally using the wonderful ccz80 compiler, combined with assembler.
3D-Maze (http://www.cpcwiki.eu/forum/programming/3d-maze-(written-using-ccz80-and-machine-code)/msg3911/#msg3911)
character-based tile engine with parallax scrolling (http://www.cpcwiki.eu/forum/programming/character-based-tile-engine-with-parallax-scrolling/)
Chunky Pixel Collision (http://www.cpcwiki.eu/forum/programming/chunky-pixel-collision/msg16841/#msg16841)
Chunky Pixel Curator - WIP (http://www.cpcwiki.eu/forum/programming/chunky-pixel-curator-teaser/)
Chunky Pixel Curator (http://www.cpcwiki.eu/forum/games/chunk-pixel-curator/msg92884/#msg92884)

Now of course I'm using cpctelera to create this:
My CPCRetroDev2015 entry - RUN"CPC" (http://www.cpcwiki.eu/forum/programming/my-cpcretrodev2015-entry-run'cpc'/)

I loved ccz80 - it was easy, and produced very readable assembler code, which helped me learn ASM a lot faster.
Unfortunately it has no support for signed values, so all numbers are unsigned, and workarounds need to be put in place for negative numbers (much like ASM, actually).

That's the main reason why I decided to look at cpctelera.
SDCC had always seemed "too hard", especially with all the workarounds needed to use it (like the tools that NoRecess talks about), but cpctelera takes all of that difficulty away!

Also, SDCC has really impressive optimisation under the hood, whereas in ccz80 you'd need to be more careful to get maximum performance.

As I've got more comfortable with SDCC, I've started changing some things to ASM, even learning to deal with the weird syntax differences.
I'm personally used to using #C000 instead of 0xC000, but it's only a small difference that's pretty easy to switch to.
Other differences are a bit stranger, but not really any harder - like LD A,1(IX) instead of LD A,(IX+1).

The thing I've had the most trouble with is talking to SDCC pointers from ASM.
That took many hours of nail-biting frustration before I cracked it.
But I tell you what - when I got it working, and I saw the speed boost that resulted from the effort, it was all worth it!
It felt like I had just beaten Dark Souls (my favourite game of all time - I'd love to see a side-scrolling CPC version of it)!
 8)

So for any subsequent CPC dev, I'll be staying with cpctelera.
I absolutely love it.
It's a brilliant dev system, is very actively supported (ronaldo is brilliant and listens to all suggestions), and it looks like it will continue to grow and improve - especially seeing as more and more of us on this forum seem to be giving it a try.

Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ervin on 09:38, 10 July 15
Just wondering - anyone here entering CPCRetroDev2015, and using cpctelera for their project?
I'm hoping to see lots of entries this year!
 ;D

I'm really thankful to the cpctelera team - we are truly blessed to receive such an incredible tool.

Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: mr_lou on 11:20, 10 July 15
Just wondering - anyone here entering CPCRetroDev2015, and using cpctelera for their project?

If we manage to complete our game, I don't see any reason not to participate in CPCRetroDev2015.
August 15th will be a big test day so to speak, when we'll present it to our mates. So I think we'll participate, but it's not 100% certain yet.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ervin on 13:22, 10 July 15
If we manage to complete our game, I don't see any reason not to participate in CPCRetroDev2015.
August 15th will be a big test day so to speak, when we'll present it to our mates. So I think we'll participate, but it's not 100% certain yet.

Best of luck!
I look forward to seeing your entry!
 ;D
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: Carnivius on 13:58, 10 July 15
I may enter CPCRetroDev2016 or 17 or 18 or whenever the hell I get smart enough to actually make something.  :-[
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: mr_lou on 14:08, 10 July 15
Best of luck!
I look forward to seeing your entry!
 ;D

Likewise!  :)

I may enter CPCRetroDev2016 or 17 or 18 or whenever the hell I get smart enough to actually make something.  :-[

I don't really have any experience with C, prior to the Z88DK/CPCRSLIB project I did back in 2009.
But if you have experience with other languages like e.g. Java or C# or PHP or Javascript, then I think you should be able to pick it up fairly fast.
Coming from BASIC (and no experience with other languages) may be difficult.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: Carnivius on 16:54, 10 July 15
How do I load CPCtelera again?   Do I have to run the setup.sh thingy in the Terminal again?
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ervin on 17:22, 10 July 15
How do I load CPCtelera again?   Do I have to run the setup.sh thingy in the Terminal again?

Once it is installed, you won't need to run setup.sh again (unless you're installing a new version).
If you simply want to compile a project, open cygwin, navigate to the folder it lives in, and type "make".

I had lots of problems initially getting cpctelera to work, as I'm not from a linux background, and cygwin is like a translation layer between the windows file system, and the linux way of doing things.
I stumbled my way through it, so if you have any questions, please ask. I'm sure I can help you!  8)

But first I need to know - where do you have cygwin installed?
I've got it in C:\cygwin

Also, where do you have cpctelera installed?
Mine is in C:\cygwin\home\ErvinPajor\cpctelera

Is your installation similar (with your name instead of mine of course)?

My projects folder is in C:\cygwin\home\ErvinPajor\cpctelera\projects
(I created that folder manually).

Then within that I've got my runcpc project.
C:\cygwin\home\ErvinPajor\cpctelera\projects\runcpc

Have you got a project folder created somewhere?
(i.e. using the cpct_mkproject command?)
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: Carnivius on 17:36, 10 July 15
Oh I see.  So the cygwin terminal is still my access to cpctelera rather than cpctelera being a seperate exe program like it would be on windows?   Ok I made a new project and I see in explorer that a new folder got made.  I can see main.c in explorer.  That's my main game code scripty thing right?   How do I view that properly?  (I tried opening in notepad and while it loaded the actual text fine, it was all over the place and hard to read).
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: mr_lou on 17:46, 10 July 15
Oh I see.  So the cygwin terminal is still my access to cpctelera rather than cpctelera being a seperate exe program like it would be on windows?   Ok I made a new project and I see in explorer that a new folder got made.  I can see main.c in explorer.  That's my main game code scripty thing right?   How do I view that properly?  (I tried opening in notepad and while it loaded the actual text fine, it was all over the place and hard to read).

The "all over the place" problem is due to how line-endings are done on the various systems.
Notepad only reads Windows line-endings, and the main.c file clearly contains Linux line endings.
I think that SDCC probably compiles your C program with Windows line-endings too, so if you just clean up the file first, then you can continue from there.
Otherwise, all you need is another editor, like e.g. Notepad++ or PSPad. They will handle Linux line-endings just fine.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: Carnivius on 17:56, 10 July 15
Ah good ol' PSPad.  One of the few programs I used a lot on my laptop that I forgot to install on my new pc.

Ok it's displaying correctly and I'm looking at game.c of the platform climber example to get an idea of how it works (after having run the dsk of that example in Winape to see what the results are).   The general structure of it reminds me of GML in Game Maker: Studio which I use to make games on PC so it's not completely alien to me fortunately.   It'll just take some time to learn what functions do what and get used to the general environment of the software.

Starting to feel a bit more confident about it.  I can't say I'll be coding the CPC code of RoboCop: Prime in it any time soon but I want to try coding a much simpler game just to get a feel for how this all works and go on from there.   Just gonna study the scripts and try change bits here and there to see what does what to the platform climber example.


By  the way what is the relevance of the .c and .h file extensions?
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: Trebmint on 18:09, 10 July 15
Its really great this framework seems to have taken off and got people coding. I always thought that there were people that wanted to code games just that the sheer difficulty in getting something setup and working, and a lack of decent tools were hampering developments. Seems we now have a winner and a way forward. Great stuff ronaldo. Looking forward to seeing some of the results :)
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: mr_lou on 18:11, 10 July 15
By  the way what is the relevance of the .c and .h file extensions?

I would be the wrong person to try to explain this, as I still don't know entirely myself.  :)
But you can most probably find some info about it online fast if you google for it, as it is common C style programming.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ervin on 18:19, 10 July 15
Starting to feel a bit more confident about it.  I can't say I'll be coding the CPC code of RoboCop: Prime in it any time soon but I want to try coding a much simpler game just to get a feel for how this all works and go on from there.   Just gonna study the scripts and try change bits here and there to see what does what to the platform climber example.

Well done on getting cpctelera working - great stuff.

I reckon a bunch of us should start to work together on bringing Robocop:Prime to life.
(Well, maybe after CPCRetroDev2015 is over).

Perhaps we could identify different tasks and hand out different portions of the program to those that are most comfortable with particular aspects.
Then we might one day see those *magnificent* graphics come to life on a CPC!
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: Carnivius on 19:01, 10 July 15
Let's not get ahead of ourselves.  Pressure pressure  :o

Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 21:34, 10 July 15
@ervin (http://www.cpcwiki.eu/forum/index.php?action=profile;u=82), @mr_lou (http://www.cpcwiki.eu/forum/index.php?action=profile;u=96): thanks for your appreciation, it is very nice to see you wanting to create things and I'm looking forward to see your productions :) . However, as your experience and @carnivac's shows, there is still much work to do to have a really easy framework for anyone. CPCtelera may have improved some things, but that's just one step: there are may things to be improved. And, of course, this is a great thing: we have lot of work ahead to develop and enjoy :) .

@carnivac: I'm sorry. I'd love to have developed something really comfortable for everyone. CPCtelera is based on Linux, what makes it work almost immediately on Linux and OSX, but requires Cygwin on Windows. It also requires some familiarity with Linux. I hope we can improve it to make it much easier for everyone on the future, but my limited time prevents me from evolving it faster. Anyway, I'll try to help you as much as possible :)

However, if all of you like (@carnivac, @mr_lou (http://www.cpcwiki.eu/forum/index.php?action=profile;u=96), @ervin (http://www.cpcwiki.eu/forum/index.php?action=profile;u=82), @Paulo Garcia (http://www.cpcwiki.eu/forum/index.php?action=profile;u=1440), @lachlak and anyone else), you may help me improve it and make it easier for others. The first thing I purpose is that you log all your initial problems with CPCtelera and your solutions. If you log it with great detail, that can be used for:
Your experience is really valuable for others and would be awesome to have it structured in CPCtelera to improve it :) .
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: mr_lou on 21:59, 10 July 15
I hope we can improve it to make it much easier for everyone on the future, but my limited time prevents me from evolving it faster.

The biggest problem we all have: Not enough time.  :(
I vote that someone on the forum should win the european lottery, and then finance all developers here so they can quit their jobs and make Amstrad CPC stuff all the time.  :)
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 22:02, 10 July 15
By  the way what is the relevance of the .c and .h file extensions?
There almost nothing inherently different between a .c and a .h file. The use is .c files contain code (definitions) and .h files contain declarations. This is because C compiler only needs to know that a given function/variable/constant/type exists, along with its types, to know what to do when you use it. For instance, when you write something like this:
Code: [Select]
if ( cpct_isKeyPressed(Joy0_Up) ) {
   // ... your code here
}
C compiler doesn't know what the hell means "cpct_isKeyPressed" unless you tell it what it is. To tell it what it is you can do it directly, declaring it:
Code: [Select]
u8 cpct_isKeyPressed(cpct_keyID key);

void main () {
  // ...
  if ( cpct_isKeyPressed(Joy0_Up) ) {
     // ... your code here
  }
  // ...
}
Now you are telling the Compiler what cpct_isKeyPressed is (declaring it) and then, when the compiler founds the if, knows how to generate code for the call. Declarations for u8 and cpct_keyID types should also be provided, but I left them out for simplicity.

When you only need to declare a function, this is enough. However, when you have lots of functions, variables, constants, etc, you group them in a header file (.h) which only includes declarations. Then, to include all the declarations for the compiler in your code, you only have to do this:
Code: [Select]
#include <cpctelera.h>

void main () {
  // ...
  if ( cpct_isKeyPressed(Joy0_Up) ) {
     // ... your code here
  }
  // ...
}
Therefore, the use for the header files (.h) is grouping these declarations that inform the compiler about the existence of other functions/variables/constants, etc. When you use #include, you are including the contents of the header file, including this declarations, not having to rewrite them everytime you need them.

One more thing: this is just informing the compiler about things that exist and their typing. Later, the linker is responsible for linking these existing things in the final binary code. You can fool the compiler telling him that a non-existing function exists and it won't complain. Later on, the linker will tell you that it does not exist when it tries to include the actual definition (the code) of the function.

Regarding the editor, I recommend you either Notepad++ or Sublime, which are really great as editors :)
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: Paulo Garcia on 00:04, 11 July 15

However, if all of you like (@carnivac, @mr_lou (http://www.cpcwiki.eu/forum/index.php?action=profile;u=96), @ervin (http://www.cpcwiki.eu/forum/index.php?action=profile;u=82), @Paulo Garcia (http://www.cpcwiki.eu/forum/index.php?action=profile;u=1440), @lachlak and anyone else), you may help me improve it and make it easier for others. The first thing I purpose is that you log all your initial problems with CPCtelera and your solutions. If you log it with great detail, that can be used for:
  • Create a help page with lot of interesting explanations for others
  • Detect things that can be improved and create a task list
  • Provide base for better usability designs and ways of explaining and introducing people to development.
Your experience is really valuable for others and would be awesome to have it structured in CPCtelera to improve it :) .


I have already forked it on Github, and I am slowly learning how to use it. My problem as you know is that I never had a Amstrad CPC before, and I am not aware of its internals. I suggest to use the Github issues on lronaldo/cpctelera · GitHub (https://github.com/lronaldo/cpctelera) to add bugs or suggestions.


As a complete cpc-noob, I might be able to help to get it easier to use. So far I found it very easy to build examples though (on Mac OSX).


Now, I've found a CPC-464 on sale here in Canada, but for $400 (CAD) I will have to stick with emulators to test my creations :)


Cheers


Paulo





Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: lachlank on 01:00, 11 July 15
As a Windows user, here is my current full setup for doing CPC dev.
I've shown a couple of really useful books I keep on hand.
A really useful output from the SDCC linker are the .rst files produced for each input .c and .s file (in the obj folder). These show the assembly generated for each .c source line, as well as absolute addresses. This allows you to effectively set breakpoints in your .c code:


Using this method you can generally debug your .c programs pretty successfully, although it can be laborious. Having said that I have found I have not had as many bugs/crashes as I expected if I take my time and test regularly and check-in to source control regularly.


Hope that is of some help to others, let's keep sharing ideas.



(http://i.imgur.com/W3OhDb8h.jpg)
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ervin on 11:39, 11 July 15
Thanks Lachlan.
That tip about the .rst files sounds brilliant.
I'll be trying it the moment I sit down for more SDCC dev!

Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: AMSDOS on 08:47, 12 July 15
Because the chapter isn't only about sprites. At the moment it also contains a drawSolidBox() function, and in time you might add more, like e.g. a drawCircle() or what do I know. General graphical stuff.
One might also argue that "drawTile" isn't about sprites either.


I would tend to agree based on the rules governed in the Firmware Manual which highlights "The Graphics VDU" & "The Screen Pack". Sprites are usually managed by the Screen Pack, which means they are represented as Encoded Bytes. A Graphic on the other hand deals in Graphic Pen Colours, so depending on what Mode your in, it could be anywhere from 2 to 8 bytes required to draw it.


Unfortunately there is also an argument that Sprites are nothing more than User Defined Graphics (UDG), which in that case is "The Text VDU" and then you've got a Loose Cannon in "The Graphics VDU" with "GRA WR CHAR (&BBFC)" aka TAG in BASIC, for positioning any character you want anywhere onscreen (except the Border). Because the Graphics VDU deals with this, they are essentially handled differently and you don't need to be worry about screen mapping.
"Jet-Boot Jack" is a nice example in how UDGs are used and the writers have only Sprites for Jack, which is kind of clever because the scenery is quite colourful, though in a way the writers have made Jack the focal point.  :D
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: mr_lou on 09:22, 12 July 15
I'm getting this error on compiling now:
obj/main.asm:1401: Error: <a> machine specific addressing or addressing mode error

Line 1401 in main.asm says:
jr    00102$

I can see it's at the very end of my main loop. So I'm guessing it happens when it's trying to jump back and run the loop again. But why did this suddenly happen? And how do I fix it?



EDIT: Nevermind. I was calling cpct_waitVSYNC() twice in my loop, which hasnt' been a problem up until now, but now it is.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ervin on 12:39, 12 July 15
I'm getting this error on compiling now:
obj/main.asm:1401: Error: <a> machine specific addressing or addressing mode error

Line 1401 in main.asm says:
jr    00102$

I can see it's at the very end of my main loop. So I'm guessing it happens when it's trying to jump back and run the loop again. But why did this suddenly happen? And how do I fix it?



EDIT: Nevermind. I was calling cpct_waitVSYNC() twice in my loop, which hasnt' been a problem up until now, but now it is.

I'd hazard a guess and say that your were trying to jump more than 128 bytes away with the JR.
I got the same error message when I did that.
 :)
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 12:45, 12 July 15
@mr_lou (http://www.cpcwiki.eu/forum/index.php?action=profile;u=96): I've never seen this problem happen on a C-based program. I've seen it happen when using inline assembler. It is SDCC related. Without having a look at your code, it's very difficult to know what may be causing this problem. As @ervin (http://www.cpcwiki.eu/forum/index.php?action=profile;u=82) says, It might be a big loop and a bad size calculation by SDCC, which leads to using jr instruction on a more than 128-byte long jump.

Anyway, calling cpct_waitVSYNC() twice in a row has near to 0 effect with respect to calling it just once. The second call returns immediately as VSYNC is still active. If you wanted to wait for 2 VSYNCs, the propper way to do it would be this one:
Code: [Select]
cpct_waitVSYNC();
// Wait for 2 interrupts to ensure that VSYNC signal is again inactive until calling waitVSYNC for the second time.
_asm_("halt");
_asm_("halt");
cpct_waitVSYNC();
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: mr_lou on 12:56, 12 July 15
Anyway, calling cpct_waitVSYNC() twice in a row has near to 0 effect with respect to calling it just once. The second call returns immediately as VSYNC is still active.

Yes, I saw that. But I didn't do it like that either.
What I was doing was this:

drawSomeSprites();
waitVSYNC();
drawSomemoreSprites();
waitVSYNC();

That way I could get 25fps without any flickering. But the 2nd waitVSYNC() suddenly gave me this error. So I removed it.
The idea was that I could update 2 different parts of the game in each their own Vsync cycle.

I haven't written a line of assembler myself (yet) in this project. So it is a bit strange why the error occurs when I re-insert the 2nd waitVSYNC() again.

BUT... if I do this:

drawSomeSprites();
waitVSYNC();
drawSomemoreSprites();
drawSomemoreSprites(); // Doing exactly the same as above
drawSomemoreSprites(); // Doing exactly the same as above
waitVSYNC();

- then I don't get the error....
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 13:05, 12 July 15
@mr_lou (http://www.cpcwiki.eu/forum/index.php?action=profile;u=96): It appears to be, as we were saying before, an SDCC calculation error. You may have a loop that takes exactly 128/129 bytes or similar, and SDCC is calculating it badly. Solutions:
You may submit your code as an issue to SDCC developers for their consideration.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: Carnivius on 14:47, 13 July 15
This is neat.  I'll come back to this in a bit after working on my phone game (gotta pay bills and such).  Keep up the good work. :D
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: mr_lou on 14:50, 13 July 15
This is neat.  I'll come back to this in a bit after working on my phone game (gotta pay bills and such).  Keep up the good work. :D

...a phone game pays the bills?
I did not know that....

(Referring to my Pirate Diamonds (http://www.piratediamonds.com) which absolutely does not pay any bills whatsoever.  ;) )
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: mr_lou on 16:13, 13 July 15
@ronaldo (http://www.cpcwiki.eu/forum/index.php?action=profile;u=1227)

Why can't I add a simple function like this, with assembler?

Code: [Select]
void myTest(u8 test) {
  test;
  __asm
  ld a, (ix + 4)
  __endasm;
}

Very simple. Does nothing in fact.

But compiler gives error:
obj/main.asm:156: Error: <q> missing or improper operators, terminators, or delimiters

Line 156 says:     ld a, (ix + 4)

Now. I know from previously SDCC examples, that SDCC is supposed to insert the following code automatically:
Code: [Select]
    push    ix
    ld    ix,#0
    add    ix,sp

That doesn't seem to happen here? Maybe that's the reason?
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ervin on 16:24, 13 July 15
@ronaldo (http://www.cpcwiki.eu/forum/index.php?action=profile;u=1227)

Why can't I add a simple function like this, with assembler?

Code: [Select]
void myTest(u8 test) {
  test;
  __asm
  ld a, (ix + 4)
  __endasm;
}

Very simple. Does nothing in fact.

But compiler gives error:
obj/main.asm:156: Error: <q> missing or improper operators, terminators, or delimiters

Line 156 says:     ld a, (ix + 4)

Now. I know from previously SDCC examples, that SDCC is supposed to insert the following code automatically:
Code: [Select]
    push    ix
    ld    ix,#0
    add    ix,sp

That doesn't seem to happen here? Maybe that's the reason?

IX syntax seems to be a little different in SDCC.

Try this:

Code: [Select]
void myTest(u8 test) {
  test;
  __asm
  ld a,4(ix)
  __endasm;
}
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: mr_lou on 16:40, 13 July 15
Wott?!

Ok...

Going back to the one I was really trying to use then: (from way back in 2011 (http://www.cpcwiki.eu/forum/programming/help-with-sdcc/msg35706/#msg35706))

Code: [Select]
void poke(u16 addr) {
addr;
__asm
  ld h,5(ix)
  ld l,4(ix)
  ld (hl),255
__endasm;
}


obj/main.asm:158: Error: <a> machine specific addressing or addressing mode error

Line 158 says:     ld h,5(ix)

Can you crack that one too then?  :)


EDIT/ADDED:

Ok, adding a '#' infront of the number makes it compile

Code: [Select]
void poke(u16 addr) {
addr;
__asm
  ld h,5(ix)
  ld l,4(ix)
  ld (hl),#255
__endasm;

However, it still doesn't work. It doesn't set the value 255 on the address that I give it. And it looks like it's the ld h,5(ix) and ld l,4(ix) that is the problem, because if I do this:
Code: [Select]
void poke(u16 addr) {
addr;
__asm
  ld h,#0xc0
  ld l,#0x00
  ld (hl),#255
__endasm;
Then it does work - but of course only on that one static address 0xc000

 
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: FloppySoftware on 18:32, 13 July 15
Why can't I add a simple function like this, with assembler?

Code: [Select]
void myTest(u8 test) {
  test;     <----- What's the purpose of this?
  __asm
  ld a, (ix + 4)
  __endasm;
}

What's the purpose of the indicated fragment of code?
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: mr_lou on 18:57, 13 July 15
What's the purpose of the indicated fragment of code?

If I don't add it, the compiler will give a warning about an unreferenced variable. No biggie.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: FloppySoftware on 19:13, 13 July 15
If I don't add it, the compiler will give a warning about an unreferenced variable. No biggie.

But it's an expression, and may be it generate some code, unless SDCC takes care of this.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: mr_lou on 19:16, 13 July 15
But it's an expression, and may be it generate some code, unless SDCC takes care of this.

Omitting it makes no change in the main.asm file.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: FloppySoftware on 19:19, 13 July 15
I think it's worth to have a look on this:
 
FORUM / SDCC / [Sdcc-user] Access local variables with inline assembly (z80) (http://develissimo.com/forum/topic/6263/)
 
Code: [Select]
char foo(unsigned char c)
{
        char e;
        e = c;
        e += 5;
        return e;
}

generates this...


;sample.c:1: char foo(unsigned char c)
;       ---------------------------------
; Function foo
; ---------------------------------
_foo_start::
_foo:
        push    ix
        ld      ix,#0
        add     ix,sp
;sample.c:4: e = c;
;sample.c:5: e += 5;
        ld      a, 4 (ix)
        add     a,#0x05
        ld      l,a
;sample.c:6: return e;
        pop     ix
        ret
_foo_end::
        .area _CODE
        .area _CABS

Specially this part:

Code: [Select]

        push    ix
        ld      ix,#0
        add     ix,sp
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: mr_lou on 19:24, 13 July 15
Nothing new there.

The first 3 lines are usually added automatically. But they aren't added for me this time.
I tried adding them myself manually, but that just crashes everything.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 19:26, 13 July 15
@mr_lou (http://www.cpcwiki.eu/forum/index.php?action=profile;u=96): Do not assume that SDCC is going to generate any given code for accessing parameters. It might be different even on different executions of the compiler. Moreover, if you add this code, you are modifying IX register, which is used internally by SDCC sometimes and you will be creating lateral effects. Whenever using IX, it is important to save it on the stack and recovering it later on.

If you want to create a complete assembly function, create a separate .s file and write all the code in assembly. Check the way CPCtelera (http://lronaldo.github.io/cpctelera) functions are implemented for reference: for instance, have a look at cpct_drawTileAligned2x8 (https://github.com/lronaldo/cpctelera/blob/master/cpctelera/src/sprites/cpct_drawTileAligned2x8.s) or cpct_getHWColour (https://github.com/lronaldo/cpctelera/blob/master/cpctelera/src/video/cpct_getHWColor.s), which recover parameters from stack in different ways.

And, if you wanted to POKE a value into memory, the easiest way to do it is this:
Code: [Select]
   *((u8*)0xC000) = 255;
which generates this appropriate code:
Code: [Select]
        ld      hl,#0xC000
        ld      (hl),#0xFF
If you wanted to check the code that SDCC generates, take a look at .asm and .lst files on obj/ folder. There you can check that SDCC is not generating the code you thought for accessing parameters.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: mr_lou on 19:44, 13 July 15
Thanks ronaldo.

I was wondering/looking for a way to poke using just pointers earlier. So thanks for giving me that.

Right now though, I'm just trying to understand how to make functions with assembler, and I'm failing miserably.
Several things just makes no sense to me.

CPCTelera itself is great. As long as I can settle for using the CPCTelera functions.
But as soon as I have to add some stuff myself, I fail as miserably as I did 4 years ago too.

Take just now. You've just told me how to poke using pointers, so I immediately try this:

Code: [Select]
u16 addr;
for (addr = 0xc000; addr < 0xffff; addr++) {
  *((u8*) addr) = 255;
}

I expect it to fill the screen with pen 3. But instead it crashes everything.
(And please don't tell me I don't need to do it like that. I am just experimenting and trying to figure it out. But I very rarely can get things working the way I expect them to).
Looking at main.asm doesn't help me much as I don't understand Assembler.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 20:00, 13 July 15
Well man, I understand you. Learning takes time and understanding things requires failing and debugging constantly. All of us are constantly doing that when we work to expand our knowledge. I know it is frustrating, but I don't know a better way. Anyways, you need to be proud of your efforts: each bit of knowledge acquired with effort is worth it :).

Your code has a typing problem. If you want to access memory, you don't want an integer, but a pointer. In this case, you want a pointer to unsigned bytes (u8) elements (accessing memory bytes one by one). Try this:
Code: [Select]
u8* addr;
for (addr = 0xc000; addr < 0xffff; addr++) {
  *addr = 255;
}
That should work.

Anyways, your previous code, even having a typing confusion, should work well. However, SDCC seems to do something quite bizarre:
Code: [Select]
;src/main.c:41: for (addr = 0xc000; addr < 0xffff; addr++) {
        ld      de,#0x3FFF
00107$:
;src/main.c:42: *((u8*) addr) = 255;
        dec     de
        ld      l, e
        ld      h, d
        ld      (hl),#0xFF
        ld      h,e
        ld      l,d
        ld      e, h
;src/main.c:41: for (addr = 0xc000; addr < 0xffff; addr++) {
        ld      a,l
        ld      d,a
        or      a,h
        jr      NZ,00107$
It initializes DE to 0x3FFF and goes decreasing it, copying it to HL and using HL to write FF to memory. It effectively deletes memory from 0x3FFF to 0x0000, which makes no sense at all.

To me this seems like an SDCC bug, kind of a confusion with types.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: mr_lou on 20:12, 13 July 15
It effectively deletes memory from 0x3FFF to 0x0000, which makes no sense at all.

You have no idea how good that makes me feel.
Means there's hope for me yet.  :)
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: gerald on 20:24, 13 July 15
Well man, I understand you. Learning takes time and understanding things requires failing and debugging constantly. All of us are constantly doing that when we work to expand our knowledge. I know it is frustrating, but I don't know a better way. Anyways, you need to be proud of your efforts: each bit of knowledge acquired with effort is worth it :) .

Your code has a typing problem. If you want to access memory, you don't want an integer, but a pointer. In this case, you want a pointer to unsigned bytes (u8) elements (accessing memory bytes one by one). Try this:
Code: [Select]
u8* addr;
for (addr = 0xc000; addr < 0xffff; addr++) {
  *addr = 255;
}
That should work.

Anyways, your previous code, even having a typing confusion, should work well. However, SDCC seems to do something quite bizarre:
Code: [Select]
;src/main.c:41: for (addr = 0xc000; addr < 0xffff; addr++) {
        ld      de,#0x3FFF
00107$:
;src/main.c:42: *((u8*) addr) = 255;
        dec     de
        ld      l, e
        ld      h, d
        ld      (hl),#0xFF
        ld      h,e
        ld      l,d
        ld      e, h
;src/main.c:41: for (addr = 0xc000; addr < 0xffff; addr++) {
        ld      a,l
        ld      d,a
        or      a,h
        jr      NZ,00107$
It initializes DE to 0x3FFF and goes decreasing it, copying it to HL and using HL to write FF to memory. It effectively deletes memory from 0x3FFF to 0x0000, which makes no sense at all.

To me this seems like an SDCC bug, kind of a confusion with types.
Putting the bug aside,  what about using memset() instead, it's far more efficient as it uses LDIR.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 20:31, 13 July 15
@gerald (http://www.cpcwiki.eu/forum/index.php?action=profile;u=250): Yes, memset, and various cpct_memset functions are far more efficient (orders of magnitude). This is just kind of an exercise for @mr_lou (http://www.cpcwiki.eu/forum/index.php?action=profile;u=96) to learn about pointers, types and memory. Then he can continue with optimization, as you suggest :) .
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: mr_lou on 20:46, 13 July 15
@ronaldo (http://www.cpcwiki.eu/forum/index.php?action=profile;u=1227)

How about adding these functions:

void cpct_scrollAreaUpM1 (void* memory, u8 width, u8 height);
void cpct_scrollAreaDownM1 (void* memory, u8 width, u8 height);
void cpct_scrollAreaLeftM1 (void* memory, u8 width, u8 height);
void cpct_scrollAreaRightM1 (void* memory, u8 width, u8 height);

Scrolls everything in the area 1 pixel in the direction.  :)

Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: FloppySoftware on 20:51, 13 July 15
Anyways, your previous code, even having a typing confusion, should work well. However, SDCC seems to do something quite bizarre:
Code: [Select]
;src/main.c:41: for (addr = 0xc000; addr < 0xffff; addr++) {
        ld      de,#0x3FFF
00107$:
;src/main.c:42: *((u8*) addr) = 255;
        dec     de
        ld      l, e
        ld      h, d
        ld      (hl),#0xFF
        ld      h,e
        ld      l,d
        ld      e, h
;src/main.c:41: for (addr = 0xc000; addr < 0xffff; addr++) {
        ld      a,l
        ld      d,a
        or      a,h
        jr      NZ,00107$
It initializes DE to 0x3FFF and goes decreasing it, copying it to HL and using HL to write FF to memory. It effectively deletes memory from 0x3FFF to 0x0000, which makes no sense at all.

To me this seems like an SDCC bug, kind of a confusion with types.

0xFFFF - 0xC000 = 0x3FFF
That kind of bugs are sooooooo nice, because are soooooo easy to find them....!
 :laugh: ;D :D ;)
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 20:53, 13 July 15
@mr_lou (http://www.cpcwiki.eu/forum/index.php?action=profile;u=96): Software scrolling functions are already part of CPCtelera (http://lronaldo.github.io/cpctelera)'s task list. They are not main priority right now, but they should be implemented for future 2.0. release :) .

I will add a note on this 4 functions as your proposal and will consider them when implementing software scroll :) . Right now, you can implement software scroll using cpct_memcpy, as I suggest in my answer to your question in the other thread. It is not the best solution, but it does the job for some cases :) .
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: mr_lou on 21:30, 13 July 15
I have become rather interested in CPCtelera.
I suspect I might begin working on a 2nd game after this. An idea I've had for years, and tried getting people interested in (http://www.cpcwiki.eu/forum/general-discussion/mockups-for-mode-1-minimalistic-graphics-platformer/) some years back too.

Even in its current state CPCtelera already feels like a solid framework.

My girlfriend and I have made 4 mobile games. The first two both took us 3 months to make. The 3rd one (http://www.ukkosjourney.com) took us 1½ years. The last one (http://www.piratediamonds.com) took 3 years (but that was because we became parents in the middle of it).
And now we've spent about 2 weeks with CPCtelera developing this CPC game, and we're almost done already! Granted, it's a simple game, but so was our first mobile game.

More functions will naturally always be desired in CPCtelera. Like e.g. the ability to move a sprite only 1 pixel left and right. (Any plans on adding that?)

I'm curious to know what future functionality you have planned.
Are you still excited to work on CPCtelera?
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 21:45, 13 July 15
Quote
I'm curious to know what future functionality you have planned.
Are you still excited to work on CPCtelera?
Yes, of course I am :) . I'm more interested as I see it is useful for people. I started CPCtelera after testing all other libraries and frameworks I knew of, and thought that something different was required. Mainly, I missed good documentation, examples and simplicity . Those were main reasons for starting.

I have lot of plans for CPCtelera: from some easy functions for dealing with tilemaps to complex rasters, screen splitting, overscan modes and other things. However, it will go slow. Next 3 months I will be very busy and will have to stop Z80 coding almost completely. On returning, I will have a pace similar to now: I want to go slow and have the best possible code, with lot of comments and full of documentation. I also would love to have time to record some videos about programming.

Too many things. I have a great task list and lots of ambitious ideas, but want to continue slow and firm :) .
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: mr_lou on 21:57, 13 July 15
Definitely worth donating to.
Development of CPCtelera will result in more new games.
I'm looking forward to see new functionality in the future!  :)

People might not make it this time, but I suspect CPCtelera will be the direct cause for an overload of submissions for CPCRetroDev2016.  :)
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: arnoldemu on 11:44, 14 July 15
Re the loop.

Don't assume it's a bug.

Compilers will be set to "signed" or "unsigned" by default.

both integers and characters can be treated like this. Sometimes you can define it with a compile time parameter.

We know what we want, compilers don't always.

In the case above, try this:

Code: [Select]
for (addr=(u16)0xc000; addr<(u16)0xffff; addr++)
{
}

Concerning pointers:

* they are variables
* the contain the address of data (in basics poke you do this: poke &4000,&ff. &4000 is the address and &ff is the data).
In pointer code you can do this:

Code: [Select]
u8 *ptr = 0x04000;
ptr[0] = 0x0ff;

OR

Code: [Select]
u8 *ptr = 0x04000
*ptr = 0x0ff;

The code showed a cast (where a type is changed into another type). Be careful with those.

You can use a pointer as if it was an array:

Code: [Select]
ptr[1] =
ptr[2] =

If ptr is u8 type, then each element of the array is treated as u8 (or 1 byte), so ptr[1] = ptr+1 and ptr[2] = ptr+2.
If ptr is a u16 type, then each element is 2 bytes (u16=2 bytes). so ptr[1] = ptr + 2, ptr[2] = ptr+4.

address = ptr + element_size*element_index.

Pointers are very powerful.

In C, use pointers to pass structures to avoid them being copied into the function.

If you don't use pointers and "pass by value", then it makes a copy of the data or puts it onto the stack, both wasting space and cpu time.
Use pointers and it will only copy the pointer itself which is 2 bytes, and is the same as a native register size so quick.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 12:39, 14 July 15
Don't assume it's a bug.
Compilers will be set to "signed" or "unsigned" by default.
both integers and characters can be treated like this. Sometimes you can define it with a compile time parameter.
We know what we want, compilers don't always.
In the case above, try this:
Code: [Select]
for (addr=(u16)0xc000; addr<(u16)0xffff; addr++) {
}
Yes, you are right in that I shouldn't have assumed it is a bug. I didn't think of the possibility of the compiler threating direct constants as signed instead of unsigned, or even not casting them on assignments or comparisons.

However, I have tried using your explicit casting proposal, and the resulting code is the same. I'm thinking of openning a issue for SDCC developers to check it.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: gerald on 13:41, 14 July 15
Yes, you are right in that I shouldn't have assumed it is a bug. I didn't think of the possibility of the compiler threating direct constants as signed instead of unsigned, or even not casting them on assignments or comparisons.

However, I have tried using your explicit casting proposal, and the resulting code is the same. I'm thinking of openning a issue for SDCC developers to check it.
Which version of SDCC are you using ? I cannot reproduce the problem with SDCC 3.4.0 and the simple test function :
Code: [Select]
void test(void)
{
  char *addr;
  for (addr =  0xc000 ; addr < 0xffff; addr++)
    {
      *addr = 255;
    }   
}

Compiled code :
Code: [Select]
;    ---------------------------------
; Function test
; ---------------------------------
_test_start::
_test:
;test.c:6: for (addr =  0xc000 ; addr < 0xffff; addr++)
    ld    hl,#0xC000
00102$:
;test.c:8: *addr = 255;
    ld    (hl),#0xFF
;test.c:6: for (addr =  0xc000 ; addr < 0xffff; addr++)
    inc    hl
    ld    d,l
    ld    e,h
    ld    a,d
    sub    a, #0xFF
    ld    a,e
    sbc    a, #0xFF
    jr    C,00102$
    ret
_test_end::


Note also that the proper cast should be :
Code: [Select]
void test(void)
{
  char *addr;
  for (addr =  (char *) 0xc000U ; addr < char *) 0xffffU; addr++)
    {
      *addr = 255;
    }   
}
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 13:43, 14 July 15
@gerald (http://www.cpcwiki.eu/forum/index.php?action=profile;u=250): you are not using the same type. The program works well when using a byte pointer (char* or unsigned char*). The problem shows when using an unsigned int (u16) to store the address.

SDCC is 3.5.0, latest one.

Note that u8 and u16 are typedefs included with CPCtelera (http://lronaldo.github.io/cpctelera):
Code: [Select]
typedef unsigned char u8;
typedef unsigned int  u16;
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: FloppySoftware on 13:52, 14 July 15
Humm... in the original code, addr it's not declared as a pointer but a simple  unsigned int:

u16 addr;

I think that is the reason that causes SDCC to out that code.

For SDCC it's a loop with a well known amount of iterations (just a subtract with constant values).

Of course, this can be a bad optimization decision, but having in mind that it is not very standard to use unsigned ints as pointers...
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 13:59, 14 July 15
@FloppySoftware (http://www.cpcwiki.eu/forum/index.php?action=profile;u=1162): SDCC shouldn't change the value of addr, being it used inside the loop. It doesn't matter if it knows the iterations. However, using addr through a cast ( *(u8*)addr) ) may be fooling SDCC into thinking that the value of addr is not used. That may be a reason for it changing into the number of iterations to use a jr nz, which is faster than a comparison and a jump.

Under this analysis I see it more clear as a bug due to an incorrect optimization assumption.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: FloppySoftware on 14:04, 14 July 15
Yes, but the use of unsigned ints as pointers it's not very standard, as you know.

I think it's better to use a pointer. That's standard.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 14:13, 14 July 15
@FloppySoftware (http://www.cpcwiki.eu/forum/index.php?action=profile;u=1162): Absolutely. A pointer should be used to point to values, no doubt about that.

The problem here is not that we wanted to code using unsigned ints as pointers, the problem is that we came to this by chance, and seems that SDCC has a bug. An unsigned int value shoud have no problem when converted to a byte pointer, as it is a 16-bits value. However, due to optimization assumptions, the internal value of the variable is different from the one the programmer wanted it to be.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: FloppySoftware on 14:52, 14 July 15
Yes, of course, you are right.

But I wanted to point out that it's not a good practice to use unsigned ints as pointers because it' s not admited by the standard, even if it works on some compilers.

In fact, SDCC, should print a warning.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 14:59, 14 July 15
In fact, SDCC, should print a warning.
It doesn't because the code makes an explicit cast previous to its use as pointer. Therefore, we are accessing memory using a proper u8*, which is initialized converting the value stored in the u16 variable. In fact, it doesn't work without the cast, as the compiler asks for a pointer to use the indirection operand * (which is normal, as it doesn't know what an unsigned int is supposed to be pointing to, as you were saying).
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: gerald on 15:16, 14 July 15
@gerald (http://www.cpcwiki.eu/forum/index.php?action=profile;u=250): you are not using the same type. The program works well when using a byte pointer (char* or unsigned char*). The problem shows when using an unsigned int (u16) to store the address.

SDCC is 3.5.0, latest one.

Note that u8 and u16 are typedefs included with CPCtelera (http://lronaldo.github.io/cpctelera):
Code: [Select]
typedef unsigned char u8;
typedef unsigned int  u16;
Why not using standard type like uint8_t/uint16_t as define in stdint.h ?
It would make the code more generic, no ?

But I wanted to point out that it's not a good practice to use unsigned ints as pointers because it' s not admited by the standard, even if it works on some compilers.
+1000  ;)
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: FloppySoftware on 15:27, 14 July 15
Ronaldo, IMHO, SDCC should print a warning due to that cast precisely.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 15:31, 14 July 15
Why not using standard type like uint8_t/uint16_t as define in stdint.h ?
It would make the code more generic, no ?
The same reason not to use the basic type names (unsigned char, unsigned int, char, int...), just mere commodity. These types are provided, but not enforced. If anyone prefers to use uint8_t/uint16_t or the standard typenames, there is no problem.

Also, as said in previous posts, we are not making an argument in favor of using unsigned ints instead of pointers: we came here by chance, and just were analyzing the potential bug. We all agree that pointers should be used to point.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 15:33, 14 July 15
Ronaldo, IMHO, SDCC should print a warning due to that cast precisely.
Why? Programmer is making something valid and doing it explicitly. I would understand a warning if no explicit cast was provided, to warn the programmer. But if the programmer does something valid explicitly, there is no reason for a warning.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: mr_lou on 19:54, 15 July 15
Hm... ok, so as far as I can gather, I'm doing something wrong.
It works though, but as far as I can tell from this thread, I ought to be doing it differently.

Here's what I'm doing at the moment:

I have a 16bit array of screen addresses that contains the path of a sprite.
Code: [Select]
const u16 path[10] = {0xc058, 0xc858, 0xd058, 0xd858, 0xe058, 0xe858, 0xf058, 0xf858, 0xc0a8, 0xc8a8};

And then to draw my sprite, I type-cast it to a pointer:

Code: [Select]
cpct_drawSprite(mySprite, (u8*) path[position], TILEWIDTH, TILEHEIGHT);

This works fine. But I have an impression my array instead of being a 16bit array of screen addresses, ought to be an array of pointers, right?

So I have been trying hard to get the same results using an array of pointers, and failing miserably.

Code: [Select]
const u8* path[10] = {0xc058, 0xc858, 0xd058, 0xd858, 0xe058, 0xe858, 0xf058, 0xf858, 0xc0a8, 0xc8a8};
// or
const u8* path[10] = {(u8*)0xc058, (u8*)0xc858, (u8*)0xd058, (u8*)0xd858, (u8*)0xe058, (u8*)0xe858, (u8*)0xf058, (u8*)0xf858, (u8*)0xc0a8, (u8*)0xc8a8};
// and then
cpct_drawSprite(mySprite, path[position], TILEWIDTH, TILEHEIGHT);
// or
cpct_drawSprite(mySprite, *path[position], TILEWIDTH, TILEHEIGHT);
// or
cpct_drawSprite(mySprite, (u8*) path[position], TILEWIDTH, TILEHEIGHT);

But nothing is drawn.

So.....  any hints here?
Should I just continue using this 16bit array?
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: arnoldemu on 19:58, 15 July 15
Code: [Select]
const u8* path[10] = {(u8*)0xc058, (u8*)0xc858, (u8*)0xd058, (u8*)0xd858, (u8*)0xe058, (u8*)0xe858, (u8*)0xf058, (u8*)0xf858, (u8*)0xc0a8, (u8*)0xc8a8};

// and then
cpct_drawSprite(mySprite, path[position], TILEWIDTH, TILEHEIGHT);


this combination should be correct.

Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: mr_lou on 20:10, 15 July 15
this combination should be correct.

Yea... that was the first one I tried too, but nothing is drawn....

Here is the assembler part in main.asm generated from the function.
Code: [Select]
    ld    de, (#(_path + 0x0170) + 0)
    ld    bc,#_mySprite
    ld    hl,#0x1004
    push    hl
    push    de
    push    bc
    call    _cpct_drawSprite
    ld    hl,#6
    add    hl,sp
    ld    sp,hl
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 20:20, 15 July 15
So I have been trying hard to get the same results using an array of pointers, and failing miserably.

Code: [Select]
const u8* path[10] = {0xc058, 0xc858, 0xd058, 0xd858, 0xe058, 0xe858, 0xf058, 0xf858, 0xc0a8, 0xc8a8};
// or
const u8* path[10] = {(u8*)0xc058, (u8*)0xc858, (u8*)0xd058, (u8*)0xd858, (u8*)0xe058, (u8*)0xe858, (u8*)0xf058, (u8*)0xf858, (u8*)0xc0a8, (u8*)0xc8a8};
The problem here is that you are creating an array of variable poiners to constants and, as the pointers are variables, they have the initialization problem we discussed previously. (You should read your definition as (const u8) * , which means you have a variable that points to a const u8 value, and that means that the constant value is what you are pointing, but not the pointer).

To solve this, you have to create constant pointers, that will be initializated as constants:
Code: [Select]
u8* const path[10] = {0xc058, 0xc858, 0xd058, 0xd858, 0xe058, 0xe858, 0xf058, 0xf858, 0xc0a8, 0xc8a8};
This means that you have 10 constant pointers, pointing to u8 values that might be changed. If you wanted constant pointers to constant values, you should use const 2 times.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: mr_lou on 20:48, 15 July 15
Yes, it works now.

I'd never have figured that out. Would never have crossed my mind to switch "u8*" and "const". Can't do such nifty tricks in Java (where I'm coming from).

This works:
Code: [Select]
u8* const path[10] = {0xc058, 0xc858, 0xd058, 0xd858, 0xe058, 0xe858, 0xf058, 0xf858, 0xc0a8, 0xc8a8};

But this works too:
Code: [Select]
u8* const path[10] = {(u8*)0xc058, (u8*)0xc858, (u8*)0xd058, (u8*)0xd858, (u8*)0xe058, (u8*)0xe858, (u8*)0xf058, (u8*)0xf858, (u8*)0xc0a8, (u8*)0xc8a8};

Don't know if it's my imagination, but the first one seems to compile faster.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 20:56, 15 July 15
@mr_lou (http://www.cpcwiki.eu/forum/index.php?action=profile;u=96): both alternatives are equal, as the compiler does the casting implicitly. Both generate this code:
Code: [Select]
_path:
        .dw #0xC058
        .dw #0xC858
        .dw #0xD058
        .dw #0xD858
        .dw #0xE058
        .dw #0xE858
        .dw #0xF058
        .dw #0xF858
        .dw #0xC0A8
        .dw #0xC8A8
which is exactly what we use const for (instead of code initializers, for instance).

I don't think there is a perceivable performance difference. It might have been coincidence.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: arnoldemu on 21:20, 15 July 15
for safety ;) :

Code: [Select]
const u8* const path[10] = {0xc058, 0xc858, 0xd058, 0xd858, 0xe058, 0xe858, 0xf058, 0xf858, 0xc0a8, 0xc8a8};

Code: [Select]
u8* path

this means a pointer that can be changed that points to modifyable data.

Code: [Select]
const u8 *path

means a pointer that can be changed but points to const/unchangeable data.

Code: [Select]
const u8 * const path
means an unchangeable pointer that points to unchangeable data ;)
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: mr_lou on 21:25, 15 July 15
for safety ;) :

Code: [Select]
const u8* const path[10] = {0xc058, 0xc858, 0xd058, 0xd858, 0xe058, 0xe858, 0xf058, 0xf858, 0xc0a8, 0xc8a8};

means an unchangeable pointer that points to unchangeable data ;)

But... doesn't that mean that I can't really use it for anything?
How can I draw a sprite there if the data is unchangeable?
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: arnoldemu on 21:41, 15 July 15
But... doesn't that mean that I can't really use it for anything?
How can I draw a sprite there if the data is unchangeable?
You can use it for reading data.
True you want the other version.

I was being a bit pedantic, showing the difference between unchangeable data, and unchangeable pointers.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: mr_lou on 21:44, 15 July 15
You can use it for reading data.
True you want the other version.

I was being a bit pedantic, showing the difference between unchangeable data, and unchangeable pointers.

Well, I had to try it anyway, and it still draws the sprites fine....
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: lachlank on 00:22, 19 July 15
Just been working on a mode 1 game so got another useful c function for you guys to print a string without using firmware. I've ripped a few fonts from different mode 1 games, most of them store data in a monochrome 1bpp bitmap format (i.e. 8 bits = 8 pixels). I have found one exception (Deflektor) which stores the characters as raw sprites - this is much easier to draw but takes twice as much memory and you can't recolour dynamically. If you want to use these, see my Mode 0 drawing routine from earlier in this thread.


To draw any of the numerous 1bpp fonts, I create a local array[16] to store the intermediate "sprite" created from the monochrome data before drawing. This is pretty straightforward by leveraging the CPCTelera function cpct_px2byteM1(). There are options for the foreground and background pen so you can use any of the available colours in mode 1.


The font used in the below example is ripped from "Scooby Doo". I used this as it's one of the few I've ripped that is "full", i.e. every character from space up to Z is included. Most others have gaps or just include digits and A-Z. You will need to tweak the code if you want to use those to skip characters. I've attached the RGAS files containing all fonts I've ripped so far (hopefully the original authors/publishers won't mind by now!).


There are probably more efficient ways of doing this, but it works:


Code: [Select]

void printString(char *str, u8 forePen, u8 bgPen, u8 x, u8 y) {
u8 sprite[16]; // holds unpacked sprite to draw
u8* scrAddr = cpct_getScreenPtr ((void *) 0xC000, x, y); 
u8 *sprPtr;

while (*str > 0) {
u8 i;
u8 c = str[0];

c -= 32; // space is first in set
   
        // read the 8 bytes (each of 8 bits = one line)
sprPtr = G_Chars + c * 8;
for (i = 0; i < 8; i++) {
u8 b = sprPtr[0];
u8 leftPix = cpct_px2byteM1(b & 128 ? forePen : bgPen, b & 64 ? forePen : bgPen, b & 32 ? forePen : bgPen, b & 16 ? forePen : bgPen);
u8 rightPix = cpct_px2byteM1(b & 8 ? forePen : bgPen, b & 4 ? forePen : bgPen, b & 2 ? forePen : bgPen, b & 1 ? forePen : bgPen);

sprite[i * 2] = leftPix;
sprite[i * 2 + 1] = rightPix;
sprPtr++;
}

     
     
cpct_drawSprite(sprite, scrAddr, 2, 8);
     
str++;
scrAddr += 2;
     
        }   
}



const unsigned char G_Chars[504] = {
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x18,
0x18,
0x18,
0x18,
0x00,
0x18,
0x18,
0x00,
0x36,
0x36,
0x12,
0x24,
0x00,
0x00,
0x00,
0x00,
0x7E,
0xFC,
0x60,
0xF8,
0x0C,
0x7C,
0xF8,
0x00,
0x1C,
0x30,
0x3C,
0x6E,
0x66,
0x7E,
0x3C,
0x00,
0x7E,
0xFC,
0x0C,
0x18,
0x18,
0x30,
0x30,
0x00,
0x3C,
0x66,
0x72,
0x3C,
0x4E,
0x66,
0x3C,
0x00,
0x3C,
0x6E,
0x46,
0x66,
0x3C,
0x0C,
0x38,
0x00,
0x0C,
0x18,
0x18,
0x18,
0x18,
0x0C,
0x00,
0x00,
0x60,
0x30,
0x30,
0x30,
0x30,
0x60,
0x00,
0x00,
0x00,
0x14,
0x08,
0x3E,
0x08,
0x14,
0x00,
0x00,
0x00,
0x04,
0x0E,
0x04,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x18,
0x18,
0x08,
0x10,
0x00,
0x00,
0x00,
0x7E,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x18,
0x18,
0x00,
0x02,
0x02,
0x04,
0x08,
0x08,
0x00,
0x00,
0x00,
0x3C,
0x6E,
0xCE,
0xD6,
0xE6,
0xEC,
0x78,
0x00,
0x3C,
0x78,
0x18,
0x18,
0x18,
0x3C,
0x78,
0x00,
0x3C,
0x7E,
0x06,
0x0C,
0x10,
0x3E,
0x7C,
0x00,
0x3E,
0x7C,
0x08,
0x1C,
0x06,
0x7E,
0x3C,
0x00,
0x1E,
0x34,
0x64,
0x7E,
0x04,
0x0E,
0x1C,
0x00,
0x7E,
0xFC,
0x60,
0xF8,
0x0C,
0x7C,
0xF8,
0x00,
0x1C,
0x30,
0x3C,
0x6E,
0x66,
0x7E,
0x3C,
0x00,
0x7E,
0xFC,
0x0C,
0x18,
0x18,
0x30,
0x30,
0x00,
0x3C,
0x66,
0x72,
0x3C,
0x4E,
0x66,
0x3C,
0x00,
0x3C,
0x6E,
0x46,
0x66,
0x3C,
0x0C,
0x38,
0x00,
0x18,
0x18,
0x00,
0x18,
0x18,
0x00,
0x00,
0x00,
0x18,
0x18,
0x00,
0x18,
0x18,
0x08,
0x10,
0x00,
0x00,
0x02,
0x04,
0x02,
0x00,
0x00,
0x00,
0x00,
0x00,
0x7E,
0x00,
0x00,
0x7E,
0x00,
0x00,
0x00,
0x00,
0x04,
0x02,
0x04,
0x00,
0x00,
0x00,
0x00,
0x38,
0x7C,
0x18,
0x10,
0x00,
0x10,
0x30,
0x7C,
0xC6,
0xDE,
0xDE,
0xDE,
0xC0,
0x7C,
0x00,
0x00,
0x70,
0x38,
0x28,
0x4C,
0x7C,
0xC6,
0xC4,
0x00,
0x78,
0xFC,
0x24,
0x7E,
0x62,
0x7E,
0xFC,
0x00,
0x3C,
0x6E,
0xC4,
0xC0,
0xE0,
0x7C,
0x38,
0x00,
0x78,
0xFC,
0x26,
0x62,
0x46,
0x7C,
0xF8,
0x00,
0x7E,
0xFC,
0x20,
0x78,
0x40,
0x7E,
0xFC,
0x00,
0x7E,
0xFC,
0x20,
0x78,
0x40,
0x60,
0xC0,
0x00,
0x3C,
0x6E,
0xC4,
0xC0,
0xEE,
0x7C,
0x34,
0x00,
0x66,
0xEE,
0x66,
0x7E,
0x66,
0x66,
0xCC,
0x00,
0x1C,
0x38,
0x18,
0x18,
0x18,
0x1C,
0x38,
0x00,
0x1C,
0x38,
0x0C,
0x0C,
0x4C,
0x6C,
0x38,
0x00,
0x66,
0xEC,
0x78,
0x6C,
0x6C,
0x66,
0xC4,
0x00,
0x70,
0xE0,
0x60,
0x60,
0x60,
0x7E,
0xFC,
0x00,
0x42,
0xE6,
0x7E,
0x7A,
0x52,
0x42,
0xC6,
0x00,
0x42,
0xE6,
0x72,
0x7A,
0x5E,
0x4E,
0xC6,
0x00,
0x3C,
0x6C,
0xC6,
0xC6,
0xC6,
0x6C,
0x78,
0x00,
0x7C,
0xEE,
0x66,
0x7C,
0x60,
0x70,
0xE0,
0x00,
0x3C,
0x6C,
0xC6,
0xC6,
0xDE,
0x6C,
0x7A,
0x00,
0x7C,
0xEE,
0x66,
0x7C,
0x64,
0x76,
0xE6,
0x00,
0x38,
0x4E,
0x64,
0x18,
0x4C,
0xE4,
0x38,
0x00,
0x7E,
0xFC,
0x30,
0x30,
0x30,
0x38,
0x70,
0x00,
0x46,
0xCC,
0x64,
0x64,
0x64,
0x7E,
0x34,
0x00,
0x46,
0xCC,
0x64,
0x6C,
0x28,
0x38,
0x10,
0x00,
0x4A,
0xDA,
0x4A,
0x6A,
0x6A,
0x7E,
0x24,
0x00,
0x4E,
0xC4,
0x68,
0x10,
0x2C,
0x46,
0xE4,
0x00,
0x66,
0x62,
0x34,
0x1C,
0x48,
0x78,
0x30,
0x00,
0x7E,
0xFC,
0x08,
0x7C,
0x20,
0x7E,
0xFC,
0x3C,
0x30,
0x30,
0x30,
0x30,
0x30,
0x3C,
0x00,
0xC0,
0x60,
0x30,
0x18,
0x0C,
0x06,
0x02,
0x00,
0x3C,
0x0C,
0x0C,
0x0C,
0x0C,
0x0C,
0x3C,
0x00,
0x18,
0x3C,
0x7E,
0x18,
0x18,
0x18,
0x18,
0x00};






Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 00:40, 19 July 15
Nice one, @lachlank (http://www.cpcwiki.eu/forum/index.php?action=profile;u=133) :).

I have bitmap font management added to the tasklist for future CPCtelera (http://lronaldo.github.io/cpctelera) modules. Solutions like yours are very useful until a dedicated/optimized module is fully developed (which will take a lot of time/effort).
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ervin on 15:45, 27 July 15
@ronaldo (http://www.cpcwiki.eu/forum/index.php?action=profile;u=1227)

Hi ronaldo.
I've installed the latest version of cpctelera, and I forgot about a previous post of yours in a different thread:

Code: [Select]
make -C cpctelera/ cleanall
./setup.sh

I'm now getting these warnings:

Code: [Select]
?ASlink-Warning-Definition of public symbol '_cpct_getScreenPtr' found more than once:
   Library: '/home/ErvinPajor/cpctelera/cpctelera/cpctelera.lib', Module: 'cpct_getScreenPtr.rel'
   Library: '/home/ErvinPajor/cpctelera/cpctelera/cpctelera.lib', Module: 'cpct_getScreenPtr_cbindings.rel'

No problems, I'll run the make/cleanall command and setup.sh again.
I'm just wondering though, can that make/cleanall command be built into setup.sh, in order to prevent errors like this happening?
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ervin on 15:46, 27 July 15
Oops - duplicate post!
 ???
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: mr_lou on 20:08, 27 July 15
Ok, time for another noob question from me.

I have finished my title-music track, and need to insert it now.

From what I've gathered, it's important that my STarKos track is located at the address I save it at.
I figure this might make it tricky or even impossible to include it the same way I include graphics.
Maybe I have to create this BASIC loader now that loads the music into a certain address first, and then loads my game-binary?
Or is there some clever way I can tell CPCtelera that certain data has to be at a certain address?

Addtionally (for the BASIC loader): Any clever way to not create a new DSK file every time, but rather just copy files to the existing DSK?
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 21:18, 27 July 15
@ervin (http://www.cpcwiki.eu/forum/index.php?action=profile;u=82): Nice suggestion. There you go (https://github.com/lronaldo/cpctelera/commit/04b1099bec778e1a5b4dc928663bcdc9c4ec81f5) ;).

@mr_lou (http://www.cpcwiki.eu/forum/index.php?action=profile;u=96): There are easier ways to make SDCC put some data at a given place in memory. I think we discussed it in another thread, but I'm not sure... Anyways, you have it in the ArkosAudio example (https://github.com/lronaldo/cpctelera/blob/master/examples/medium/arkosAudio/src/music/music.h):

Code: [Select]
// Molusk song, created by Targhan / Arkos. Music is defined and
//   located at the desired location in memory in music.c
extern __at(0x1D4D) const u8 molusk_song[8883];

SDCC provides the prefix __at() to let you specify where you want some data to be located. This is a very convenient way of locating things into specific memory places, but you have to take some precautions when using it:
I think this will be enough to suit most of your needs :).
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ervin on 02:25, 28 July 15
@ervin (http://www.cpcwiki.eu/forum/index.php?action=profile;u=82): Nice suggestion. There you go (https://github.com/lronaldo/cpctelera/commit/04b1099bec778e1a5b4dc928663bcdc9c4ec81f5) ;).

Fantastic!
Thanks ronaldo.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: mr_lou on 16:00, 31 July 15
I have problems regarding my titlemusic.

I use the STarKos tool GS to convert to binary, because I'm using Linux and don't like Mono.
The binary file is extracted from my DSK using ManageDsk without header.
Here is the first weird thing. ManageDsk say my entry point is 0x40, which is correct. That's the address I used.
It then says the length of the file is 5747 bytes. GS said that too, so all is still good.
But then ManageDsk says: Start address: 0x1d02
I don't get that. How can start address be an address much higher than the entry point + length?

Anyway, I then use cpct_bin2c to convert it into a byte array. And then create a titlemusic.h and titlemusic.c file.

Code: [Select]
//music.h
extern __at(0x40) const u8 music[5747];
Code: [Select]
//titlemusic.c
const u8 music[5747] = {0x53, 0x4b, 0x31, .... and so forth};


Then I changed Z80CODELOC to 0x16b3 because that where the music stops, as far as I can see.

Compiling gives error:

src/titlemusic.h:1: syntax error: token -> 'music' ; column 32

Tried changing Z80CODELOC to 0x26b3 suspecting it might be because of overlapping, but no. Same error.

What am I doing wrong?
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: mr_lou on 17:02, 31 July 15
Ok, the compile error was because I hadn't included #include <types.h>.... doh

So it compiles now, but gives me noise and other weird sounds.

Isn't STarKos supposed to be 100% compatible with Arkos Tracker?
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: mr_lou on 17:16, 31 July 15
Ok, trying to convert my SKS into AKS with the supplied tools using mono, which I apparently had installed. Getting this error

Missing method Show in assembly /cpctelera/tools/arkosTracker-1.0/tools/STKToAKS.exe, type System.Windows.Forms.MessageBox
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: mr_lou on 17:35, 31 July 15
Ok, ignore previous posts.
Apparently you HAVE to load the SKS file into Arkos Tracker and save it from there.  :(
This sucks for those of us who's using Linux.
But at least it's a one-time operation.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 19:01, 31 July 15
Wow, @mr_lou (http://www.cpcwiki.eu/forum/index.php?action=profile;u=96), you seem to be having a chat with yourself :). Lucky you are finding the problems and solving them. Maybe you should consider uncrossing them and add some edits on your own findings to let them be useful for others having same problems :).

The only thing I've found on your code is that you have to use __at() both in definition and in declaration of the variables. However, I think SDCC may have already warned you about that :).

Right now, the only problem with Arkos Tracker is being programmed in C# and not working well under wine or mono. I tend to use a virtual machine with WinXP for that.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: mr_lou on 19:22, 31 July 15
The only thing I've found on your code is that you have to use __at() both in definition and in declaration of the variables. However, I think SDCC may have already warned you about that :) .

Yes, I found out about that too.  :)

I was rather disappointed when I learned Targhan coded Arkos Tracker in C#. Because I know that means I'll never be using it.
Then Microsoft can take their "It's crossplatform - just use an emulator" and shove it.
By their logic, Amstrad games are crossplatform too then.

I have no problem sticking with STarKos on my CPC. In fact I prefer using the real hardware. But it means I HAVE to use a Windows PC if I want to put my music in my CPCtelera games.  :(
I want a utility that runs on Linux that'll convert my SKS file into the hex data needed for CPCtelera.  :)
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 19:47, 31 July 15
I want a utility that runs on Linux that'll convert my SKS file into the hex data needed for CPCtelera.  :)
Maybe we should ask @Targhan (http://www.cpcwiki.eu/forum/index.php?action=profile;u=110) and hope for him having time for such a deal :).
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: mr_lou on 19:55, 31 July 15
Maybe we should ask @Targhan (http://www.cpcwiki.eu/forum/index.php?action=profile;u=110) and hope for him having time for such a deal :) .

Last time I spoke with him about something similar (I forget what though), his reply was that he prefers C#, so I doubt he'll make such a tool.

Alternatively, STarKos and its GS tool should be upgraded, but he didn't have any interest in that either last time the topic came up.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: mr_lou on 11:42, 04 August 15
Trying to fade my title music before the game starts, by using cpct_akp_setFadeVolume(value), but getting this error:

?ASlink-Warning-Undefined Global '_cpct_akp_setFadeVolume' referenced by module 'main'
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 12:24, 04 August 15
Yes, that's normal. It's my fault not to warn you on the documentation.

Fades are turned off by default on the version of Arkos Tracker included with CPCtelera. This is done to save some CPU cycles and memory, as Fades are used occassionaly.

Right now, there is no easy interface develop por activating these features. They have to be activated by hand. I add to my tasklist an API modification to make this much more simple and straight forward.

The proccess to activate Fades right now is as follows:

Code: [Select]
.equ PLY_UseFades       , 0
Code: [Select]
.equ PLY_UseFades       , 1
Code: [Select]
make cleanall && makeAfter following these steps, you should be able to use Fades.

I'm going to include a warning on the documentation, that should have already been there.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: AMSDOS on 12:28, 04 August 15
Wow, @mr_lou (http://www.cpcwiki.eu/forum/index.php?action=profile;u=96), you seem to be having a chat with yourself :) . Lucky you are finding the problems and solving them. Maybe you should consider uncrossing them and add some edits on your own findings to let them be useful for others having same problems :) .


That's always happening on this forum (particularly the Programming Section).
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: mr_lou on 14:48, 04 August 15
Yes, that's normal. It's my fault not to warn you on the documentation.

Fades are turned off by default on the version of Arkos Tracker included with CPCtelera. This is done to save some CPU cycles and memory, as Fades are used occassionaly.

Actually I do recall having read something about that. So it must be described somewhere already. I just couldn't find it again now.

EDIT: It's in the general description of Arkos Player functions.
Arkos Player Manual - . . (http://lronaldo.github.io/cpctelera/files/audio/arkosplayer-txt.html)
Title: #CPCtelera 1.2. Official Release
Post by: ronaldo on 11:51, 05 August 15
After 2 months of work, lots of improvements and new functions, CPCtelera 1.2 (http://lronaldo.github.io/cpctelera) release is finally out!

This release comes with some very useful new features. In particular, Easytilemaps managing module will be particularly useful in combination with authoring tools (RGAS, Img2CPC) and tileset conversion utility cpct_img2tileset. However, the release includes much more than this. Down you will find the complete list of additions :) .

Hope you enjoy this release and it helps you create more and better games for our beloved Amstrad CPCs! :)

RELASE NOTES

New features included in this release:
  * Added new modules: cpct_random & cpct_easytilemaps
  * 3 new fast functions for very easy management of Tilemaps and Tilesets directly.
  * New cpct_img2tileset utility for converting images containing complete tilesets or sprites groups into C data for including directly in projects code.
  * 2 new fast functions for generating pseudo-random byte numbers uniformly distributed.
  * 2 faster memset functions, up to 3 times faster than original cpct_memset (cpct_memset_f8, cpct_memset_f64)
  * New function to set the location of the program stack at will (cpct_setStackLocation)
  * New function for drawing Masked Aligned Sprites using Transparency Tables(cpct_drawSpritesMaskedAlignedTable)
  * Added a transparency_tables header file for easing inclusion.
  * Added a C-script for generating mask lookup tables.
  * Added new examples: Text Software Scrolling, fastmemset, Easytilemaps demo, drawSpritesMaskedAligned demo, ProgramStack demo.
  * Added Img2CPC image conversion tool by Augusto Ruiz.
  * Added new version of RGAS: 1.0
  * Updated SDCC to 3.5.0
  * Movable project folders: they can be moved to different locations on a same hard-disk or even on a different machine without any change (provided CPCtelera 1.2 (http://lronaldo.github.io/cpctelera) is installed). They now use an environment variable for linking with framework.

List of improvements and bug-fixes:
  * Added a bug-fix for SDCC __z88dk_callee function binding on tail jumping optimizations.
  * Improved performance for C calls to functions using __z88dk_callee and __z88dk_fastcall new calling conventions included with SDCC 3.5.0.
  * Fixed mixed up definitions for Joy1_Fire1 and Joy1_Fire2
  * Optimized several library functions.
  * Documented functions that use self-modifying code (and will not work from ROM, logically)
  * Split C and ASM bindings for most functions: calls from both languages include their own code without overheads
  * Recalculated timings of most functions with respect to Amstrad's microsecond-rounded scheme.
  * cpct_mkproject checks for valid AMSDOS characters on project names.
  * Fixed a subtle calculation bug in cpct_getScreenPtr
  * Added library cleanup to setup.sh
  * Improved OSX compatibility for the cpct_mkproject and setup.sh scripts

Big thanks
  to all people supporting this project and. special thanks to people who directly contributed to this 1.2 release: @Alcoholics Anonymous (http://www.cpcwiki.eu/forum/profile/?u=1116), @AugustoRuiz (http://www.cpcwiki.eu/forum/index.php?action=profile;u=85), @ervin (http://www.cpcwiki.eu/forum/index.php?action=profile;u=82), @lachlank (http://www.cpcwiki.eu/forum/index.php?action=profile;u=133), @Octoate (http://www.cpcwiki.eu/forum/index.php?action=profile;u=12), @mr_lou (http://www.cpcwiki.eu/forum/index.php?action=profile;u=96).

Some videos about from the code examples:

[youtube]https://www.youtube.com/watch?v=2yOy92tfuzU[/youtube]

[youtube]https://www.youtube.com/watch?v=1F7F6YTZ8q4[/youtube]

[youtube]https://www.youtube.com/watch?v=6TOHpSUfTFE[/youtube]
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ervin on 15:20, 05 August 15
Wow, this is a major release!
Congrats @ronaldo (http://www.cpcwiki.eu/forum/index.php?action=profile;u=1227) - really great work!

Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: Neil79 on 21:49, 05 August 15
Giggidy!  ;D
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 22:31, 05 August 15
Last version (https://github.com/lronaldo/cpctelera/archive/master.zip) on github (http://github.com/lronaldo/cpctelera) includes a little fix for setup on OSX.

Title: #CPCtelera 1.2.1 bugfix release
Post by: ronaldo on 15:27, 06 August 15
There you go, a new release including two little fixes and a new example. Now it works on Mac OSX (setup.sh was failing). Enjoy it :)
And here you are a video with a the new example included: smooth 1-pixel movement on mode 0 :) .
[youtube]https://www.youtube.com/watch?v=bEkf95Q2puk[/youtube]
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: EgoTrip on 01:00, 07 August 15
I cant figure out how to get this working on windows 8.1, what exactly do I need?
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 09:49, 07 August 15
@EgoTrip (http://www.cpcwiki.eu/forum/index.php?action=profile;u=337): have you read CPCtelera's install instructions (http://lronaldo.github.io/cpctelera/files/readme-txt.html#Installing_CPCtelera_in_your_system)? The first step for installing CPCtelera (http://lronaldo.github.io/cpctelera) is following them carefully, step by step. Then, if you have any problem or something is unclear, please ask us and will try to help you.

In particular, Windows 8.1 should behave similar to Windows 7. You need to install Cygwin (http://www.cygwin.com), along with required its software packages (picking them on the packages step, during Cygwin (http://www.cygwin.com) install process), and then CPCtelera (http://lronaldo.github.io/cpctelera).
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: EgoTrip on 16:02, 08 August 15
Cygwin can fuck off.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: McKlain on 16:21, 08 August 15
Cygwin can fuck off.


No cpctelera for you then.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 17:46, 08 August 15
@EgoTrip (http://www.cpcwiki.eu/forum/index.php?action=profile;u=337): Well, then your alternatives are a Virtual Machine with Linux (you can use VirtualBox for that), a Mac (or a Hackinstosh), changing your W8.1 for Linux, or developing a new CPCtelera (http://lronaldo.github.io/cpctelera) branch that works directly over W8.1. :)

If any of the options is not good for you, you can use other alternatives to CPCtelera (http://lronaldo.github.io/cpctelera). We are lucky to have lot of great programmers and plenty of software (Pasmo, SDCC, CPCRSLib, Z88DK, CPC BASIC, etc). You only have to chose the one that works better for you ;) .
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: robcfg on 18:32, 08 August 15
I just installed CPCTelera on my macbook and it's as easy as it gets.

Great setup script, thank you!
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 20:41, 08 August 15
@robcfg (http://www.cpcwiki.eu/forum/index.php?action=profile;u=4): You're welcome, man :). Hope it helps :D
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: AMSDOS on 11:40, 09 August 15

And here you are a video with a the new example included: smooth 1-pixel movement on mode 0 .


It looks impressive, though was wondering how you tackled the 1-pixel movement?


I can only assume the sprite isn't Encoded.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: AMSDOS on 11:57, 09 August 15
If any of the options is not good for you, you can use other alternatives to CPCtelera (http://lronaldo.github.io/cpctelera). We are lucky to have lot of great programmers and plenty of software (Pasmo, SDCC, CPCRSLib, Z88DK, CPC BASIC, etc). You only have to chose the one that works better for you ;) .


I'm not very creative when it comes to my programming, and only come up with bits and pieces from time to time, as you probably have gathered. So it's good to go to CPC-Power and find some Type-ins which have been scanned and are online, but no Tape/Disc exists. It's incredible to see how much stuff exists, but isn't available, even though the Source Code is available.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 11:59, 09 August 15
It looks impressive, though was wondering how you tackled the 1-pixel movement?
It's done shifting sprite bytes for every movement. You can check the full code of the move1pixel example (https://github.com/lronaldo/cpctelera/tree/master/examples/advanced/move1pixel/src): it's included with latest version of CPCtelera (http://lronaldo.github.io/cpctelera) :).
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: AMSDOS on 12:18, 09 August 15
It's done shifting sprite bytes for every movement. You can check the full code of the move1pixel example (https://github.com/lronaldo/cpctelera/tree/master/examples/advanced/move1pixel/src): it's included with latest version of CPCtelera (http://lronaldo.github.io/cpctelera) :) .


Ok, so if I'm reading it properly you're dividing the number of pixels per byte to generate the effect.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 12:26, 09 August 15
Not exactly. CPCtelera (http://lronaldo.github.io/cpctelera)'s drawing functions draw sprites at byte locations. Division is there to convert pixel coordinates to byte locations.

The 1-pixel movement is based on shifting functions (shiftSpritePixelsRight / shiftSpritePixelsLeft). Each shift moves the sprite 1 pixel to the left or to the right in-place (inside the sprite buffer). Then the sprite is drawn normally copying bytes to screen with cpct_drawSprite function.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: arnoldemu on 12:31, 09 August 15
Cygwin can fuck off.
I believe EgoTrip's point is that for windows users there is no simple one click installer?




Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 12:38, 09 August 15
@arnoldemu (http://www.cpcwiki.eu/forum/index.php?action=profile;u=122): Having one-click installers would be marvellous. If someone wants to develop and maintain them, I would be more than happy :D.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: EgoTrip on 13:12, 09 August 15
Well yeah, a 1-click would be nice. However, sitting around waiting for an hour to download, then 2 hours later it still had not finished installing, I just gave up cos there was no sign of it ever ending. All I did was try to install the devel package for gcc. Nothing else.

I'm going to try CPC Basic but thats not really going to  cut it from what I can gather. I need a proper coder who knows what they are doing really but nobody wants to get involved, theres no financial incentive and maybe my game ideas are just crap really.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 13:16, 09 August 15
@EgoTrip (http://www.cpcwiki.eu/forum/index.php?action=profile;u=337): That happens when you select a slow mirror for Cygwin. It has happened to me sometimes. Last time I was waiting for 10 minutes, then I cancelled, picked up a different mirror and everyting installed in 3 minutes.

Organizations set up mirrors with their own means and they are not always able to cope with demand.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: AMSDOS on 13:39, 11 August 15
Not exactly. CPCtelera (http://lronaldo.github.io/cpctelera)'s drawing functions draw sprites at byte locations. Division is there to convert pixel coordinates to byte locations.

The 1-pixel movement is based on shifting functions (shiftSpritePixelsRight / shiftSpritePixelsLeft). Each shift moves the sprite 1 pixel to the left or to the right in-place (inside the sprite buffer). Then the sprite is drawn normally copying bytes to screen with cpct_drawSprite function.


Cool, so the bytes are either Added or Subtracted by &55 to obtain the next pixel position.
Title: #CPCtelera 1.2.3 critical bugfix release
Post by: ronaldo on 10:18, 14 August 15
As discussed yesterday, there is another occurence of the tail jumping bug when using __z88dk_callee functions in SDCC 3.5.0. This is a critical bug, as programs suffering it crash due to a bad optimization made by the compiler.

So, we have issued a new bugfix release of CPCtelera (http://lronaldo.github.io/cpctelera/), fixing this bug. Everyone is urged to update.

You have more details on this update on its release notes (https://github.com/lronaldo/cpctelera/releases/tag/v1.2.3).
Title: Re: #CPCtelera 1.2.3 critical bugfix release
Post by: ervin on 14:57, 14 August 15
As discussed yesterday, there is another occurence of the tail jumping bug when using __z88dk_callee functions in SDCC 3.5.0. This is a critical bug, as programs suffering it crash due to a bad optimization made by the compiler.

So, we have issued a new bugfix release of CPCtelera (http://lronaldo.github.io/cpctelera/), fixing this bug. Everyone is urged to update.

You have more details on this update on its release notes (https://github.com/lronaldo/cpctelera/releases/tag/v1.2.3).

Thanks ronaldo.
I'm very happy to see cpct_isAnyKeyPressed in this release.
 :)

Title: Re: #CPCtelera 1.2.3 critical bugfix release
Post by: ronaldo on 18:57, 14 August 15
Yes, @ervin (http://www.cpcwiki.eu/forum/index.php?action=profile;u=82), I implemented the functions when you suggested it, so I only had to write documentation and include them in the release :) .

It might also be more interesting for you the new feature I have just commited to the main branch (that will be available on next releases). Now CPCtelera (http://lronaldo.github.io/cpctelera) automatically manages .bin files included under src/ folder. It detects them and automatically makes the conversion to .c array that is compiled and included in the project. It also detects any change to the .bin files and redoes the conversion when this happens. You don't have to worry anymore about manually converting your binary files: you only save them to a folder under src/ and they are automatically managed :) .

There is a very simple example under examples/medium folder (incbin example).
Title: Re: #CPCtelera 1.2.3 critical bugfix release
Post by: ervin on 16:19, 15 August 15
Yes, @ervin (http://www.cpcwiki.eu/forum/index.php?action=profile;u=82), I implemented the functions when you suggested it, so I only had to write documentation and include them in the release :) .

It might also be more interesting for you the new feature I have just commited to the main branch (that will be available on next releases). Now CPCtelera (http://lronaldo.github.io/cpctelera) automatically manages .bin files included under src/ folder. It detects them and automatically makes the conversion to .c array that is compiled and included in the project. It also detects any change to the .bin files and redoes the conversion when this happens. You don't have to worry anymore about manually converting your binary files: you only save them to a folder under src/ and they are automatically managed :) .

There is a very simple example under examples/medium folder (incbin example).

Now THAT is a feature I will find very useful!
Thanks for implementing it.
 :)
Title: Re: #CPCtelera 1.2.3 critical bugfix release
Post by: arnoldemu on 17:47, 15 August 15
Nice!
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: AMSDOS on 11:30, 16 August 15
You might need a "Clear Input" Void to go with that "Any Key" Routine?
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 11:41, 16 August 15
@AMSDOS (http://www.cpcwiki.eu/forum/index.php?action=profile;u=330): "Clearing input" is a concept used when using intermediate buffers between keypresses and software key reads. That's not the case here. Keyboard functions access the present status of the keys. So, if a key is being pressed, there is no way to "clear it" as you only can wait for the user to stop pressing it. In other words, the status will be "pressed" until the user releases it.

So, using cpct_anyKeyPressed(), the solution is using 2 loops: a first loop that waits until no key is pressed and then, another loop that waits for a keypress. That's the way to ensure that a key has been pressed voluntarily by the user. This is a code sample for doing that:
Code: [Select]
void wait4Keypress() {
   // First, if there is any key pressed, we wait until no key is pressed
   do { cpct_scanKeyboard_f(); } while ( isAnyKeyPressed() );

   // Then we wait until a Key is pressed
   do { cpct_scanKeyboard_f(); } while ( !isAnyKeyPressed() );
}
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: AMSDOS on 11:51, 16 August 15
Yeah so usually what happens is a buffer of user input has been generated, and needs to be cleared, otherwise the Any key routine just does it's own thing, which could be taking you back into the game and if your lucky some user input from earlier if running the game.
Title: Re: #CPCtelera 1.2.3.
Post by: ronaldo on 12:00, 16 August 15
[quote
[...] what happens is a buffer of user input has been generated, and needs to be cleared, [...]
That usually happens on nowadays machines and operative systems. OS are those who create and maintain buffers for user input. That does not happen on a CPC when you directly program its hardware, like CPCtelera (http://lronaldo.github.io/cpctelera) does. All keyboard functions from CPCtelera (http://lronaldo.github.io/cpctelera) do scan and report present keyboard status, with no input buffers (not like modern OSes).
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: AMSDOS on 12:22, 16 August 15
I see what your saying, but what I'm asking is does the "Any Key" Routine need something to clear the buffer? I would have thought the Hardware Especially keeps a Buffer of Backlogged key-presses, otherwise you've got yourself a computer ignoring Key-presses.
Would of thought something for Clearing the Buffer needed to be kept separate from an "Any Key" routine, I don't know, just thought that if the Buffer was Cleared before the "Any Key" routine was called, would a key become ignored?
Title: Re: #CPCtelera 1.2.3.
Post by: ronaldo on 12:42, 16 August 15
I'm asking is does the "Any Key" Routine need something to clear the buffer? I would have thought the Hardware Especially keeps a Buffer of Backlogged key-presses, otherwise you've got yourself a computer ignoring Key-presses.
No, hardware does not have any buffer. Keyboard is directly scanned to see if keys are pressed or not.

Quote from: AMSDOS
I don't know, just thought that if the Buffer was Cleared before the "Any Key" routine was called, would a key become ignored?
Keys could be ignored if your keyboard scanning frequency is low, and a user presses and releases a key between two scans. If you scan keyboard 25/50 times per seconds that's unlikely. However, as your frequency decreases, you may experience ignored keys. In fact, you can see this happening on lot of games with low framerate (as they may be scanning keyboard once per frame drawn to screen).
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: AMSDOS on 13:56, 17 August 15
I guess this is where games were tested for playability and reviewers would say if a game was unplayable. So it would seem there was more than one way of scanning the keyboard. Even on @arnoldemu (http://www.cpcwiki.eu/forum/index.php?action=profile;u=122) website there's a routine which is considered CPC Plus unfriendly.
Title: Re: #CPCtelera 1.2.3.
Post by: ronaldo on 14:12, 17 August 15
I guess this is where games were tested for playability and reviewers would say if a game was unplayable. So it would seem there was more than one way of scanning the keyboard. Even on @arnoldemu (http://www.cpcwiki.eu/forum/index.php?action=profile;u=122) website there's a routine which is considered CPC Plus unfriendly.
To my knowledge, there is only one way of scanning the keyboard. You can arrange it in multiple ways (scan only some keys, scan the complete keyboard, store scanned status or not...), but I only know of a way to scan it.

Anyways, the kind of unplayability you are referring comes from low scan frequency, not from different ways of scanning. Games tend to scan for user input once on every iteration of the game loop. If a game runs at 6 FPS, that lefts the player with a maximum of 6 actions per second. Moreover, you may have a delay up to 0,16s between a keypress and its reaction. That drives the game unplayable, in most cases.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: AMSDOS on 13:55, 19 August 15

Cool, so the bytes are either Added or Subtracted by &55 to obtain the next pixel position.


i tested this out, though my comment isn't correct in the sense it's not being added or subtracted, but shifted, and for a graphic to shift from one spot to another depending on direction relies on it being shifted by either &55 or &AA which are based on Left Most Pixel or Right Most Pixel in a 7 or 8 bit format.


The routine obviously works, though I cannot workout (from a sprite driver I made a few years ago, which allows for 1 byte pixel movement), the encoded byte results from it.


For example a Left Byte Position looks like this:


Code: [Select]
&C0,&40,&40,&80

which becomes:


Code: [Select]
&40,&80,&80,&C0

Don't think I'm shifting based on Byte positions.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: Paulo Garcia on 23:17, 19 August 15
Hey Ronaldo, I am curious...why did you remove the maze game example from master branch?


Cheers



Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: andycadley on 01:18, 20 August 15

i tested this out, though my comment isn't correct in the sense it's not being added or subtracted, but shifted, and for a graphic to shift from one spot to another depending on direction relies on it being shifted by either &55 or &AA which are based on Left Most Pixel or Right Most Pixel in a 7 or 8 bit format.


The routine obviously works, though I cannot workout (from a sprite driver I made a few years ago, which allows for 1 byte pixel movement), the encoded byte results from it.


For example a Left Byte Position looks like this:


Code: [Select]
&C0,&40,&40,&80

which becomes:


Code: [Select]
&40,&80,&80,&C0

Don't think I'm shifting based on Byte positions.

&55 and &AA wouldn't be values to shift by, they'd be pixel masks to AND with. You're encoding each byte so that both the left and right pixels are set to the same Pen, then you can extract the left pixel by ANDing the encoded value with &AA or the right pixel by ANDing with &55. The two subsequent values can then be OR'd to get the final value to write to the display.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: AMSDOS on 05:57, 20 August 15
&55 and &AA wouldn't be values to shift by, they'd be pixel masks to AND with. You're encoding each byte so that both the left and right pixels are set to the same Pen, then you can extract the left pixel by ANDing the encoded value with &AA or the right pixel by ANDing with &55. The two subsequent values can then be OR'd to get the final value to write to the display.


I wrote this little example using AND to move left and right pixels to the Right:


Code: [Select]
org &4000

ld a,(&c000)
and &aa
ld (&c001),a
ld a,(&c000)
and &55
ld (&c000),a


I guess to implement it in a working environment, it would be applied from the Right Edge of the Sprite, moving backward though a loop and going down. Which I presume would mean the opposite when moving the Sprite Left.
Title: Re: #CPCtelera 1.2.3
Post by: ronaldo on 10:08, 20 August 15
Hey Ronaldo, I am curious...why did you remove the maze game example from master branch?
Because I merged it to the master branch by mistake. It's still under development, on its own branch. It will return to master branch once finished ;).
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: awergh on 17:43, 29 August 15
Seeing some peoples dislike for cygwin I decided to try building CPCtelera with mingw and msys. I would have preferred not to need msys but the to use the sdcc configure script it really needed msys, alternatively I could have used Visual Studio to build sdcc but I figured that might be a bit much if someone else wanted to build it.

I have as far as I can see successfully built the tools and cpctelera.lib while leaving the makefiles intact so it should still compile with linux although I haven't checked.
I only have the examples left to build which looks time consuming if I don't want to just do a find and replace to fix up all the finds (windows has its own find that doesnt work for this) and fix my include errors (probably missed a step in building sdcc).

Oh and porting the tools\scripts as well hmmmm

I'm just wondering how worthwhile it is to do a complete build on windows without cygwin. I find I do have a bit of a tendency to get bored of various programming projects if they are tedious or I discover something more exciting!

Heh and maybe one day I'll actually play with CPCtelera for real  :) .
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 18:21, 29 August 15
Well, @awergh (http://www.cpcwiki.eu/forum/index.php?action=profile;u=249). I think that's a ton of work or more, and you actually do impress me: never thought of anyowe willing to do such amount of non-ceremonious work :).

I have never had the opportunity to run MSYS, but it should come with some version of bash and GNU make. That should be enough for running scripts on tools/scritps and most makefiles. Anyway, have you tried enabling Interix? I assume you are on Windows 7+. (Well, I think GCC compiler comming with Interix is too old, but you may try).

I personally think that this is too much work for a result that won't be completely satisfactory. Moreover, take into accont that any change on CPCtelera (http://lronaldo.github.io/cpctelera) will probably require a great amount of work to port it to Windows. The main problem is not developing, but maintaining.

When we started CPCtelera (http://lronaldo.github.io/cpctelera) we decided to support Cygwin for productivity reasons. Our limited time should be productive and we have to create useful things, rather than fighting with different systems' idiosyncrasies. Maintaining a Windows build system, tools and setup would have been like doubling the size of the project (like doing almost 2 different projects) due to the differences with *NIX environments (mainly Linux and OSX).

So, I think that Windows users have enough alternatives for using CPCtelera (http://lronaldo.github.io/cpctelera):
Having such a number of alternatives makes me think that investing time in creating a native version of CPCtelera (http://lronaldo.github.io/cpctelera) for a non-developer-oriented system like Windows in non-productive work. In a portion of the time required you can install a virtual machine with Linux and have all the functionalities working.
Anyways, this is just my opinion. If you are really interested in porting it to Windows and some people like it, for me is more than okay: it's amazing :D. It'd be even more amazing if there were enough people to maintain it over time :D.

As Gandalf says: "All we have to decide is what to do with the time that is given us". ;)
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: Arnaud on 23:20, 29 August 15
With the latest version on gitHub i have seen two little problems when building my project :
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: Alcoholics Anonymous on 05:45, 30 August 15
Seeing some peoples dislike for cygwin I decided to try building CPCtelera with mingw and msys. I would have preferred not to need msys but the to use the sdcc configure script it really needed msys, alternatively I could have used Visual Studio to build sdcc but I figured that might be a bit much if someone else wanted to build it.

I'm not clear on why cygwin has to be used but if it's to compile sdcc for windows, you should know you don't have to compile it.  If you go to the sdcc nightly builds and grab the windows version, everything has already been compiled for you and you can run sdcc directly on windows without doing anything except unzipping and setting the path variable.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: awergh on 06:26, 30 August 15
@ronaldo (http://www.cpcwiki.eu/forum/index.php?action=profile;u=1227)
You mean no one likes modifying makefiles shellscripts and a bit of PowerShell just for the fun of it  :P
Nope haven't tried Interix but it is no longer included with Windows so it isn't really a workable solution anyway.

I can understand why you went with Cygwin, in actual fact I don't really mind Cygwin except installing it where it seems to want to download the internet but I was mostly curious to see if it was workable to build under windows easily.

In an ideal world you could use cmake and build everything instead of manual makefiles but I see that as being way too much work to setup for what isn't a huge project.
I think I'll probably clean up what I've done and provide it on github in case anyone is interested in it because you never know ;)


@Alcoholics Anonymous (http://www.cpcwiki.eu/forum/index.php?action=profile;u=1116)

Cygwin is used for building cpctelera.lib and sdcc and for the scripts that you use for your cpctelera game projects. I don't know if the version of SDCC included with cpctelera is customised at all but I was mostly keeping to the same build process because that seemed the logical choice.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 10:17, 30 August 15
@Alcoholics Anonymous (http://www.cpcwiki.eu/forum/index.php?action=profile;u=1116): It's not because of SDCC. CPCtelera (http://lronaldo.github.io/cpctelera) is being developed under Linux and support is given for OSX and Cygwin. All tools coming with CPCtelera (http://lronaldo.github.io/cpctelera) are ready to build on the 3 systems (Cygwin, Linux and OSX). Everything is based on Makefiles and shell scripts, not only tool builds, but all the build system and the environment. Everything relies on a bash shell and a POSIX system. :)

@awergh (http://www.cpcwiki.eu/forum/index.php?action=profile;u=249): No, I didn't mean that, of course :) . It's just that your sudden interest surprises me, in a way positive sense :D . Although I have a personal opinion, I greatly appreciate your effort. It's amazing for me :) . I thought of using CMake long time ago, but it also had drawbacks, like changing and maintaining the build system of some tools. I use CMake on other projects and it's great, but I didn't consider it necessary for this one. It might be reconsidered in the future, but I don't think of building on Windows as great argument in favor of CMake: I think CMake is good by itself ;) .
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 10:21, 30 August 15

@Arnaud Bouche (http://www.cpcwiki.eu/forum/index.php?action=profile;u=1424): Thank you for testing and reporting. Regarding your issues...

Header files

H files have been never taken as a dependency in CPCtelera (http://lronaldo.github.io/cpctelera)'s makefiles. The problem is that SDCC does not have a way to create dependency files like GCC. Therefore, there is no easy way to know which C files depend on which H files. However, you can provide this information manually to the compiler, at the end of the Makefile. For instance, if you wanted src/actions.c to be recompiled whenever an included header file is modified, you could do this:
Code: [Select]
# actions.rel depends on actions.c and all header files included from actions.c
obj/actions.rel: src/actions.c src/actions.h src/defines.h src/character.h src/drawScene.h src/structures.h

Alternatively you could tell the compiler to recompile all C files when any H file is changed. If you don't mind such recompilation, this is easy to tell to the compiler in the Makefile:
Code: [Select]
# List all Header files in the source folder and subfolders
HFILES := $(foreach DIR, $(SUBDIRS), $(wildcard $(DIR)/*.h))

# Make each C File depend on all Header files
$(foreach F, $(C_OBJFILES), $(eval $(F):$(HFILES)))

Inclusion of files in the DSK

This is an issue I introduced because I didn't check it properly. I have to do some modifications to solve it. When solved, I will report it here for you to update.

Thank you again for reporting :D
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: Arnaud on 10:22, 30 August 15
Previously i have installed CPCTelera with Cygwin64 with the instructions and i have no problems.

This morning i have installed CPCTelera with Cygwin32 and i have to add the following packages in order to compile during installation :
For information (if someone have the same problem), on my Windows 10 64bits i have to launch Cygwin32 in compatible mode Windows 8, if not the installation compilation fails randomly.



Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 10:29, 30 August 15
@Arnaud Bouche (http://www.cpcwiki.eu/forum/index.php?action=profile;u=1424): That doesn't sound as a CPCtelera (http://lronaldo.github.io/cpctelera) problem. Sounds more like a Cygwin32 problem on Windows10. Doesn't seem logical at all to require mingw packages. Are you sure you added standard gcc-core and gcc-g++ cygwin packages (not mingw ones)?

I don't have any Windows10 here to test, but I don't think I can do anything to solve this issue. Anyways, I'd like to report it in the installation instructions.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: Arnaud on 10:42, 30 August 15
Are you sure you added standard gcc-core and gcc-g++ cygwin packages (not mingw ones)?
Yes, i have compared my two setup list package x86 and x64 side to side and they were identical.

I don't have any Windows10 here to test, but I don't think I can do anything to solve this issue. Anyways, I'd like to report it in the installation instructions.
Yes or in a FAQ
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 11:44, 30 August 15
@Arnaud Bouche (http://www.cpcwiki.eu/forum/index.php?action=profile;u=1424): Last update to CPCtelera master branch (https://github.com/lronaldo/cpctelera) should solve your problem with files being removed from DSK on recompiling :D
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: Arnaud on 13:24, 30 August 15
@Arnaud Bouche (http://www.cpcwiki.eu/forum/index.php?action=profile;u=1424): Last update to CPCtelera master branch (https://github.com/lronaldo/cpctelera) should solve your problem with files being removed from DSK on recompiling :D
Just tried and the problem always here the files are not added on build update.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 13:38, 30 August 15
If you have just updated and typed in 'make', that's normal. You first have to make a complete rebuild. Otherwise, the build system thinks that files are already on the disk and does not add them.

Type in this:
Code: [Select]
make cleanall && make
make cleanall removes all object files and DSKs generated to let you do a subsequent complete rebuild using make.

After that, your DSK file should be kept up to date on changes.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: Arnaud on 13:53, 30 August 15
Code: [Select]
make cleanall && make

Perfect it works  ;)
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: mr_lou on 19:17, 25 September 15
I've been kept away from my project by work and other non-exciting things.

Had a little time today to start looking into sound-effects, and I just can't get anything playing.

Music plays fine.
I fade it out. Stop it, and then (just to be on the safe side) I set fadevolume to 0 again.

For starters I'm just trying to play the instruments in the same song. So at the beginning I have:

Code: [Select]
cpct_akp_musicInit((u8*) 0x40);
cpct_akp_SFXInit((u8*) 0x40);

And to play a sound effect I try:

Code: [Select]
cpct_akp_SFXPlay(3, 15, 80, 0, 0, 0);

But nothing.
Anything comes to mind?

EDIT: Doh... nevermind. I have a feeling I'm being stupid. Obviously the sound-effects has to be played the same way as the music, right? I.e. I have to call the function in the loop repeatedly.

EDIT2: Hm no, that didn't seem to be it.....
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 19:37, 25 September 15
@mr_lou (http://www.cpcwiki.eu/forum/index.php?action=profile;u=96): There is a flaw in the documentation. In the article about cpct_akp_SFXPlay (http://lronaldo.github.io/cpctelera/files/audio/arkostracker-s.html#cpct_akp_SFXPlay), it says this:

Code: [Select]
void cpct_akp_SFXPlay (u8 sfx_num, u8 volume, u8 note, u8 speed, u16 inverted_pitch, u8 channel_num)

Input Parameters (7 bytes)
....
(1B A ) channel_num    Number of Channel where to reproduce the FX (0, 1, 2)

This is wrong. Latest parameter should be called channel_bitmask, as it is not an index number, but a bitmask. Channels are A = 1 (001), B = 2 (010), C = 4 (100). Confusion comes from channel names, which are also referred as 0, 1 and 2 (A, B and C). Channel bitmasks are defined in audio.h (https://github.com/lronaldo/cpctelera/blob/master/cpctelera/src/audio/audio.h), and included when you include cpctelera.h (https://github.com/lronaldo/cpctelera/blob/master/cpctelera/src/cpctelera.h), also referred in the documentation article about Audio Constants&Variables (http://lronaldo.github.io/cpctelera/files/audio/audio-h.html). They are defined this way:
Code: [Select]
#define AY_CHANNEL_A    0b00000001
#define AY_CHANNEL_B    0b00000010
#define AY_CHANNEL_C    0b00000100
#define AY_CHANNEL_ALL  0b00000111
Try changing your call to SFXPlay with this:
Code: [Select]
cpct_akp_SFXPlay(3, 15, 80, 0, 0, AY_CHANNEL_A);
I've already changed this in the documentation files, and will be fixed for next release of CPCtelera (http://lronaldo.github.io/cpctelera). Thank you very much for reporting :) .
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: mr_lou on 19:48, 25 September 15
Try changing your call to SFXPlay with this:
Code: [Select]
cpct_akp_SFXPlay(3, 15, 80, 0, 0, AY_CHANNEL_A);

Thanks!

Sadly it didn't help me out though. Still nothing is playing.

I should mention I'm still using v1.1.1
Is that a problem?
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 19:57, 25 September 15
Is music already playing when you call SFXPlay? You need to call akp_musicPlay at your required Hz rate to hear SFX, as SFX is added to the music. Arkos Player documentation says it this way:
Quote from: http://lronaldo.github.io/cpctelera/files/audio/arkosplayer-txt.html
Obviously, SFXs are “added” to the music.  So you need to play the song to actually hear them ! Also, as they are adding another layer of sound to the player, they are consuming more CPU, especially if you’re playing SFXs on the three channels at once.Also, note that triggering a sound over another one will cut this last one.
You may also want to check Arkos Audio example (https://github.com/lronaldo/cpctelera/blob/master/examples/medium/arkosAudio/src/main.c) to see differences with your code.

BTW, I recommend you to update to latest version of CPCtelera (http://lronaldo.github.io/cpctelera) from github. It's almost to the point of being tagged next release.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: mr_lou on 20:10, 25 September 15
Is music already playing when you call SFXPlay? You need to call akp_musicPlay at your required Hz rate to hear SFX, as SFX is added to the music.

No. I play the music in my title screen. Then when a game starts I fade out the music. There is no music playing in the game itself. Only sound-effects.

Are you saying that I can't technically achieve this by putting the sound-effects into the same tune if I don't want to play this particular tune in the game?

So calling SFXPlay() adds an instrument to the "stream" to be played, and the sound-effect itself is actually played by the musicPlay() function?
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 21:13, 25 September 15
So calling SFXPlay() adds an instrument to the "stream" to be played, and the sound-effect itself is actually played by the musicPlay() function?
It works precisely this way. Documentation for Arkos Player explains it and also explains how to have only SFX during the game: having a "dummy" song that only has the instruments and is playing nothing but the mixed SFXs. You may also reuse instruments from another song (as you are trying to do), but cpct_akp_musicPlay (http://lronaldo.github.io/cpctelera/files/audio/arkostracker-s.html#cpct_akp_musicPlay) must be called, as that's the function that actually plays things.

For more details, you may want to check Arkos Player Manual (http://lronaldo.github.io/cpctelera/files/audio/arkosplayer-txt.html), which is included in CPCtelera (http://lronaldo.github.io/cpctelera) documentation.

Personally, I think that Arkos Player is a great player, but may not be suitable for all uses/needs. I plan to add other players in the future, to let users choose the one they prefer. Sorry for not having time to do it now.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: mr_lou on 20:20, 28 September 15
Well damn.... looks like I have to skip sound-effects for completely other reasons....

All of my CPC's have falled sick.
First, I toast my CPC6128 because I'm an idiot. Connects FD-1 using a cable for a PC 3.5" floppy.
Then my CPC464 starts typing fffffffffffffffffffffffffffffffffffffffffff when turning it on, and loading STaRKos results in a freeze/crash.
My CPC+ still works but F3 and F6 keys are dead, and I need those to enter the instrument editor in STaRKos and to switch between instruments.
And no, I don't use Windows so I can't use Arkos Tracker. Wake me up when it's ported to Linux.

Looks like I'll just have the music playing through-out the game instead then.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: EgoTrip on 18:01, 29 September 15
Maybe someone can do a Game Maker style front end for retards like me. Cos I really cant get the hang of pure code.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: mr_lou on 18:14, 29 September 15
Maybe someone can do a Game Maker style front end for retards like me. Cos I really cant get the hang of pure code.

Isn't there already another framework that offers this?
I forget the name. But as far as I remember it's not that old.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: EgoTrip on 18:16, 29 September 15
Theres AGD on the CPC but its extremely limited and has more bugs in it than an NHS hospital.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: mr_lou on 18:22, 29 September 15
Theres AGD on the CPC but its extremely limited and has more bugs in it than an NHS hospital.

Well, there'll always be bugs, no matter what platform and framework you go with.
Part of development is to find them and work around them, however annoying it is sometimes.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: mr_lou on 20:48, 29 September 15
@ronaldo (http://www.cpcwiki.eu/forum/index.php?action=profile;u=1227)

Alright, my CPC464 started behaving again for some reason, so I looked into SFX again.

I now stop music in the title screen, and then do this before the game starts:

Code: [Select]
    cpct_akp_musicInit((u8*) 5877);
    cpct_akp_SFXInit((u8*) 5877);

As far as I understand, I have to initialize music again with the address of my SFX file? And then call cpct_akp_musicPlay() in my game-loop?
There's no song-data in my sfx file, as I wish to only have sound-effects in the game. So I mark "Export only SFX" when exporting to binary. Otherwise it seems to exclude all the instruments that aren't used in the song.... meaning all of them....

But I get this error now when trying to compile:

Multiple definition of _music

EDIT: Argh, nevermind, I'm stupid again.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: mr_lou on 21:53, 29 September 15
Ok I'm getting a ton of these messages now:

Overlapped record detected

Thought maybe it was confused by me adding two __at prefixes, so I tried merging my music and sfx into the same array, but still get a ton of those messages.

EDIT: Oh gawd, I'm going for a record in being stupid. Been entering the export address in decimals in Arkos Tracker.... and it says clearly "hex".... I'm just gonna go to bed now... G'nite.

EDIT 2: mkay, that didn't help. I still get a ton of "Overlapped record detected" messages.....

EDIT 3: I'm beginning to suspect the problem simply is having two Arkos Tracks......?
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 01:29, 30 September 15
@mr_lou (http://www.cpcwiki.eu/forum/index.php?action=profile;u=96): when using __at prefixes, try to have all your absolutely located stuff on the same source code file. If you produce different .rel modules with absolutely located code, some of your absolutely located stuff will be relocated by the linker. It's a problem SDCC has with the linker.

If some of your code gets relocated, you may end up having different pieces of code ending on the same address space, then having overlapped records.

You also may overlap records by not correctly calculate where to place your absolutely located portions of code.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: mr_lou on 08:27, 30 September 15
Well that was good to know. :-)

It doesn't fix my problem though.

I have this in my titlemusic.h file now:

Code: [Select]
#include <types.h>

extern __at(64) const u8 music[5813];
extern __at(5878) const u8 soundeffects[318];

I have tried various start addresses for the soundeffects. All gives this overlapping error.

As soon as I remove the soundeffects line (and the data in the corresponding c file) then it compiles fine.

I also tried putting my sound-effects into the music array. Gave the same overlapping error. This tells me that the overlapping error is caused by the data somehow. But I don't get why.
I don't think I'm exceeding limit, because I have a huge scroll-text that I removed, resulting in several kb freed, and still nothing.

So I'm still suspecting that you just can't have two Arkos Tracker tracks in one project.....

Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: mr_lou on 08:40, 30 September 15
The interesting part in this, is that even when I just add the 318 bytes of sound-effects into my music array, I still get the overlapping errors.

Meaning I only have one __at prefix. Same as before. The only difference is the additional 318 bytes in the array - and that results in the overlapping errors.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 08:41, 30 September 15
The overlapping is lilely happening between your sfx and the start of your code. Where is your code loading? Check the value of Z80CODELOC.

After compiling, go to obj/ folder and open .map file to check loading addresses of everything. Check if your sfx and music are being loaded where you put them, and check where does overlapping happen.

There is nothing preventing you having 2 Arkos tracker buffers. SDCC doesn't know what do buffers contain. It could be Arkos tracker songs or random data. For SDCC it's exactly the same.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: mr_lou on 09:00, 30 September 15
The overlapping is lilely happening between your sfx and the start of your code. Where is your code loading? Check the value of Z80CODELOC.

Yes that was it of course.
I'm just gonna go sit in the corner for an hour now....
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ervin on 09:16, 30 September 15
Yes that was it of course.
I'm just gonna go sit in the corner for an hour now....

 :laugh:

Having said that, I shouldn't really laugh.
I've also done that many times...
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: mr_lou on 21:00, 30 September 15
Alright.

Sound effects working, except one.
I have 5 sound effects at the moment, all working, except one of them that just doesn't play. Just weird.
I can't spot anything weird about it in Arkos Tracker. The only thing that stands out about it, is that it was copied from another effect in STaRKos. Surely that shouldn't mean anything.
Out of ideas at the moment, but not given up.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: Targhan on 00:31, 01 October 15
Hi all,

Quote
Personally, I think that Arkos Player is a great player, but may not be suitable for all uses/needs. I plan to add other players in the future, to let users choose the one they prefer. Sorry for not having time to do it now.

Could you please tell me what you feel is limitating or why the player doesn't work as you would like it to ? I may have plans about it, so don't hesitate to give me ideas about how to improve things. Though I thought the Music/SFX thingy was quite flexible... PM me, I wouldn't want to hijack this thread. Thanks !
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 11:22, 01 October 15
@Targhan (http://www.cpcwiki.eu/forum/index.php?action=profile;u=110): I might have sounded wrong way, sorry. I was just trying to be neutral with my statement. As you already know, I asked you to include Arkos Player because I think is really great. However, I'm councious that users always have different preferences, no matter how great a product is. So, I planned to include different music players in CPCtelera (http://lronaldo.github.io/cpctelera) from the start. It's not a complain on Arkos Player features, but just a way to give options to users and let them pick their preference.

Anyway, if you like I'd love to discuss some ideas with you. As I adapted it to work with CPCtelera (http://lronaldo.github.io/cpctelera) I took some notes that might be interesting. Also, you might find interesting discussing with people using CPCtelera (http://lronaldo.github.io/cpctelera)'s version of your player about their experience.

It's always really nice to have great developers like you willing to improve already great software :D.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: Targhan on 13:36, 01 October 15
Oh no don't worry, you didn't sound negative, and even if you did, I wouldn't have been upset: each one has the right to have an opinion :). But it's important to me now to know what could be improved for future evolution, whether they could be related to its CPCTelera integration or not.


And supporting various players in your framework is actually a great idea.
Title: Re: #CPCtelera 1.3. official release is out!
Post by: ronaldo on 18:54, 17 October 15
Well, on latest months, development of CPCtelera (http://lronaldo.github.io/cpctelera) is going very slow, but lot of things have entered this release step by step. So, the time has come for a new official release, including all new features that have been populating development branch this time. There plenty of interesting things: please, take time to read releas notes. Moreover, we've collected plenty of feedback and our tasklist is full of ideas. We really hope to have time to implement all your suggestions and make CPCtelera (http://lronaldo.github.io/cpctelera) a much better software for you to fastly and comfortably develop new games and programs for our Amstrad CPCs!

Here you are the release notes (https://github.com/lronaldo/cpctelera/releases/tag/v1.3) :
Thank you very much to all of you who are collaborating with CPCtelera (http://lronaldo.github.io/cpctelera). This is getting better and better thanks to all of you :D . Special mention in this release goes to donnors: @Arnaud (http://www.cpcwiki.eu/forum/index.php?action=profile;u=1424), @mr_lou (http://www.cpcwiki.eu/forum/index.php?action=profile;u=96), @ervin (http://www.cpcwiki.eu/forum/index.php?action=profile;u=82), @Octoate (http://www.cpcwiki.eu/forum/index.php?action=profile;u=12) and @lachlank (http://www.cpcwiki.eu/forum/index.php?action=profile;u=133). I also want to specially mention @AugustoRuiz (http://www.cpcwiki.eu/forum/index.php?action=profile;u=85) for his incredible support and direct collaboration with the project as developer.

Hope you enjoy this release and create new and better games and software for Amstrad CPC! :)

And, of course, don't forget that we are 1 week away from CPCRetroDev (http://cpcretrodev.byterealms.com/contest-en/cpcretrodev-2015/)' (https://twitter.com/search?src=typd&q=%23cpcretrodev)s deadline. There are lots of projects under development for this edition. You can check some of them on twiiter (hashtag #CPCRetroDev' (https://twitter.com/search?src=typd&q=%23cpcretrodev)). ¡This year we are probably going to have to create a double cassette edition to include all the games! Amstrad community's true potential is still to be unleashed :D .
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: mr_lou on 19:55, 17 October 15
We're having two mates over tomorrow to test our 4-player game. The CPC+ is set up ready for the show.  :)
Still not sure on how to do the video-demonstration of the game.

It's awesome to see CPCtelera improved and expanded. I've used v1.1.1 for our game though. I almost never upgrade my dev tool in the middle of a project. (Had a bad experience once).
I already have ideas for other CPC games to do with CPCtelera. Sadly time isn't my biggest resource. But hopefully I'll have a chance to check out newer versions of CPCtelera eventually.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: Arnaud on 21:36, 17 October 15
Downloaded, installed, project rebuilded and tested. All is OK.
And i saw the wrong size on disk of the binary added is fixed.

Congratulation for this release  :)

Edit : I had to modified manualy .bask_profile in order to set path to cpctelera-1.3. At the end of installation the path of cpctelera was not updated and stay on cpctelera-1.2.3.
 
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: mr_lou on 10:53, 18 October 15
I have a question about audio channels.

While preparing for our mates to arrive (in 10 minutes) I notice I seem to have reversed the stereo. When expecting sound in the right speaker I'm hearing it in the left speaker, and vice versa.

I thought:
Channel A = left speaker
Channel B = both speakers
Channel C = right speaker

But it seems to be:
Channel A = right speaker
Channel B = both speakers
Channel C = left speaker

Meanwhile, trying to figure out what's right I find this page claiming a whole third thing:
Locomotive BASIC - CPCWiki (http://www.cpcwiki.eu/index.php/Locomotive_BASIC#SOUND)
Channel A = both speakers
Channel B = left speaker
Channel C = right speaker

So I'm confused.
What's right?

P.S.: I haven't checked if I've connected my speakers correctly, because it requires me to pull out the whole TV.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 11:30, 18 October 15
Well, the best way to determine this is having a look to the schematics:
 [ You are not allowed to view attachments ]
It appears clear that B channel is conected to both (left and right), whereas A and C are connected to either left-right or right-left: I can't determine exactly, as I can't distinguish them with the labels 2 and 3. However, it should be easy to test, if your speakers are connected the right way.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: mr_lou on 13:49, 18 October 15
Hm I checked. I've connected the wires correctly.

Here's more weirdness:

Plugging in headphones to the CPC, audio does come in left speaker as expected.
So I thought maybe my audio-system switched the channels around, but no. Connecting audio out from the CPC to my audio-system, stereo is as expected too.

So, in conclusion: The problem is with the monitor/scart cable that comes with the CPC+
(Unless @Bryce (http://www.cpcwiki.eu/forum/index.php?action=profile;u=225) made the cable for me, which I can't remember if he did?).

Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: andycadley on 15:43, 18 October 15
Well the CPC+ itself never came with a monitor/scart cable (it's built into the CM14) so it seems a definite candidate.....
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: EgoTrip on 11:34, 30 October 15
I noticed a typo on the website, on the main page underneath the banner it says "Astohishing" instead of "Astonishing"
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: arnoldemu on 11:35, 30 October 15
@mr_lou (http://www.cpcwiki.eu/forum/index.php?action=profile;u=96):
I will confirm this on my plus monitor over this weekend.

Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 12:24, 01 November 15
@EgoTrip (http://www.cpcwiki.eu/forum/index.php?action=profile;u=337): Fixed! Thanks, man :D
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: arnoldemu on 13:06, 01 November 15
@mr_lou (http://www.cpcwiki.eu/forum/index.php?action=profile;u=96):
I will confirm this on my plus monitor over this weekend.
All is ok here.

channel a (psg register 8 ) is left.

On my cm14, sound comes from left speaker (left here means left side when monitor is connected up and I am looking at the screen).

I checked the stereo, sound comes from left headphone too.

Tested on 464plus with cm14 and gx4000 with the same cm14.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: EgoTrip on 13:18, 01 November 15
Someone please write a windows graphical game-maker style program as I can't deal with all the text only stuff and the c and ha files etc, it just confuses me and is easy to get lost in.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: AMSDOS on 10:11, 02 November 15
Someone please write a windows graphical game-maker style program as I can't deal with all the text only stuff and the c and ha files etc, it just confuses me and is easy to get lost in.


Isn't that what TommyGun (http://www.cpcwiki.eu/index.php/TommyGun) does?
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: EgoTrip on 13:15, 02 November 15
TommyGun doesn't support CPCtelera and I could never get the hang of it anyway.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: dragon on 16:25, 10 November 15
mmmm. :picard2:

== 1: CPCtelera initial tests
===============================================================
> Checking directory structure... [ OK ]
> Checking important files....... [ OK ]
> Checking required commands...
>>> Looking for 'gcc'... [ OK ]
>>> Looking for 'g++'... [ OK ]
>>> Looking for 'make'... [ OK ]
>>> Looking for 'bison'... [ OK ]
>>> Looking for 'flex'... [ OK ]
> Checking required libraries...
>>> Looking for 'boost/graph/adjacency_list.hpp'... [ OK ]
>>> Looking for 'libintl.h'... [ OK ]
Everything seems to be OK.

===============================================================
== 2: Building CPCtelera tools, z80 library and examples
===============================================================
> Proceeding to build required tools to build and manage CPCtelera and other sof                            tware for Amstrad CPC (This might take a while, depending on your system):
>>> Building compilation tools:                                     100% [ OK ]
>>> Building cpctelera z80 lib:                                     100% [ OK ]
> Bulding procedure finished.
> CPCtelera's tools and library are now ready to be used on your system.

>>> Building cpctelera examples:                                    30%

#########################
## UNRECOVERABLE ERROR ##
#########################
##> There was an error building CPCtelera examples. Please, check '/home/dreams/                            cpctelera-1.2.3/cpctelera/logs/examples_building.log' for details. Aborting.


Yuppi!! I crash it without write one line.

Probare en otro directorio fuera de home, a ver si cae la breva.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: EgoTrip on 15:10, 15 November 15
@dragon (http://www.cpcwiki.eu/forum/index.php?action=profile;u=251) did you sort your problem? I ran into the same issue, and it turns out it was my antivirus causing problems. Disable it before you install, but afer that you won't need to disable it again.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ervin on 15:17, 15 November 15
I'm getting similar problems with the latest version of cpctelera (master branch).
Any attempt at compiling even a simple main.c fails.

I've reverted to the previous version, and things are working again.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: Arnaud on 18:19, 15 November 15
On my PC with Windows 10 x64 i have to use Cygwin 32bits running in administrator in order to install cpctelera.

If you have a previous version of cpctelera installed you have to set manually the new path in your .bash_profile.
The file is not updated by the setup and keep previous path of cpctelera.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 22:42, 16 November 15

Yuppi!! I crash it without write one line.

Probare en otro directorio fuera de home, a ver si cae la breva.
@dragon (http://www.cpcwiki.eu/forum/index.php?action=profile;u=251): The problem seems to be something not letting SDCC write files to disc. I've seen this happen many times on Windows with antivirus software. Most of the problems people have on Windows are caused by this type of software, which is interfering with Cygwin and SDCC.

@Arnaud (http://www.cpcwiki.eu/forum/index.php?action=profile;u=1424): have you checked this? If not, please try doing a clean install of Cygwin64 and CPCtelera (http://lronaldo.github.io/cpctelera) with antiviruses and other similar software disabled.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: Arnaud on 23:33, 16 November 15
@ronaldo (http://www.cpcwiki.eu/forum/index.php?action=profile;u=1227): I have just installed Cygwin x64 and cpctelera 1.3 (on W10x64 updated) to make test as you asked :
- I installed directly cpctelera -> KO
- I deactivated my Windows Defender (i have not other antivirus) -> KO
- I also tried in administration mode with Windows Defender deactivated -> KO

-> i have exactly the same problem in all cases, when building examples it always crashes at 30%  :doh:
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 23:48, 16 November 15
@Arnaud (http://www.cpcwiki.eu/forum/index.php?action=profile;u=1424): Could you please attach me the .log file?

There is a list of software that is known to interfere with Cygwin (https://cygwin.com/faq/faq.html#faq.using.bloda). Have a look at it to see if any of this software is causing this problem.

Does the same happen with CPCtelera 1.3 (https://github.com/lronaldo/cpctelera/releases/tag/v1.3)?
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: Arnaud on 23:54, 16 November 15
Does the same happen with CPCtelera 1.3 (https://github.com/lronaldo/cpctelera/releases/tag/v1.3)?
It was Cpctelera 1.3 (typo error)

There is a list of software that is known to interfere with Cygwin (https://cygwin.com/faq/faq.html#faq.using.bloda). Have a look at it to see if any of this software is causing this problem.
Well, the only thing i see is : NVIDIA GeForce (some versions)

@Arnaud (http://www.cpcwiki.eu/forum/index.php?action=profile;u=1424): Could you please attach me the .log file?
Of course.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ervin on 00:30, 17 November 15
@Arnaud (http://www.cpcwiki.eu/forum/index.php?action=profile;u=1424): Could you please attach me the .log file?

There is a list of software that is known to interfere with Cygwin (https://cygwin.com/faq/faq.html#faq.using.bloda). Have a look at it to see if any of this software is causing this problem.

Does the same happen with CPCtelera 1.3 (https://github.com/lronaldo/cpctelera/releases/tag/v1.3)?

Hi Ronaldo.

Welcome back! Sounds like you've been really busy!
I know the feeling...

I'm also getting failed compilations on the latest cpctelera master branch.
When I go back to the previous version, compilation works fine.
(I'm using Cygwin on windows 7).
I'll try messing with my antivirus, and a few other things, tonight.

[EDIT] I sent an email to cpctelera@cheesetea.com a few days ago, and in that email I included a screenshot of the build failure during setup.sh, as well as the command-line text I get when I try to compile, and also examples_building.log and my global_main_makefile.mk.
 :)

Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: arnoldemu on 11:05, 17 November 15
I installed cpctelera on windows 10 without 1 single problem :)

First I installed cygwin and the packages mentioned on the website.
then cpctelera itself.

All was good :)

I am using windows 10 with windows defender.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: cpcitor on 13:36, 17 November 15
Hello all,

Been very busy this year. I'm happy to see that cpc-dev-tool-chain: a portable toolchain for C/ASM development targetting CPC. (http://www.cpcwiki.eu/forum/programming/cpc-dev-tool-chain-a-portable-toolchain-for-casm-development-targetting-cpc/) got forked into something much more complete.

I'm eager to have some time to try it.  By the way, the motivation for cpc-dev-tool-chain was dragged by another project: a game that typically needs the kind of primitives provided by cpctelera (e.g. regain features lost when disabling firmware).

I'm wondering if cpctelera managed to keep the nice "lean" property that was present cpc-dev-tool-chain C ease of use without bloat. (http://www.cpcwiki.eu/forum/programming/cpc-dev-tool-chain-a-portable-toolchain-for-casm-development-targetting-cpc/msg70216/#msg70216) -> Ability to get a Amstrad CPC executable binary file that does something more than a hello world and still counts in hundreds of bytes, not even a kbyte. In the case of the link above, 203 bytes are enough to draw a pattern on the screen from a simple, clean and readable C source file (included in referenced post).
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: Arnaud on 19:41, 17 November 15
I am using windows 10 with windows defender.
x64 version ?
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 22:28, 18 November 15
I'm wondering if cpctelera managed to keep the nice "lean" property that was present cpc-dev-tool-chain C ease of use without bloat. (http://www.cpcwiki.eu/forum/programming/cpc-dev-tool-chain-a-portable-toolchain-for-casm-development-targetting-cpc/msg70216/#msg70216) -> Ability to get a Amstrad CPC executable binary file that does something more than a hello world and still counts in hundreds of bytes, not even a kbyte. In the case of the link above, 203 bytes are enough to draw a pattern on the screen from a simple, clean and readable C source file (included in referenced post).
Technically, CPCtelera (http://lronaldo.github.io/cpctelera) doesn't impose any kind of cost to your programs. You can create programs in C or ASM, and you can use the low-level library or your own code. So, you are not limited in any sense: you may create programs that call firmware to save space, same as you are able to do with cpc-dev-tool-chain.

The low-level library is still in an early stage of development, but provides many useful things. You may print strings using ROM characters, not requiring an own font. For instance, printing "Welcome to CPCtelera!" takes 245 bytes (including the string, the drawString low-level code from the library and the code for the main program).

I also followed your advise and functions are isolated in individual assembly files to let SDCC link only those required :).
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 22:31, 18 November 15
I sent an email to cpctelera@cheesetea.com a few days ago, and in that email I included a screenshot of the build failure during setup.sh, as well as the command-line text I get when I try to compile, and also examples_building.log and my global_main_makefile.mk.
 :)
Hi again @ervin (http://www.cpcwiki.eu/forum/index.php?action=profile;u=82) :) .

I received your mail. I'm still reordering everything, as being more than 2 weeks absorved has left me a pile of todo things. As soon as I regain some time to continue with CPCtelera (http://lronaldo.github.io/cpctelera), I'll have a look at it.

Thank you for reporting! :D
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 22:32, 18 November 15
It was Cpctelera 1.3 (typo error)
Well, the only thing i see is : NVIDIA GeForce (some versions)
Of course.
I've seen your logs, an the folder is cpctelera-1.2.3. Were you installing over previous version?
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: Arnaud on 23:01, 18 November 15
Here the right log for cpctelera 1.3, in admin mode with Windows Defender Disabled.

Were you installing over previous version?

It's a new installation of cygwinx64, there are not previous version of Cpctelera.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 23:10, 18 November 15
Could you please run these commands manually and tell me what they say?
Code: [Select]
cd /home/ArnaudPC/cpctelera-1.3/examples/advanced/bouncingLogo
make
Code: [Select]
cd /home/ArnaudPC/cpctelera-1.3/examples/advanced/animation
ls
mkdir obj
/home/ArnaudPC/cpctelera-1.3/cpctelera/tools/sdcc-3.5.0/bin/sdcc -I/home/ArnaudPC/cpctelera-1.3/cpctelera/src -mz80  -c  src/main.c -o  obj/main.rel
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: Arnaud on 23:21, 18 November 15
Could you please run these commands manually and tell me what they say?
Code: [Select]
cd /home/ArnaudPC/cpctelera-1.3/examples/advanced/bouncingLogo
make

Code: [Select]
$ cd /home/ArnaudPC/cpctelera-1.3/examples/advanced/bouncingLogo

ArnaudPC@ArnaudPC ~/cpctelera-1.3/examples/advanced/bouncingLogo
$ make
/home/ArnaudPC/cpctelera-1.3/cpctelera/tools/sdcc-3.5.0/bin/sdcc -I/home/ArnaudPC/cpctelera-1.3/cpctelera/src -mz80  -c  src/main.c -o  obj/main.rel
/home/ArnaudPC/cpctelera-1.3/cpctelera//cfg/global_main_makefile.mk:39 : la recette pour la cible « obj/main.rel » a échouée
make: *** [obj/main.rel] Erreur 127


Code: [Select]
cd /home/ArnaudPC/cpctelera-1.3/examples/advanced/animation
ls
mkdir obj
/home/ArnaudPC/cpctelera-1.3/cpctelera/tools/sdcc-3.5.0/bin/sdcc -I/home/ArnaudPC/cpctelera-1.3/cpctelera/src -mz80  -c  src/main.c -o  obj/main.rel
No error message but obj directory is empty (only directory "entities" empty -> obj/entities)
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 23:39, 18 November 15
That's very bad. Seems the same behaviour as with some antiviruses: they automatically delete generated objects.

Try this:
Code: [Select]
/home/ArnaudPC/cpctelera-1.3/cpctelera/tools/sdcc-3.5.0/bin/sdccDoes it output SDCC's help?
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: Arnaud on 23:51, 18 November 15

That's very bad. Seems the same behaviour as with some antiviruses: they automatically delete generated objects.

I have opened the obj directory in explorer in same time as the sdcc generation launched, and i have not see any files appeared

Try this:
Code: [Select]
/home/ArnaudPC/cpctelera-1.3/cpctelera/tools/sdcc-3.5.0/bin/sdccDoes it output SDCC's help?

Strange it do nothing.
I also try to enter directory tools/sdcc-3.5.0/bin and enter ./sdcc.exe -> nothing

On my cpctelera on cygwin32 i have the help displayed.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 00:01, 19 November 15
I saw this behaviour happen on another Win10 machine some time ago. It happened with some tools, but not with SDCC. When manually calling the compiler, tools got compiled and worked flawlessly. However, when make was used to compile the tools, the final binaries did the same: output nothing.

It's horribly extrange, and I guess it may be related to some Windows-Cygwin stuff. I sincerely have no clue on what may cause such behaviour. It's not related to CPCtelera, and I might not be able to find and solve it. It may be a task for Cygwin developers.
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 11:20, 19 November 15
@Arnaud (http://www.cpcwiki.eu/forum/index.php?action=profile;u=1424):  Could you please try these commands?
Code: [Select]
cd /home/ArnaudPC/cpctelera-1.3/cpctelera/tools/sdcc-3.5.0/
make cleanall && make
cd /home/ArnaudPC/cpctelera-1.3/examples/
make cleanall && make
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: Arnaud on 21:42, 19 November 15
Same problems.


Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ronaldo on 22:31, 19 November 15
Could you please look into the C:\cygwin64\bin directory and check for files with the pattern "cygwin1.dll*"? Could you please tell me which ones are there?
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: Arnaud on 23:41, 19 November 15
Could you please look into the C:\cygwin64\bin directory and check for files with the pattern "cygwin1.dll*"? Could you please tell me which ones are there?

Only one "cygwin1.dll" 3312ko
Title: #CPCtelera 1.4. Under development
Post by: ronaldo on 23:57, 21 January 16
After a long period of time, we are slowly returning and continuing development of CPCtelera (http://lronaldo.github.io/cpctelera). We hope to release 1.4. version in a not too distant future (say some weeks). Then, we hope to be able to attend most of the requests for new features that have been formulated during past months.

But, the most important thing is that we may have fixed an important problem thanks to the collaboration of @SyX (http://www.cpcwiki.eu/forum/index.php?action=profile;u=324). Some people experienced problems installing CPCtelera (http://lronaldo.github.io/cpctelera) under Windows/Cygwin on Win7, 8 and 10. @SyX (http://www.cpcwiki.eu/forum/index.php?action=profile;u=324) identified a problem related to Cygwin failing to dinamically link against libstdc++ under some circumstances. This seems to be happenning on Win7, 8 and 10, and producing void executables after compilation. That was probably causing some random problems to people installing CPCtelera (http://lronaldo.github.io/cpctelera).

Our latest master version at Github (http://github.com/lronaldo/cpctelera) includes a fix for this problem, statically linking against libstdc++. In our test, this seems to solve the issue. However, we need more confirmations. So, please, it would be really useful if those of you that had problems installing CPCtelera (http://lronaldo.github.io/cpctelera) could download latest github version (http://github.com/lronaldo/cpctelera) and test it under Windows/Cygwin.

Thank you very much in advance to those of you that are collaborating/have collaborated with CPCtelera (http://lronaldo.github.io/cpctelera) :D 
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: Arnaud on 20:04, 22 January 16
Now, all works perfectly on Cygwin x64 with Windows 10 x64. 

Problem solved, congratulation !

 :)
Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: ervin on 13:54, 24 January 16
Yay! Working nicely here as well!
 8)

Title: Re: #CPCtelera 1.0. Amstrad CPC game development library official release
Post by: HAL 6128 on 14:55, 24 January 16
I have trouble installing cpctelera on a cygwin64 (Win10). There's a missing library (libboost-devel), despite the fact I have installed it?!
Title: Re: #CPCtelera 1.4. Under development
Post by: ronaldo on 15:07, 24 January 16
@Arnaud (http://www.cpcwiki.eu/forum/index.php?action=profile;u=1424), @ervin (http://www.cpcwiki.eu/forum/index.php?action=profile;u=82), @HAL 6128 (http://www.cpcwiki.eu/forum/index.php?action=profile;u=365), thank you all for testing and reporting :)

@HAL 6128 (http://www.cpcwiki.eu/forum/index.php?action=profile;u=365): Are you sure you have installed libboost-devel? You may have installed libboost, without the development headers (only the binary files). The test for detecting that libboost is installed compiles a program that requires libboost-devel to be installed. When compilation fails, libboost-devel is not properly installed.

Please, first of all, verify your Cygwin installation, and double check libboost-devel installation.

If you are sure it is installed, next thing to check is your antivirus software, that may be interferring with Cygwin, and ruining CPCtelera (http://lronaldo.github.io/cpctelera) installation (that problem is described by Cygwin developers).

If all these steps fail, post CPCtelera (http://lronaldo.github.io/cpctelera) installation logs and I'll check them.

EDIT: I didn't properly read your error message. It seems that you are using a previous version of Cygwin and you may have a dependency detection problem, resulting in cygisl-10.dll not being installed. That impedes you to compile anything with GCC. Try installing  libisl10 and libcloog-isl4 (you may use "apt-cyg install libisl10 libcloog-isl4" or the cygwin installer)
Title: Re: #CPCtelera news, releases, reports and support
Post by: HAL 6128 on 16:22, 24 January 16
Yes, libisl10 and libcloog-isl4 were missing. Now it starts installing. Thank you very much for the hint!
But breaks after 75% of installing. I have to check the log file.

What do you mean with "previous version of Cygwin"? I freshly downloaded the "setup-x86_64.exe" file from "http://cygwin.com/install.html" (http://cygwin.com/install.html");. Are there differences? Yes, I compiled anything with GCC. Which version of GCC is recommended?
Title: Re: #CPCtelera news, releases, reports and support
Post by: ronaldo on 16:46, 24 January 16
Well, it may depend on the mirror you have selected. This problem happens because of some untracked dependencies on Cygwin. This should have been fixed on latest versions. In fact, I didn't experience this problem by myself, but seems more likely on Win10. It also may be related to antivirus software interferring (it seems less likely in this case, but it may).

Anyway, are you using latest master version of CPCtelera (http://lronaldo.github.io/cpctelera) from github?

Title: Re: #CPCtelera news, releases, reports and support
Post by: HAL 6128 on 17:44, 24 January 16
Yes, I'm using the lastest master version.

Ok, I deleted everything and have been choosen another mirror. The Installationen process went through without any problem.
Now it works!

:)
Title: Re: #CPCtelera news, releases, reports and support
Post by: ronaldo on 17:50, 24 January 16
Much better, then :). Thanks for testing and reporting :D
Title: Re: #CPCtelera news, releases, reports and support
Post by: dragon on 19:42, 26 January 16
¿Cual es la sintaxis de la directiva org en el ensamblador que trae cpctelera?

Intento una cosa super simple como empezar un codigo en A000 cambiando el archivo de configuración.

Escribir 3 instruciones.

LD HL,#0xA100
LD DE,#0x006E
LD BC,#0x0050
LDIR

Y poner una org para que a partir de aqui lo ponga en A100.

No hay manera he intentado de todo, con almohadilla con & con h con dolar.

Y segun que ponga siempre me devuelve: src/main.s:51: Error: <o> .org in REL area or directive / mnemonic error
 o src/main.s:51: Error: <q> missing or improper operators, terminators, or delimiters

 :doh:
Title: Re: #CPCtelera news, releases, reports and support
Post by: FloppySoftware on 22:29, 26 January 16
La sintaxis parece correcta, viendo los ejemplos en ensamblador de cpctelera (aunque difieren del código de abajo; imagino que acepta varias sintaxis).

Yo creo que el problema es poner un ORG en un área de código que no lo permite: Error: <o> .org in REL area...
 
P. ej., el fichero crt0.s empieza así:
 
Code: [Select]
   .module crt0
   .globl   _main
   .area   _HEADER (ABS)
   ;; Reset vector
   .org    0
   jp   init
   .org   0x08
Title: Re: #CPCtelera news, releases, reports and support
Post by: reidrac on 11:44, 27 January 16
I found this very useful: http://sdcc.sourceforge.net/doc/sdccman.pdf (http://sdcc.sourceforge.net/doc/sdccman.pdf)

(I don't use cpctelera, but I use SDCC and its assembler is awful and very limited :'()
Title: Re: #CPCtelera news, releases, reports and support
Post by: PulkoMandy on 14:13, 27 January 16
You can't use ORG in source files this way. The memory layout is not defined by the assembler as in traditional amstrad tools, but by the linker.


If you want to change the start address, you will need to edit the linker file instead, to tell where your code segment should be located.
Title: Re: #CPCtelera news, releases, reports and support
Post by: ronaldo on 14:57, 27 January 16
¿Cual es la sintaxis de la directiva org en el ensamblador que trae cpctelera?
Intento una cosa super simple como empezar un codigo en A000 cambiando el archivo de configuración.
Y poner una org para que a partir de aqui lo ponga en A100.
No hay manera he intentado de todo, con almohadilla con & con h con dolar.

Lo que tienes no es un problema de sintaxis. El problema es que el código que escribes es considerado "RELocatable", lo que quiere decir que el linker tiene la posibilidad de moverlo y/o ajustarlo como considere oportuno. Por ese motivo, una orden ORG no tiene sentido, porque dejaría el código en posición absoluta, y es contradictorio con darle libertad al linker para moverlo.

Si lo único que quieres es definir la posición inicial de tu binario, lo que tienes que hacer es cambiar la variable Z80CODELOC del fichero de configuración del proyecto de CPCtelera (http://lronaldo.github.io/cpctelera) (en cfg/build_config.mk). Esa variable es la que se le pasa al linker al compilar para indicar la posición inicial del binario generado en memoria.

Si más adelante quieres tener varias zonas de código ubicadas en posiciones absolutas de memoria, tienes que definir zonas de código de posicionamiento absoluto, utilizando las directivas .area con el calificador (ABS), como te han dicho arriba. De todas formas, de eso podemos hablar cuando lo necesites, si lo prefieres.

===========================================================================================

Your problem is not related to syntax. Your problem is due to your main code area being RELocatable by default. This means that the linker has the right relocate and/or adjust parts of your code as it considers. Because of this, an ORG command does not have any meaning inside this area, as it will locate code in an absolute location, and that is contradictory with the "RELocatable" property.

If your desire is just to place your binary at a given location in memory, it will be enough with changing the value of Z80CODELOC variable, which is located in the configuration file of your CPCtelera (http://lronaldo.github.io/cpctelera) project (cfg/build_config.mk). That variable is passed to the linker during compilation to state the initial location of the generated binary in memory.

Lately, if you want to have several code zones in different absolute locations in memory, you have to define ABSolutely located code zones using .area directives and the (ABS) qualifier. Anyway, we can discuss about this later, when you need it.
Title: #CPCtelera 1.4.2. release
Post by: ronaldo on 16:53, 17 July 17
 CPCtelera (http://lronaldo.github.io/cpctelera) 1.4.2. is finally out!

This version is an important update, mainly because SDCC 3.5.5 codebase was showing some important compilation issues under different circumstances. With this new release, many compilation and Mac OSX compatibility issues should dissapear and make live easier and happier to many of you. Hope it actually does! :D
Features included in this release: Hope you all enjoy it much while we continue towards 1.5. Release! :D
(https://github.com/lronaldo/cpctelera/blob/master/cpctelera/docs/images/cpct_logo.png?raw=true) (http://lronaldo.github.io/cpctelera/)
Title: Re: #CPCtelera 1.4.2. release
Post by: ervin on 18:12, 17 July 17
CPCtelera (http://lronaldo.github.io/cpctelera) 1.4.2. is finally out!

This version is an important update, mainly because SDCC 3.5.5 codebase was showing some important compilation issues under different circumstances. With this new release, many compilation and Mac OSX compatibility issues should dissapear and make live easier and happier to many of you. Hope it actually does! :D
  • #CPCtelera 1.4.2 multisystem ZIP bundle (https://github.com/lronaldo/cpctelera/archive/v1.4.2.zip).
  • #CPCtelera 1.4.2 Release Notes. (https://github.com/lronaldo/cpctelera/releases/tag/v1.4.2)
  • Reference manual and documentation. (http://lronaldo.github.io/cpctelera/files/readme-txt.html)
Features included in this release:
  • Updated SDCC compiler from version 3.5.5 to newest version 3.6.8 (revision 9946). New version is much more efficient, generates better code and solves some bugs from previous one.
  • Added automatic Arkos Traker 1 AKS music conversion. It is done through the makefile macro AKS2C, which is easily added in config file cfg/music_conversion.mk
  • Added project support for Visual Studio Code IDE. All CPCtelera projects can now be opened and compiled in VS Code. Moreover, intellisense and keyboard shortcuts for automaticly running games are easily added.
  • Documented VS Code integration, with plenty of information for users on how to set up projects.
  • Documented Automatic Conversion Tools for Music, Graphics and Tilemaps. This will greatly help users on fastly and comfortably integrating asset production in their projects without having to bother to convert them when they change.
  • Added support for drawing tiles using gray code order and making use of the stack. Really fast method for advanced users.
  • Added troubleshooting section to the documentation in order to help users with common issues.
  • Fixed issue in iDSK: it was overwritting files with same name but different extension.
  • Added Support for Paged Memory and use of memory beyond 64K.
  • Added z88dk speculative optimization peepholes for advanced users wanting to experiment with advanced optimization.
  • Added new asm examples with animations, music and data structures: greetcardmusic/ and structs/.
  • Updated RGAS to latest 1.2.2 version.
  • Added bitarray support for tiled Tilemap TMX-CSV conversion to C.
  • Fixed getRandom to output predictable random sequences.
Hope you all enjoy it much while we continue towards 1.5. Release! :D

FANTASTIC!!!
Thanks for all of your hard work!
Title: Re: #CPCtelera 1.4.2. release
Post by: Arnaud on 20:31, 17 July 17
CPCtelera (http://lronaldo.github.io/cpctelera) 1.4.2. is finally out!

Great ! Nice to see CPCTelera updated.
Title: Re: #CPCtelera 1.4.2. release
Post by: johnlobo on 00:36, 18 July 17

Great !!


Just in time for the CPCRetroDev.


 :D

CPCtelera (http://lronaldo.github.io/cpctelera) 1.4.2. is finally out!

This version is an important update, mainly because SDCC 3.5.5 codebase was showing some important compilation issues under different circumstances. With this new release, many compilation and Mac OSX compatibility issues should dissapear and make live easier and happier to many of you. Hope it actually does! :D
  • #CPCtelera 1.4.2 multisystem ZIP bundle (https://github.com/lronaldo/cpctelera/archive/v1.4.2.zip).
  • #CPCtelera 1.4.2 Release Notes. (https://github.com/lronaldo/cpctelera/releases/tag/v1.4.2)
  • Reference manual and documentation. (http://lronaldo.github.io/cpctelera/files/readme-txt.html)
Features included in this release:
  • Updated SDCC compiler from version 3.5.5 to newest version 3.6.8 (revision 9946). New version is much more efficient, generates better code and solves some bugs from previous one.
  • Added automatic Arkos Traker 1 AKS music conversion. It is done through the makefile macro AKS2C, which is easily added in config file cfg/music_conversion.mk
  • Added project support for Visual Studio Code IDE. All CPCtelera projects can now be opened and compiled in VS Code. Moreover, intellisense and keyboard shortcuts for automaticly running games are easily added.
  • Documented VS Code integration, with plenty of information for users on how to set up projects.
  • Documented Automatic Conversion Tools for Music, Graphics and Tilemaps. This will greatly help users on fastly and comfortably integrating asset production in their projects without having to bother to convert them when they change.
  • Added support for drawing tiles using gray code order and making use of the stack. Really fast method for advanced users.
  • Added troubleshooting section to the documentation in order to help users with common issues.
  • Fixed issue in iDSK: it was overwritting files with same name but different extension.
  • Added Support for Paged Memory and use of memory beyond 64K.
  • Added z88dk speculative optimization peepholes for advanced users wanting to experiment with advanced optimization.
  • Added new asm examples with animations, music and data structures: greetcardmusic/ and structs/.
  • Updated RGAS to latest 1.2.2 version.
  • Added bitarray support for tiled Tilemap TMX-CSV conversion to C.
  • Fixed getRandom to output predictable random sequences.
Hope you all enjoy it much while we continue towards 1.5. Release! :D
(https://github.com/lronaldo/cpctelera/blob/master/cpctelera/docs/images/cpct_logo.png?raw=true) (http://lronaldo.github.io/cpctelera/)
Title: Re: #CPCtelera 1.4.2. release
Post by: XeNoMoRPH on 15:28, 30 March 19
https://twitter.com/pedroaznar/status/1111975213254758400 (https://twitter.com/pedroaznar/status/1111975213254758400)
(https://pbs.twimg.com/media/D26QhW1W0A8YMLV.png)
Title: Re: #CPCtelera 1.4.2. release
Post by: asertus on 18:40, 13 August 19
Problem with development branch.


Hi, these holidays I have decided to try out the new release, 1.5, but when I try to run setup.sh, I get these errors:



./setup.sh: línea 19: $'\r': no se encontró la orden
./setup.sh: línea 27: $'\r': no se encontró la orden
./setup.sh: línea 33: $'\r': no se encontró la orden
: No such file or directory/User/cpctelera
./setup.sh: línea 36: $'\r': no se encontró la orden
./setup.sh: línea 39: error sintáctico cerca del elemento inesperado `$'{\r''
'/setup.sh: línea 39: `function usage {




It is in cygwin, and previous version 1.4.2 works perfectly fine. Does anyone else have this problem?


Thanks
Title: Re: #CPCtelera 1.4.2. release
Post by: teopl on 21:40, 13 August 19
Yes and I call this "newline hell" :) Looks like issue is that wrong newlines are used (not unix, but windows or macos) or system/unzip/git client ... changed them.

I remember I had to convert some shell scripts and make files (.mk extension) but this should work fine on Linux (or maybe even Cygwin if you extract or clone repository in a different way - not sure).

To convert to linux newlines I used: (from the cpctelera folder)
Code: [Select]
find . -iname '*.sh' -exec flip -u {} \;

but you should be careful if you are not sure of course.

This should replace all newlines in .sh files (same should be done on .mk or any other files which you see a problem during compile)

If I remember, I needed even to open some files manually from Emacs because they were detected like binary files by flip tool.

https://emacs.stackexchange.com/questions/5779/how-to-convert-dos-windows-newline-characters-to-unix-format-within-gnu-emacs

So, backup and good luck :)

And sorry if there is better way, I just needed to quickly do the job. (didn't investigate the problem in more detail)
Title: Re: #CPCtelera 1.4.2. release
Post by: asertus on 21:58, 13 August 19
I see, thank you. Problem is that the same problem is also in other script files, i.e., running  cpct_winape, etc..


I understand there should be a version without this problem, or some workaround better than "fixing" every script file...





Title: Re: #CPCtelera 1.4.2. release
Post by: Arnaud on 22:22, 13 August 19
Hi, @asertus (http://www.cpcwiki.eu/forum/index.php?action=profile;u=2262), @teopl (http://www.cpcwiki.eu/forum/index.php?action=profile;u=2874),

you should create an issue here :
https://github.com/lronaldo/cpctelera

Effectively the problem shall be resolve for everyone under linux.
Title: Re: #CPCtelera 1.4.2. release
Post by: cpcitor on 13:50, 15 August 19
Problem with development branch.

Hi, these holidays I have decided to try out the new release, 1.5, but when I try to run setup.sh, I get these errors:

Hi asertus. Where did you download 1.5? From git? From tar.gz?

http://lronaldo.github.io/cpctelera/files/readme-txt.html#Installing_CPCtelera mentions 1.4.2 , and github offers versions only up to 1.4.2 https://github.com/lronaldo/cpctelera/tags .

I'm willing to help finding a clean solution and it will depend on your answer.
Title: Re: #CPCtelera 1.4.2. release
Post by: Arnaud on 14:27, 15 August 19
Hi asertus. Where did you download 1.5? From git? From tar.gz?

CPCtelera 1.5 is still the development branch
Title: Re: #CPCtelera 1.4.2. release
Post by: cpcitor on 17:39, 15 August 19
Problem with development branch.


Hi, these holidays I have decided to try out the new release, 1.5, but when I try to run setup.sh, I get these errors:

./setup.sh: línea 19: $'\r': no se encontró la orden
./setup.sh: línea 27: $'\r': no se encontró la orden
./setup.sh: línea 33: $'\r': no se encontró la orden
: No such file or directory/User/cpctelera
./setup.sh: línea 36: $'\r': no se encontró la orden
./setup.sh: línea 39: error sintáctico cerca del elemento inesperado `$'{\r''
'/setup.sh: línea 39: `function usage {

I can reproduce the problem with latest cygwin like this:

git clone https://github.com/lronaldo/cpctelera
cd cpctelera
./setup

Will offer a solution.
Title: Re: #CPCtelera 1.4.2. release
Post by: ronaldo on 18:07, 15 August 19
Problem with development branch.

Hi, these holidays I have decided to try out the new release, 1.5, but when I try to run setup.sh, I get these errors:

./setup.sh: línea 19: $'\r': no se encontró la orden
./setup.sh: línea 27: $'\r': no se encontró la orden
./setup.sh: línea 33: $'\r': no se encontró la orden
: No such file or directory/User/cpctelera
./setup.sh: línea 36: $'\r': no se encontró la orden
./setup.sh: línea 39: error sintáctico cerca del elemento inesperado `$'{\r''
'/setup.sh: línea 39: `function usage {

It is in cygwin, and previous version 1.4.2 works perfectly fine. Does anyone else have this problem?

Thanks
This is not a CPCtelera problem, but a problem with the tools installed in your system. Many users have experienced same before and has already been addressed many times.

The problem is that cygwin includes tools in your Windows PATH, and you are using Windows GIT instead of cygwin's. Windows GIT by default download files and applies Windows CRLF line ending. This ruins all bash scripts included in CPCtelera: when bash tries to execute any one of them, it fails due to line ending.

The problem is as easy to solve as installing GIT under Cygwin and using Cygwin's instead of Windows'. You could also change line ending policy in your Windows GIT installation, but I usually prefer not to do that.

The only thing CPCtelera can do about this is adverting you in some sense, but CPCtelera cannot prevent you from using different, not properly configured, tools in your system.
Title: Re: #CPCtelera 1.4.2. release
Post by: cpcitor on 20:08, 15 August 19
The problem is that cygwin includes tools in your Windows PATH, and you are using Windows GIT instead of cygwin's. Windows GIT by default download files and applies Windows CRLF line ending. This ruins all bash scripts included in CPCtelera: when bash tries to execute any one of them, it fails due to line ending.

This seems pretty logical yet do @asertus (http://www.cpcwiki.eu/forum/index.php?action=profile;u=2262), @teopl (http://www.cpcwiki.eu/forum/index.php?action=profile;u=2874) or other confirm that they have another, Windows-level git?

The reason I was able to reproduce the issue is that the machine I test with does have "git bash" which is mingw64-based, and configured to checkout wirh CRLF.

The problem is as easy to solve as installing GIT under Cygwin and using Cygwin's instead of Windows'. You could also change line ending policy in your Windows GIT installation, but I usually prefer not to do that.

The only thing CPCtelera can do about this is adverting you in some sense, but CPCtelera cannot prevent you from using different, not properly configured, tools in your system.

It can also, as lronaldo and I are discussing on https://github.com/lronaldo/cpctelera/pull/95 include a .gitattributes file instruting it to checkout text files with LF not CRLF.
Title: Re: #CPCtelera 1.4.2. release
Post by: teopl on 23:59, 15 August 19
I can confirm that cloning cpctelera development branch from cygwin console with cygwin git works well.

You can confirm cygwin git location like this:
Code: [Select]
$ which git
/usr/bin/git

I thought that my git client messed up new lines but it's something which you just don' t expect! If you clone a repo - it should be the same!

Anyway, I used windows client sourcetree which is easier for me to use then the console.

I suggest to have this information in the cpctelera installation since we are not the only ones which had/will have this issue.

Edit: Also I guess some of us like to work in Visual Studio, even when editing .sh files :) and that will change newlines to windows also...

So, having some info about how to make this working well would be good. Personally, I didn't have the patience and I just googled and did some setup to "just make it work"

So I edited .gitattributes like this:
Code: [Select]
$ cat .gitattributes
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto

###############################################################################
# Set the merge driver for project and solution files
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
# the diff markers are never inserted). Diff markers may cause the following
# file extensions to fail to load in VS. An alternative would be to treat
# these files as binary and thus will always conflict and require user
# intervention with every merge. To do so, just comment the entries below and
# uncomment the group further below
###############################################################################

*.sln        text eol=crlf
*.csproj     text eol=crlf
*.vbproj     text eol=crlf
*.vcxproj    text eol=crlf
*.vcproj     text eol=crlf
*.dbproj     text eol=crlf
*.fsproj     text eol=crlf
*.lsproj     text eol=crlf
*.wixproj    text eol=crlf
*.modelproj  text eol=crlf
*.sqlproj    text eol=crlf
*.wmaproj    text eol=crlf

*.xproj      text eol=crlf
*.props      text eol=crlf
*.filters    text eol=crlf
*.vcxitems   text eol=crlf

# Explicitly declare text files you want to always be normalized and converted
# to native line endings on checkout.
*.c text eol=lf
*.h text eol=lf
*.s text eol=lf

# Denote all files that are truly binary and should not be modified.
*.exe binary
*.sh binary

But this made .sh files binary so the git client didn't see the changes...
Title: Re: #CPCtelera 1.4.2. release
Post by: Neurox66 on 09:59, 16 August 19

Hello,
It's a week that I try to install CPCTelera 1.4.2 on my iMac but I can't.
I've a iMac 27 "Late 2015 with i7 4GHz and 32GB Ram, macOS Mojave 10.14.6.
I've followed the instructions on the site and tried to install both the stable and the daily version.
Unfortunately the result is the same. With a clean installation stops at 62% while if I try to reinstall after the first stop it stops at 33%.


(http://www.borzini.it/CPCTelera_install_fail.png)

I tried to read the log file but apart from many warnings I can't understand what is the problem.
Any suggestions?
Obviously change the computer it is not an acceptable suggestion  :D :D :D


Regards,
Paolo
Title: Re: #CPCtelera 1.4.2. release
Post by: cpcitor on 10:21, 16 August 19
Hello,
It's a week that I try to install CPCTelera 1.4.2 on my iMac but I can't.
I've a iMac 27 "Late 2015 with i7 4GHz and 32GB Ram, macOS Mojave 10.14.6.
I've followed the instructions on the site and tried to install both the stable and the daily version.
Unfortunately the result is the same. With a clean installation stops at 62% while if I try to reinstall after the first stop it stops at 33%.
I tried to read the log file but apart from many warnings I can't understand what is the problem.
Any suggestions?
Obviously change the computer it is not an acceptable suggestion  :D :D :D


Regards,
Paolo

Can you share the log file, e.g. on a pastebin (if short enough) or https://framadrop.org/ ?
Title: Re: #CPCtelera 1.4.2. release
Post by: Neurox66 on 11:25, 16 August 19
Here the file log of clean installation of 1.4.2:

https://framadrop.org/r/4uRSjMzVaZ#0jfiMEcre0dpbRjpkr3/kEHU6lg6oN+zLzUhBwBVOkM= (https://framadrop.org/r/4uRSjMzVaZ#0jfiMEcre0dpbRjpkr3/kEHU6lg6oN+zLzUhBwBVOkM=)


Here the file log of re-installation of latest version from github:
https://framadrop.org/r/5WxVLIhQJ9#AQyQrX0c6wId00Zx3Pl/11Y/eJWTzeHGDVqn/ZAxSjs= (https://framadrop.org/r/5WxVLIhQJ9#AQyQrX0c6wId00Zx3Pl/11Y/eJWTzeHGDVqn/ZAxSjs=)


Paolo
Title: Re: #CPCtelera 1.4.2. release
Post by: cpcitor on 14:13, 16 August 19
Here the file log of clean installation of 1.4.2:

https://framadrop.org/r/4uRSjMzVaZ#0jfiMEcre0dpbRjpkr3/kEHU6lg6oN+zLzUhBwBVOkM= (https://framadrop.org/r/4uRSjMzVaZ#0jfiMEcre0dpbRjpkr3/kEHU6lg6oN+zLzUhBwBVOkM=)


Here the file log of re-installation of latest version from github:
https://framadrop.org/r/5WxVLIhQJ9#AQyQrX0c6wId00Zx3Pl/11Y/eJWTzeHGDVqn/ZAxSjs= (https://framadrop.org/r/5WxVLIhQJ9#AQyQrX0c6wId00Zx3Pl/11Y/eJWTzeHGDVqn/ZAxSjs=)


Paolo

Thanks Paolo for these logs. I see two strictly identical files.

This is strange, I see warnings but no error.

Any idea @lronaldo ?
Title: Re: #CPCtelera 1.4.2. release
Post by: cpcitor on 15:21, 16 August 19
Unfortunately the result is the same. With a clean installation stops at 62% while if I try to reinstall after the first stop it stops at 33%.

These two different options should then produce two different log files, right?

I tried to read the log file but apart from many warnings I can't understand what is the problem.

I have compared your log with my log on a Linux machine. Compilation of cpctelera/tools/sdcc-3.6.8-r9946/src/src/SDCCgen.c works on my machine and things go on.

It looks like on your machine, the gcc compiler just returned a non-zero code for an unknown reason. Very strange. Can you try a different compiler?

Title: Re: #CPCtelera 1.4.2. release
Post by: XeNoMoRPH on 21:59, 25 April 20
https://twitter.com/FranGallegoBR/status/1254113002367918081
Title: Re: #CPCtelera 1.4.2. release
Post by: funkheld on 01:18, 03 May 20

the program is the last dirt.
as long as there is no perfect installation location.


it is only a two man project at the time.


So stay away from the program.
Title: Re: #CPCtelera 1.4.2. release
Post by: teopl on 12:41, 03 May 20
funkheld is there some better C framework for creating games for CPC?

I had very good experience with cpctelera and the android export function looks very promising...
Title: Re: #CPCtelera 1.4.2. release
Post by: XeNoMoRPH on 13:09, 03 May 20
https://play.google.com/store/apps/details?id=com.cpctelera.rvmengine.PlatformClimber
Title: Re: #CPCtelera 1.4.2. release
Post by: teopl on 14:11, 03 May 20
hahah the great platform climber :)

I am waiting for some instructions how to export to android because I don't really know much about what is needed to setup an android app and I don't have time to explore now.
Title: Re: #CPCtelera 1.4.2. release
Post by: XeNoMoRPH on 16:13, 03 May 20
hahah the great platform climber :)

I am waiting for some instructions how to export to android because I don't really know much about what is needed to setup an android app and I don't have time to explore now.
it's WIP, but ... here is a video about that, recorded last days in spanish sorry :(
https://www.twitch.tv/videos/607336776 (https://www.twitch.tv/videos/607336776),
Title: Re: #CPCtelera 1.4.2. release
Post by: SpDizzy on 22:10, 25 May 20
Working under cpctelera, as many others, with no problems at all with the framework. It is perfect for programming both on c and assembler, even for a really novice like me. It has a complete installation guide, lots of documents about it's usage, and a huge bunch of learning videos to do all kind of stuff. These videos are updated every year from the Alicante University.
What's the exact problem with the installation @funkheld (https://www.cpcwiki.eu/forum/index.php?action=profile;u=354) ?
Maybe some of us, or @ronaldo (https://www.cpcwiki.eu/forum/index.php?action=profile;u=1227) can help with that
Title: Re: #CPCtelera 1.4.2. release
Post by: funkheld on 20:49, 22 July 20

So my cpctelera is now running on win10 with the notebook. I did it at the age of 70.

the obstacle was previously partly the cygwin64.

what i'm missing is more help for the cpctelera.
i didn't waste my life studying.

greeting
Title: Re: #CPCtelera 1.4.2. release
Post by: Otto on 22:15, 22 July 20
So my cpctelera is now running on win10 with the notebook. I did it at the age of 70.
 
Six days ago you were still 71 years old. (https://www.cpcwiki.eu/forum/programming/sdcc2pasmo-v1-5/msg189857/#msg189857)

Today you're 70.
 
So, using CPCtelera makes younger? I should absolutely start to use it.
Title: Re: #CPCtelera 1.4.2. release
Post by: asertus on 22:52, 22 July 20
Six days ago you were still 71 years old. (https://www.cpcwiki.eu/forum/programming/sdcc2pasmo-v1-5/msg189857/#msg189857)

Today you're 70.
 
So, using CPCtelera makes younger? I should absolutely start to use it.


Myself, I feel 25 years younger when using my CPC..  :D
Title: Re: #CPCtelera 1.4.2. release
Post by: funkheld on 00:19, 23 July 20

when you are 71 you don't count the years anymore.
you just guess ...

I want to say how stupid are people who are much younger than me and only complain.
Title: Re: #CPCtelera 1.4.2. release
Post by: Otto on 08:58, 23 July 20
For us CPC retro friends, every bit counts.

(Und wer hier ständig sich beklagt über CPCtelera und vieles mehr, ist ja gerade ein gewisser alter Meckerfratz.)
Title: Re: #CPCtelera 1.4.2. release
Post by: funkheld on 09:47, 23 July 20

I only say what can be improved because I have tested it.
you haven't tested properly with cpctelera yet.

you are here in the forum only a "seer ...." who is inactive with cpctelera.


do your test with cpctelera, then we can write at eye level.

greeting
Title: Re: #CPCtelera 1.4.2. release
Post by: Otto on 11:35, 23 July 20
Some days ago I watched my son unpacking the CPCtelera package (https://www.cpcwiki.eu/forum/news-events/cpcretrodev-2020/msg190181/#msg190181) on our Ubuntu Linux, and some hours later his first sprite moved around the screen. Done by his short C code calling a few of the efficient and well documented CPCtelera library functions. Sprite graphics created by him with Gimp (plus an ex- and imported CPC palette with the help of one of those many tools from the CPCtelera package, the one with French terminal messages).
 
Having read the CPCtelera documentation in combination with this in-house short-test of CPCtelera, does tell me what CPCtelera is (and what it is not (https://www.cpcwiki.eu/forum/programming/cpctelera-with-win10/msg190070/#msg190070)) and how to use it basically.
 
I then fellt obliged to tell him that back in the days in the 1980ies, when we did the similar stuff just on bare metal Z80 assembler with no documentation, no cool sprite library, and sprites drawn on paper first, things were a little bit more complicated.
 
CPCtelera helps software developers to totally concentrate on the content. Those Spanish geniuses created a master-piece. Of course you need to study its documentation and samples first! The comments from Prof. Ronaldo here on the forum (https://www.cpcwiki.eu/forum/programming/loop-is-only-run-once-at-cpctelera/msg190183/#msg190183) are very helpful, and also his and his co-authors' screen-cast videos despite we not understanding a single spoken Spanish word – but often a picture is worth a thousand words. :-)
Title: Re: #CPCtelera 1.4.2. release
Post by: funkheld on 13:35, 23 July 20

without sdcc principles you can't get any further. there are examples: http://www.cpcmania.com/Docs/Programming/Programming.htm
they no longer work with the new sdcc from tpctelera.

cpctelera makes internal changes with the commands that you do not yet know and surprises you when you mix your own sdcc routines with the code from the cpctelera.

it's not just about moving sprites, the surrounding must work on background, transparency of the sprite and size of the binary code.

Without mathematics you cannot set a sprite on certain sin / cos points.
Title: Re: #CPCtelera 1.4.2. release
Post by: ronaldo on 14:18, 23 July 20
without sdcc principles you can't get any further. there are examples: http://www.cpcmania.com/Docs/Programming/Programming.htm (http://www.cpcmania.com/Docs/Programming/Programming.htm)
they no longer work with the new sdcc from tpctelera.

cpctelera makes internal changes with the commands that you do not yet know and surprises you when you mix your own sdcc routines with the code from the cpctelera.
These examples have nothing to do with CPCtelera. In fact, they were written many years before CPCtelera even existed. And they do not work because they are more than a decade old and the COMPILER (SDCC) has changed. CPCtelera is not SDCC. SDCC is an independent compiler and CPCtelera just includes it as a tool for compiling.

CPCtelera does not make any change to any internal commands at all. It is just a bunch of coordinated tools (a framework) and a library you can optionally use which, in fact, you are NOT yet using. So the only addition to the tools that CPCtelera makes is exactly what you are not using yet.

If you want help, we can give you help, but criticizing things you do not comprehend yet is quite a extrange way to ask for it.
Title: Re: #CPCtelera 1.4.2. release
Post by: asertus on 15:08, 23 July 20
I think it would be better, if you are following that course from CPCMania that you just get the closest version of SDCC, 3.1, and try it independently from cpctelera, http://sdcc.sourceforge.net/previous.php (http://sdcc.sourceforge.net/previous.php)


You may just use visual Studio code, the compiler, and the tools in CPCMania... You will have less issues..
Title: Re: #CPCtelera 1.4.2. release
Post by: funkheld on 15:12, 23 July 20
Hi good afternoon.
I also think cpctelera is wonderful as a German.
but you probably did not develop cpctelera for the elite, but also for us ordinary people
who want to continue learning fromcpc also from the system.

the new sdcc now has this type of programming:
---------------------------------
void poke(u16 a)
{
__asm
ld h,5(ix)
ld l,4(ix)
ld (hl),#129
__endasm;
}
-------------------------------
this loop with : sdcc-20200722-11758-setup.exe

no loop with cpctelera.
how does this asm work in cpctelera?

you say you don't program something like that.

but have already asked the question of how to do something like this,
it is not just about poke, but about the principle of this way of doing something in cpctelera.

thank you.
greeting
Title: Re: #CPCtelera 1.4.2. release
Post by: ervin on 15:17, 23 July 20
Hi funkheld.
I think you are misunderstanding what ronaldo is saying.
We don't do something in cpctelera.
cpctelera is a library of routines which we use with sdcc.
Title: Re: #CPCtelera 1.4.2. release
Post by: ronaldo on 15:43, 23 July 20
the new sdcc now has this type of programming:
---------------------------------
void poke(int a)
{
__asm
ld h,5(ix)
ld l,4(ix)
ld (hl),#129
__endasm;
}
-------------------------------
You are not understanding what I have told you 3 times already. This is not about the syntax, is about the assembly. You cannot use IX register directly to get the parameters. This will not work! And you don't need assembly (much less a function) to do a poke, you can do it in plain C:
Code: [Select]
// More readable way
u8 *mem = (u8*)0xC000; // Put your own address here
*mem = 129;

// More compact way
*((u8*)0xC000) = 129;  // Change 0xC000 by your own address

However, if you insist on using assembly, your assembly is incorrect for SDCC. And if you insist on using IX, you have to do it this way
Code: [Select]
void poke(void* address, unsigned char value) {
   address; value;
   __asm
      ld ix, #0
      add ix, sp  ;; THIS IS NEEDED TO MAKE IX POINT TO THE STACK
      ld h, 3(ix)
      ld l, 2(ix)
      ld a, 4(ix)
      ld (hl), a
   __endasm;
}
Check at what the compiler generates in both cases: https://godbolt.org/z/4be8do (https://godbolt.org/z/4be8do). You'll see it's much better to use C for this task. Again, this has nothing to do with CPCtelera. This is programming. You can do same with any C compiler, and without CPCtelera, because this is only programming. CPCtelera is doing nothing here.
Title: Re: #CPCtelera 1.4.2. release
Post by: funkheld on 16:47, 23 July 20

hello, thank you for your help and info.
maybe you will need your help again.


if have the mister for cpc6128 with core-cpc6128:
https://manuferhi.com/p/mister-fpga (https://manuferhi.com/p/mister-fpga)
https://github.com/MiSTer-devel/Main_MiSTer/wiki (https://github.com/MiSTer-devel/Main_MiSTer/wiki)


my mister with wlan , mouse mit cpc-core and "tmhwscr.dsk" from cpctelera.

thank you.
greeting