English Amiga Board


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

 
 
Thread Tools
Old 09 December 2018, 19:02   #1
technomancer
Registered User
 
Join Date: Aug 2018
Location: Czech Republic
Posts: 20
WB1.3 starting from icon not releasing memory on exit

Hi,

I'm creating a little asm intro as learning excercise and I have a little problem.

When I start prg from CLI and exit, it releases all memory but same file started from icon doesn't, chip ram gets lower and lower until prg can't be started anymore. This problem happens only on 1.2 and 1.3 KS ROMs, on 2.0 and newer I don't have any problems.

I don't use any memalloc&freemem in code, but I use BSS_C section - EDIT: moving BSS_C section in DATA_C section doesn't solve problem. After all - starting from CLI works without problems.

I would like to make it runable without problems on all ROM versions and situations Anyone expirienced something like this?

Last edited by technomancer; 09 December 2018 at 19:55.
technomancer is offline  
Old 09 December 2018, 20:24   #2
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
Starting from Workbench requires a special procedure. You can handle both cases like this:

Code:
GetMsg     = -372
FindTask   = -294
Forbid     = -132
ReplyMsg   = -378
pr_MsgPort = 92


Start   clr.l   -(sp)
        move.l  4, a6
        sub.l   a1, a1
        jsr     (FindTask, a6)
        move.l  d0, a2
        tst.l   (pr_CLI, a2)
        bne     .1

        lea     (pr_MsgPort, a2), a0
        jsr     (WaitPort, a6)
        lea     (pr_MsgPort, a2), a0
        jsr     (GetMsg, a6)
        move.l  d0, (sp)

.1      bsr     Demo

        move.l  (sp)+, d2
        beq     .2

        move.l  4, a6
        jsr     (Forbid, a6)
        move.l  d2, a1
        jsr     (ReplyMsg, a6)

.2      moveq   #0, d0
        rts
Leffmann is offline  
Old 09 December 2018, 20:36   #3
FlynnTheAvatar
Registered User
 
FlynnTheAvatar's Avatar
 
Join Date: Jan 2018
Location: Germany
Posts: 46
Starting from Workbench is a bit different than starting from CLI:
http://amigadev.elowar.com/read/ADCD.../node0248.html

When starting from WB, it sends you a WBStartup message that needs you need to reply and dealloc before existing your program. Otherwise the WBStartup message stays in memory.

There are some startups that take care of of it.
FlynnTheAvatar is offline  
Old 09 December 2018, 20:40   #4
technomancer
Registered User
 
Join Date: Aug 2018
Location: Czech Republic
Posts: 20
Leffmann, thanks, works OK.

I was using this in startup code, but for some other reason (other bug) that didn't work so I was filtering this code with LibVersion check. Now checked again after you replied and all works as it should.

Maybe its better to take some rest from coding Thanks again!
technomancer 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
Do I need WaitBlit before releasing image buffers? PeterK Coders. System 3 09 September 2018 22:22
Releasing sound resources when paused etc. mark_k support.WinUAE 1 21 October 2016 20:25
Releasing Unreleased Amiga Games fondpondforever Amiga scene 1 17 October 2013 13:16
California games releasing date Tony Landais HOL data problems 5 04 January 2008 21:07
re - releasing old games plasmatron Retrogaming General Discussion 2 17 June 2003 01:20

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

Top

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