How would one check for any key press with a direct key input?

And can any one point me to a good routine to use for title menus like fish7 and alot of the penguins programs use? (yeah I will get a screenie in a few minutes)



basically a text based title screen
I think that the most help that I can give would be to look at days 12 and 22 in Asm in 28 days. Sorry I am still learning z80 also.
Lol no problem any input is welcome I am also being lazy which is half of why I am asking i have looked threw them Just lost track of how to do any key checking and then I never really payed much attention to text displaying... probably should re-read that.
Also for text display look at day 11 for display help.
Also you really look like someone I know at school--wierd
For text display you would just use _PutS and _VPutS, for large font and small font respectively.

Code:
ld h,0
   ld l,9
   ld d,191
   ld e,9
   ld a,2
   call fastline
   call iFastCopy


how would I make that smaller my attempts at converting it to

ld hl,** etc failed horridly
geekboy1011 wrote:

Code:
ld h,0
   ld l,9
   ld d,191
   ld e,9
   ld a,2
   call fastline
   call iFastCopy


how would I make that smaller my attempts at converting it to

ld hl,** etc failed horridly

Try ld hl,9? That should work.
err more for DE on that list I should say..just looked at HL again and realized that one was easy......

Code:
    ld hl,9
    ld de,(191 * 256) + 9
    ld a,2

For bonus conciseness.
@Tari May Ii ask how that works for future knowledge ^_^ (like mathematically speaking I mean)
Multiplying by 256 is the same as shifting left 8 bits. Somewhat easier to visualize if you consider the values in hex (recall that each digit in hex represents 4 bits):

Code:
191 -> 0xBF
256 -> 0x100
0xBF * 0x100) -> 0xBF00
0xBF00 + 0x09 -> 0xBF09

Splitting 0xBF09 back into bytes, that's 0xBF (191) in the high byte (register D in this case), and 0x09 (9) in the low byte (register E).

You could even write a simple macro to do this if you wanted:

Code:
#define PACK16(r16, high, low) ld r16, (256 * high) + low
; Alternate version with bitmath (not sure if TASM or Spasm let you do bit-shifts/masks like this, but Brass will)
#define PACK16(r16, high, low) ld r16, (high << 8) | low
Ah that makes much more sense Tari Thank you!

Code:

        ld de,(25*256)+55
        ld (pencol),de
        ld hl,RankW                  ; points to "win:",0
        call vputsc
        ld de,(25*256)+71
        ld (pencol),de
        ld hl,scores                  :points to the first ,db in scores
        call vputsc
        ld de,(35*256)+55
        ld (pencol),de
        ld hl,RankL                  ;points to "loss:"
        call vputsc
        ld de,(35*256)+71
        ld (pencol),de
        ld hl,(scores)+2          :points to second .db in scores
        call vputsc
RankW:
 .db "Wins:",0
RankL:
 .db "Loss:",0
Scores:
 .db 01,0
 .db 02,0



when I use this I get random chars for my scores. How should I do this so that I get numbers instead?
You're getting character 0x01 and 0x02. Try, for example, DCS routines VDispHL and DispLongInt.
Thanks Kerm!

Ok now how would I get a random number between say like 10 and 20?
geekboy1011 wrote:
Thanks Kerm!

Ok now how would I get a random number between say like 10 and 20?
You would use the Doors CS (well, Ion) iRandom routine, let it pick between 0 and 10, and just add 10 to the result.
/facepalm

somedays I feel not very smart. Thanks again Kerm!
geekboy1011 wrote:
/facepalm

somedays I feel not very smart. Thanks again Kerm!
Not a problem, it happens to the best of us. Smile Keep those questions coming, and it looks like this is something that will deserve its own Your Projects topic in a very short time!
So next question. I have read it like 50 times but I can not remember where. How does one set up ABS(or any saferam area) to use as variable storage?
geekboy1011 wrote:
So next question. I have read it like 50 times but I can not remember where. How does one set up ABS(or any saferam area) to use as variable storage?
Abs? Since when is Abs a safeRAM area? Shock And you don't set up safeRAM, you just use it.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 2 of 3
» All times are UTC - 5 Hours
 
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 vote in polls in this forum

 

Advertisement