In this topic, I will post current code for the game, for others to comment, correct, praise, ect. Nothing I post has been assembled, unless I post that it was assembled, as moving the program to windows and assembling it will be non-trivial.

Without further ado,

Edit by Tanner: See your post below.
/Huge code
A Star Trek clone sounds cool!
Could you please give us a bit more information on your project? What do plan to have this game do? What kind of play are you shooting for? Have any games you are trying to imitate?
This is a multiplayer space shooter, with a GUI that resembles the actual inside of the enterprise in star trek. You get a viewing window and hotkeys below the window to bring up tactical menus, transporter, ect. There are also firing hotkeys and special weapons you can get. Powered by CALCnet2.2.

@Kerm. Where do I store the addresses of each calculator in the game? Saferam2 is used for player-side data. AppBackupScreen is used for the Cn buffers. What is left? Can you give me some pseudo-code that will have every calc on network receiving the address of every other, and how do I set a max number of members?

Update--More Code

Edit: Woops. Completely forgot the 2-byte "Points"

http://pastebin.com/cK4Udyc3

Edit by Tanner: Lots and lots and lots of code! Made into a pastebin.
Here is some code from CnT, which finds calculators on the network and displays a menu: http://pastebin.com/iQAmxCj5
The calculator IDs are 5 bytes long and they are stored in idarray.

EDIT:
Code:
.list
#include   "ti83plus.inc"
#include   "dcs7.inc
.nolist

You forgot a quotation mark at the end of dcs7.inc. Wink
souvik1997 wrote:

You forgot a quotation mark at the end of dcs7.inc. Wink


Thanks and thanks.
Oh, and Kerm (or anyone who can help with this).

I would like to look at some code, similar to Obliterate's code, that uses the DCS7 GUI commands to prompt for user name and password, and how the data in the forms is then absorbed as data back into the program/appvar. I would like to do that in my game.


Edit:

I have an idea for greyscale...


splash:
b_call(_ClrLCDFull) ;draw splash screen
ld hl,NullWinData
ld de,NullWinDataEnd-NullWinData
ld a,GUIRNull
call PushGUIStack
ld hl,FullScrnImg1
ld de,FullScrnImg2-FullScrnImg1
ld a,GUIRFullScreenImg
call PushGUIStack
ld hl,FullScrnImg2
ld de,Description-FullScrnImg2
ld a,GUIRFullScreenImg
call PushGUIStack
greyscaleloop:
...

Now, the two screen images have been pushed onto the GUI Stack. Now, can't I just repeatedly push and pop the stack to create the greyscale, within a getCSC loop?
You could, but it would be very slow. I would not try to use the GUI to do grayscale actively; I would instead create your GUI, use RenderGUI to draw it, then repeatedly iFastCopy from two different buffers as per your original plan. You need very little else going on while you're doing grayscale for it to be smooth and natural.
Ok, I will give that a try. Thanks. Now, how exactly do you create a username/password UI box, like in Obliterate?

Edit: This is the route I went on the greyscale. I think this will work.



Code:
splash:
   b_call(_ForceFullScreen)
   b_call(_ClrLCDFull)      ;draw splash screen
   ld hl,Splash1
   ld de,$9340
   ld bc,Splash2-Splash1
   ldir
   ld hl,Splash2
   ld de,$86EC
   ld bc,Description-Splash2
   ldir
   ld a,8
   ld (winBtm),8
greyscaleloop:
   ld hl,$9340
   b_call(_BufCpy)
   b_call(_ClrLCDFull)
   ld hl,$86EC
   b_call(_BufCpy)
   b_call(_ClrLCDFull)
   b_call(getCSC)
   jr z,greyscaleloop
   b_call(_ClrLCDFull)


As a call routine to set the MSB of the SndBuf, would this routine suffice:


Code:
settoxmit:
   ld a,%10000000
   ld (SndBufSize+1),a      ; i predefined this to $87FF (+1)
   ret
Argh, all those B_Calls!
1. Instead of B_Call _BufCpy use Call ifastcopy.
2. instead of using getCSC, try to use direct input.
aeTIos wrote:
Argh, all those B_Calls!
1. Instead of B_Call _BufCpy use Call ifastcopy.
2. instead of using getCSC, try to use direct input.


1. Done
2. I looked at that. Does it work the same way, because the stuff I read about key groups was scary.

Posting new code in a few.
Okay, a general 'wait for key' routine:

Code:
Wait_For_Key:
ld a,%00000000
out ($01),a
nop
nop
in a,($01)
cp %11111111
jp nc,Wait_For_Key

Warning: I haven't tested this code, but it should work. you can also easy add any commands in this loop. just add them before the ld a,%00000000. If you have any other questions, I am willing to answer them Smile
ok.

Updated code:

http://pastebin.com/R3KwMYPQ
Tested the code; works.
ok. What does that code do? What is the 'out' and 'in'?
It communicates with the keyboard port, which is effectively the keyboard. Out means: you send a byte to the port. In means: You get a byte from the port. More (and better) info about ports is in the asm in 28D tutorial.
aeTIos wrote:
It communicates with the keyboard port, which is effectively the keyboard. Out means: you send a byte to the port. In means: You get a byte from the port. More (and better) info about ports is in the asm in 28D tutorial.


And 'nop'
Nop wastes exactly 4 cycles, to give the hardware time to react (the hardware is a bit slow Razz)
Well, I'll keep that in mind, but for purposes of this game, I will use 'getCSC' and 'call Cn2_GetK' when Cn2 is active. It'll just be easier.

@Kerm: are the keycodes for Cn2_GetK different? And what does 'debounce' mean?
Remember that _getCSC has a very low repeat rate (for repeating keys) and that it only checks for 1 key.
  
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 1 of 4
» 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