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 - Hot_Dog
Pages: 1 ... 138 139 [140] 141 142 ... 194
2086
« on: August 17, 2010, 11:37:29 am »
Wow, that's complex. Thanks for enlightening us/me. That's more knowledge than I ever knew about multi page apps. Thanks Hot Dog! 
Your welcome! Yes, it gets a little bit complicated, and the Developer's Guide can get confusing. That's why I'm including an appendix in the Z80 ASM lessons about how to write applications -- single and multipage.
2087
« on: August 17, 2010, 11:27:08 am »
Ok, here's the deal: Your application header is fine. Since you have a knowledge of ASM, I'll get into a little bit of technical talk, but you can always ask questions if you are confused.
Even though your application is run directly from flash ROM, you can only have access to one application page at a time. As was said eariler, you need to switch pages to access them. If you are running a 2-page application, you cannot run page 1 (the second page) until you switch to it from page 0.
Now, your calculator does all this switching for you, but you need to tell the calculator which page to jump to, and WHERE on the page to jump to. You need what's called a "branch table." This is where you put all functions (with labels, variables, etc) that must be called from another page.
After your application header, use a "jp" statement to jump to where your program begins.
Now, you start typing in data for labels that are on your second page. If there is a label on your second page that your first page needs to call, you need to place it in this branch table. If there is a label on your second page that ONLY your second page uses, you don't need to type in any data about it.
Suppose you have a label on your second page called Access_Sprite_Data, and you need to call it from your first page. Remember, your first page is called page 0, and your second page is called page 1.
The data to tell the calculator about this label should be typed in after your JP statement. However, make sure that this page data starts on a byte that is a multiple of 3--and I would not be the best person to help you with that. If it does not start on a byte that is a multiple of 3, add some .db 0 statements until the data is. We're going to pretend that the data starts on byte 132, which is a multiple of 3.
.dw Access_Sprite_Data ; The label on the second page that you need to call from the first page .db 1 ; This function is on the second page
Now, let's say you have a third application page, with a timer function.
.dw Adjust_Timer .db 2
And so on and so forth. Just remember that you only need to type in functions/labels that are called from another page.
But you're not done yet. The data is there, but the calculator doesn't know it. So what you need is a "nickname" for each label in that branch table. We will use ASD as the nickname for Access_Sprite_Data, and Timer as the nickname for Adjust_Timer.
ASD .equ 44 * 3 ; 44 * 3 = 132. We need this because the page data for Access_Sprite_Data is on byte 132 of the program. Timer .equ 45 * 3 ; 45 * 3 = 135, and the data for Adjust_Timer is on byte 135 of the program
Now, to actually call the label, use B_CALL on the nickname. DO NOT use call, and do not use the actual label name.
B_CALL ASD B_CALL Timer
If you need to jump to a label instead of calling it, use B_JUMP.
Now, this technique can only be used for labels that can be called and jumped to. You, unfortunately, cannot use this to access data from another page. You should have functions on the page with your data to access that data.
The last thing is, you have to tell your compiler which data goes on which page. But this differs with each compiler (which one are you using?), so that is something I cannot help you with
2088
« on: August 17, 2010, 10:32:41 am »
Yeah, I hope he's alright. We'll all miss you, JSJ!
2089
« on: August 16, 2010, 07:58:02 pm »
Nice screenshot! It's great to see new progress.
2090
« on: August 16, 2010, 03:13:53 am »
I couldn't get to sleep, so I made this screenshot to promote/advertise lesson 15, which will hopefully be coming this week.
2091
« on: August 16, 2010, 12:40:23 am »
I was using register B for holding the EOL when I should have used Max_Num_Of_Chars, which meant the cursor wasn't advancing and new chars were not being added to the name
2092
« on: August 16, 2010, 12:17:49 am »
The code you sent me works anyways. Something else is going on.
As for break points. I would put one at the top of this subroutine and step through it.
Yeah, I found the problem. Thanks!
2093
« on: August 15, 2010, 11:29:21 pm »
Oops, I set the wrong breakpoint. I can handle the debugging from here
2094
« on: August 15, 2010, 11:04:15 pm »
Everything there says to me that it should work. I never use getKey, but while unoptimized, I see no problems other than a push DE up top with no pop.
Could you give the full context of where this is used? I can't really debug it since there are a lot of variables not initialized within the routine.
This is used for a player to input his name. Here's some code that comes before hand: Input_Player_One_Name:
ld hl, Splash_Screen ld de, plotsscreen ld bc, 768 ldir
call fastCopy
ld de, Player_One_Name ; Player_One_Name .equ statVars ld hl, Please_Input_Player_Name ; "Name:" ld b, 12 ;The name can only be up to twelve characters
ld a, MainMenuItem1Y ld (Input_Y), a ;Where to draw the underscore cursor, Y coordinate. The underscore cursor tells a player ;where the next character in the name will be placed ld (penRow), a
ld a, 22 ld c, a ld (Input_X), a
ld a, 1 ld (Coordinates_Of_Please_Input), a ;The X coordinate where the "Name:" text will be drawn ld (penCol), a
call Get_Player_Input
Let me know if you need more.
2095
« on: August 15, 2010, 10:16:27 pm »
One word: WOW
2096
« on: August 15, 2010, 10:14:12 pm »
Sorry for the double post. I should mention that when I put fastcopy before SET textwrite, and then take away SET textwrite, everything works perfectly
2097
« on: August 15, 2010, 09:34:08 pm »
Are interrupts enabled and in "im 1"?
Yes, I'm afraid that's not the issue.
2098
« on: August 15, 2010, 08:15:28 pm »
I've been continuing work on ASM Gorillas so that I can work on Lesson 15 of my ASM lessons. It seems that for some reason, nothing happens after _getKey. I tried setting a break point on the line immediately following, and that breakpoint is never reached. What am I doing wrong?
Btw, in this case, B = 12, C = 21, HL = "Name:" and DE = statVars.
;HL = The text to display for receiving input ;DE = Variable to store the input to ;B = The maximum number of characters that can be
inputted ;C = penCol location, that is, the X coordinate of ; the string being entered
Get_Player_Input:
ld (Input_Display_Text), hl ld (Variable_For_Input), de ld (Pen_Column), bc ld a, b ld (Max_Num_Of_Chars_Check), a push de
ld hl, plotsscreen ld de, appbackupscreen ld bc, 768 ldir
SET lwrCaseActive, (IY + appLwrCaseFlag)
Draw_Underscore_Cursor:
SET textWrite, (IY + sgrFlags)
ld hl, appbackupscreen ld de, plotsscreen ld bc, 768 ldir
ld a, (Input_Y) ld (penRow), a
ld a, (Coordinates_Of_Please_Input) ld (penCol), a
ld hl, (Input_Display_Text)
;Saves the value of where our string inputted ;will be saved
;Displays the string telling the player ;what to input
B_CALL _VPutS
ld hl, (Variable_For_Input)
ld bc, (Pen_Column)
ld a, c ld (penCol), a
B_CALL _VPutS
call fastcopy
ld a, (Input_X) ld (penCol), a
RES textWrite, (IY + sgrFlags) ld a, (Underscore) B_CALL _VPutMap
B_CALL _getKey
cp kExtendEcho2 jr z, Check_For_LowerCase_Letters
2099
« on: August 15, 2010, 12:23:43 pm »
I think that if CAS is used, the calculator won't be allowed on SAT tests.
2100
« on: August 15, 2010, 11:18:40 am »
I am NOT going to kill people's calculators and give people nightmares by drawing blue lobsters. End of Story.
Pages: 1 ... 138 139 [140] 141 142 ... 194
|