Main Menu

Power Bobs

Started by Hungry Horace, 12 Nov, 2008, 10:28 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Tormentor

Thx i will test it.

MichaelVParent

I just tested it and it seems to work perfectly.  no pause, no screen with text, no wait for button press.

Great job Hungry Horace!

Lets please give this Nag-Free version a permanent place as a hosted file here at AmosFactory.

cheers.
Mike

Lonewolf10

Nice work Hungry Horace ;)

I shall download and add it to my pile of AMOS stuff  ;D


Quote from: MichaelVParent on 03 Aug, 2015, 10:05 PM
I just tested it and it seems to work perfectly.  no pause, no screen with text, no wait for button press.

Have you tried compiling something with Power Bob instructions in it?


james666

#18
As noted above, the AmosPro "magic numbers" make it rather awkward.  From the extension structure I inferred that the cold start routine starts at $6DC.  Dissembling from here, I get the following code:

MOVEM.L    A3-A6,-(SP)
LEA    (lbL000298,PC),A3    * store address of datazone
MOVE.L    A3,($1B8,A5)
LEA    (lbL000024,PC),A0    * store address of default/run routine
MOVE.L    A0,($1BC,A5)
LEA    (lbL000024,PC),A0    * store address of cleanup routine (same as default/run)
MOVE.L    A0,($1C0,A5)
MOVEM.L    (SP)+,A3-A6
MOVEQ    #12,D0            * Move extnb-1 to d0 - extension loaded OK.
RTS

lbL000024   
LINK.W    A3,#-$20
BSR.W    lbC00012A    * bsr to nag screen routine - replace this with $4E714E71 to skip   
dl    $FE31001D    * AmosPro Rbsr
dl    $FE31000A    * AmosPro Rbsr
.
.
.

lbC00012A is the nag screen routine (easily identified by the text) so I found I could skip it simply by replacing the "BSR.W lbC00012A" with two NOPs.  This can be done by loading the extension binary into a hex editor, going to location $704 and replacing $61000100 with $4E714E71.

james666

On closer inspection I was able to identify the specific code that opens the nag screen and prints the message.  It's interesting that everything is done with internal amos.library calls. I wasn't aware that these were documented back in the day.  The equ.s file on the AmosPro tutorial disk has the equates for these functions but doesn't explain the input parameters.  The note at the top of the file just says "Be patient, we will soon (I hope) publish informations about the functions of the amos.library."


L0 MOVEM.L A3-A6,-(SP)
LEA (MB,PC),A3
MOVE.L A3,($1B8,A5) * store address of datazone
LEA (default,PC),A0
MOVE.L A0,($1BC,A5) * store address of default/run routine
LEA (default,PC),A0
MOVE.L A0,($1C0,A5) * store address of cleanup routine (same as default/run)
MOVEM.L (SP)+,A3-A6
MOVEQ #12,D0 * Move extnb-1 to d0 - extension loaded OK.
RTS

