English Amiga Board


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

 
 
Thread Tools
Old 23 May 2015, 20:57   #1
Astrofra
Amos Basic
 
Astrofra's Avatar
 
Join Date: Feb 2013
Location: Orleans | France
Age: 49
Posts: 85
Demoscene project using SAS/C

Hi all,

here's a small demo I released during the Outline 2015 demoparty in Netherlands :

http://www.pouet.net/prod.php?which=65580

What is specific to this project :
  • Everything was written in C, compiled with the latest version of SAS/C
  • There is practically no direct access to the hardware, except the mouse test & a couple of sprite reset
  • It works on an Amiga 500 with 1meg of ram, starting with kickstart 1.2. I really wanted to see what could be achieved with the early releases of the Amiga OS.
  • It uses the chipset extensively, copper, blitter & dual playfield, using system calls only.

If you are curious about the source code, I did everything on github :
https://github.com/voitureblanche/projet-secret

I hope you will enjoy watching it
Astrofra is offline  
Old 23 May 2015, 22:57   #2
tolkien
AmigaMan
 
tolkien's Avatar
 
Join Date: Oct 2012
Location: Castro Urdiales/Spain
Posts: 763
Interesting. I'll give a try to that source. Thanks.
tolkien is offline  
Old 24 May 2015, 15:55   #3
hooverphonique
ex. demoscener "Bigmama"
 
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,646
are you using audio.device for music playback then? ;-)
hooverphonique is offline  
Old 24 May 2015, 20:22   #4
Astrofra
Amos Basic
 
Astrofra's Avatar
 
Join Date: Feb 2013
Location: Orleans | France
Age: 49
Posts: 85
Yes Sir
I'm using "EASY-SOUND V2.00 by ANDERS BJERIN" that uses the audio device :
https://github.com/voitureblanche/pr...outines.c#L321
Astrofra is offline  
Old 16 June 2015, 10:29   #5
Samurai_Crow
Total Chaos forever!
 
Samurai_Crow's Avatar
 
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,207
It'll be interesting to see what is possible with an up-to-date C compiler someday. ;-) (Even if it starts as a cross-compiler...)

https://github.com/SamuraiCrow/llvm-m68k
Samurai_Crow is offline  
Old 27 November 2015, 15:44   #6
kamelito
Zone Friend
 
kamelito's Avatar
 
Join Date: May 2006
Location: France
Posts: 1,866
@Samurai_Crow Any update on LLVM 68k?
Do you think that it will see the light of the day?
Kamelito
kamelito is offline  
Old 27 November 2015, 17:39   #7
Samurai_Crow
Total Chaos forever!
 
Samurai_Crow's Avatar
 
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,207
Currently, it is difficult to do separate banks of registers for pointers and integers on LLVM, as the 68k is set up with address and data registers. The link above is not only incomplete but also is based on an old version of LLVM which further complicates matters. The next version of LLVM may have a new organizational structure that will simplify matters. Also, my programming partner has 2 jobs already and a family so, as much as he'd like to work on an Amiga LLVM backend, he doesn't have much time to spare.

I do still think about having competitive compiler infrastructure for the sake of softcores like the Vampire 2's Apollo softcore. Also, it would make existing accelerators stretch to the level of Assembly coding and bring LLVM-based projects such as WebAssembly to the Amiga as well.
Samurai_Crow is offline  
Old 27 November 2015, 20:49   #8
ReadOnlyCat
Code Kitten
 
Join Date: Aug 2015
Location: Montreal/Canadia
Age: 52
Posts: 1,178
What a wonderful idea!
I have to see this demo!

Thank you Kamelito for resurrecting the thread!
ReadOnlyCat is offline  
Old 04 June 2017, 18:34   #9
guy lateur
Registered User
 
guy lateur's Avatar
 
Join Date: May 2017
Location: Belgium
Age: 50
Posts: 334
Wow, thank you for that, this looks awesome, and it's exactly what I'm looking for!

Sorry this is a bit of a necro, and even worse, it's to ask this total noob question: how do I convert this into a SAS/C project? I see there's a SCoptions file in the src subdirectory, which I should probably copy somewhere. Do I make a new project and then copy these files into it somehow? Help!
guy lateur is offline  
Old 05 June 2017, 08:19   #10
Minuous
Coder/webmaster/gamer
 
Minuous's Avatar
 
Join Date: Oct 2001
Location: Canberra/Australia
Posts: 2,686
I never bother with projects. There is a makefile there so it should be sufficient just to type "make".
Minuous is offline  
Old 05 June 2017, 19:36   #11
guy lateur
Registered User
 
guy lateur's Avatar
 
