English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Asm / Hardware

 
 
Thread Tools
Old 17 February 2021, 15:54   #61
Jobbo
Registered User
 
Jobbo's Avatar
 
Join Date: Jun 2020
Location: Druidia
Posts: 389
Quote:
Originally Posted by jotd View Post
I now suddenly understand why your games are only made with 1 exec file.

All assets are probably "static const unsigned char bitmap[] = {0x...}" like. It makes sense, as long as the whole game data fits into memory without loading.

You still have access to all the Amiga libraries, so you can use those for loading. I presume this would be a better choice than any CRT for A500.

That being said, I don't actually know much about the Amiga libs. I'd be curious if anyone has managed to load files or use the trackdisk device in a game or demo.

Last edited by Jobbo; 17 February 2021 at 17:01.
Jobbo is offline  
Old 17 February 2021, 17:39   #62
mcgeezer
Registered User
 
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
Quote:
Originally Posted by Bartman View Post
are you referring to my seminar? https://www.twitch.tv/videos/468413972?t=02h20m09s

Excerpt from there:
VBCC->GCC 6.2 +100% ->GCC 7.0 +20% ->GCC 8.2 +20%
I just watched the video and I'm going to switch over to your ide and setup... it looks very useful.

As I enjoy working in assembler and I'm not a C man it'll hopefully be ok.

Thanks for posting a link to the video!
mcgeezer is offline  
Old 17 February 2021, 18:07   #63
Bartman
Registered User
 
Join Date: Feb 2019
Location: Munich, Germany
Posts: 63
Quote:
Originally Posted by jotd View Post
I now suddenly understand why your games are only made with 1 exec file.

All assets are probably "static const unsigned char bitmap[] = {0x...}" like. It makes sense, as long as the whole game data fits into memory without loading.
we have INCBIN ^_^
Bartman is offline  
Old 17 February 2021, 18:43   #64
roondar
Registered User
 
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,421
On the topic of files, is there any way to set up the VS Code environment so that there are external files included in the WinUAE environment? Or is it truly single-executable only?

I did try to figure that out, but I couldn't find it in the documentation
roondar is offline  
Old 18 February 2021, 11:44   #65
zero
Registered User
 
Join Date: Jun 2016
Location: UK
Posts: 428
Quote:
Originally Posted by jotd View Post
static const unsigned char bitmap[] = {0x...}
This hurts my brain :-)

Please everyone use uint8_t, it's so much more precise and descriptive!

Then again I can't really get on board with C++ for this kind of work. I suppose it makes organizing code a bit nicer but there are too many useful things you can do in C that were removed from C++.
zero is offline  
Old 18 February 2021, 12:22   #66
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,247
uint8_t is fine. As long as you have the "stdint.h" header available...
jotd is offline  
Old 18 February 2021, 17:50   #67
Dunny
Registered User
 
Dunny's Avatar
 
Join Date: Aug 2006
Location: Scunthorpe/United Kingdom
Posts: 2,025
Quote:
Originally Posted by zero View Post
This hurts my brain :-)

Please everyone use uint8_t, it's so much more precise and descriptive!

Then again I can't really get on board with C++ for this kind of work. I suppose it makes organizing code a bit nicer but there are too many useful things you can do in C that were removed from C++.
I store all my data in strings. Is that bad?
Dunny is offline  
Old 18 February 2021, 20:39   #68
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,247
Quote:
I suppose it makes organizing code a bit nicer but there are too many useful things you can do in C that were removed from C++
I really don't see what. example?

Quote:
I store all my data in strings. Is that bad?
it allows to create a 100% C or C++ code, but if the data is really big it can crash the compiler. For instance a 10 MB file converts as a 40 or 50 MB header/array file because each character converts to 1 to 3 digits plus comma.
jotd is offline  
Old 18 February 2021, 21:41   #69
DMWCashy
Registered User
 
Join Date: Dec 2019
Location: Newcastle
Posts: 67
Quote:
Originally Posted by zero View Post
This hurts my brain :-)

