MaxCoderz

for your 1 bit pleasure!

All times are UTC




Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 26 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Wed 23 Feb, 2005 1:56 pm 
Offline
Maxcoderz Staff

Joined: Sat 18 Dec, 2004 3:51 am
Posts: 1477
Location: Toledo, Ohio, USA
Copied from my aw_tilem.z80 file.
Code:
;//Routines for tilemapping, by Patori

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Before doing anything, I think that it'd be best to plan
;ahead. hehehe. So anyways, I believe I should discuss the
;program structure, nyo? Ok:
;
;
;   char 'F','L','C','L'
;   byte width,height
;   byte DATA --------------->
;   ------------------------->
;   ------------------------->
;       End, no need for termination bytes, that'd be a waste.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; ///Anyways, the way that the tilemapper would work (or, simply put, it's Algorithm) would be as follows, in poorly written C:
;
;   Variables:
;      width = the map's width
;      height = the map's height
;      xentry = xposition to draw from
;      yentry = yposition to draw from
;      bytetostart = pointer to where to start drawing from
;      MAR = Random Access Memory (Level data)
;      tempy = temporary y value
;      function drawsprite(x pos, y pos, sprite num) = self explanitory
;
;   int tileMap(int width, int height,int xentry, int yentry)
;   {
;      //To calculate the max y.... height-4
;      int bytetostart;
;      if (yentry > (height-4))
;      {
;         tempy = height-4;
;      }
;      else
;      {
;         tempy = yentry;
;      }
;      if (yentry < 0)
;      {
;         yentry = 0;
;      }
;      if (xentry < 0)
;      {
;         bytetostart = (yentry*width);
;      }
;      if (xentry > (width-4))
;      {
;         bytetostart = (yentry*width) + (width-4);
;      }
;      if ((xentry < (width-4)) && (xentry > 0))
;      {
;         bytetostart = (yentry*width) + width;
;      }
;      //We are pretending that the RAM is a big array called MAR...
;      //FIX THIS
;      for (int y = 0; y < 4; y++)
;         for (int x = 0; x < 4; x++)
;            drawSprite((x*16),(y*16),MAR[bytetostart+(y*height)+x]);
;      return 0;
;   }
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; In theory, (at least in my theory) this will work. I had to re-re-re-code this like 5 or 6 times.
; Pretty much cuz I was an idiot and didn't think to check X Positions or Y Positions... ^*^. I'll let
;Maxcoderz look over it before I convert it into ASM. BTW, units are gonna be loaded in a completely different
;way, they start off as arrays of data structures that will be loaded, and checked for relevence with the current
;viewpoint that is being displayed.
;Well, I'm gonna be really proud if this works :-D
;Looking over this code, I realize that it will take forever, and at least 1-2kb to code this in ASM. *gulp*.
;I WILL FINISH THIS FOR TICALC.ORG POTY 2005.
;
;Maxcoderz people (wow! I'm one of these elitists! yay!): I'm sorry that I have not shown any real work as of late,
;my home life has went down a toilet. We cannot afford internet, my dad looks for scrap steel for a living, and
;I cannot graduate until I can come up with $1.7k for tuition. (To go to this school, costs $7k, I have scholarship for $5k)
;I've been looking for a job as of late, and even when I get one it will be difficult to save up money for internet
;(I need a phone line turned back on first), and I will likely not have much free time when I work. I'm not asking for pity,
; I'm begging for patience and understanding. My life sucks. lol. I'd happy with it though... not really... *goes back to
;being a goth at home*
;
; "It's hard to be a goth when you are an optimist" - A teacher of mine, to me... :-S
;
; my life may turn around. Mrs. Sinha (Java teacher) spoke of a Database developing job over the summer, and I'm filling out
; tons of apps at various places by my school.



Do you think this code'll work? Ideas please?

_________________
Currently coming up with a new signature idea... since my forum avatar changer was killed by an upgrade...


Top
 Profile  
 
 Post subject: more help
PostPosted: Wed 23 Feb, 2005 1:59 pm 
Offline
Maxcoderz Staff

Joined: Sat 18 Dec, 2004 3:51 am
Posts: 1477
Location: Toledo, Ohio, USA
I'd also appreciate help with my load level loop's termination. I'm simply storing the mem addresses in saferam1, saferam1 and saferam1+1 as a pointer to where data was last entered, saferam1+2 data entry point.

Code:
#define LookSpot saferam3
#define LevelList saferam1 ;1 and two for last entry, rest is data
            ;In theory, cannot be filled up :) "Luhcky!" - N. Dynamite

