heres the current code for my map generator for SC

I know there isn't nearly enough error checking, however, that isn't a problem yet because for some reason the code that would present the possibility of errors doesn't actually seem to get called (popisland), so any help would be appreciated.


Code:
.nolist
#include "dcs6.inc"
_strcpy   =$44E3
_MultAbyE   =$8042
OCEAN       =$00
LAND      =$00
.list
   .org progstart
#IFDEF TI83P
   .db $BB,$6D
#ENDIF
INIT:
   xor d
#IFDEF TI83P
   .db $C9
#ENDIF

   jr Start
   .dw $0000
   .db $06,$00
   .dw Icon
   .dw $0000
   .dw $0000
Icon:            ;a 16x16 icon
   .db $3C,$09,$66,$3F,$C3,$7E,$C1,$10,$60,$00,$3C,$3E,$06,$63,$83,$41
   .db $C3,$40,$66,$40,$3C,$C1,$01,$63,$76,$3E,$FF,$81,$FF,$8E,$63,$1F
START:
   bcall(_cleargbuf)
   bcall(_ClrLcdf);
   call seed
   call iFastCopy
   call pause
   ret

seed:
   ld b,10
   call iRandom
   ld b,a
   inc b
   inc b
   inc b
   inc b
   inc b
   inc b
   inc b
   inc b
   inc b
   inc b
   ld a,b
   ld (numseeds),a
seedjump:
   push bc
   ld b,60
   call iRandom
   inc a
   inc a
   ld e,a
   ld b,92
   call iRandom
   inc a
   inc a
   ld (coordx),a
   ld a,e
   ld (coordy),a
   call iGetPixel
   OR (HL)
   LD (HL), A
   call popisland
   pop bc
   djnz seedjump
   ret   

popisland:
   ld a,(numseeds)
   ld e,a
   ld d,0
   ld hl,25
   scf
   ccf
   sbc hl,de
   ld a,l
   ld (mdist),a
   ld e,a
   ld h,a
   call H_Times_E
islandloop:
   push hl
   ld a,(mdist)
   ld b,a
   call iRandom
   ld e,a
   ld a,(coordy)
   add a,e
   ld e,a
   ld a,(mdist)
   ld b,a
   call iRandom
   ld b,a
   ld a,(coordx)
   add a,b
   call iGetPixel
   OR (HL)
   LD (HL),A
   pop hl
   dec hl
   cp l
   jr z,islandloop
   ret
   
numseeds:
   .db 0
coordx:
   .db 0
coordy:
   .db 0
mdist:
   .db 0

H_Times_E:           ; HL = H × E
   LD     D, 0       ; Zero D and L
   LD     L, D
   LD     B, 8
_loop:
   ADD    HL, HL     ; Get most-significant bit of HL
   JR     NC, _skip
   ADD    HL, DE
_skip:
   DJNZ   _loop
   RET
 
.end
END
after some help from Jim E I now have a working version for ION only, but I can't get it to work properly once integrated into the Strategic Conquest source
What was the problem? And does it work as a standalone for DCS?
yes, the ion only program works in DCS, but once I try integrating it into stratcon it won't display anything...
Nothing at all? I mean trying giving the Ion-only program a DCS header instead and seeing if it still works.
KermMartian wrote:
Nothing at all? I mean trying giving the Ion-only program a DCS header instead and seeing if it still works.


it does.
OK then, post up the complete SC code. I believe that the code is probably not getting called at all for some reason.
our router is fried as of yesterday morning, so my computer with the source is unavailable Sad
Well, post it when you get home. It's probably something silly like a missing ifastcopy or something. Smile
I checked that repeatedly, it even pauses like its supposed to at the end after the normal 10 second pause, but nothing is drawn on screen
Hnmm, 'tis indeed passing strange. I look forward to solving it once I see the source code that's causing this problem this evening. Smile
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement