Memory leak? Need some help -_-

Ask anything your want about Megadrive/Genesis programming.

Moderator: BigEvilCorporation

Post Reply
Montserrat
Very interested
Posts: 115
Joined: Fri Sep 18, 2015 2:56 pm

Memory leak? Need some help -_-

Post by Montserrat » Thu Apr 20, 2017 7:44 pm

Hi, im doing some basic tests, using guides from Bigevilcorp, and other sources.

My test is doing well both in the emulator and real hardware (using sega nomad and UMDK to test), but the ram keeps geting filled until it runs out of space, i've tried to find the cause with REGEN debugger, but i dont get it, I thinks its something with Vint countercan someone take a look? I've attached rom and source. Also a screen:

Image

Thanks in advance.
Attachments
ScrollTests.7z
(55.24 KiB) Downloaded 214 times

BigEvilCorporation
Very interested
Posts: 209
Joined: Sat Sep 08, 2012 10:41 am
Contact:

Re: Memory leak? Need some help -_-

Post by BigEvilCorporation » Thu Apr 20, 2017 7:53 pm

You're using BSR for an infinite loop with no RTS - BSR will push the return address to the stack, and since you never return, it'll fill memory up with these addresses forever:

Code: Select all

 bsr		@Loopie
Use BRA if you never intend to return from the subroutine.
A blog of my Megadrive programming adventures: http://www.bigevilcorporation.co.uk

Montserrat
Very interested
Posts: 115
Joined: Fri Sep 18, 2015 2:56 pm

Re: Memory leak? Need some help -_-

Post by Montserrat » Thu Apr 20, 2017 8:00 pm

Wow that was fast, and yes, solved!

Definetly i have to learn much more about OPCODES, :oops:

Post Reply