Welcome, Guest. Please login or register.

Author Topic: Mr Beanbag not working with accelerator  (Read 5415 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Mrs Beanbag

  • Sr. Member
  • ****
  • Join Date: Sep 2011
  • Posts: 455
    • Show only replies by Mrs Beanbag
Re: Mr Beanbag not working
« Reply #14 on: January 26, 2012, 01:36:35 PM »
Quote from: Leffmann;677535
I also found that pressing the keyboard causes the game to crash, something with the keyboard interrupt or VBR not taken into account maybe, and also your logo in the beginning will just flash briefly on faster CPUs.

If you don't care about tool-types or command line arguments, then the attached file shows how to make programs WB-friendly:

Thanks for that.  I've no clues on the keyboard thing though, I use keys to do various things in the development build of the game (and Esc takes you back to the title screen), I haven't noticed it crash, although I am aware that my keyboard handling code is very much a hack, I should probably get round to doing that properly as well but it was never a priority until now.

p.s. please report bugs on our website here so we can keep track of them all in one place!
http://www.glastonbridge.co.uk/mrbeanbag/showpost.php?id=14454
« Last Edit: January 26, 2012, 01:37:55 PM by Mrs Beanbag »
Signature intentionally left blank
 

Offline paul1981

Re: Mr Beanbag not working
« Reply #15 on: January 26, 2012, 09:06:22 PM »
Quote from: dougal;677440
Hi Mrs Beanbag.. here is the info you asked for:

1: The guru says "Beanbag Program failed (error #80000004). Wait for disk activity to finish.
2: It says this right after i click the program icon.
3: Running from workbench icon
4: No software (that i know of) in the background

I tried with NO STARTUP-SEQUENCE and then typed "loadwb" and the game loads and works fine. This is without disabling the caches or accelerator.

I'm running OS3.9

I've managed to replicate this error myself, but ONLY if using FBlit in 'Task Exclude Mode'.  So in other words, if Beanbag isn't in the Exclude list, it'll most likely fail on startup with error#80000004.
So I don't think this is a Beanbag fault at all, I believe it to be due to FBlit.

Dougal, are you using FBlit?  If so, edit the preferences of FBlit (FAllocBitMap) (Task List Options) to 'Task Include Mode' and see if you still get the error.
 

Offline dougalTopic starter

  • Hero Member
  • *****
  • Join Date: Oct 2005
  • Posts: 1221
    • Show only replies by dougal
Re: Mr Beanbag not working
« Reply #16 on: January 26, 2012, 09:20:25 PM »
Quote from: paul1981;677601
I've managed to replicate this error myself, but ONLY if using FBlit in 'Task Exclude Mode'.  So in other words, if Beanbag isn't in the Exclude list, it'll most likely fail on startup with error#80000004.
So I don't think this is a Beanbag fault at all, I believe it to be due to FBlit.

Dougal, are you using FBlit?  If so, edit the preferences of FBlit (FAllocBitMap) (Task List Options) to 'Task Include Mode' and see if you still get the error.


Yes Paul i'm using FBlit. Will have a go with your suggestion tomorrow and post results.
A1200HD- Blizzard 1230IV / 64Mb / Kick 3.1 / OS 3.9 / 20GB HD
A4000 040 @33Mhz -Kick 3.1 / 16MB
A2000 Rev4.4 - \'030 @25Mhz / 8MB / Kick 3.1 / ClassicWB
CD32 -     Stock (W/ 2 CD32 Controllers]
A500 Plus - 68000 / 2MB Chip / 2Mb Fast / 2.04/1.3 / A590 / A570
A600HD - 2MB Chip / 8MB Fast / 2GB CF HD / Kick 3.1
CDTV

PowerMac G4 1Ghz (MorphOS / Leopard)

[url]http://amigamap.com/us
 

Offline Mrs Beanbag

  • Sr. Member
  • ****
  • Join Date: Sep 2011
  • Posts: 455
    • Show only replies by Mrs Beanbag
Re: Mr Beanbag not working
« Reply #17 on: January 26, 2012, 09:30:38 PM »
I've cleaned up my WB init code using Leffmann's source, you can download the patched version here:
http://www.glastonbridge.co.uk/mrbeanbag/downloads/BeanBag_PatchOS3_9.lha

I don't know if it will make a difference after Paul suggested that FBlit may be the culprit, but I did realise that I was opening dos.library before calling the initialisation code, so it could also be that OS3.9 doesn't like that for some reason.

EDIT: strange if it's FBlit though, the game doesn't use any OS blitter functions, only hits the hardware directly.  Except for "ownblit" at the start and "disownblit" at the end!  If anyone has any hints and tips for making it play nicely with FBlit they will be gratefully received.
« Last Edit: January 26, 2012, 09:41:25 PM by Mrs Beanbag »
Signature intentionally left blank
 

Offline ChaosLord

  • Hero Member
  • *****
  • Join Date: Nov 2003
  • Posts: 2608
    • Show only replies by ChaosLord
    • http://totalchaoseng.dbv.pl/news.php
Re: Mr Beanbag not working
« Reply #18 on: January 26, 2012, 09:40:32 PM »
@John Q. Public:
As I have said a million times before:
FBLIT is riddled with bugs and trashes many many many programs.

If you insist on running Fblit u must run it in INCLUDE mode and only include those few programs that happen to get lucky and not trigger the bugs in Fblit.

@MrsBeanbag
Fblit trashes all my games too so don't feel bad.
Wanna try a wonderfull strategy game with lots of handdrawn anims,
Magic Spells and Monsters, Incredible playability and lastability,
English speech, etc. Total Chaos AGA
 

Offline Mrs Beanbag

  • Sr. Member
  • ****
  • Join Date: Sep 2011
  • Posts: 455
    • Show only replies by Mrs Beanbag
Re: Mr Beanbag not working
« Reply #19 on: January 26, 2012, 11:53:14 PM »
oh and regarding the keyboard handler, I've had terrible difficulty finding any good information about how to read the keyboard properly, I have three Amiga programming books and none of them say anything useful on the subject :confused:

I found this post on EAB though:
http://eab.abime.net/showthread.php?p=791956

I take it that code would suit my needs, I'd need to turn the relevant interrupt back on though I guess?
Signature intentionally left blank
 

Offline paolone

  • Sr. Member
  • ****
  • Join Date: Dec 2007
  • Posts: 382
    • Show only replies by paolone
    • http://www.icarosdesktop.org
Re: Mr Beanbag not working
« Reply #20 on: January 27, 2012, 04:04:07 PM »
@Mrs Beanbag

You've got mail (well, you've got a personal message on this forum...) ;-)
p.bes

 

Offline Leffmann

  • Full Member
  • ***
  • Join Date: Feb 2011
  • Posts: 119
    • Show only replies by Leffmann
Re: Mr Beanbag not working
« Reply #21 on: January 27, 2012, 04:25:37 PM »
Quote from: Mrs Beanbag;677639
oh and regarding the keyboard handler, I've had terrible difficulty finding any good information about how to read the keyboard properly, I have three Amiga programming books and none of them say anything useful on the subject :confused:

I found this post on EAB though:
http://eab.abime.net/showthread.php?p=791956

I take it that code would suit my needs, I'd need to turn the relevant interrupt back on though I guess?


I'm guessing you pause the AmigaOS and go directly on the hardware in the game, so it's probably easier to poll the keyboard hardware manually:

Code: [Select]
     ; disable keyboard interrupts

      move.b  #%00001000, ciaaicr


poll  btst    #3, ciaaicr
      beq     poll
         
      ; read event
         
      move.b  ciaasdr, d0
         
      ; handshake
         
      bset    #6, ciaacra
      (wait 85us)
      bclr    #6, ciaacra

      (act on keyboard event)
         
      bra     poll


      ; enable keyboard interrupts before exiting to AmigaOS

      move.b  #%10001000, ciaaicr
 

Offline Mrs Beanbag

  • Sr. Member
  • ****
  • Join Date: Sep 2011
  • Posts: 455
    • Show only replies by Mrs Beanbag
Re: Mr Beanbag not working
« Reply #22 on: January 27, 2012, 06:19:49 PM »
Quote from: Leffmann;677753
I'm guessing you pause the AmigaOS and go directly on the hardware in the game, so it's probably easier to poll the keyboard hardware manually

