Author |
Message |
|
WikiGuru ADOS (Attention deficit... Oh! Shiny!)
Elite
Joined: 15 Sep 2005 Posts: 923
|
Posted: 15 Jul 2008 12:10:47 am Post subject: |
|
|
I don't understand why you need an and/or mask (unless I'm misunderstanding something). If all you want is to draw an image over another instead of xoring it over it, change your drawing routine. I believe i've got one that will suite your need...
No matter what was beneath the 8-bit region, this routine will draw over it. It can also be modified to save what was beneath. Sorry for the lack of comments and readability.
Code: ;===============================================
; putpic8
;===============================================
;
;8-bit width picture
;
;inputs:
; a=xc
; l=yc
; b=height of sprite (pixels)
; ix=>sprite location
;
putpic8:
ld e,l
ld h,$00
ld d,h
add hl,de
add hl,de
add hl,hl
add hl,hl
ld e,a
and $07
ld c,a
srl e
srl e
srl e
add hl,de
ld de,gbuf
add hl,de
putpicLoop1:
ld d,(ix)
ld e,$00
ld a,c
or a
push bc
ld bc,$00FF
jr z,putpicSkip1
putpicLoop2:
srl d
rr e
scf
rr b
rr c
dec a
jr nz,putpicLoop2
putpicSkip1:
ld a,(hl)
and b
xor d
ld (hl),a
inc hl
ld a,(hl)
and c
xor e
ld (hl),a
pop bc
ld de,$0B
add hl,de
inc ix
djnz putpicLoop1
ret
edit: Oh wow, it just dawned on me what you are doing! Haha, boy am I slow.
Last edited by Guest on 15 Jul 2008 12:17:45 am; edited 1 time in total |
|
Back to top |
|
|
magicdanw pcGuru()
Calc Guru
Joined: 14 Feb 2007 Posts: 1110
|
Posted: 15 Jul 2008 12:46:41 am Post subject: |
|
|
The mask becomes necessary when you want to draw a closed shape to the screen, so that the outline is drawn black, the inside is drawn white, and the outside is left transparent. No routine can figure out which parts to blank white, and which to leave transparent, so you need a mask to provide this data. If you and the mask to the screen, and or the image over it, then it will all work out happy |
|
Back to top |
|
|
WikiGuru ADOS (Attention deficit... Oh! Shiny!)
Elite
Joined: 15 Sep 2005 Posts: 923
|
Posted: 15 Jul 2008 11:56:57 am Post subject: |
|
|
Yeah, I wasn't thinking about that. In the routine I had, I just needed to completely overwrite the 8*8 square (unbound), and for some reason I thought that's what you wanted too, since blobby is basically a square. And then I thought about enemies and other moving stuff... |
|
Back to top |
|
|
Liazon title goes here
Bandwidth Hog
Joined: 01 Nov 2005 Posts: 2007
|
Posted: 15 Jul 2008 06:01:35 pm Post subject: |
|
|
there are other bit operation combinations, but and/xor or and/or is usually the most logical and easiest for actually creating the sprite and mask. |
|
Back to top |
|
|
WikiGuru ADOS (Attention deficit... Oh! Shiny!)
Elite
Joined: 15 Sep 2005 Posts: 923
|
Posted: 15 Jul 2008 07:32:36 pm Post subject: |
|
|
I'm sure there is a way to have the sprite routine figure out the mask for you... like finding the first bit set and the last bit set, or something like that. I'll tinker with that for a bit... |
|
Back to top |
|
|
tr1p1ea
Elite
Joined: 03 Aug 2003 Posts: 870
|
Posted: 16 Jul 2008 07:53:45 am Post subject: |
|
|
I wrote you an example of probably the most standard way - in the programming help thread.
Last edited by Guest on 16 Jul 2008 08:20:34 am; edited 1 time in total |
|
Back to top |
|
|
Liazon title goes here
Bandwidth Hog
Joined: 01 Nov 2005 Posts: 2007
|
Posted: 16 Jul 2008 07:53:39 pm Post subject: |
|
|
WikiGuru wrote: I'm sure there is a way to have the sprite routine figure out the mask for you... like finding the first bit set and the last bit set, or something like that. I'll tinker with that for a bit...
[post="125325"]<{POST_SNAPBACK}>[/post]
provided the sprite is an enclosed style (black edges) you could just scroll in some 1s on either side of the byte. it's not so useful if you have areas that are intentionally white but are not enclosed by a black outline. |
|
Back to top |
|
|
DigiTan Unregistered HyperCam 2
Super Elite (Last Title)
Joined: 10 Nov 2003 Posts: 4468
|
Posted: 17 Jul 2008 10:55:59 pm Post subject: |
|
|
Either way, I'd definitely recommend creating the masked sprites sooner rather than later. You want to build the foundation first and the house second. |
|
Back to top |
|
|
cjgone Aw3s0m3
Active Member
Joined: 24 May 2006 Posts: 693
|
Posted: 09 Aug 2008 06:03:13 pm Post subject: |
|
|
Just so no one gets their hopes up, this project is officially dead for unknown amount of time.
I'm reworking the "engine" atm but don't expect something for a while.
peace. |
|
Back to top |
|
|
cjgone Aw3s0m3
Active Member
Joined: 24 May 2006 Posts: 693
|
Posted: 31 Aug 2008 02:30:39 am Post subject: |
|
|
Hell yea, I started up this project again.
I've optimized the game and rewrote most of the object handling the code. More advanced object things can occur, same with animations.
I was able to shave off about 500 bytes, which is intense stuff.
Will spend some time trying to fix this game up. No new features, but the "engine" update will make way for some cooler stuff.
Last edited by Guest on 31 Aug 2008 02:32:08 am; edited 1 time in total |
|
Back to top |
|
|
cjgone Aw3s0m3
Active Member
Joined: 24 May 2006 Posts: 693
|
Posted: 01 Sep 2008 12:41:41 am Post subject: |
|
|
I've had a change of heart. Gonna try 2 port Super Mario Advance1 to the calc.
Screenshot of what i got, kinda glitchy (went thru a wall, mysterious coin appears at end...)
I'm also encountering some random bugs like getting frozen in mid air and invisible blocks appearing like 20% of the time. Kinda annoying.
Last edited by Guest on 01 Sep 2008 02:45:24 am; edited 1 time in total |
|
Back to top |
|
|
tr1p1ea
Elite
Joined: 03 Aug 2003 Posts: 870
|
Posted: 01 Sep 2008 02:19:48 am Post subject: |
|
|
Holy WOW!
Thats looking great! Your engine certainly is flexible! .
Last edited by Guest on 01 Sep 2008 03:03:02 am; edited 1 time in total |
|
Back to top |
|
|
cjgone Aw3s0m3
Active Member
Joined: 24 May 2006 Posts: 693
|
Posted: 01 Sep 2008 02:48:14 am Post subject: |
|
|
Thanks Tr1p. :D
Super Mario Advance 1 is a pretty standard tile mapped based game and I hope to finish porting a general idea of the game in 5 months max (not an exact port, just close enough). I'm pretty excited, since I actually own SMA1 for my GBA so I can directly get the maps from it. Untrue for my shooter, which is going to be delayed because I don't have the creativity for my own level designs.
Anyway, I
Re-wrote the object allocation and it seems to have fixed the invisible wall glitch.
Thru-wall glitch not fixed, pretty trivial imo, it won't happen to often anyway.
Coin glitch is a weakness in my object spawn engine. Apparently the object spawn for "down" does not spawn objects in the right corner, so the coin at the end never appeared after I jumped and fell down. It only appeared after I walked back left.
Minor lag with 10+ objects on the LCD.
Last edited by Guest on 01 Sep 2008 02:51:08 am; edited 1 time in total |
|
Back to top |
|
|
Art_of_camelot
Member
Joined: 05 Jan 2008 Posts: 152
|
Posted: 01 Sep 2008 11:28:59 am Post subject: |
|
|
That's great! I really loved SMB2. Are you going to add in all the characters with their different attributes? |
|
Back to top |
|
|
Madskillz
Active Member
Joined: 02 Jan 2004 Posts: 608
|
Posted: 01 Sep 2008 06:43:16 pm Post subject: |
|
|
looks and sounds great I cant wait to see this project's future! |
|
Back to top |
|
|
cjgone Aw3s0m3
Active Member
Joined: 24 May 2006 Posts: 693
|
Posted: 04 Sep 2008 12:02:15 am Post subject: |
|
|
skool has started which sucks 4 me. =\
i have 2 modify my engine of when objects are deleted to create objects like b4 they hit the screen.
Last edited by Guest on 04 Sep 2008 12:05:55 am; edited 1 time in total |
|
Back to top |
|
|
Liazon title goes here
Bandwidth Hog
Joined: 01 Nov 2005 Posts: 2007
|
Posted: 04 Sep 2008 03:58:51 pm Post subject: |
|
|
i see you've been getting inspiration from the first super mario game for gba lol |
|
Back to top |
|
|
cjgone Aw3s0m3
Active Member
Joined: 24 May 2006 Posts: 693
|
Posted: 20 Sep 2008 09:06:02 pm Post subject: |
|
|
No, project is not dead.
A little update with goomba thing. |
|
Back to top |
|
|
Liazon title goes here
Bandwidth Hog
Joined: 01 Nov 2005 Posts: 2007
|
Posted: 20 Sep 2008 11:15:52 pm Post subject: |
|
|
looking awesome!
makes you wonder why nobody's bothered w/ a port of the gba mario games. it was more fun when you had 4 characters to choose from w/ different stats, and you killed things by picking them up and throwing them at others.
lots of fun puzzles too.
add quicksand lol |
|
Back to top |
|
|
NanoWar
Newbie
Joined: 21 Sep 2008 Posts: 30
|
Posted: 21 Sep 2008 07:01:30 am Post subject: |
|
|
Maybe add masked sprites! |
|
Back to top |
|
|
|