News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_ronaldo

#CPCtelera 1.4.2. release

Started by ronaldo, 11:59, 11 May 15

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ronaldo

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:
mkpasswd > /etc/passwd
which 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.

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.

ervin

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?)

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'

ronaldo

Thank you very much for your testing, @ervin :) . This problem turns out to be inocuous and much simpler than I thought. It should be fixed now in the latest version of cpctelera. 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 :)

ronaldo

Thanks to your help, @ervin, I have made a new release of CPCtelera. It is just a bugfix release, but required after addressing the problems you have discovered in your tests :) .

Thank you :)

ervin

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


ervin

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.


ronaldo

Quote from: ervin on 15:09, 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, 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). :).

ervin


lachlank

Quote from: arnoldemu on 09:16, 27 May 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. 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:

       
  • drawing filled/outlined rectangles and ellipses
  • Setting pen width for drawing
  • Import bitmaps from clipboard rather than just file (works great in combination with Paint.Net)
  • Re-colour sprite (substitute pen x for pen y)
  • Import a sprite from a binary file of pixel bytes
  • A new file-format using JSON (better backwards compatibility and the ability to easily share sprites between files using cut & Paste)
Lachlan























TFM

It would be awesome to have such a system (both of them of course!) on a real CPC running.  :)
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

ronaldo

Quote from: TFM on 23:05, 25 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

TFM

We got Small-C and Z3Plus on CPC already. It's not that different.  ;)
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

ronaldo

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.

And to test it you have to get the repository and switch to sdcc35 branch:

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.

lachlank

Just going to take the opportunity in this useful thread to mention that I have updated RGAS.zip on the wiki page 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.

ronaldo

There you go: RGAS 0.100 added to CPCtelera master branch: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

TFM

Quote from: lachlank on 10:49, 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.  :)
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

ronaldo

Quote from: TFM on 16:25, 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 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 could have some time to contribute to the project. If you already have some useful assembly routines, that would be really helpful for 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).

TFM

Quote from: ronaldo on 17:06, 29 June 15
It would be awesome that experience assembly programmers like you, @TFM could have some time to contribute to the project. If you already have some useful assembly routines, that would be really helpful for 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.
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

ervin

Quote from: ronaldo on 20: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.

And to test it you have to get the repository and switch to sdcc35 branch:

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).


[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'



mr_lou

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.

ronaldo

Quote from: mr_lou on 07:05, 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, which works well.

Quote from: mr_lou on 07:05, 01 July 15
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.

Quote from: mr_lou on 07:05, 01 July 15
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:

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:

// 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 :).

ronaldo

Quote from: ervin on 05:41, 01 July 15
Just one thing - during compilation, I get warnings that I wasn't getting before.
(My source code has not changed).

[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:

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.

ervin

Quote from: ronaldo on 13:06, 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:

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.
:)


ronaldo

@ervin, have you updated to latest version previous to do this? Compare cpc_memset* files with the ones at Github 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.

ervin

Quote from: ronaldo on 16:14, 01 July 15
@ervin, have you updated to latest version previous to do this? Compare cpc_memset* files with the ones at Github 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.


Powered by SMFPacks Menu Editor Mod