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 - ACagliano
Pages: 1 ... 18 19 [20] 21 22 ... 62
286
« on: October 03, 2011, 12:12:31 pm »
Hmm, I just realized that you'll also have to properly handle non-significant zeros, like if they type 01337 or 0.0001. The only FP value that is allowed to start with a 0 nibble is zero itself. Leading zeros before the decimal point can simply be ignored, but leading zeros after the decimal point should also decrease the exponent.
Easy. Just ignore every zero until you hit a non-zero character.
287
« on: October 03, 2011, 10:51:01 am »
Ok. Thanks.
288
« on: October 03, 2011, 10:38:18 am »
Ok, so let me just double check. To make it only accept numbers, remove the upper and lowercase data tables, and take out the 2nd and Alpha key checks?
289
« on: October 03, 2011, 10:34:18 am »
Ok, so you could be in one of two situations:
1. You have a text string with the numerical data If this is the case, the answer is pretty easy, copy low nibbles of the text data into the data section OP1. Then, take the number of nibbles you copied, add it to 7F, and store that in the exponent field.
Example: Text = 12345 = $31, $32, $33, $34, $35 Copy this into OP1, OP1 = 00 84 12 34 50 00 00 00 00
This is the way it will be. The issue is, the numerical string MAY contain a decimal point.
290
« on: October 02, 2011, 05:51:08 pm »
No, it will not already be FP data. I Will be trying to convert the results of an getkey input routine (numerical data only) into FP data.
291
« on: October 02, 2011, 10:36:06 am »
I know HOW to move it. My issue is getting the floating point into the correct format.
292
« on: October 01, 2011, 08:25:57 pm »
Let us assume that I have some floating point data in RAM that I want to move to an Op variable. How would I get it there correctly. I know about the type byte, the exponents, and all that, but I know that, in the actual bytes 2-8, the data is in hex, but you still see your actual decimal numbers, 2 to a byte. How the blazes do I manage that?
293
« on: October 01, 2011, 03:17:01 pm »
For getting the text, here's an awesome routine I made.
;##################################### ;The all inclusive typing routine ;input: c = length ; de = curRow ; hl = buffer location ;output: ; b = length ; de = byte after ; hl = beginning ; carry = quit ; zero terminated string ;destroys: ; af, bc ; 2 bytes after length of string
typing: push hl ld (hl), e inc hl ld (hl), d inc hl ld (curRow), de
push hl push bc bcall(_clrTxtShd) pop bc pop hl
ld b, 0
editEntry: set shiftAlpha, (iy + shiftFlags) res shiftLwrAlph, (iy + shiftFlags) set curAble, (iy + curFlags)
typeLoop: call cursorOn typeLoop2: halt push hl bcall(_getCSC) pop hl or a jr z, typeLoop2
push af call cursorOff pop af
cp skEnter jr nz, notEnter
res curAble, (iy + curFlags) res shiftLwrAlph, (iy + shiftFlags) res shiftAlpha, (iy + shiftFlags)
pop hl push hl ld de, 2 add hl, de pop de push de
push bc ld c, b ld b, 0 ldir
pop bc pop hl xor a ld (de), a ret
notEnter: cp sk2nd jr nz, not2ndz
res shiftLwrAlph, (iy + shiftFlags) res shiftAlpha, (iy + shiftFlags) jr typeLoop
not2ndz: cp skAlpha jr nz, notAlpha
set shiftAlpha, (iy + shiftFlags) ld a, (iy + shiftFlags) xor %00000001 << shiftLwrAlph ld (iy + shiftFlags), a jr typeLoop
notAlpha: cp skLeft jr nz, notLeft doLeft: ld a, b or a jp z, typeLoop dec b
dec hl ld (hl), 0 ld de, (curRow) dec d jp p, notOffEdge ld d, 15 dec e notOffEdge: ld (curRow), de ld a, ' ' bcall(_putMap) jp typeLoop
notLeft: cp skDel jr z, doLeft notDelete: cp skMode jr nz, notMode res curAble, (iy + curFlags) res shiftLwrAlph, (iy + shiftFlags) res shiftAlpha, (iy + shiftFlags)
pop hl scf ret notMode: cp skClear jr nz, notClear
ld a, b or a jp z, typeLoop
pop hl push hl ld e, (hl) inc hl ld d, (hl) inc hl push hl
push de ld (curRow), de
push bc ld c, b ld b, 0 inc bc bcall(_memClear)
pop bc ld a, ' ' clearLoop: bcall(_putC) djnz clearLoop
pop de ld (curRow), de
pop hl jp typeLoop
notClear: sub skAdd jp c, typeLoop cp skMath - skAdd + 1 jp nc, typeLoop
push hl
ld hl, numTable bit shiftAlpha, (iy + shiftFlags) jr z, setFound ld hl, lowTable bit shiftLwrAlph, (iy + shiftFlags) jr nz, setFound ld hl, charTable
setFound:
ld e, a ld d, 0 add hl, de
ld a, b cp c jr z, noMore
ld a, (hl)
or a noMore: pop hl jp z, typeLoop
inc b
ld (hl), a inc hl bcall(_putC) jp typeLoop
cursorOn: res curOn, (iy + curFlags) jr readyk cursorOff: set curOn, (iy + curFlags) readyk: ld a, 1 ld (curTime), a ei halt ret
CharTable: .db $22, "WRMH", 00, 00 .db "?", $5B, "VQLG", 00, 00 .db ":ZUPKFC", 00 .db " YTOJEB", 00, 00 .db "XSNIDA"
NumTable: .db "+-*/^", 00, 00 .db $1A, "369)", 00, 00, 00 .db ".258(", 00, 00, 00 .db "0147,", 00, 00, 00, 00 .db $1C, 00, 00, $12, $11, 00
lowTable: .db $22, "wrmh", 00, 00 .db "?", $5B, "vqlg", 00, 00 .db ":zupkfc", 00 .db " ytojeb", 00, 00 .db "xsnida"
This routine allows you to type letters, but you can remove that ability.
Then, as far as making a number out of it. You could probably parse it yourself, and if you can't do that, you might be able to save it as a string and parse it into a TI float, though, I don't really know how to do that. (Probably undocumented.)
I would like to only be able to accept numbers as input. I can handle the moving to Op. Where does it save that to?
294
« on: October 01, 2011, 02:47:58 pm »
I need help. I am uncertain how to get input in z80. There's a program I'm looking to make, but can someone help me with this. I need to do this in assembly:
Disp "A:ROCKET MASS" Prompt A Disp "B:PREV RCKT VELOCITY" Prompt B Disp "PROPELLENT MASS" Prompt C Disp "D:PROPELLENT VELOCITY" Prompt D Disp "E:PLANET MASS" Prompt E Disp "F:END TIME" Prompt F Disp "G:INITIAL DISTANCE" Prompt G
295
« on: September 13, 2011, 12:08:42 pm »
Small Update
A slight revision to the text rendering routines. I will prepend each string with a two byte location. When I load the string into hl, I will load 'hl' into (penCol) and 'hl+1' into (penRow). Then, I will 'inc' twice and 'hl' should now point to the start of the string. Means I don't have to manually code the setting of penCol and penRow each time I display text.
296
« on: September 08, 2011, 03:42:28 pm »
I need a z80 routine that renders an 8x8 sprite to the screen. The upper left corner of the sprite should be at a,b and the hex for the sprite in hl?
297
« on: September 08, 2011, 09:30:52 am »
Sure. I'm not amazing at it, but I can get by. I did a remake of Hexpic (the program included with Axe) in ASM.
Ok, welcome to the AI team. What is ur email address? I'll send you all the data I have thus far on the AI. And, anyone else wanna help?
298
« on: September 07, 2011, 06:26:14 pm »
You cannot have the map data in the app and then just have a list of items that are taken in the savefile?
Its not just the items that change. Ice blocks can be melted, lava watered, keys taken, switches activated. The map will actively change, and those changes need to be preserved.
All of those things can be kept track of in the save file (though keep in mind that a lot of zelda games even reset some of that stuff when you leave that map area, so you won't need to save that)
I know it can, but considering how the game is set up, doing so would actually be harder than just using the map for that data.
299
« on: September 07, 2011, 05:00:19 pm »
You cannot have the map data in the app and then just have a list of items that are taken in the savefile?
Its not just the items that change. Ice blocks can be melted, lava watered, keys taken, switches activated. The map will actively change, and those changes need to be preserved.
300
« on: September 07, 2011, 04:55:02 pm »
Why not store the data directly in the app?
If you are talking about the map data, then I cannot because the data needs to be edited, if an item is collected from the map. Having it in the app would make me have to modify the app's flash page. If you are talking about my other question, the sprites data, then I can have that in the app, but during the game it needs to be in RAM.
Pages: 1 ... 18 19 [20] 21 22 ... 62
|