Please everyone use uint8_t, it's so much more precise and descriptive!

Then again I can't really get on board with C++ for this kind of work. I suppose it makes organizing code a bit nicer but there are too many useful things you can do in C that were removed from C++.
What useful things have been removed from C in C++?

I am old school and would tend to steer to unsigned char, unless the project had SIL (Safety Integrity Level) requirements then a bespoke naming convention for types would be used. Either way type naming is down to personal preference and I do not see many coders having an issue with what convention was used, as long as its spaces not tabs lol.
DMWCashy is offline  
Old 18 February 2021, 23:51   #70
Antiriad_UK
OCS forever!
 
Antiriad_UK's Avatar
 
Join Date: Mar 2019
Location: Birmingham, UK
Posts: 418
Quote:
Originally Posted by DMWCashy View Post
as long as its spaces not tabs lol.
You absolute monster.
Antiriad_UK is offline  
Old 19 February 2021, 01:49   #71
Dunny
Registered User
 
Dunny's Avatar
 
Join Date: Aug 2006
Location: Scunthorpe/United Kingdom
Posts: 2,025
Quote:
Originally Posted by jotd View Post
it allows to create a 100% C or C++ code, but if the data is really big it can crash the compiler. For instance a 10 MB file converts as a 40 or 50 MB header/array file because each character converts to 1 to 3 digits plus comma.
It gets worse; I've been known to store executable code in strings too, and run it from there.
Dunny is offline  
Old 19 February 2021, 10:28   #72
zero
Registered User
 
Join Date: Jun 2016
Location: UK
Posts: 428
Quote:
Originally Posted by jotd View Post
I really don't see what. example?
Type punning is the most common one for me I think. Yeah you can do it in C++ but it just ends up polluting the code to do what is easy in C.
zero is offline  
Old 19 February 2021, 16:03   #73
pink^abyss
Registered User
 
Join Date: Aug 2018
Location: Untergrund/Germany
Posts: 408
Quote:
Originally Posted by mcgeezer View Post
I just watched the video and I'm going to switch over to your ide and setup... it looks very useful.

As I enjoy working in assembler and I'm not a C man it'll hopefully be ok.

Thanks for posting a link to the video!

I have to say i'm quite impressed that you actually finished all of your asm game projects and with such high quality. Now looking forward your C ventures
pink^abyss is offline  
Old 19 February 2021, 17:22   #74
mcgeezer
Registered User
 
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
Quote:
Originally Posted by pink^abyss View Post
I have to say i'm quite impressed that you actually finished all of your asm game projects and with such high quality. Now looking forward your C ventures
Thanks, likewise you're productions are very high quality and great for the Amiga.

I have the amiga-debug ide setup now and I have to say it's very easy to install.

VSCode and C is foreign to me so it's going to take a while to get used to.

In Bartman's presentation he quickly swapped from C to Assembler...
I haven't figured out how to do that just yet - any quick tips?

Also, can I still do source level debugging on pure assembler routines? I have a lot of general routines already written in assembler that I'd like to package up as a library and call them from C, but I still need to trace the assembler from time to time.

Geezer
mcgeezer is offline  
Old 19 February 2021, 23:09   #75
Bartman
Registered User
 
Join Date: Feb 2019
Location: Munich, Germany
Posts: 63
Quote:
Originally Posted by roondar View Post
On the topic of files, is there any way to set up the VS Code environment so that there are external files included in the WinUAE environment? Or is it truly single-executable only?

I did try to figure that out, but I couldn't find it in the documentation
Sure you can. Just put your data files in the same directory as your project/executable and load them via dos.library functions
Bartman is offline  
Old 19 February 2021, 23:11   #76
Bartman
Registered User
 
Join Date: Feb 2019
Location: Munich, Germany
Posts: 63
Quote:
Originally Posted by mcgeezer View Post
Thanks, likewise you're productions are very high quality and great for the Amiga.

