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 - Xeda112358

Pages: 1 ... 72 73 [74] 75 76 ... 317
1096
TI Z80 / Jade
« on: February 26, 2013, 03:16:23 pm »
After reading some Atari documentation and also seeing some of the documentation for the 84+C, the way I saw what was considered "acceptable" assembly completely changed. For the past few years, I have procrastinated on this project of mine, but last night I started from scratch and it is almost finished.

I have basically created an emulator for a processor that doesn't exist. I created the instruction set to emulate and the ports. I originally modeled instructions and interactions based on how the z80 does it and so the process of completing the instruction set was tedious. I completely changed my approach and here are the stats:

The instruction set is 6-bits, so there is room for 64 instructions but not all are finished. You have 256 bytes of RAM, the first 42 bytes (it will probably be more before this is finished) is for interacting with ports and the last 128 bytes is for a stack. There are 512 bytes of code space and there are no registers. This was the main spark of insight I had last night. Instead, you work directly with the RAM. Here are the instructions currently emulated:

Note that all values are 1-byte.

ld (addr1),(addr2) loads a byte from one RAM address to another.
ld (addr),const loads a byte into the RAM address
add (addr1),(addr2) adds two bytes of RAM together, storing the result to the first byte. Modifies C and Z flags
add (addr),const adds the constant value to the byte. Modifies C and Z flags

You get the idea, I am sure, so here are others that follow the same structure:
adc
sub
sbc
xor
or
and
cp    (compare two values)

And these are some more:
inc (addr)
dec (addr)
push (addr)
push const
pop (addr)
ex (addr1),(addr2)   ;exchange two bytes
ret
ret z
ret c
ldir (addr),size,data   ;copies inline data of the given number of bytes to a ram location specified by (addr)
ldir const,size,data   ;copies inline data of the given number of bytes to a ram location specified by (addr)

It is important to note that the ldir commands are very useful for setting up the ports.

there are also the jrf, jrb, callf, and callb commands. Each of these can work on a condition of c or z (not nc or nz).

jrf jumps forward a given number of bytes.
jrb jumps backwards a given number of bytes.
callf calls a relative routine that is within 256 bytes ahead
callb calls a relative routine that is within 256 bytes behind

Anytime a relative jump or call is made, it will never execute code from RAM. If you go past the 0~511 byte code range, it will loop back around.

There are 8 sets of 4 ports for sprites. The ports are ordered:
LSB of sprite data
MSB of sprite data
X coordinate
Y coordinate

In all, these makeup the first 32 bytes of RAM
Port 20h is the Sprite Update Port. When a sprite is drawn, its corresponding but gets set here. You can reset all of the bits here, then read from it to figure out when all of the sprites have been drawn.
Port 29h is the Sprite Mask Port. Set the corresponding but here to have the sprite drawn. Compare this port to port 20h to see if all the sprites are drawn.
Ports 21h~27h hold values for keypresses
Port 28h is the Key Mask Port which determines which groups of keys get polled

2Ah holds the stack pointer.


Anyways, I would offer an upload or something, but I cannot get it off of my calc, once again. Also, it is currently written in Grammer code, but I plan to convert it to an assembly program. My first attempt is going to make a Pong game and all I currently have done codewise setting up the ports All of the mentioned instructions work by the way, all I need to do is emulate the ports :)

1097
TI Z80 / Re: Slova progress
« on: February 26, 2013, 10:15:38 am »
Cool, I hope you can find some down-time. This program has some really awesome potential.

1098
TI Z80 / Re: Random Maze Generation (Grammer)
« on: February 26, 2013, 08:40:34 am »
You can change the size of the of the squares, so it was just easier than scaling a sprite to fit the size of the path. I did have a version that used a built in sprite when the path size was 5 pixels wide, but I got rid of it :/

1099
TI Z80 / Re: Random Maze Generation (Grammer)
« on: February 26, 2013, 06:52:10 am »
I finally have the program all typed up and everything :) By changing the starting values:
S = Size of square
A is the height   (max=32)
B is the width    (max=48)

The larger the playing field, the longer it takes to create the maze and it takes so much longer to get through it o.o I am also working on another algorithm (slower, probably), that will hopefully make more complicated mazes.

