geekboy1011 wrote:
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.
Yeah, but you have a lot of other routines and cool things that you could take advantage of. Smile I hope you stick with it.
Probably will unless the code becomes to massive for a program and it needs to be converted to an app.

Now comes the trickier parts though, actually making a working engine. Guess I should solidify on my graphics format and some math. Still have no idea how I'm going to process placing every thing on the screen or where on the screen its going in game....at least I have 4 levels of grey to help differentiate things with.

Cursor
Off tiles
On Tiles
Overlay tiles

Hey look just enough colors for every thing Wink
Hey look we now have a crappy textmapper!




Oh and here is the crap code that makes it work.(minus the sprite routine and such)


Code:

TextOut:
 
;
; assumes a standards null termed string
;out puts text into the black buffer
; pointer to string to put out
;d = x
;e = y
 push de        ; save xy
  ld a,(bc)     ;ld a with first letter in the string
  inc bc        ; inc for next iteration
  or a
  jp z,_null
  cp $20         ; if
      ; less than 32 (aka null) then abort
  jp z,_space   ; if 32 add space
  sub $41        ; subtract 41 to properly reflect my table
  ld hl,LetterLut ; ld hl with table
  ld d,0
  ld e,a       ; add a to hl
  add hl,de    ;2 bytes per entry so we add it twice to compensate
  add hl,de    ;
  ld a,(hl) \ inc hl \ ld h,(hl) \ ld l,a ; load sprite pointer into hl
  ld a,(hl)    ; save letter width to scrap+3
  ld (scrap+3),a
  inc hl    ; in to actual letter data
 pop de     ;resotre x y
 push bc  ; save string pointer
  push de    ; save x y again
   push hl   ; save sprite pointer
   pop ix    ; into ix
    push ix  ; save sprite pointer
     ld a,d  ; load a with x val
     ld bc,appbackupscreen ; load bc with buffer
     call putsprite8xb     ; draw
   pop ix    ;restore sprite pointer
  pop de     ; restore x y
   push de   ; resave xy
    ld a,d   ; save x in a
    ld bc,plotsscreen   ; load bc bufer
    call putsprite8xb   ; draw
   pop de    ; restore x y
   ld a,(scrap+3) ; load a with sprite width
   add a,d   ; add sprite width to x
   ld d,a    ; save
  pop bc     ; restore string pointer
  jp textout ;
 _null:
 pop de      ;restore stack
 ret         ;return
 _space:
 pop de
  ld a,6
  add a,d
  ld a,d
 
  jp textout
Ok I am in need of some help again.

http://pastebin.com/cmy848H4

When I run the code in this paste it goes threw the first iteration correctly I believe. After that when it calls dgetcharwidthlocfroma it just spazzes I think I'm handling the pages wrong but I cant tell :/
ld d,a \ out (6),a

Errr, loads go right to left. Wink
..... this just proves I need to get more sleep at night....

That did it now just to fix some stupid bugs with the decompressor.... then it works!

(although I get these cool hieroglyphs atm look really cool ^_^)
geekboy1011 wrote:
..... this just proves I need to get more sleep at night....
Hehe, I've made many a silly ASM error of the same ilk in my day, fear not.
OK this is not working at all its supposed to put the letter "m" on the screen using the dcs font. But it doesn't instead it displays gibberish


Code:
Start:
 
 ld a,1
 ld (bitflag1),a   ; set it to always be a wide char for lazyness and since we know thats what we want
 ld a,"m"
 call dgetcharwidthlocfroma
 ld a,d
 out (6),a
 inc hl
 push hl
 pop ix
 ld e,1
 ld a,1
 ld bc,gbuf
 call putsprite8xb
 call ifastcopy
haltt:
 halt
 jp haltt
 
putsprite8xb:
; inputs | A = X | E = Y | IX + sprite pointer | BC = Buffer | XxNTemp = width | XnNtemp2 = Hight
; draws a B' x C' sprite onto the screen at A E
 push bc
  push af ;LD A,(bitflag2)
   xor a
   ld (bitflag2),a
  pop af
  ld   h,$00       ; zero h
  ld   d,h         ;zero D
  sla e         ;y*2
  sla e         ;y*4
  ld   l,e         ;ld l with Y
  add   hl,de   ;faster:y*8
  add   hl,de   ;faster:y*12
  ld e,a         ;ld e with x
  srl   e       ; x/2
  srl   e       ;x/4
  srl   e       ;x/8
  add   hl,de
 pop   de      ; restore buffer into DE
 ld B,5       ; load b with hight which will always be 5
 add   hl,de
 and 7           ;if alinged skip to put sprite
 ld c,a          ;save ^ to C