default LINK.W A3,#-$20
BSR.W nagscreen * bsr to nag screen routine - replace this with $4E714E71 to skip
dl $FE31001D * AmosPro Rbsr
dl $FE31000A * AmosPro Rbsr
.
.
.
nagscreen MOVEA.L ($1B8,A5),A2 *Dload flag from datazone
ADDQ.L #1,($5D4,A2)
BEQ.W lbC00091E *Skip nag screen if flag set
MOVE.L #6,-(A3)
MOVE.L #$140,-(A3)
MOVE.L #$C8,-(A3)
MOVE.L #4,-(A3)
MOVE.L #0,-(A3)
MOVE.L (A3)+,D5
ANDI.L #$8004,D5
MOVE.L (A3)+,D6
MOVEQ #1,D4
MOVEQ #2,D1
lbC00083E CMP.L D1,D6
BEQ.B lbC00084C
LSL.W #1,D1
ADDQ.W #1,D4
CMP.W #7,D4
BCS.B lbC00083E
lbC00084C MOVE.L (A3)+,D3
MOVE.L (A3)+,D2
MOVE.L (A3)+,D1
LEA ($95C,A5),A1
MOVEA.L (-8,A5),A0 * EcCall Cree (See wequ.s and equ.s)
JSR (12,A0) *
MOVE.L A0,($52C,A5)
MOVE.W ($BC,A0),($52A,A5)
ADDQ.W #1,($52A,A5)
MOVEA.L (-8,A5),A0 * EcCall CopForce
JSR ($20,A0) *
MOVEQ #5,D2
MOVEQ #0,D1
MOVEA.L (-12,A5),A0 * WiCall Locate
JSR ($10,A0) *
LEA (PowerBobsV10.MSG,PC),A1
MOVEA.L (-12,A5),A0 * WiCall Centre
JSR (8,A0) *
MOVEQ #7,D2
MOVEQ #0,D1
MOVEA.L (-12,A5),A0 * WiCall Locate
JSR ($10,A0) *
LEA (Unregisteredv.MSG,PC),A1
MOVEA.L (-12,A5),A0 * WiCall Centre
JSR (8,A0) *
MOVEQ #9,D2
MOVEQ #0,D1
MOVEA.L (-12,A5),A0 * WiCall Locate
JSR ($10,A0) *
LEA (PowerSoft.MSG,PC),A1
MOVEA.L (-12,A5),A0 * WiCall Centre
JSR (8,A0) *
MOVEQ #13,D2
MOVEQ #0,D1
MOVEA.L (-12,A5),A0 * WiCall Locate
JSR ($10,A0) *
LEA (PresstheEnter.MSG,PC),A1
MOVEA.L (-12,A5),A0 * WiCall Centre
JSR (8,A0) *
lbC0008D4 MOVEA.L (-4,A5),A0 * SyCall WaitVbl
JSR ($5C,A0) *
MOVEA.L (-4,A5),A0 * SyCall InKey
JSR (A0) *
CMP.W #13,D1 * Has chr$(13) been entered?
BNE.B lbC0008D4
MOVEQ #6,D1
MOVEA.L (-8,A5),A0 * EcCall Del
JSR ($10,A0) *
CLR.W ($52A,A5)
CLR.L ($52C,A5)
CMPA.L #0,A0
BEQ.B lbC00091E
MOVE.W ($BC,A0),D0
CMP.W #8,D0
BCC.B lbC00091E
ADDQ.W #1,D0
MOVE.W D0,($52A,A5)
MOVE.L A0,($52C,A5)
MOVEA.L (-8,A5),A0
JSR ($20,A0)
lbC00091E RTS

Lonewolf10

Quote from: james666
The equ.s file on the AmosPro tutorial disk has the equates for these functions but doesn't explain the input parameters.  The note at the top of the file just says "Be patient, we will soon (I hope) publish informations about the functions of the amos.library."
Yeah, I spent some time a few years back trying each of those routines and how to get them to work.

I believe I sent a copy of what I worked out to HungryHorace a year or so back. I can publish what I worked out here if you like?

james666

Quote from: Lonewolf10 on 23 Aug, 2015, 05:46 PM
I believe I sent a copy of what I worked out to HungryHorace a year or so back. I can publish what I worked out here if you like?

It would be great if it could be hosted here.  I'm sure it would help during the redevelopment work.

I was intrigued that extension writers were able to use these functions "back in the day".  Did they reverse engineer the amos libraries or was there some other official extension documentation that I missed? 

Hungry Horace

dont re-invent the wheel too much... Bruceuncle already resourced most extensions

http://www.ultimateamiga.com/index.php/topic,9794.msg46877.html#msg46877

Quote from: KillerGorillabecause winuae is made of code and your amiga is made of stuff


Lonewolf10

Quote from: james666 on 23 Aug, 2015, 06:59 PMI was intrigued that extension writers were able to use these functions "back in the day".  Did they reverse engineer the amos libraries or was there some other official extension documentation that I missed?

Francois documented the functions within a sourcefile located on one of the disks. All the info you need is in the attached file.

P.S. Apologies for the late reply.

Hungry Horace

anyone got any thoughts on why i cant get PBOBS to display my image number 101 from the bob bank?

is there a coded limit on what image numbers can be used??
Quote from: KillerGorillabecause winuae is made of code and your amiga is made of stuff


Lonewolf10

