Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 14:39 27 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : PICO PETSCII

     Page 33 of 38    
Author Message
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1113
Posted: 11:13am 24 Nov 2023
Copy link to clipboard 
Print this post

  Volhout said  Hi Martin,

Are you still planning to combine get_psyched.mod with sfx ? Or can it not be shrunk into 128k? There is a larger version you made before (180kbyte).
There is always the option to use the larger MODBUFF.

yes, it's going to be something personal between the MOD and me

  Volhout said  
I just checked, but the whole game will not fit on the A-drive (on a VGA it may if we squeeze the hell out of it, but the LCD version has a smaller A drive(last I looked) .. so it will not fit).

even if you save every Flashbuffer together as one File, I dont think that there remains the space to store the Music ..
Maybe a SFX only Version
Edit: I just noticed that you didn't include the pure sfx module in the current package.
was that intentional?
Edited 2023-11-24 21:25 by Martin H.
'no comment
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4243
Posted: 11:49am 24 Nov 2023
Copy link to clipboard 
Print this post

petsciisfx.mod is there, I even included the non-sfx version of get_psyched.mod.



Volhout

P.S. technically it is possible to "shrink" every level file with 256 bytes...saving 3.5k. The game can be saved "crunched" by MMEdit, saving around 20k.
Edited 2023-11-24 21:55 by Volhout
PicomiteVGA PETSCII ROBOTS
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1113
Posted: 11:53am 24 Nov 2023
Copy link to clipboard 
Print this post

i was to blind ... did you use the matal_heads mod where i added the Beep in it?
So it can be played by using the menu when selecting an entry.
Edited 2023-11-24 21:54 by Martin H.
'no comment
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4243
Posted: 11:57am 24 Nov 2023
Copy link to clipboard 
Print this post

Good question.

The metal_heads.mod is the same from pet24 and pet23 series.
In the "larger file size" mod files ZIP there was a different metal_heads.
This one:

metal_heads-sfx.zip

Maybe that is the one you need? But it has not been used before. We can add it..

Volhout

P.S. tried the above mod, and it works.
Edited 2023-11-24 22:13 by Volhout
PicomiteVGA PETSCII ROBOTS
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1113
Posted: 02:28pm 24 Nov 2023
Copy link to clipboard 
Print this post

Just tested Pet25 on the Gamemite
Error : Not enough memory
> [1664] Play modfile "music/sfcmetallicbop2.mod"   'sfx combined with music
Error : Not enough memory

> memory
Program:
 55K (41%) Program (2100 lines)
  1K ( 0%) 1 Embedded Fonts
 76K (59%) Free

Saved Variables:
 16K (100%) Free

RAM:
 26K (15%) 97 Variables
 90K (56%) General
 44K (29%) Free

> option list
PicoMite MMBasic Version 5.07.08RC19
OPTION SYSTEM SPI GP6,GP3,GP4
OPTION AUTORUN  1
OPTION CPUSPEED  252000 'KHz
OPTION DISPLAY 28, 80
OPTION LCDPANEL ILI9341, RLANDSCAPE,GP2,GP1,GP0
OPTION TOUCH GP5,GP7
GUI CALIBRATE 0, 368, 294, 882, 666
OPTION SDCARD GP22
OPTION AUDIO GP20,GP21', ON PWM CHANNEL 2
OPTION MODBUFF ENABLE

maybe the additional sprit for the banner is to much
Edited 2023-11-25 00:34 by Martin H.
'no comment
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9122
Posted: 02:42pm 24 Nov 2023
Copy link to clipboard 
Print this post

I could reduce memory usage by the mod file codec by reducing MAXNOTES (currently 144) and/or MAXCHANNELS (currently 32). Not sure how big a difference they will make but happy to post some restricted versions of firmware is useful (currently uses 24K)

UPDATE
Just tried - effect is minimal and mod files don't play properly so ignore above
Edited 2023-11-25 00:48 by matherp
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1113
Posted: 03:07pm 24 Nov 2023
Copy link to clipboard 
Print this post

  Martin H. said  Just tested Pet25 on the Gamemite
Error : Not enough memory
> [1664] Play modfile "music/sfcmetallicbop2.mod"   'sfx combined with music
Error : Not enough memory
[/Code]

maybe the additional sprit for the banner is to much


yes .. on Game Mite "Rem" out those two lines

first at the start of the Program:

'write frame around playfield
 FRAMEBUFFER Write sc$
 Load image "images/layerb.bmp"  'the actual frame
'----THIS LINE:
 'sprite write #1,0,0 'top of screen showing robot eyes

 If Game_Mite Then FRAMEBUFFER Merge 9


and at the end of the Start menu:

   Pause 50: 'Contr_input$() is to fast to see what position you are in
 Loop
 Play stop
 'save image "images\strip.bmp",0,85,320,16
'----THIS LINE:
' sprite read #1,0,85,320,16
End Sub


if you still want the Banner above, use this bmp


layer_b.zip
Edited 2023-11-25 01:11 by Martin H.
'no comment
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4243
Posted: 03:12pm 24 Nov 2023
Copy link to clipboard 
Print this post

Hi Martin,

Thanks for debugging...
The charm was that the banner changed automatically with difficulty level. There are other ways to fix this if we want, I know. The banner is 320x16=5k pixels = 5kbyte at 1 char per pixel, or 2.5kbyte at 4bpp.

