Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - chickendude

Pages: 1 ... 40 41 [42] 43 44 ... 55
616
Other Calculators / Re: What should I buy?
« on: October 18, 2012, 05:38:02 am »
Then why does mine have 1.5 MB? Also, not to seem thick, but where is the serial number? I just see some patent numbers and a place to write your name... Does the "About" screen tell you anything? Thanks :)

617
Other Calculators / Re: What should I buy?
« on: October 18, 2012, 04:44:02 am »
Btw, how much FLASH does an 84+ (not SE) have? I just got mine and it seems to have 1.5 MB, i thought they only had something like 500kb...?

EDIT: And how can i test if i've got the extra RAM pages?

618
Ash: Phoenix / Re: [A:P] Documentation
« on: October 18, 2012, 04:16:28 am »
I'm not sure how parameters are handled in Axe. That routine there requires that the position in the gbuf be calculated beforehand.

I think this should work:
Code: [Select]
26 00 -  -  ld h,0
54 -  -  -  ld d,h
6B -  -  -  ld l,e ;hl=de
29 -  -  -  add hl, hl ; 2
19 -  -  -  add hl, de ; 3
29 -  -  -  add hl, hl ; 6
29 -  -  -  add hl, hl ; 12
 -  -  -  - 
 -  -  -  -  ; x / 8
78 -  -  -  ld a,b
CB 38 -  -  srl b
CB 38 -  -  srl b
CB 38 -  -  srl b
58 -  -  -  ld e,b
19 -  -  -  add hl,de ; A present on a le decalage dans hl
11 42 93 -  ld de,gbuf+2 ; Prendre le debut du graphbuffer
19 -  -  -  add hl,de ; Puis ajouter le decalage
E6 07 -  -  and $07
Though the best would be to have a specific 12x12 tilemap routine rather than recalculate the position in gbuf every time you draw a tile.

EDIT: Added opcodes.

619
Other Calculators / Re: The Newprog discussion thread
« on: October 18, 2012, 03:58:04 am »
For collision detection, assuming all of your tiles are square and there aren't any irregular shapes in the collision area of your tiles, what i generally do is something like this. If you are going up, add the y velocity to the current y position and check what tile is in that new y position. If it is passable, save the new y position. If it isn't passable, you need to save (old y position % F8h): essentially, remove the y offset so that it is aligned to the tile. When checking collisions below you, you'll need to add 2 (if your coordinates are stored in multiples of 8) or 16 (if they're stored in pixels) to the y position before checking, since you need to check the position below the player. If it isn't passable, then just remove the y offset from the new coordinates and store that. If you're only going to be moving 1 pixel at a time, it can be simplified a little since you won't need to worry about aligning the player to the next tile (they will already be aligned). You can also limit your checks to every 16 pixels, but i like to do it every frame since it makes it easier for example to test if you are standing in lava and need to do damage to the player, etc.

*Edit AOC* in order to prevent 8) from turning into a smiley emoticon, check the "Don't use smileys" box when posting.

620
ASM / Re: Reading data directly from archive
« on: October 16, 2012, 06:46:31 pm »
Awesome, thanks! And when you say "crossing a sector", i don't understand the difference between a "page" and a "sector". Is a page swapped into a sector? And the filename will always be the same since there's only going to be one file. The program is getting too large to fit the level packs in so i wanted to try making them external. Speed's not an issue and i would've used _FlashToRam, but the thing is the levels are RLE compressed and i wanted to unpack them directly into my buffer (rather than look for ANOTHER 2k+ space in RAM to store the compressed levels into).

Another option might be to calculate how many bytes are left until i reach the next page and load it into bc or something and switch to the next page when the counter runs down (or just exit if i reach the end of data before the page ends), that way i don't have to test after every byte read. I like that "fast_bhl" routine, it's pretty clever :)

EDIT: Alright, it's finally working like a charm :D My 83+ arrived today and the first thing i did was toss my program on there and much to my dismay many of the levels were crashing. I added these few lines in (which i think is slightly shorter/faster than the code above? If it is, to you or anyone else: "help yourself!"):
Code: [Select]
ld a,%10000000
and h
jr z,continueRLE
rra
ld h,a
in a,(6) ;charger la prochaine page de FLASH
inc a
out (6),a
continueRLE:
...and now it's working great. Thanks a lot :)

EDIT2: Not faster than calc84maniac's code ;) I just saw your post, thanks :)

EDIT3: Errr... maybe not. It works fine now on the emulator but oncalc it's buggy :/

EDIT4: (sorry) And i just ran it again and now it's working perfectly. It's so weird. I can't remember if i garbage collected or not, i think so, which might be why it's working now :/