I have the amiga-debug ide setup now and I have to say it's very easy to install.

VSCode and C is foreign to me so it's going to take a while to get used to.

In Bartman's presentation he quickly swapped from C to Assembler...
I haven't figured out how to do that just yet - any quick tips?

Also, can I still do source level debugging on pure assembler routines? I have a lot of general routines already written in assembler that I'd like to package up as a library and call them from C, but I still need to trace the assembler from time to time.

Geezer
Did you take a look at the included demo project? You can use either inline assembly, or use .s assembly files, although they need to adhere to GNU assembler syntax. Have a look at gcc8_asm_support.s

I think tracing assembler should work, but not 100% sure on that now.. been a while
Bartman is offline  
Old 20 February 2021, 00:08   #77
roondar
Registered User
 
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,421
Quote:
Originally Posted by Bartman View Post
Sure you can. Just put your data files in the same directory as your project/executable and load them via dos.library functions
Cool, thanks!
Don't know why I couldn't figure that out
roondar is offline  
Old 20 February 2021, 10:17   #78
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,247
Yeah. We at least need Forbid/Permit/Enable/Disable/AllocMem, and maybe dos functions.

Except that calling amiga OS needs to be done in assembly. Or are there some compatible header/other files to make that transparent (like in Bebbo's distro) ?

Having examined your Tiny games startup shells, I saw you're doing the minimal calls to freeze the system, and then restore it. I suppose it's part of an asm startup.
jotd is offline  
Old 20 February 2021, 11:10   #79
Antiriad_UK
OCS forever!
 
Antiriad_UK's Avatar
 
Join Date: Mar 2019
Location: Birmingham, UK
Posts: 418
Quote:
Originally Posted by jotd View Post
Yeah. We at least need Forbid/Permit/Enable/Disable/AllocMem, and maybe dos functions.

Except that calling amiga OS needs to be done in assembly. Or are there some compatible header/other files to make that transparent (like in Bebbo's distro) ?
You can call all those from C no problem - no assembler required. If you look at the example project that in Bartman's distro there is a simple C program that does the usual system takedown with a mix of library calls and custom reg writes. No messing around required.
For another example I did bits of the C program for amigaklang with Bartman's gcc which does a full system takedown and restore as well and plays music using PHX's replay (I did call the PHX replay using a small asm wrapper though)

Amigaklang is here: https://www.pouet.net/prod.php?which=85351
Just go intro the exe_creator folder and look at main_executable.c.

OpenLibrary example from that:
Code:
// We will use the graphics library only to locate and restore the system copper list once we are through.
	GfxBase = (struct GfxBase *)OpenLibrary((CONST_STRPTR)"graphics.library",0);
	if (!GfxBase)
		Exit(0);

Last edited by Antiriad_UK; 20 February 2021 at 11:18.
Antiriad_UK is offline  
Old 02 April 2021, 12:45   #80
girv
Mostly Harmless
 
girv's Avatar
 
Join Date: Aug 2004
Location: Northern Ireland
Posts: 1,115
Great thread, I love this sort of information


Quote:
Originally Posted by pink^abyss View Post
-Blitting (with priority on) starts after the last displayed line.
-Blits are orchestrated by the CPU.

Does this mean you queue all blits then, at the correct raster, you busy loop through the queue blit->wait->blit->wait->blit->... ?


Do you loop checking VPOS for the right line to start the queue or use an interrupt?
girv 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
Tinyus Open Beta Released (OCS Gradius port) pink^abyss News 213 11 May 2023 01:50
Tinyus - An arcade quality Amiga OCS port of Gradius/Nemesis pink^abyss News 103 12 May 2021 04:58
Tech AMIGA magazine thinlega request.Apps 9 19 February 2021 17:26
Trackmo tech paraj Coders. Asm / Hardware 4 30 March 2017 20:57
AmigaWorld Tech Journal Shadowfire AMR news 7 26 April 2009 19:14

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 09:32.

Top

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