English Amiga Board


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

 
 
Thread Tools
Old 10 July 2021, 16:36   #1
KONEY
OctaMED Music Composer
 
KONEY's Avatar
 
Join Date: Jan 2009
Location: Venice - Italy
Age: 49
Posts: 666
SECTION CODE - Problem with chunks and FAST ram

HELP!!

I'm building my first intro requiring 512Kb+. So far I manage to load everything not needing to be on CHIP in "SECTION CODE" and samples+gfx in "SECTION DATA_C".

Everything is OK, vasm builds and returns as expected:
Quote:
vasm 1.8d (c) in 2002-2018 Volker Barthelmann
vasm M68k/CPU32/ColdFire cpu backend 2.3b (c) 2002-2017 Frank Wille
vasm motorola syntax module 3.11c (c) 2002-2018 Frank Wille
vasm hunk format output module 2.9b (c) 2002-2017 Frank Wille

Code(acrx2): 173552 bytes
ChipData(adrw1): 448728 bytes
Press any key to continue . . .
and the intro works OK with 512kb CHIP+512kb SLOW or with at least 1mb CHIP. But on my A1000 I have 512KB of chip + 8mb FAST and the code won't start, exiting with an ERROR CODE 103 (not free ram).

Replicating the configuration on WinUAE sorted the same results. This applies only for KS1.3, from KS 2.0 everything is fine. Also tried with ASM-PRO, same result. Looks like there is a problem with fast starting address.

I'm using Photon's Mini Wrapper, full code here https://github.com/KONEY/lost_octame.../TR-808_MAIN.s


I think it's a quite trivial problem but I can't figure out exactly what to do, I guess I need to find the largest non-chip mem chunk and pass it to... what? Also when running the program it won't even load, just exit so I wonder if any changes at code could sort any effect at all...?


Please, any help or example would be appreciated


Thanks
KONEY is offline  
Old 10 July 2021, 17:08   #2
Thomas Richter
Registered User
 
Join Date: Jan 2019
Location: Germany
Posts: 3,215
Quote:
Originally Posted by KONEY View Post
I'm building my first intro requiring 512Kb+. So far I manage to load everything not needing to be on CHIP in "SECTION CODE" and samples+gfx in "SECTION DATA_C".

Replicating the configuration on WinUAE sorted the same results. This applies only for KS1.3, from KS 2.0 everything is fine. Also tried with ASM-PRO, same result. Looks like there is a problem with fast starting address.

I'm using Photon's Mini Wrapper, full code here https://github.com/KONEY/lost_octame.../TR-808_MAIN.s
I have no idea what that is. But if the file fails to load on 1.3 only, then the binary uses hunk types or hunk sizes the 1.3 loader (aka "dos/LoadSeg") does not recognize, in particular how to indicate that a hunk has to go into chip mem. I suggest trying another linker, e.g. "BLink" from Aminet.
Thomas Richter is offline  
Old 10 July 2021, 17:22   #3
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
Does the system actually have big enough contiguous free chip ram chunk? Z2 fast vs slow RAM is not exactly equal and might cause slight memory usage differences.

(or perhaps it is the most common problem: different number of floppy drives)
Toni Wilen is online now  
Old 10 July 2021, 17:23   #4
a/b
Registered User
 
Join Date: Jun 2016
Location: europe
Posts: 1,039
Did you try avail to see how much of the 512KB base chip is available, and how large is the largest segment? If has to be at least 439KB (512KB minus wb screen, disk buffers, ...).
a/b is offline  
Old 10 July 2021, 17:41   #5
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 3,334
Quote:
Originally Posted by Thomas Richter View Post
I have no idea what that is. But if the file fails to load on 1.3 only, then the binary uses hunk types or hunk sizes the 1.3 loader (aka "dos/LoadSeg") does not recognize, in particular how to indicate that a hunk has to go into chip mem. I suggest trying another linker, e.g. "BLink" from Aminet.
The problem might be due to vasm creating executables with RELOC32SHORT hunks.

You can use ShortRel to convert those to RELOC32 which does work on Kickstart 1.x.

There is probably a vasm option to tell it to only create reloc32 hunks in the first place too.
mark_k is online now  
Old 10 July 2021, 17:56   #6
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
Did you use a linker or did you let vasm generate the hunk-format executable with
-Fhunkexe
option? In the latter case you have to use the
-kick1hunks
option, as vasm will output OS2.0 compatible executables by default.

EDIT: Noticed that your error was 103. Probably there is just no Chip RAM region which is large enough with your A1000 config, as others suggested.

Last edited by phx; 10 July 2021 at 18:10. Reason: 103
phx is offline  
Old 10 July 2021, 18:10   #7
KONEY
OctaMED Music Composer
 
KONEY's Avatar
 
Join Date: Jan 2009
Location: Venice - Italy
Age: 49
Posts: 666
thanks, i'll try everything. Anyway I did a test with asm-pro and the same problem happened.

I should have chip ram free, when using slow fast the chip ram is the same amount and it works.
KONEY is offline  
Old 10 July 2021, 18:22   #8
KONEY
OctaMED Music Composer
 
KONEY's Avatar
 