1100
Other Calculators / Re: TI-Concours - last days to subscribe !
« on: February 26, 2013, 06:37:06 am »
Hehe, I am getting anxious! I have a vacation from the 9th to the 17th, so hopefully I can get much done for TI-BASIC (68K and z80).

1101
Grammer / Re: Grammer 3-Concepts, ideas, requests
« on: February 26, 2013, 06:28:36 am »
@ghest: Coincidentally, I just found that bug for the first time yesterday, too o.o (I was working on another project). I am not sure what would cause it, but I will try to figure it out. You have the latest complete release (the one that comes with a readme), but this is the latest update: http://ourl.ca/13558/336252
I am not sure if I broke anything in that version, though :/

@Matrefeytontias: Grammer 3 won't be using the OS tokens or the OS program editor, so I won't need to worry about that. I am working on creating a custom program editor and token set. I am also trying to keep it customisable, that way it can be easily ported as a BASIC program editor, Axe, or Assembly, but that is really difficult x.x

1102
Grammer / Re: Grammer 3-Concepts, ideas, requests
« on: February 25, 2013, 04:44:56 pm »
yes, I am sure it will and that is what the extended commands are (multi-byte tokens, basically). So for example:
Code: [Select]
F800     ;Command 0 of one of the extended token sets
I was also trying to figure out a good way of allowing the extended sets to have extended tokens just in case, but I don't think I will need to do that (will we really need 3-byte tokens? :P)

1103
Grammer / Re: Grammer 3-Concepts, ideas, requests
« on: February 25, 2013, 04:31:27 pm »
Yeah, that is what I am worried about. Basically, for the extensions, the appvar/app/program would need to contain all of the code for handling certain commands. I am pretty sure that I have gotten a good format for calling the extended commands, the difficulty is in compiling the programs that use extended commands. Actually, this is the same problem for built in commands, too XD. I could manually create a Grammer 3 program at the moment, but having a compiler would be much less tedious. Basically, for something like the Rect() command, this:
Code: [Select]
Rect(X,Y,8,8,2)
Needs to be converted to:
Code: [Select]
20        ;20h = Rectangle command
10 0000 ;10h says it is a 1-byte integer, 0000 is the compiled offset into the integer table
1F        ;ends the argument. Think of this like a comma.
10 0100  ;another 1-byte integer
1F
08
1F
08
1F
02
1E      ;end the command. Basically an ending parentheses
So I know what it is supposed to compile to, it is just that I need to work up the motivation to create the compiler x.x I actually started writing the compiler a few months ago in Grammer 2 code after I added in the new Input command with syntax highlighting.

1104
Grammer / Re: Grammer 3-Concepts, ideas, requests
« on: February 25, 2013, 12:36:42 pm »
Oh, yes, that might be useful (the header thing). As well, floating point numbers are a different type from integers. Integers also have signed/unsigned, and 8,16,32, and arbitrary sizes.

