How to reduce file size?
Re: How to reduce file size?
@NicTheQuick thanks for the clarification
-
- Addict
- Posts: 1443
- Joined: Wed Nov 12, 2008 5:01 pm
- Location: Russia
Re: How to reduce file size?
1 MB of flash this is a very very large amount of memory for the microcontroller!NicTheQuick wrote:Of course, on small microcontrollers with 1 MB of flash memory or less you need to look at each bit individually to get the smallest executable possible.
Here is a typical 8-bit microcontroller with a 2 KB flash and 68 bytes of RAM. https://www.microchip.com/wwwproducts/en/PIC16F84
Here is a modern 32-bit microcontroller with an ARM core, in which 16 KB of flash memory and 4 KB of RAM. https://www.st.com/en/microcontrollers- ... 030f4.html
Re: How to reduce file size?
I'm guessing it's for one of those "intro" contests where the executable size must be 1.44 MB or less to enter.Demivec wrote:Is there any reason why you would be limited to only a 1.44 mb floppy?
Re: How to reduce file size?
If you are worried about file size you should take a look at the ASM file Purebasic generates (pbcompiler.exe /COMMENTED). PB tends to call some init/end/free library functions even though no other functions of that particular library are called, thus inflating the final exe with unused libs.Vernostonos wrote:Are there any tricks for keeping file size down for a PB project?
I just hit 101 kb and have only half of my character creation system finished. I'm worried once all the dialog, custom fonts, and locations are completed its no longer going to fit on a 1.44mb floppy.
I wrote an IDE tool for this matter (pbOptimizer). Another way to reduce the size of your program, if you are working with images, is to not include Use???ImageDecoder() but instead use LoadImageEx/LoadSpriteEx.
Et cetera is my worst enemy
- Vernostonos
- User
- Posts: 58
- Joined: Thu Jul 02, 2020 9:52 pm
Re: How to reduce file size?
Thank you everyone for the tips. My original post was vague, for example I shaved off about 5kb by eliminating large areas of copy and pasted code. Instead using "procedures" to display the same information across a range of different prompts. I'm a novice so I am still learning how to kick bad habits and better optimize my code.
viewtopic.php?f=13&t=75649
Considering I'm working on a "console/command prompt" type game its a requirement of mine. It might seem like an odd goal to fit a game on a 1.44mb floppy, its more about the novelty of actually doing it. I have no plans to enter a contest this is just a personal project for fun and learning.Josh wrote:Excuse me, it's the year 2020.Vernostonos wrote:... its no longer going to fit on a 1.44mb floppy.
Windows for now but you can see more about my game project here.Bitblazer wrote:What is your software supposed to do? What is your target operating system?
viewtopic.php?f=13&t=75649