_4:
 ld a,(bitflag1)         ; checks for 4 or 5 bit sprite
 or a                    ;
 jr nz,_incix             ; if set jp to inc ix always
 
 ld a,(bitflag2)         ; check if we need to shift of just mask
 or a                    ; if 1 rotate
 jr z,_rotate4
 xor 1
 ld (bitflag2),a         ; toggle flag
 ld a,(ix)               ; else mask second nibble
 and %11110000
 ld d,a
 jr putspriteloop1
_incix:
 inc ix
 ld d,(ix)
 jr putspriteloop1
_rotate4:
 xor 1
 ld (bitflag2),a
 ld a,(ix)
 sla a
 sla a
 sla a
 sla a
 ld d,a
 inc ix
putSpriteLoop1:
 ;ld   d,(ix)      ; load D with first byte of sprite ; commented out handled below
 ld   e,$00       ; zero E incase of alignment
 ld a,c          ; load a with IF aligned value
 or a            ; if zero skip aligner
 jr   z,putSpriteSkip1   ; blaaaahhhh
putSpriteLoop2:
 srl   d           ; move d to the right one throw bit 0 in cary
 rr   e           ; rotate carry into E
 dec   a           ;dec a and repeat till alinged
 jr   nz,putSpriteLoop2
putSpriteSkip1:
 ld   a,(hl)     ;load a with byte of buffer
 or   d          ; or a with the value of D
 ld   (hl),a     ; load buffer with or'd value
 inc   hl         ;in location on buffer
 ld   a,(hl)     ; load a with byte on buffer
 or   e          ; or buffer with E
 ld   (hl),a     ; put back on buffer
 ld   de,$0B     ;load b with 12
 add   hl,de      ; move to next row on buffer
 djnz _4
 ret
 
 
 
 


Problem is most likely in the sprite routine but I cant figure out where if at all :/
Not exactly knowing how to use everything, but perhaps you could use
Code:
ld a,'m'
Unfortunately, that is the only thing I can think of.
I wish it were that simple but nope :/ displays the same thing (kinda expected it to...)
It actually would be more correct to use single-quotes for a one-character string, but regardless, let's take a look at your code. You know that it works correctly for nibble-packed, 4-px-and-narrower characters, right? If so, we can examine only the execution paths for wide characters.

Umm. This is sorta my fault. Sad I think I didn't tell you the following very important piece of information:

WideSprite:
.db 0xf0 | width
.dw ptr_to_data
Well that there did fix it! Now my title screen is less confusing and I can start the menu system!

(Personal choice to do things in the order I see them in a game as its easier for me to watch it all come together that way)


Oh, the epic success! Very Happy I'm sorry I held you back unintentionally for so long. Sad Here's top more progress!
*Too
But anyway not an issue. Was not all for naught I actually learned a great deal form this endeavor. Like how to use rotations, page mapping, and also to comment your code a lot more . ESPECIALLY when you do a lot of conditional jumping based off of custom flags...
Yes, that's extremely important. Smile May I actually recommend that you rename your flags to something more descriptive of what they do?
Probably should. Probably won't. Bad habits Razz I'll probably do it when I go to comment the code the rest of the way. Needs to be done so I don't forget it later my self xD


EDIT: Did and done.....tis a bit easier to read I guess Razz


EDIT2: Random info for fun: curtisy of Spasm -S

Number of labels: 4672
Number of defines: 17
Code size: 1351
Data size: 201
Total size: 1552

I think it's counting my .dbs as labels xD
Im bored, procrastinating, and being lazy so I decided to share some random info on what I am currently "working" on in this project

That would be the menu system yay!! </sarcastic>
Anyway I'm dynamically generating menus off the external level pack format because I can. This format is as followed

# Levels/entries in pack/menu ;1 byte
Title ;7letters max padded to always be 7 bytes with spaces nullterm for the 8th byte ; * bytes
Width/Height ; 2 bytes
Bitmap ; 16x16pxl bitmap regardless of entry size 32bytes
Time ;fastest scored time on level all 0's in a normal menu entry ;3bytes
#play ;1 bytes
Jumptable offset ;used to move to the next menu or preform an action ; 1 byte

47bytes per Level/Menu entry +1byte for amount of entries in file

Not to bad I think
Niftysauce! Geekboy, try running your program through BranchMap to see how it compares to Spasm's output?
lets see branch maps says!

Project Statistics
Total branches: 90
Total calls: 47
Total bcalls: 4
Total labels: 115

guess spasm likes reading into .inc files to much XD
That's what it looks like to me. Very Happy Silly SPASM, although I guess it wants to count both code includes and "header" includes as labels; perhaps it can't quite tell the difference?
  
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 2 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