Games in Progress: 3 | Players logged in: 3 | Players Registered: 37413 | Games Played Total: 68656
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Rate at which the store turns smithore into mules  (Read 630 times)
Keybounce
Prototype Tester
Mule Senior
****
Posts: 170


View Profile
« on: February 18, 2010, 10:05 »

According to Korah:
Quote
The MULE manual states that it takes the Store an entire turn to build MULEs, so any Smithore sold during trading cannot be used in this fashion.***

I've seen the store build 8 new mules immediately on being sold smithore, without having to wait a turn first.
Logged
Peter
Turborilla
Administrator
Mule Expert
*****
Posts: 379


Planet M.U.L.E. Team


View Profile WWW
« Reply #1 on: February 19, 2010, 07:34 »

Actually I haven't seen this in the documents I have. Could anyone verify how mule building works in the Atari and C64 version of the original Mule?

Currently Planet Mule can use all smithore in the store at the end of the round to build mules. However it can only build 8 mules while the original game built as many as possible. This will be changed with the next version though as stated in a previous post.
Logged

piete
Prototype Tester
Mule Senior
****
Posts: 156



View Profile
« Reply #2 on: February 19, 2010, 10:08 »

You can find the assembly code of Atari Mule here: http://bringerp.free.fr/RE/Mule/downloads.php5

Look at the subroutine starting at address 339A (bolding and italic comment by me):

339A ; ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ S U B R O U T I N E ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
339A
339A
339A buildAndCalcPriceMule:        ; ...
339A   LDA   goodsStoreNb+2
339D   LSR   A                     ; // construction des mules
339D                               ; int nbMulesBuildable = goodsStoreNb [Smithore] / 2 that is, upper limit is the amount of smithore (taking into account the store limit 3 rows below)
339E   BEQ   calcMulePrice         ; if (nbMulesBuildable != 0) {
33A0   STA   byte_80
33A2   LDA   #14                   ;   // le store contient 14 mules au max
33A4   SEC
33A5   SBC   goodsStoreNb+4        ;   int nbMulesMissingInStore = 14 - goodsStoreNb [Mule]
33A8   BEQ   calcMulePrice         ;   if (nbMulesMissingInStore != 0) {
33A8                               ;
33AA   CMP   byte_80               ;     int nbMulesToBuild = nbMulesMissingInStore
33AC   BCC   loc_33B0              ;     if (nbMulesToBuild >= nbMulesBuildable ) {
33AE   LDA   byte_80               ;       nbMulesToBuild = nbMulesBuildable
33AE                               ;     }
33B0
33B0 loc_33B0:                     ; ...
33B0   ASL   A                     ;     // A contient le nb de mules qui peuvent
33B0                               ;     // etre construites par rapport au smithore dispo
33B0                               ;     // 1 MULE prend 2 SMITHORE
33B1   STA   byte_88               ;     nbSmithoresForBuild = nbMulesToBuild * 2
33B3   LDA   goodsStoreNb+2
33B6   SEC
33B7   SBC   byte_88
33B9   STA   goodsStoreNb+2        ;     goodsStoreNb [Smithore] -= nbSmithoresForBuild
33BC   LSR   byte_88
33BE   LDA   goodsStoreNb+4
33C1   CLC
33C2   ADC   byte_88
33C4   STA   goodsStoreNb+4        ;     goodsStoreNb [Mule] += nbMulesToBuild
33C4                               ;   }
33C4                               ; }
33C7
33C7 calcMulePrice:                ; ...
33C7   LDA   goodsPrice+4          ; // calcul du nouveau prix des mules
33CA   LDY   goodsPrice+5          ; Y/A = GOODS_PRICE [SMITHORE]
33CD   LDX   #5
33CF   JSR   div16Bits             ; Y/A /= 5
33D2   LDX   #10
33D4   JSR   mul16BitsBy8Bits      ; Y/A *= 10
33D4                               ; // Y/A = GOODS_PRICE [SMITHORE] * 2
33D7   STA   mulePriceL
33DA   STY   mulePriceH            ; mulePrice = (goodsPrice [Smithore] - goodsPrice [Smithore] % 5) * 2
33DD   RTS
33DD ; End of function buildAndCalcPriceMule
« Last Edit: February 19, 2010, 10:15 by piete » Logged
trouba
Mule Regular
***
Posts: 37


View Profile
« Reply #3 on: February 19, 2010, 11:57 »

Wow, I didn't know I still can read 6502 assembler - didn't do that for almost 20 years Cheesy

So, for non-programmers - the Atari version builds MULEs from ore in no time, too.
Logged
piete
Prototype Tester
Mule Senior
****
Posts: 156



View Profile
« Reply #4 on: February 19, 2010, 17:04 »

As if the game itself wasn't nostalgic enough! I'm not a programmer, but when I (re)start to study programming (during my retirement), I will (re)start from 6502 assembly! Smiley
Logged
Pages: [1]
  Print  
 
Jump to: