So back when Axe first came out I decided I would attempt to make a PiCross clone. Well I failed horridly at axe and eventually managed to pick up asm which is what I am now writing this in, so here we go!



So far not to much is done. I have most of my graphics routines done. and 2 of the underlying support routines done.

ToDo list (in no particular order):
Features:
- external levels
- overlay mode
- highscores
Everything else:
-rendering of levels
-code to check for level completion
-code to handle input
-...why am i typing this huge list of things out





Needless to say a lot still needs to be done but were getting some where!
*Too much, *And two, *somewhere. But your spelling and grammar is magically getting much better! Perhaps our nagging is helping. Wink

I'm very happy that my masked sprite routine is helping, and I hope you'll both continue to ask us all of your ASM questions in your topic or in the channel, and keep us abreast of your progress.
I plan on it. I'm on the hunt for a line routine currently but I think runer/axe has one that will work for me. This is slowly looking like it may be a possible nostub game...I have yet to use any calls outside of my own xD
geekboy1011 wrote:
I plan on it. I'm on the hunt for a line routine currently but I think runer/axe has one that will work for me. This is slowly looking like it may be a possible nostub game...I have yet to use any calls outside of my own xD
I strongly recommend Doors CS!

http://dcs.cemetech.net/index.php?title=Fastline
Issue with that is I can not change the buffer its drawn to. The way I am doing the grey scale is just by altering what buffer everything is drawn to. Sadly I don't get that option with Fastline
geekboy1011 wrote:
Issue with that is I can not change the buffer its drawn to. The way I am doing the grey scale is just by altering what buffer everything is drawn to. Sadly I don't get that option with Fastline
Ah, that's an excellent point. Sad The MirageOS libraries that Doors CS emulates let you select what buffer address you want to copy to the screen from using my super-spiffy interrupt-aware iFastCopy routine, but sadly, the line and rectangle routines don't provide the same flexibility. Sad
Which is a big bummer but tis ok. Im just hoping I have enough executable code space for the entire game. its filling up fast xD (compiled program is ~900bytes only 64bytes of that is graphics and other things)
geekboy1011 wrote:
Which is a big bummer but tis ok. Im just hoping I have enough executable code space for the entire game. its filling up fast xD (compiled program is ~900bytes only 64bytes of that is graphics and other things)
Since you're planning on grayscale, hopefully you can push the bulk of the program, namely the grayscale sprite and graphics data, up above $C000 with enough room for your code, as you said. Smile I vote that you make it a DCS program anyway if you so decide. Also, I'm required by my conscience to say this: since this is your first ASM game, if you get frustrated or roadblocked, I strongly recommend you put this aside for a week or two, write and complete a simpler, perhaps monochrome, game or program, then pick this up again. If progress goes well, though, by all means carry on.
You mentioned the other night that you may want some help with redoing small pieces of your code (namely, the part does does all the drawing), and I'd still be glad to help out. Also, I could have sworn that one of the MirageOS routines let you choose what piece of RAM you wanted to use. Hmm, guess not. I guess I was thinking about the one that let you choose what buffer iPutSprite goes to :/
If I can not figure it out on my own I will gladly ask for help. ... or if i just get lazy which ever comes first >.> <.<

I got lazy/stupid

I need help optmizing this.


Code:
DrawgreyS:
;a color grey 1 light 2 dark 3 white 4 black
; b= y coordinate
; E = x coordinate
; IX = address of spritemask
; IX + 8 = address of sprite
; ix + 16 adress of white sprite mask
; IX + 24 Adress of sprite in white.
;takes these inputs and draws a sprite to the screen based on how what color you specify it to be. Is only called by IM phase 2 if called else where destroys everything
 cp 1   ;
 jr z,_LightG
 cp 2
 jr z,_DarkG
 cp 3
 jr z,_WhiteG