Yes this is the case.  I shall try your code this weekend and see how it goes, but as I say it never crashed my computer although sometimes the keyboard would freeze up for a few seconds and then all the key presses would come through at once.  Weird.  I'll have to rely on you to test it for me though.

Oh and sorry to use you as a kind of living coding reference here but could you give me some idea of how to use UnLoadSeg?  I take it this is the right function to use, basically the problem is, Mr Beanbag's executable is compressed in my own format, the decompression header reserves some memory, decompresses the data into it, and then jumps into it.  But that leaves the compressed data still sitting in memory, uselessly.  I want to be able to free it back up since it's not used anymore, but it's part of the executable.
Signature intentionally left blank
 

Offline marcfrick2112

  • Hero Member
  • *****
  • Join Date: May 2003
  • Posts: 811
    • Show only replies by marcfrick2112
Re: Mr Beanbag not working
« Reply #23 on: January 27, 2012, 08:20:03 PM »
Hmm, oddly Mr. Beanbag now runs without any Guru's on my 1260.. I usually have to disable caches to run it.

I have GOT to say, while a hard game to me, it is VERY fun, and nicely polished...

I have the icon left out on my WB screen, 'nuff said...
---------------
Marc Frick
---------------
A1200T / \'060, 256MB, CD-R, OS3.9
A4000 w/ WarpEngine / 82MB , OS3.1
A4000 16MB, OS 3.9
A1200 , \'030 / 10MB
A1200 (stock)

CD32 :)

...And a very sick 4000T
 

Offline Leffmann

  • Full Member
  • ***
  • Join Date: Feb 2011
  • Posts: 119
    • Show only replies by Leffmann
Re: Mr Beanbag not working
« Reply #24 on: January 27, 2012, 11:30:51 PM »
Quote from: Mrs Beanbag;677770
Oh and sorry to use you as a kind of living coding reference here but could you give me some idea of how to use UnLoadSeg?  I take it this is the right function to use, basically the problem is, Mr Beanbag's executable is compressed in my own format, the decompression header reserves some memory, decompresses the data into it, and then jumps into it.  But that leaves the compressed data still sitting in memory, uselessly.  I want to be able to free it back up since it's not used anymore, but it's part of the executable.

If the compressed data occupies a section of its own then you should be able to unlink that section from the seglist and UnLoadSeg it, but I haven't actually experimented with it.

An executable is scatter-loaded into memory into a seglist, which is a singly linked list where each segment holds each section of your executable. At offset -4 of each segment you have the size of the whole segment in bytes, at 0 you have a BPTR to the next segment, or 0 if it's the last, and at 4 comes the contents of that section. If you unlink the segment with the compressed data and call UnLoadSeg on it then it should be freed correctly.

Have you looked into in-place decompression? AmigaOS supports BSS after any section, so you can have f.ex a 50K file load into the beginning of 100K of allocated space. With some margins you can decompress backwards (or move the data to the end and decompress forwards) and the decompressed data will never catch up so to speak, so any compressed data you write over has already been read in by your decompression code. This is how most compressors for executables work on the Amiga.
« Last Edit: January 27, 2012, 11:33:45 PM by Leffmann »
 

Offline Mrs Beanbag

  • Sr. Member
  • ****
  • Join Date: Sep 2011
  • Posts: 455
    • Show only replies by Mrs Beanbag
Re: Mr Beanbag not working
« Reply #25 on: January 28, 2012, 12:19:48 AM »
I did think of that, but all too late I'm afraid, it means re-writing my compression algorithm, and then re-compressing everything... it stores the bitstream and literal bytes separately for speed.

So to get the address of the segment I just subtract 4 from the start address of the program?  There is only one segment so unlinking is trivial.  I'll give it a try, I'll know it hasn't worked if it crashes...
Signature intentionally left blank
 

Offline Leffmann

  • Full Member
  • ***
  • Join Date: Feb 2011
  • Posts: 119
    • Show only replies by Leffmann