EDIT5 (and final!): I finally figured out what was causing it, my routine works fine once you have the address and are advancing one by one, but to get the initial offset you need to use one of the other routines since they don't depend on you changing hl one byte at a time. Now everything's working great on both the emulator and hardware :D

621
KnightOS / Re: KnightOS Translation Project
« on: October 16, 2012, 03:18:38 pm »
Try pressing ESC and typing ":wq" and see if that works...

622
ASM / Reading data directly from archive
« on: October 16, 2012, 01:46:07 pm »
Alright, so i wrote a little piece of code to swap the ROM page of the level file in and locate the first bits of data and it seems to be working perfectly. However, i am pretty sure this is only because on the emulator my FLASH is pretty much empty and it's getting loaded into the low values of $4000. Am i right in assuming that this is just "luck" and that on a regular calculator where the archive is fuller that it's possible the data file (well over 8k) will span two pages?

This is the code that i wrote, it finds the file in archive, swaps it in, and reads maplocations from a map table at the start of the data file:
Code: [Select]
loadLevelFromArchive:
push bc
ld hl,levelName_txt
rst 20h ;9 octets à (hl) dans OP1
bcall(_ChkFindSym) ;chercher le programme dans OP1
;hl = VAT, de = addresse du data
ret c ;c armé si pas encontré
in a,(6) ;il faut sauvegarder la page FLASH actuelle
ld (savePort),a
ld a,b ;b = 0 si le fichier est dans RAM
or a
ret z ;si pas dans le RAM, b = la page FLASH
out (6),a ;a = la page FLASH où est notre fichier
ex de, hl
ld de,20-6 ;-6 parce que b=1 est la première carte, on va ajouter 6
add hl,de ;il y a 20 octets avant le début du data, le nom du program, sa taille, addresse, page de FLASH, etc.
pop bc
;début du data
ld e,6
add hl,de
djnz $-1
; Aller prendre les informations dans les infos et mettre dans hl, de bc avant de lancer chargerCarte

;...do stuff

savePort = $+1
ld a,0
out (6),a
ret
What can i do to handle cases where it spans more than one page? I can check to see if hl passes $7FFF, but how do i know what the next page is?

623
Ash: Phoenix / Re: [A:P] Documentation
« on: October 16, 2012, 03:02:26 am »
This is the basic code. First however, you'll need to calculate where to draw the sprite on screen and put that into hl, +2 bytes (since it draws from right to left, we start with the right side of the sprite and draw leftward). I'm not really sure how Axe handles inputs to routines, so if i got a little more information i could add that in for you too. The first line loads the x offset, that is, how many pixels away from 0 we are. If you are drawing at an aligned position (a multiple of 8) b will equal 0. If you are drawing at X=1, b = 1. If X=19, b=19%8=3. C should be how many rows you want to draw. Here it's 16 (10h). If you want 12, you would change 10h to 0Ch. And the address of the sprite should be in ix. I also wrote a quick small aligned 16x16 tilemapper, i'm not sure how you draw your tilemaps. None of this uses grayscale, however, so i don't know how useful it is to you. I'd be happy to help write something for you, though. So:
b = x offset (how many pixels away from being aligned the sprite is)
c = number of rows to draw, this could be changed easily to a variable height sprite routine.
ix = address of first byte in sprite
Code: [Select]
47 -  -  -   ld b,a
 0E 10 -  -   ld c,16
 -  -  -  -  
 -  -  -  -  drawPlayerLoop:
 C5 -  -  -   push bc
 DD 56 00 -   ld d,(ix)      ;sprite
 DD 5E 01 -   ld e,(ix+1)
 AF -  -  -   xor a
 B8 -  -  -   cp b
 CA 71 A0 -   jp z,skipSpriteClip
 CB 3A CB 1B F9 srl d \ rr e \ rra \ djnz $-5   ;rotate sprite
 -  -  -  -  skipSpriteClip:
 B6 -  -  -   or (hl)
 77 -  -  -   ld (hl),a
 2B -  -  -   dec hl
 7E -  -  -   ld a,(hl)
 B3 -  -  -   or e
 77 -  -  -   ld (hl),a
 2B -  -  -   dec hl
 7E -  -  -   ld a,(hl)
 B2 -  -  -   or d
 77 -  -  -   ld (hl),a
 DD 23 -  -   inc ix
 DD 23 -  -   inc ix
 11 0E 00 -   ld de,14
 19 -  -  -   add hl,de
 C1 -  -  -   pop bc
 0D -  -  -   dec c
 C2 5E A0 -   jp nz, drawPlayerLoop
 C9 -  -  -   ret