aw_load_detect:         
   ld hl,(ProgPtr)
   ld (LookSpot),hl
   ld de,saferam1+2
   ld (LevelList),de
aw_load_detect_loop:
   ld hl,(LevelList)
   push hl
   ld hl,(LookSpot)
   ld ix,aw_load_token
   call iondetect
   pop hl
   ;;ex de,hl   ;Erm, rethink, not sure if it will work... hehe. Forum time!, nvm, solved by self.
   ld (hl),d
   inc hl
   ld (hl),e
   inc hl
   ld (LevelList),hl   ;Will it float?! Will it float?! - Late Show

   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   ; Okay, I've determined that there is no real way to check if all of the RAM has ;
   ;been scanned with iondetect, at least in the way that I'm using it... So I guess;
   ;I'll have to ask those "elitist teenagers" (w00t!) at Maxcoderz for some help,  ;
   ;or I can kill myself recoding it... I'll prefer to ask for help at this point...;
   ;               -Patori 2/22/05             ;
   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   ;ld hl,$0000      ;REALLY NEED TO DOUBLE CHECK... Tired though
   ;bcall(_cphlde)
   ;jp nc
   jp aw_load_detect_loop   ;Infinte for now, until i can Break.
aw_load_token:      ;For file detection. Fooly - Coolyin' it up, ^^ Don't wanna be a statistic, "Death by motorbike!" -FLCL
   .db "FLCL",0   ;God, if I use obscure Anime references throughout my code, I'll be famous.
aw_list_token:
   .db "EVAG",0   ;THAT'S RIGHT... Evangelion. "Basically giant robot anime" -FLCL (Go Gainix!)

;

Anyways, I need some help with terminating this loop. I believe that there is no safe way of telling whether all RAM has been checked, but I dunno. I may need to re-re-rewrite the code...

_________________
Currently coming up with a new signature idea... since my forum avatar changer was killed by an upgrade...


Top
 Profile  
 
 Post subject: Re: Help with tilemap?
PostPosted: Wed 23 Feb, 2005 2:42 pm 
Offline
Maxcoderz Staff

Joined: Sat 18 Dec, 2004 3:51 am
Posts: 1477
Location: Toledo, Ohio, USA
Patori wrote:
; drawSprite((x*16),(y*16),MAR[bytetostart+(y*height)+x]);
; return 0;
; }


height should be width above... oops.

_________________
Currently coming up with a new signature idea... since my forum avatar changer was killed by an upgrade...


Top
 Profile  
 
 Post subject:
PostPosted: Wed 23 Feb, 2005 3:46 pm 
Offline
Maxcoderz Staff

Joined: Sat 18 Dec, 2004 6:53 pm
Posts: 1349
Shoudn't this be in the programming help forum?

_________________
[Gridwars Score] - E: 1860037 M: 716641 H: 261194


Top
 Profile  
 
 Post subject:
PostPosted: Wed 23 Feb, 2005 4:07 pm 
Offline
Calc Wizard

Joined: Wed 22 Dec, 2004 5:37 am
Posts: 680
Location: West Palm Beach,FL
Well im not an expert in C or ASM for that matter, but I would like to wish you the best of luck with this project and I hope that you will recieve all the money you need. :)

_________________
Blog, programming, life, yep
Free Ipod w/ video playback!


Top
 Profile  
 
 Post subject:
PostPosted: Wed 23 Feb, 2005 9:43 pm 
Offline
Maxcoderz Staff

Joined: Sat 18 Dec, 2004 3:51 am
Posts: 1477
Location: Toledo, Ohio, USA
DarkAuron wrote:
Shoudn't this be in the programming help forum?


Well, it directly has to do with a project, so... I dunno.

_________________
Currently coming up with a new signature idea... since my forum avatar changer was killed by an upgrade...


Top
 Profile  
 
 Post subject:
PostPosted: Wed 23 Feb, 2005 10:48 pm 
Offline
Maxcoderz Staff

Joined: Sat 18 Dec, 2004 6:53 pm
Posts: 1349
Just figured it'd be more fitting in there since people that can help will probably look in there to help people.

_________________
[Gridwars Score] - E: 1860037 M: 716641 H: 261194


Top
 Profile  
 
 Post subject:
PostPosted: Thu 24 Feb, 2005 12:09 am 
Offline
Calc Guru
User avatar