Re: Mr Beanbag not working
« Reply #26 on: January 28, 2012, 12:17:41 PM »
Been playing with this a bit and to save you from wasting your time I can say it doesn't work reliably. It never crashes, but there's always a leak of 16 bytes when the program quits, hinting that something else could be terribly wrong.
 

Offline Mrs Beanbag

  • Sr. Member
  • ****
  • Join Date: Sep 2011
  • Posts: 455
    • Show only replies by Mrs Beanbag
Re: Mr Beanbag not working
« Reply #27 on: January 28, 2012, 03:00:22 PM »
Quote from: Leffmann;677851
Been playing with this a bit and to save you from wasting your time I can say it doesn't work reliably. It never crashes, but there's always a leak of 16 bytes when the program quits, hinting that something else could be terribly wrong.

Hmm I noticed that AMOS leaks 16 bytes every time you quit it as well, I wonder if that's doing the same thing...

I'll have a rethink of my compression algorithm, but unless I come up with something revolutionary we can probably deal with the loss of 18k...
Signature intentionally left blank
 

Offline Cammy

Re: Mr Beanbag not working with accelerator
« Reply #28 on: January 29, 2012, 07:55:36 AM »
Quote from: kedawa;677364
If you could do that, I would really appreciate it as well.
My CD32 is the only AGA Amiga that I have access to, and I'd really like to try this on real hardware.

I hope Mrs.Beanbag doesn't mind me uploading this, I can take it down if you want. I have compiled a CD32 bootable disc with Mr. Beanbag on it, including the latest executable, the Halloween demo and the new Burns Night demo.

Simply burn the ISO with any CD burning program and pop the disc in your CD32, leave it for a few seconds and the regular version of Mr. Beanbag will run. If you hold the Green or Yellow button after you put the disc in it will load the Halloween demo. If you hold the Red button it will load the Burns Night demo, and if you hold the Blue button it will run the latest executable, which is the full game but it says "Burns Night" in the menu, even though it will go to the regular map screen.

If you quit from the game, you can use the control pad to move the mouse around and click on the OK button.

You can download it here:  http://amigachristmastree.ultimateamiga.co.uk/MrBeanbag.iso
A1200 030@28Mhz/2MB+32MB/RTC/KS3.1/IDE-CF+4GB/4-Way Clockport Expander/IndivisionAGA/PCMCIA NIC
A1200 020@14Mhz/2MB+8MB/FPU/RTC/KS3.0/IDE-CF+2GB/S-Video
CD32 020@14Mhz/2MB+8MB/RTC/KS3.1/IDE-CF+4GB
A600 030@30Mhz/2MB+64MB/RTC/IDE-CF+4GB/Subway USB/S-Video/PCMCIA NIC/USB Numeric Keypad+Hub+Mouse+Control Pad
A500 000@7Mhz/512kB+512kB/ROM Switcher/KS3.1+1.3/S-Video

Get AmigaOS
 

Offline Mrs Beanbag

  • Sr. Member
  • ****
  • Join Date: Sep 2011
  • Posts: 455
    • Show only replies by Mrs Beanbag
Re: Mr Beanbag not working with accelerator
« Reply #29 from previous page: January 29, 2012, 02:27:55 PM »
Quote from: Cammy;678074
I hope Mrs.Beanbag doesn't mind me uploading this, I can take it down if you want. I have compiled a CD32 bootable disc with Mr. Beanbag on it, including the latest executable, the Halloween demo and the new Burns Night demo.

Simply burn the ISO with any CD burning program and pop the disc in your CD32, leave it for a few seconds and the regular version of Mr. Beanbag will run. If you hold the Green or Yellow button after you put the disc in it will load the Halloween demo. If you hold the Red button it will load the Burns Night demo, and if you hold the Blue button it will run the latest executable, which is the full game but it says "Burns Night" in the menu, even though it will go to the regular map screen.

If you quit from the game, you can use the control pad to move the mouse around and click on the OK button.

You can download it here:  http://amigachristmastree.ultimateamiga.co.uk/MrBeanbag.iso

Oh oops, I forgot to put the menus back!  Silly me.  That means you also won't get codes/continues.  Some people would like that though.

No I don't mind at all.  As a priority I should get the "special stages" menu working so there'd be no need for all this red button/green button stuff.
Signature intentionally left blank