1105
Grammer / Re: Grammer 3-Concepts, ideas, requests
« on: February 25, 2013, 05:40:26 am »
Y before X is because in TI-BASIC many commands are that way too. Grammer was made specifically to get TI-83+ BASIC coders used really fast to it.
Yes, precisely, like with the Pixel commands and Text( in TI-BASIC.
And I am not sure I understand header files, but does this sound useful:

I have planned for Grammer 3 to keep the last 16 tokens for an extended command set. In TI-BASIC, there are a handful of two-byte tokens which is basically what this is. The difference, though, is that you can load different command sets into your program. For example, if a command set is made for 3D rendering, called 3DRender, you might do something like:
Code: [Select]
Ext0 3DRender
I haven't quite gotten down how I want to incorporate this code-wise. I will want to let the user install command sets as either appvars or apps, but I will have to have some format to tell Grammer what arguments each command can take x.x Grammer also has some pretty high-level variable structures like n-dimensional arrays, actual string support, sprites, bit-maps, integer math and there are still a few more types that I am working on like Floating-Point and fixed-point math. The editor is just a real pain, still x.x The format that I currently have, though, makes it easy to jump to sections of code and edit things like sprites in-line :)

1106
TI Z80 / Re: Random Maze Generation (Grammer)
« on: February 24, 2013, 07:47:42 am »
This is actually a type of algorithm that would be much better in Axe or Assembly, so I was thining of porting it later today. Luckily all three languages are similar enough that porting won't b too difficult.

1107
TI Z80 / Re: Random Maze Generation (Grammer)
« on: February 23, 2013, 09:26:14 pm »
I have a program on my calculator where you try to navigate through the maze. I inflated the pixels to 4x4 so you can only see a portion of the maze, and that should make it more challenging. Unfortunately, I cannot send anything from my calculator to my computer, so I will have to find time to type it into either WabbitEmu or SourceCoder later.

1108
TI Z80 / Random Maze Generation (Grammer)
« on: February 23, 2013, 04:07:51 pm »
I started working on a maze generating thingy after seeing KermM's BASIC algorithm (using the DCS7 AnsStack command). I have coded this in Grammer and I am still working on optimising it more. If you want to edit the size of the path (2 pixels wide, 3 pixels wide, et cetera), open the source and change the value for →S. 2 makes a 1-pixel wide path, 6 makes a 5 pixel wide path, for example. On my actual calc, I have an actual game started, but I haven't been able to transfer my programs.

Here is the code:
Code: [Select]
:.0:Return
:Full
:3→S
:Fix 16
:96/S
:*64/S→A
:Send(+A,"VYπ→θ+A→Z
:π86EC→W
:π9340→V
:Lbl "BTR→T
:Lbl "pxl-Test(NEIGHBORS→U
:Fill(0→N→X→Y
:ClrDrawZ
:Disp W
:ClrDraw
:64/S→A
:96/S→B
:Horizontal A
:Vertical B
:Line(S*B-1,S*A-1,S,,0,V
:Pxl-On(A-1,B-1
:!Repeat N
:int(Z+N,X
:int(θ+N,Y
:Pxl-On(Y,X
:Line(1+S*X,1+S*Y,S-1,,0,V
:If 15=prgmU
:prgmT
:!Repeat and A
:e^(randInt(0,4
:End
:→A=2
:+X-A=1→X*S
:+1+A=1
:-A=2→B
:Y+A=4
:-A=8→Y*S
:+1+A=8
:-A=4→A
:Line(B,A,S-1,,0,V
:IS>(N
:Disp V:DispGraph:Disp W
:End
:Stop
:.BTR
:Repeat 15≠prgmU
:N-1→N
:If θ'
:Stop
:(+Z→X
:(θ+N→Y
:End
:End
:.pxl-Test(NEIGHBORS
:pxl-Test(Y-1,X
:+Ans+pxl-Test(Y+1,X
:+Ans+pxl-Test(Y,X+1
:+Ans+pxl-Test(Y,X-1→A
:End

That creates a maze that is guaranteed to have a path from the upper left corner to the lower right of the screen.

1109
News / Re: First 84+CSE game come out!
« on: February 23, 2013, 10:41:23 am »
We can probably set up some kind of an interrupt with a keyhook that records keypresses, stores them to a stack of some sort, and then executes each keypress when the screen is updated properly and there is time. I made a program that did the second half of this, so I could probably make a program to do the key recording, too :D

1110
TI Z80 / Re: [z80 hex] Small but useful key hook
« on: February 22, 2013, 11:35:53 am »
That seems rather useful and it is pretty clever o.o If I may make a suggestion, maybe you can use ON+Down to scroll to the bottom of the code or ON+Up to scroll tot he top? This might need to be tweaked since I am not home and cannot test the code, but I modified it to:
Code: [Select]
:AsmPrgm
:21A89D
:110080
:011E00
:EDB0
:210080
:7C      ;instead of 3E01
:EF664F
:C9
:83
:FDCB0156
:C8
:47
:DB04EE08E608    ;Test if ON is pressed. Returns A=0 and z flag set if ON is pressed.
:C8
;0505
;1005
;EF5A491805
:1003
:EF5D49
:AF
:C9

Pages: 1 ... 72 73 [74] 75 76 ... 317