; start black here
 ld a,b
 ld l,e
    push af  ; save registers as putspritemask kills them
        push hl
            push ix
             ld de,appbackupscreen        ;load first buffer(
             call imPutSpriteMask     
         pop ix
      pop hl
   pop af
 ld de,plotsscreen
 call imPutSpriteMask
 ret
;a = X-coordinate of upper-left of sprite
;b = Sprite height, in pixels
;l = Y-coordinate of upper-left of sprite
;ix = Pointer to first byte of sprite
_WhiteG:
 ld a,b
 ld l,e
 ld de,16
 add ix,de
 push af
      push hl
          push ix
              ld de,appbackupscreen
              call imPutSpriteMask
          pop ix
      pop hl
  pop af
 ld de,plotsscreen
 call imPutSpriteMask
 ret
 
_lightG:
 ld a,b
 ld l,e
 push af
      push hl
          push ix
              ld de,appbackupscreen
              call imPutSpriteMask
          pop ix
          ld de,16
          add ix,de
      pop hl
  pop af
 ld de,plotsscreen
 call imPutSpriteMask
 ret
 
 
_DarkG:
 ld a,b
 ld l,e
 push af
     push hl
         push ix
             ld de,plotsscreen
             call imPutSpriteMask
         pop ix
         ld de,16
         add ix,de
     pop hl
 pop af
 ld de,appbackupscreen
 call imPutSpriteMask
 ret
Well I got Iambian to help me. Its slower then what I had but much smaller so. I'm happy with it.


Code:
;            0123
;in: A=color(BLDW),B=curY,E=curX
;IX=Sprite: +00=sprmask +08=sprite +16=whitemask +24=spriteinwhite
 
DrawgrayS:
 ld c,e    ;save curX to C for later storage
 ld de,plotsscreen      ;first ref buffer
 ld hl,appbackupscreen  ;second ref buffer
 push bc
  cp 2
  jr nz,$+3
  ex de,hl
  cp 3
    push de
    jr nz,$+7
    ld de,16
    add ix,de
       push ix       ;save secondary buffer
       ex de,hl     ;put primary buffer to DE
        push af
          ld L,c
          ld a,b
         call imPutSpriteMask
       pop af
     pop ix
   and %00000011
   jp pe,$+8     ;odd number of bits (1 or 2, not 0 nor 3), dont jump
   ld de,16
   add ix,de
  pop de
 pop bc
 ld L,c
 ld a,b
 jp imPutSpriteMask
Oh god, with the freaking $+N, don't oh please don't do that. Use labels or I will stab you with a calculator for making life unnecessarily difficult. I see a few more optimizations I can suggest after that.
Tis not my code its Iambians. That just makes sense to him....Cadan's source is riddled with them X.x

Ill see what I can do right after I solve this grey scale issue I am having
geekboy1011 wrote:
Tis not my code its Iambians. That just makes sense to him....Cadan's source is riddled with them X.x

Ill see what I can do right after I solve this grey scale issue I am having
I know, when I was consulting with the Celtic III code I had to spear my eyes with all of those. Tell me more about this grayscale issue, and perhaps you have a screenshot?
Grayscale issue was me messing up a value. it was calling my empty mapper like 200 times every second or so X.x

as for Iambian's Code. We now have lables Instead of relative adressing. ^_^
(I apologize for crappy tabbing....)

Code:
DrawgrayS:
 ld c,e          ;save curX to C for later storage
 ld de,plotsscreen      ;first ref buffer
 ld hl,appbackupscreen  ;second ref buffer
 push bc         ; save x,y
  cp 2           ; if not light grey jump to _1 $+3
  jr nz,_SkpLightBufPrep
  ex de,hl       ; put abs in de and pss in hl
    push de      ; save pointer to abs
_SkpLightBufPrep:   ;
    cp 3         ; if not white
     jr nz,_DrawFirstSprite    ; jump to _2 $+7
     ld de,16    ;
     add ix,de   ; inc ix to second sprite
     push ix      ;save secondary sprite
_DrawFirstSprite:     ;jumped to if sprite is black or light grey or dark grey
    ex de,hl     ;put pss back in de hl is empty for all signifigant purposes
    push af      ; save a
     ld L,c      ; load x,y to proper vals for imputspritemask
     ld a,b
     call imPutSpriteMask
    pop af       ; restore a
   pop ix        ; restore sprite pointer
   and %00000011 ;
   jp pe,_SkpSpriteIncForWDG      ;odd number of bits (1 or 2, not 0 nor 3), don't jump $+8
   ld de,16      ; if it was not inc earlier inc sprite pointer now
   add ix,de
  pop de         ; restore buffers
 pop bc          ; restore x y
 ld L,c          ; put where they belong
_SkpSpriteIncForWDG:    ;jumped to if sprite is not black
 ld a,b          ; load a with neede value
 jp imPutSpriteMask  ; jp to imsprite and ret
The labels are still non-descriptive. If you're going to use them like that,why not use anonymous labels? I find that they're more powerful, and they won't clutter up your namespace.

Also, nice to see the grayscale is now better Smile
In all honesty I have no idea *how* this code works yet I am reading/learning that now. All I currently know is it works....it will be spiffed up and better commented/labled in my source when all is said and done lol
Yay Double posts.



A proper title screen now. Will get one more thing added to it eventually, but for now I like it.

now to go work on the actual engine xD
Do I see some fades in there? That looks great, if so. Smile And I'm happy that you're running it from Doors CS. Do you need help designing an icon?
Fades as in abusing greyscale to make a line look like its fading? Then yes.

Probably. Have not put to much thought into the icon as currently it may not stay DCS . It may have to be converted to an app due to code length restriction things, And the fact that it only uses DCS's quit to shell routine which means it could easily be adjusted for no shell as of now.
  
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 2
» 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