English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. C/C++

 
 
Thread Tools
Old 08 April 2023, 07:17   #1
desiv
Registered User
 
desiv's Avatar
 
Join Date: Oct 2009
Location: Salem, OR
Posts: 1,770
ushort chip on 1.3 in DICE 3.16 -already answered

OK, I was having an issue, but found the solution...
(After I typed most of this, but before I clicked Submit and found something in an Amiga C book that made me look at the dcc (DICE compiler) doc files closer... )

Spoiler, the solution is: "__chip USHORT" instead of "USHORT chip".

----
The Amiga C Manual (disk 1, example 7) uses this type of data block for their image data:
Code:
/* REMEMBER! Image data MUST be put in chip-memory! */
USHORT chip my_image_data[]= /* Image data for a nice four colour face: */
{
  0x3E00, /* Bitplane ZERO */
  0x7F00,
  0xC980
...
...
But when I try to compile this with DICE, it gives me an error.
I was able to get it to compile and run (on an AmigaForever 2M CHIP A500 config that matches my physical A500), but by doing this:
Code:
USHORT my_image_data[]=
So, I had to take out the "chip" directive...
------

And as mentioned, the solution was to use the __chip in FRONT of the USHORT instead of just chip after it...

I wish I could find my .h file to see what I had used back in the day. Did a different version of DICE change that? Different version of the Amiga C Manual code?
Or did I just read the manual better 30+ years ago...
(Doubtful, but then again the printed code I found had WAY more commenting that I ever thought I would do... ;-)
desiv is offline  
Old 08 April 2023, 11:21   #2
Thomas Richter
Registered User
 
Join Date: Jan 2019
Location: Germany
Posts: 3,231
The original example was never valid C syntax, so I wonder which compiler should have accepted this code snippet.
Thomas Richter is offline  
Old 08 April 2023, 19:12   #3
desiv
Registered User
 
desiv's Avatar
 
Join Date: Oct 2009
Location: Salem, OR
Posts: 1,770
Quote:
Originally Posted by Thomas Richter View Post
The original example was never valid C syntax, so I wonder which compiler should have accepted this code snippet.
Interesting... I've seen several other mentions online of the code in the ACM not being ideal (no prototyping (which I still haven't looked at and don't really know what that is... ;-) ).
I just took a look, and it looks like the author was using Lattice C.
From the ACM intro chapter:
Quote:
If you use the Lattice C Compiler V5.00 or higher, you can put the keyword "chip" in front of the name of the data, and the Compiler will automatically put it in the Chip Memory.
Eg. UWORD chip graphics_data[] = { ... };
As I only used DICE back in the day and my code was inspired/based on the ACM examples, I almost certainly ran across that at the time and forgot in the last 32 years... ;-)
desiv is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
DICE documentation StantheAmigaMan support.Apps 24 05 April 2023 12:57
What is EXTICK? (Edit: Answered) Starglider 2 support.Hardware 0 14 September 2018 04:38
DICE Disks (adf) Saghalie request.Other 4 18 October 2016 21:13
Lost in installing dice-3.16 from Aminet! W4r3DeV1L support.Apps 25 24 May 2013 20:35
Elite 2 very basic question need answered dword support.Games 3 19 July 2008 01:41

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 22:45.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.08583 seconds with 13 queries