23 August 2012, 11:32 | #1 |
Registered User
Join Date: May 2009
Location: Leicester/U.K
Posts: 36
|
Amiga C manual and Hi-SoftC/C++ problem
Hi all,
I've been busy trying to code with the Amiga over the last few days. Im on chapter 3 (Sprites) of the Amiga C manual, example 2. I have tried everything, but the ChangeSprite() function just wont compile: ChangeSprite( 0, &my_sprite, ship_data[ frame ] ); I just get the error "Illegal argument". I've spent ages looking on the net for a solution and tinkering with the compiler settings, but to no avail. Any help would be much appreciated. |
23 August 2012, 11:46 | #2 |
Amiga Tomcat
Join Date: Sep 2007
Location: Boston Lincs
Posts: 1,500
|
I've got Hisoft installed on my system so I should be able to look at it tonight for you.
Dave G |
23 August 2012, 12:08 | #3 |
Registered User
Join Date: May 2009
Location: Leicester/U.K
Posts: 36
|
Thanks Dave !!
|
24 August 2012, 00:49 | #4 |
Amiga Tomcat
Join Date: Sep 2007
Location: Boston Lincs
Posts: 1,500
|
@Sparticle
I've got the example to compile and run in both HisoftC and StormC. The only thiing I had to do was remove the chip keyword and insert the #pragma chip and #pragma fast The only problem is the sprite doesn't show up Which must be something to do with the sprite data as the sprite is allocated correctly and the position is updated as it should be I'm away now for a few days but I will look into it again when I get back and have got a bit more time. Unless of course you or somebody else comes up with the answer before then Dave G |
24 August 2012, 01:18 | #5 |
Registered User
Join Date: May 2009
Location: Leicester/U.K
Posts: 36
|
Thanks Dave, I've sorted it mate.
All I needed to was cast the last parameter to an unsigned char*; from: ChangeSprite( 0, &my_sprite, ship_data[ frame ] ); to: ChangeSprite( 0, &my_sprite, (unsigned char*)ship_data[ frame ] ); Strange really as the last parameter is described as an APTR pointer on the net. Thanks again mate |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Amiga manual Website | Josh | News | 297 | 19 August 2020 10:15 |
Amiga 1200 manual | wlcina | request.Other | 1 | 15 December 2009 17:10 |
A500 service manual, technical reference manual | a500l0ver | request.Other | 2 | 26 September 2008 14:06 |
FS/FA: Amiga Guru Book & Amiga 1200 Service Manual | vamigan | MarketPlace | 3 | 11 August 2007 14:56 |
Amiga Realm & Amiga DOS online reference manual. | Paul | Amiga websites reviews | 4 | 26 August 2002 12:06 |
|
|