English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. AMOS

 
 
Thread Tools
Old 08 August 2023, 11:48   #1
Mikket
Registered User
 
Join Date: May 2019
Location: Finland
Posts: 13
AMCAF Fonts Bug?

Hi.

Have you noticed this kind of bug in Amcaf?

Text bank change seems to eat all the memory . First fast, then chip.

I have hud, where I like to use different sizes of fonts, so I change
the bank in main loop.

This problem does not exist, in some winuae configurations.
But in real Amiga 1200 + 4mb (and Winuae, with similar config) it happends.

How can it be avoided?


Here's code to test:

Screen Open 0,320,256,2,Lowres
Curs Off : Colour 1,$FFF
Make Bank Font 7
Change Font "ruby.font",8
Make Bank Font 8

Repeat
Change Bank Font 7
Text 10,10,"Chip:"+Str$(Chip Free)+" "
Change Bank Font 8
Text 10,20,"Fast:"+Str$(Fast Free)+" "
Until Mouse Click
Mikket is offline  
Old 24 August 2023, 14:47   #2
adrazar
Registered User
 
Join Date: Feb 2017
Location: Oslo
Posts: 90
Hey, it's leaking my memory too!

Like you I am using Change Bank Font frequently in the project I'm currently working on, so this problem is relevant for me as well.
Incredible find @Mikket
adrazar is offline  
Old 24 August 2023, 15:30   #3
Retro1234
Phone Homer
 
Retro1234's Avatar
 
Join Date: Jun 2006
Location: 5150
Posts: 5,775
No idea but what is you Erase 7 etc or Erase All etc does it make a difference?
Retro1234 is offline  
Old 24 August 2023, 19:21   #4
adrazar
Registered User
 
Join Date: Feb 2017
Location: Oslo
Posts: 90
Lucky me! I found a way to plug the leak

Quote:
Originally Posted by Retro1234 View Post
No idea but what is you Erase 7 etc or Erase All etc does it make a difference?
No, not this (it increased the chip ram, but fast ram did not come back)

I went over to the SetFont docs, and found in the BUGS section that this function is known to have a memory leak problem, starting from kickstart V36 (which according to wikipedia means starting with the A500+ model). It further suggests using StripFont to solve the problem, and this appears to work.

The following instructions will call StripFont with the required arguments:
Code:
Areg(0)=Leek(Scrn Rastport+52) : RESULT=Gfxcall(-822)
I found that it works to insert this code right after each call to Change Bank Font.
adrazar is offline  
Old 24 August 2023, 21:48   #5
Retro1234
Phone Homer
 
Retro1234's Avatar
 
Join Date: Jun 2006
Location: 5150
Posts: 5,775
Retro1234 is offline  
Old 28 August 2023, 23:12   #6
Mikket
Registered User
 
Join Date: May 2019
Location: Finland
Posts: 13
Great, that you found this fix adrazar. I had to transfer one font to icons, but now i can change back to amcaf font bank. Thanks.
Mikket 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
Changing Fonts Using AMCAF DrkStarr Coders. AMOS 8 17 July 2023 15:04
WinUae 4.4.0 - Action replay bug/ Load Config bug Dan support.WinUAE 2 20 July 2020 07:59
Bug in x64 file requester and bug in Blizzard PPC ROM filesize headkase support.WinUAE 5 26 June 2016 14:17
Fonts GordonM support.WinUAE 8 04 May 2016 18:20
Fonts alkis21 request.Apps 2 23 August 2002 09:33

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 19:26.

Top

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