Join Date: Jan 2009
Location: Venice - Italy
Age: 49
Posts: 666
AVAIL with 512kb CHIP + 512kb SLOW: (WORKS!)
Quote:
Type Available In-Use Maximum Largest
chip 457296 65936 523232 457296
fast 471416 45472 516888 471288
total 928712 111408 1040120 471288
AVAIL with 512kb CHIP + 512kb FAST: (ERROR 103)
Quote:
Type Available In-Use Maximum Largest
chip 449032 66832 515864 447824
fast 479744 44512 524256 479208
total 928776 111344 1040120 479208
well there's a small difference, maybe I should run something like add44kb before. I'll do tests!
KONEY is offline  
Old 10 July 2021, 18:27   #9
a/b
Registered User
 
Join Date: Jun 2016
Location: europe
Posts: 1,039
Yeah, your largest chip mem chunk is not large enough (~1KB too short). Try addk21k (this one is the most harmless, compared to the rest of the addXk family) or reduce the size of disk buffers.
a/b is offline  
Old 10 July 2021, 18:36   #10
KONEY
OctaMED Music Composer
 
KONEY's Avatar
 
Join Date: Jan 2009
Location: Venice - Italy
Age: 49
Posts: 666
yes I just figured it out, it works! Do you know where I can find add21k? on aminet there's only a 36k version.
KONEY is offline  
Old 11 July 2021, 00:16   #11
Antiriad_UK
OCS forever!
 
Antiriad_UK's Avatar
 
Join Date: Mar 2019
Location: Birmingham, UK
Posts: 418
Slightly off topic but I'd also recommend having your winuae config having a df0: and df1: as that reduces the chipmem as well. Quite a few error 103 comments on pouet when people attempt to run intros with a df1: (like the old days) so nice to catch those errors early and put in the readme/nfo.
Antiriad_UK is offline  
Old 11 July 2021, 01:20   #12
Radertified
Registered User
 
Join Date: Jan 2011
Location: -
Posts: 728
Quote:
Originally Posted by KONEY View Post
yes I just figured it out, it works! Do you know where I can find add21k? on aminet there's only a 36k version.
In the zone
Radertified is offline  
Old 11 July 2021, 07:40   #13
Don_Adan
Registered User
 
Join Date: Jan 2008
Location: Warsaw/Poland
Age: 55
Posts: 1,959
Seems you can too split your chip_c section on two chip_c sections. First large, about 440KB and second small about 9KB.
Don_Adan is offline  
Old 11 July 2021, 20:27   #14
KONEY
OctaMED Music Composer
 
KONEY's Avatar
 
Join Date: Jan 2009
Location: Venice - Italy
Age: 49
Posts: 666
Quote:
Originally Posted by Antiriad_UK View Post
Slightly off topic but I'd also recommend having your winuae config having a df0: and df1: as that reduces the chipmem as well. Quite a few error 103 comments on pouet when people attempt to run intros with a df1: (like the old days) so nice to catch those errors early and put in the readme/nfo.

Not OT, actually quite relevant. Thanks for the tip!


Quote:
Originally Posted by Radertified View Post
In the zone

grabbed, thanks!


Quote:
Originally Posted by Don_Adan View Post
Seems you can too split your chip_c section on two chip_c sections. First large, about 440KB and second small about 9KB.

And what should happen this way?
KONEY is offline  
Old 11 July 2021, 20:42   #15
Don_Adan
Registered User
 
Join Date: Jan 2008
Location: Warsaw/Poland
Age: 55
Posts: 1,959
Ok, seems my idea was not good, you must to fit chip memory different. first chip hunk must have about 447800 bytes, and second chip hunk about 1000 bytes.
Don_Adan is offline  
Old 12 July 2021, 13:09   #16
defor
Registered User
 
Join Date: Jun 2020
Location: Brno
Posts: 90
Are you sure you need all your data to reside in the chip RAM from the beginning? It's risky for your program to require such a large continuous block of memory on 512kB chip RAM machines (see Antiriad's comment). Maybe you can place some of your data to fast/slow memory and move them (possibly even decompress) later to the chip RAM only when needed? In other words: Detect that some of your data can easily overlap through the program's lifetime
defor is offline  
Old 12 July 2021, 13:42   #17
KONEY
OctaMED Music Composer
 
KONEY's Avatar
 
Join Date: Jan 2009
Location: Venice - Italy
Age: 49
Posts: 666
I do If you look at the source code you'll notice I even splitted .MED file into two parts and modified the player so that everything but samples will be loaded in fast ram. CHIP ram will be crammed to the rim with samples
KONEY is offline  
Old 12 July 2021, 14:36   #18
morbid
Registered User
 
Join Date: Aug 2020
Location: Huddinge
Posts: 24
Slightly OT but @hoffmann did a nice write up of how they streamed samples from disk "just in time" in the demo EON https://hoffman.home.blog/2019/04/27/eon/, (scroll down to the SAMPLE STREAMING section).

Perhaps you can use a similar technique and copy samples from fast ram to chip ram?
morbid is offline  
Old 12 July 2021, 15:17   #19
KONEY
OctaMED Music Composer
 
KONEY's Avatar
 
Join Date: Jan 2009
Location: Venice - Italy
Age: 49
Posts: 666
nice read, thanks!
KONEY 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
SECTION statement and the CHIP/FAST attribute Apollo Coders. Asm / Hardware 3 15 June 2013 18:18
Problem playing modules from fast ram vagrant support.Hardware 4 19 February 2013 23:51
Use of 4MB PCMCIA Fast Flash Memory as Fast RAM in A1200 nkarytia support.Hardware 10 16 September 2011 13:37
help optimising a section of code h0ffman Coders. General 15 02 March 2011 13:19
32-bit FAST RAM vs. ZII FAST RAM polbit support.Hardware 16 28 January 2007 20:16

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 21:05.

Top

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