Join Date: May 2017
Location: Belgium
Age: 50
Posts: 334
You're probably right, I should learn how to build stuff using a makefile. I used to do it this way, but it's been a very long time, so please bear with me..

For clarity, here's the complete makefile:

Code:
# project directories
EXE_DIR = $(CURDIR)/bin
INC_DIR = -I$(CURDIR)/../m68k-amigaos/os-include/ -I$(CURDIR)/include/
OBJ_DIR = $(CURDIR)/build
SRC_DIR = $(CURDIR)/src

# implicit rule variables
CC = m68k-amigaos-gcc
CFLAGS = -noixemul -s -Os -Wall -fomit-frame-pointer -m68000 -msmall-code
LDLIBS = -lnix13

# other
OBJS = $(patsubst %.c,%.o,$(wildcard $(SRC_DIR)/*.c))

main: $(OBJS)
	@mkdir -p $(EXE_DIR)
	$(CC) $(CFLAGS) $(LDLIBS) $(OBJS) -o $(EXE_DIR)/main 

-include $(OBJS:.o=.d) # include dependency makefile
	
%.o: %.c
	$(CC) -c $(CFLAGS) $(INC_DIR) $*.c -o $*.o
	$(CC) -MM $(CFLAGS) $*.c > $*.d

.PHONY: clean purge
	
clean:
	rm -f $(SRC_DIR)/*.o $(SRC_DIR)/*.d

purge:
	rm -rf $(EXE_DIR)
	rm -rf $(OBJ_DIR)
	rm -f $(SRC_DIR)/*.o $(SRC_DIR)/*.d
I can't type make to build this, because that's an unknown command, which probably comes with your specific (gcc based?) development environment. I can type smake (coming with SAS/C), though, and it starts reading the makefile (*). It fails at line 13:
Code:
OBJS = $(patsubst %.c,%.o,$(wildcard $(SRC_DIR)/*.c))
Message: expected ')' or '}', found ' '

I'll probably need to translate this makefile for use with smake. There's a couple of lines that worry me a little:

Line 3:
Code:
INC_DIR = -I$(CURDIR)/../m68k-amigaos/os-include/
I don't think I have this; I've just got a blank install of SAS/C 6.58. Where do I look for those?

Line 8:
Code:
CC = m68k-amigaos-gcc
Same as above, really; I should probably replace this with sc (the sasc compiler, if I'm not mistaking)

Line 13:
Code:
OBJS = $(patsubst %.c,%.o,$(wildcard $(SRC_DIR)/*.c))
Like I said, this is where smake bails out. I have no idea what patsubst is or how to check its usage. Any thoughts?

TIA!

(*) FYI, I've tried making a new project in sasc, and then copying all files of the distribution into it. When I ran/doubleclicked the Build command, it gave me the same line-13-error -- although there is an SCoptions file in there, which I thought was kind of the equivalent of a makefile. I could happily remove the SCoptions file, btw, and it would say the same thing. Only when I removed the makefile, it would say there are 'no files to compile'. But that's actually good for our purposes, right?
guy lateur is offline  
Old 06 June 2017, 00:57   #12
Minuous
Coder/webmaster/gamer
 
Minuous's Avatar
 
Join Date: Oct 2001
Location: Canberra/Australia
Posts: 2,686
Well, I don't normally use makefiles either ;-) If it was me I would replace the makefile with an AmigaDOS script to do the same thing.

>I don't think I have this; I've just got a blank install of SAS/C 6.58. Where do I look for those?

System includes are in the OS3.9 NDK.
Minuous is offline  
Old 06 June 2017, 12:52   #13
guy lateur
Registered User
 
guy lateur's Avatar
 
Join Date: May 2017
Location: Belgium
Age: 50
Posts: 334
Quote:
Originally Posted by Minuous View Post
Well, I don't normally use makefiles either ;-) If it was me I would replace the makefile with an AmigaDOS script to do the same thing.
That may indeed be something to consider. I've never written a dos script, though, and tbh, I'm not even 100% sure what exactly it is that needs to be done. So if you happen to have any examples of this at hand, feel free to post them here.

Quote:
Originally Posted by Minuous View Post
System includes are in the OS3.9 NDK.
Of course, thanks!
guy lateur 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
Moleman2 Demoscene DDNI Amiga scene 1 04 September 2014 15:53
Natami project freezed, Tina project folded...what next?? Bamiga2002 Amiga scene 52 21 May 2014 09:19
Building a project in SAS/C Tiddlypeeps Coders. General 2 21 April 2010 11:48
Demoscene and .... consoles ?! Another World Retrogaming General Discussion 11 07 June 2009 21:03
UK demoscene pics Yesideez Amiga scene 12 16 September 2007 17:18

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 20:17.

Top

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