Quote from: Hungry Horace on 15 Sep, 2016, 10:54 PM
anyone got any thoughts on why i cant get PBOBS to display my image number 101 from the bob bank?

is there a coded limit on what image numbers can be used??

Did you check your AMOS configuration to ensure that you can use more than 100 Bobs?

Hungry Horace

Quote from: Lonewolf10 on 03 Feb, 2017, 10:54 PM
Quote from: Hungry Horace on 15 Sep, 2016, 10:54 PM
anyone got any thoughts on why i cant get PBOBS to display my image number 101 from the bob bank?

is there a coded limit on what image numbers can be used??

Did you check your AMOS configuration to ensure that you can use more than 100 Bobs?

Wouldn't that be for 100+ bobs displayed, and not a limit on what image number in the bank can be used?

I was trying (at the time) to convert some old (working) code to Pbobs for speed gain, and I tend to use lots of different numbers in my big banks (often with gaps) to make things easier (like all heroes on 100+, monsters from 200+, etc)
Quote from: KillerGorillabecause winuae is made of code and your amiga is made of stuff


Lonewolf10

Quote from: Hungry Horace on 14 Feb, 2017, 10:24 PM
Quote from: Lonewolf10 on 03 Feb, 2017, 10:54 PM
Did you check your AMOS configuration to ensure that you can use more than 100 Bobs?

Wouldn't that be for 100+ bobs displayed, and not a limit on what image number in the bank can be used?

Hmph, I was clutching at straws and was probably a bit sleepy when I wrote that  ;D

My current project (almost finished) uses just under 500 bobs in the bob/sprite bank, with a handful of sprites at the end. I am however using the normal Bob command. I have 3 thought's:

1) Your 'Bob' is actually a sprite

2) Pbobs is bugged and won't go past 100

3) I *may* have a partial fix to a part of AMOS that you don't have - or don't have installed.

Hungry Horace

#28
I suspect a pbobs bug tbh!

Usually the simplest answer is the true one!


At some point maybe I'll look at the pbob code again
Quote from: KillerGorillabecause winuae is made of code and your amiga is made of stuff


Lonewolf10

#29
Ok, I just did some testing on my project. I loaded it in saved it under a different name (added "-Pbob" to filename) then converted all Bob instructions to Pbob. Everything worked until it found the first Pbob instruction then it flagged an error.

Confused, I dug up the Pbob documentation. I found the following:

Pbob NR,X,Y,IMAGE
Does almost the same thing as the normal Bob command.
The only differences are :
1) the maximum width of the IMAGE is 32 pixels wide.
    There are no restrictions on the height of the Pbob.

2) the height of the IMAGE that will be displayed may NOT exceed
    the maximum height for this Pbob.
    See the Pbob Height command.

3) the amount of colours of the IMAGE may NOT exceed the amount
    of screen colours where the Pbob will be displayed.
    Else a crash is certain!
    So if you open a screen with 4 colours, do not try to display a Pbob
    with 8 or more colours. But it is valid to, for example, to open a screen
    with 32 colours and display Pbob's with fewer colours (bitplanes).
    Only the bitplanes defining the Pbob will be copied on screen.
   

4) all parameters must be included.

5) the Pbob numbering starts at 1, not 0 like the AMOS/Pro Bobs...

6) it is important to know that the coordinates for the Pbob's are
    measured from the top left-hand corner of the image.
    The current hot spot setting in not taken into account!

7) the Pbob commands have to be executed in the screen where they are
    to be displayed !
    This is because a part of the Clipping routine is done inside the
    Pbob command.
    Ex.:
Repeat
       Screen 1
   Proc UPDATE_SCORE
   Screen 0
   Proc MOVE_BADDIES : Rem move the BAD_GUYS with Pbob NR,X,Y,IMAGE
   Proc MOVE_GOODIE : Rem  move the GOOD_GUYS with Pbob NR,X,Y,IMAGE
   Proc UPDATE_BADDIES_AND_GOODIES : Rem Pbob Clear : Pbob Draw : Screen Swap : Wait Vbl
Until AMOUNT_OF_GOODIES=0


My bob images are 60x60. So that's why it won't work with my existing bobs.