This means that RAM is (very) critical at the Game*Mite. Note that there where only 97 variables when Game Mite ran out of memory. In VGA when running there are 141 variables.

Volhout
Edited 2023-11-25 01:14 by Volhout
PicomiteVGA PETSCII ROBOTS
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1113
Posted: 03:30pm 24 Nov 2023
Copy link to clipboard 
Print this post

  Volhout said  Hi Martin,

Thanks for debugging...
The charm was that the banner changed automatically with difficulty level. There are other ways to fix this if we want, I know. The banner is 320x16=5k pixels = 5kbyte at 1 char per pixel, or 2.5kbyte at 4bpp.

This means that RAM is (very) critical at the Game*Mite. Note that there where only 97 variables when Game Mite ran out of memory. In VGA when running there are 141 variables.

Volhout

maybe the lowervariables are couse it happend right at the start of the game ..
I am not sure, if the Sprites at the LCD Version uses 4 or 24Bit per Pixel , than the Banner uses 320x16x24 Bytes.
Peter can definitely answer the question

If you want to change the banner during Levels, you can still use the previous method of simply reloading them.
Edited 2023-11-25 01:32 by Martin H.
'no comment
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4042
Posted: 03:32pm 24 Nov 2023
Copy link to clipboard 
Print this post

I don't think it's the variable memory that is the issue it is the MMBasic heap (strings, arrays, buffers) that is exhausted. Look to see if there are any arrays of integers being used to store 8 and 16 bit numbers and instead allocate smaller arrays and use PEEK and POKE to access them.

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4243
Posted: 03:49pm 24 Nov 2023
Copy link to clipboard 
Print this post

Hi Tom,

Yes there are. Plenty. The game is 8. Bit based.
And no. I am not going that path.
Someone else may volunteer.

Volhout
PicomiteVGA PETSCII ROBOTS
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1113
Posted: 04:43pm 24 Nov 2023
Copy link to clipboard 
Print this post

A small thing in the game logic:
When I walk past the Evilbot's door it opens, even if I dont have the star key
Edited 2023-11-25 02:50 by Martin H.
'no comment
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4243
Posted: 05:32pm 24 Nov 2023
Copy link to clipboard 
Print this post

That is new…
It did not do that before.

Volhout

Edit: good find. The spade key opens 2 doors. Will fix it this weekend.
Edited 2023-11-25 04:08 by Volhout
PicomiteVGA PETSCII ROBOTS
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1113
Posted: 07:28am 25 Nov 2023
Copy link to clipboard 
Print this post

  Volhout said   good find. The spade key opens 2 doors. Will fix it this weekend.

found another issue ..
If you walk into TC your Health get 0
Your sprite disappears, but the game doesn't end, so you can walk around invisible as a ghost, and no one can kill you
Edited 2023-11-25 17:40 by Martin H.
'no comment
 
Bleep
Guru

Joined: 09/01/2022
Location: United Kingdom
Posts: 509
Posted: 10:05am 25 Nov 2023
Copy link to clipboard 
Print this post

Hi Harm,
I can have a look at optimisation of arrays, if you think it will be useful, I noticed there are already functions to do LGETBYTE and LONGSTRING SETBYTE for longstrings (a byte array) but I'd also experiment with PEEK & POKE to see if it was quicker/easier?
Regards Kevin.
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9122
Posted: 10:38am 25 Nov 2023
Copy link to clipboard 
Print this post

There is a feature in peek that I incorporated ages ago that may be useful and probably hasn't been used before

peek(bp addrress%)

This returns the byte at address% but also then increments address%. This allow you to very quickly step though a byte array.

There is also to equivalent for 32-bit steps (peek(wp...)) and 16 bit steps (peek(sp...))


a$="123456789"
b%=peek(varaddr a$)
timer=0:for i%=0 to 8:c%=peek(bp b%):next:?timer
b%=peek(varaddr a$)
timer=0:for i%=0 to 8:c%=peek(byte b%+i%):next:?timer
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1113
Posted: 10:54am 25 Nov 2023
Copy link to clipboard 
Print this post

  matherp said  There is a feature in peek that I incorporated ages ago that may be useful and probably hasn't been used before

peek(bp addrress%)

This returns the byte at address% but also then increments address%. This allow you to very quickly step though a byte array.

Thank you , reminds me of auto-incrementing registers in assembler. Is there also a matching Poke(bp addrress%)?
I'll give it a try at the Map generation,not to save Memory but maybe i can get it under 500ms  
Edited 2023-11-25 21:04 by Martin H.
'no comment
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9122
Posted: 11:19am 25 Nov 2023
Copy link to clipboard 
Print this post

Haven't done a poke but could easily if useful
 
Bleep
Guru

Joined: 09/01/2022
Location: United Kingdom
Posts: 509
Posted: 11:50am 25 Nov 2023
Copy link to clipboard 
Print this post

Hi Peter,
When declaring a LONGSTRING array as Integer, do I need to add an extra element to the array to allow for the string length word (64 bits) which seems to be on the beginning, or is this allowed for automagically?
Regards Kevin
Edited 2023-11-25 21:51 by Bleep
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9122
Posted: 11:54am 25 Nov 2023
Copy link to clipboard 
Print this post

You need to allow for it. So if you need 48 bytes of data then declare the array with cardinality of 7
 
     Page 33 of 38    
Print this page
© JAQ Software 2024