Joined: Mon 03 Jan, 2005 7:54 pm
Posts: 835
Location: out there. seriosly.
yes...I will be able to understand sprites now ^_^

_________________
Life is getting better.


Top
 Profile  
 
 Post subject:
PostPosted: Mon 28 Feb, 2005 12:08 am 
Offline
Maxcoderz Staff
User avatar

Joined: Thu 16 Dec, 2004 10:06 pm
Posts: 4094
Location: I cant seem to get out of this cryogenic chamber!
Jeebus, i didnt think you had put this much thought into the game patori! This will be awesome when you complete it :).

Above all else, i hope your home situation works out.

_________________
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."
Image
Image


Top
 Profile  
 
 Post subject:
PostPosted: Mon 28 Feb, 2005 1:46 pm 
Offline
Maxcoderz Staff

Joined: Sat 18 Dec, 2004 3:51 am
Posts: 1477
Location: Toledo, Ohio, USA
tr1p1ea wrote:
Jeebus, i didnt think you had put this much thought into the game patori! This will be awesome when you complete it :).

Above all else, i hope your home situation works out.


Um... I've thought alot about this... I think that that tilemap routine will work....

Currently building a computer outta spare parts from closet... Gonna make a 1337 233mhz, 128mb RAM, 8 GB HDD, 52xCDRom 40x24x40x Burner, floppy drives, and a USB 1.whatever PCI Card... all running windows 98... w00t. Will use specifically for programming on Calc...

_________________
Currently coming up with a new signature idea... since my forum avatar changer was killed by an upgrade...


Top
 Profile  
 
 Post subject:
PostPosted: Mon 28 Feb, 2005 2:31 pm 
Offline
Maxcoderz Staff
User avatar

Joined: Thu 16 Dec, 2004 10:06 pm
Posts: 4094
Location: I cant seem to get out of this cryogenic chamber!
Hehehe that sounds fun ... but 233? Anyway, devoting an entire machine to calc coding means comitiment, and i like that! :).

_________________
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."
Image
Image


Top
 Profile  
 
 Post subject:
PostPosted: Tue 01 Mar, 2005 3:03 pm 
Offline
Maxcoderz Staff

Joined: Sat 18 Dec, 2004 3:51 am
Posts: 1477
Location: Toledo, Ohio, USA
tr1p1ea wrote:
Hehehe that sounds fun ... but 233? Anyway, devoting an entire machine to calc coding means comitiment, and i like that! :).


Well... playing mp3's too... I need to be able to listen to music at night to get to sleep.... :).. I'm having trouble building it though... 233 is the fast processor I could find... the family's fastest comp is a 500 mhz...

_________________
Currently coming up with a new signature idea... since my forum avatar changer was killed by an upgrade...


Top
 Profile  
 
 Post subject: whatta!
PostPosted: Tue 01 Mar, 2005 8:05 pm 
Offline
Calc Master
User avatar

Joined: Fri 17 Dec, 2004 9:53 am
Posts: 1089
Location: Belgium
500 mhz fastest! Here is 2.7 ghz fastest (my bro's GGRRR), i've got 2.4 ghz 2nd fastest :p Smallest 233 or 500 mhz, not sure which :p Ur so unlucky man...

_________________
TI-calculator = good time


Top
 Profile  
 
 Post subject:
PostPosted: Tue 01 Mar, 2005 10:05 pm 
Offline
Calc Master
User avatar

Joined: Wed 22 Dec, 2004 3:07 am
Posts: 1454
Location: Through the Aura
If only you lived in my area, I could give you a computer, or at least parts... UMass Amherst is basically giving away 450 mhz PIIs with 256 mb RAm and I think 10 gb HDs... I'm using one as a workstation. 233 mhz, that really bites! My main comp is a 1.7 ghz (but it's an athlon xp, so itsfaster than the clock speed would lead you to believe) with 512 RAm and 120 gb HD.

_________________
Image


"You're very clever, young man, but it's turtles all the way down!"


Top
 Profile  
 
 Post subject:
PostPosted: Tue 01 Mar, 2005 11:00 pm 
Offline
Calc Guru
User avatar

Joined: Mon 03 Jan, 2005 7:54 pm
Posts: 835
Location: out there. seriosly.
TigerDirect.com selled Mobos+Cpu's at 1300 or 5$.

_________________
Life is getting better.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 26 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


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 post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB ® Forum Software © phpBB Group | DVGFX2 by: Matt