EDIT: This routine will also slow down a little the further away from being aligned you go. We could unroll the shifting loops which, although taking up more space, would be slightly faster and have a more even runtime, or something like a 12x12 version of what i posted over here:
http://ourl.ca/15050 :)

624
KnightOS / Re: KnightOS Translation Project
« on: October 16, 2012, 02:40:50 am »
You should make an account on GitHub and make a "fork" of KnightOS. It took me a while to figure it out since i've never used git/github before, so here's what i did:
1. You need "git" installed.
2. Make an account on github.com, and click "fork" on the KnightOS github page.
3. Choose a directory for the project to go into (it will create a directory called KnightOS there)
4. From the terminal/command prompt: "git clone [address of your cloned project]". For me, this was "git clone https://github.com/chickendude/KnightOS/"
5. Go into the lang folder and create a folder with your language name (nl_be, de, es, etc.) and copy your translated files. Make sure they are encoded in ANSI (Windows-1252) (not UTF-8 or some other format). I think files written in Notepad are ANSI by default.
6. From the terminal "git commit"
7. Again, from the terminal "git push". You will need to type in your username followed by your password, and it will upload your changes to your fork.
8. Now all you have to do is log on to github, go to your KnightOS fork, and make a pull request (there's a button above the project that says "Make a pull request") and you're done.

It took me a while to figure it out, but once you get everything figured out altogether it takes less than a minute from the initial download of the project to the final push. In the future, when updating your files, just go into your KnightOS git project directory and run "get pull" to make sure there haven't been any changes since you last updated. There are also some GUIs, but i couldn't figure out how to get any of them to "push" the changes to the internet :/

Again, make sure that the files are ANSI formatted!

I'd be more than happy to help anyone who's having trouble :)

625
Other Calculators / Re: What should I buy?
« on: October 15, 2012, 07:49:02 pm »
Do you know how it compares hardware-wise? It seems like it has a pretty nice processor. I remember back in the day seeing lots of Zelda demos for HP calcs, but they always seemed fairly similar to our 83/+ Zelda demos.

626
Ash: Phoenix / Re: [A:P] Documentation
« on: October 15, 2012, 07:46:55 pm »
Ah i didn't know Axe could only do multiples of 8. It's kinda silly since it's super easy to draw extra Y tiles, unless there's some weird trick he's using. One of my projects now has a 16x16 sprite drawing routine i've written for it. Changing one number turns it into a 16x12 sprite drawing routine ;) It could easily be a 16 x any number routine. I don't know how to write an Axiom and it's likely what i write ends up being less optimized than what Runer wrote. Ah and i am clueless when it comes to grayscale, are you using grayscale? And really, for a tilemap, it's usually more efficient to implement the sprite drawing into the mapper itself, not keeping the x and y coordinates on the screen but rather your position in the buffer, that way you don't have to recalculate your position in the buffer each time you go to draw a tile.

And squidgetx, unpacking the sprites would take the same space in RAM, but it would save space in your program. And it wouldn't even take up the user's RAM, just saferam. And you wouldn't have to have every map's set of sprites unpacked at the same time, just your current set. It might not be worth the trouble, but it'd save you 6 bytes (or 8, if you're using 16x16 sprites) per sprite.

@DJ: I think 16x16 is generally faster since you don't have to do as many calculations (it's faster to draw one 16x16 sprite than it is to draw 4 8x8 sprites)

627
Other Calculators / Re: Does anyone have spencer putt's zelda demo?
« on: October 15, 2012, 09:52:29 am »
However, Spencer hasn't ever been to the new site, he and Jim e both seem to have disappeared with the old site. Btw, you can also use "revolutionsoftware.org".

628
KnightOS / Re: KnightOS Translation Project
« on: October 15, 2012, 09:42:26 am »
How do i ask questions about what exactly is meant? For example, "Running Programs" can be either a list of programs that are running: "Programas ejecutándose" or a state: "Ejecutando programas". I've finished translating everything (to anyone else thinking about it: it's really not much, it took me maybe ten minutes).

EDIT: So first he needs to add an "Es" folder before i can upload the translations?
EDIT2: Translation attached.

629
KnightOS / Re: KnightOS Translation Project
« on: October 15, 2012, 08:16:51 am »
I can do/help with Spanish. No Klingon, though, sorry. Do you have a link to the article on TI Planet ? Ah, the most recent post. I really have no idea how to use these sorts of sites, though, (i have no idea what a pull request is, for example) but i can provide the translations.

630
Other Calculators / Re: What should I buy?
« on: October 15, 2012, 08:00:54 am »
Yeah, online i've read that it.. emulates Saturn ASM? There were several programming languages you could use (including C), but i'm much more interested in ARM assembly.

Pages: 1 ... 40 41 [42] 43 44 ... 55