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

Pages: 1 ... 108 109 [110] 111 112 ... 153
1636
Minecraft Discussion / Re: Minecraft
« on: December 06, 2010, 11:47:33 am »
I stopped playing Minecraft the way it was supposed to be played a long time ago. ;D So here's a to-scale, fully accurate construction of a z80 microprocessor! It doesn't do anything without actual processing units, but all the pinouts are fully wired and would correctly mimic the pins on a physical z80 if they were connected to the right things.






1637
The Axe Parser Project / Re: Features Wishlist
« on: December 06, 2010, 11:06:18 am »
That would work too. It would be smaller than the -(^16) solution; every call with a modulo of 2-256 could use the 8-bit and operator and would be 6 bytes, and a modluo of 512-32768 would be 9 bytes. Reverse modulus optimizations would be, on average, about 60% the size of their and -CONST counterparts. Which I guess isn't too much, but if adding it wouldn't be too hard, why not add it and let people save a few bytes. And I think it would be especially useful for the 2-byte ^^256, which could come in handy in some situations.

1638
The Axe Parser Project / Re: Features Wishlist
« on: December 06, 2010, 12:13:32 am »
Indeed it could be. But, especially for the cases where the modulus is a multiple of 2, it would be both faster and smaller to actually have a reverse modulus function. For instance, whereas -(^16) would be 12 bytes, ^^16 would be 6 bytes. As an even more extreme example, whereas -(^2) would be 11 bytes, ^^2 would be 2 bytes.



EDIT: On a completely unrelated note, I like the new filetype that can be attached to posts.

1639
The Axe Parser Project / Re: Features Wishlist
« on: December 05, 2010, 10:37:30 pm »
Here's a sort of odd request: reverse modulus. Instead of returning the remainder of a division, it would return the original number minus the remainder. Perhaps it could use ^^ as its operator? For instance, 16^^7 would return 14 and 9001^^3 would return 9000. I've been trying to wrap my head around how to get a reverse modulus routine to work, but complex math routines aren't my specialty. But I figure the least I could do if you want to implement this feature is save you a few minutes and write the reverse modulus auto-optimizations (really just adjustments to the normal modulus auto-optimizations), which are what I would want the most anyways. I could actually do without a reverse modulus routine.

Code: [Select]
p_RMod2:
.db 2
res 0,l
p_RMod4:
.db 4
ld a,%11111100
and l
ld l,a
p_RMod8:
.db 4
ld a,%11111000
and l
ld l,a
p_RMod16:
.db 4
ld a,%11110000
and l
ld l,a
p_RMod32:
.db 4
ld a,%11100000
and l
ld l,a
p_RMod64:
.db 4
ld a,%11000000
and l
ld l,a
p_RMod128:
.db 4
ld a,%10000000
and l
ld l,a
p_RMod256:
.db 2
ld l,0
p_RMod512:
.db 4
ld l,0
res 0,h
p_RMod1024:
.db 6
ld l,0
ld a,%11111100
and h
ld h,a
p_RMod2048:
.db 6
ld l,0
ld a,%11111000
and h
ld h,a
p_RMod4096:
.db 6
ld l,0
ld a,%11110000
and h
ld h,a
p_RMod8192:
.db 6
ld l,0
ld a,%11100000
and h
ld h,a
p_RMod16384:
.db 6
ld l,0
ld a,%11000000
and h
ld h,a
p_RMod32768:
.db 6
ld l,0
ld a,%10000000
and h
ld h,a

1640
Axe / Re: Mouse
« on: December 05, 2010, 06:17:46 pm »
Of course, I optimized it so you could use it! (And because I get random impulses to optimize stuff)

EDIT: By the way, I just noticed that -4-Str1 should be -3-Str1. Make sure you got the changed version.

EDIT 2: In actually testing the code, it doesn't work as it should have... let me look into this.

EDIT 3: Found the error and corrected it. I got my argument for the pen movement command backwards so it was trying to draw things at a Y-value of 80. Make sure you get the version that has the line Text(*8-3→B*256+80).

EDIT 4: (Wow this is a lot of edits!) I'm guessing your code does this too, but do you also get the lack of borders between the middle buttons? This would fix it:

Code: [Select]
:"WTRSNDMTLSPKOILFIRERS"→Str1
:8→A+1→C
:While A-1→A
:Text(*8-3→B*256+80)
:Text A*3-3+Str1
:RectI(78,B-1,15,C)
:RectI(79,B,13,8→C-1)
:End

1641
Axe / Re: Mouse
« on: December 05, 2010, 06:13:10 pm »
There's actually a slightly more efficient way of doing it. Let's say that you have a series of buttons arranged vertically, as is common in many GUIs. You could arrange the buttons with a simple algorithm like this:

Code: [Select]
:"WTRSNDMTLSPKOILFIRERS"→Str1
:For(A,0,6
:A*8+5→B
:Text(80,B,3*A+Str1)
:RectI(78,B-1,15,9
:RectI(79,B,13,7
:End

This will display three characters from the string for each button and draw a box around the text. When you go to click on a button, you just have to redo the algorithm with with the Y coordinate.

I love optimizing code. :)

Code: [Select]
:"WTRSNDMTLSPKOILFIRERS"→Str1
:8→A
:While A-1→A
:Text(*8-3→B*256+80)
:Text A*3-3+Str1
:RectI(78,B-1,15,9)
:RectI(79,B,13,7)
:End

1642
The Axe Parser Project / Re: Bug Reports
« on: December 05, 2010, 01:52:33 pm »
Are you in the TI-OS program editor, editing an Axe program with an appropriate header? The token replacements only take effect under those circumstances. Also, try opening the Axe application once and then trying it again.

EDIT: It looks like the problem has been solved already.

1643
The Axe Parser Project / Re: Bug Reports
« on: December 05, 2010, 01:49:48 pm »
Port has disappeared from the commands.

It looks to me like it's right where it always was, as a token replacement for ClrTable.

1644
Axe / Re: Mouse
« on: December 05, 2010, 10:42:04 am »
That should work, as long as you insert it into a suitable place in the code. Where did you try putting it?

1645
Axe / Re: Mouse
« on: December 05, 2010, 10:39:38 am »
getKey(15) will equal 1 if the clear key is being held down and 0 if it isn't. That's all it does: return a value. If you want it to actually do something useful based on whether or not it (or any other key) is held down, you have to put it as the condition in an if statement and then put what you want it to do as the contents of the if statement, just like the other 5 if statements already in the code.

1646
TI Z80 / Re: Sprite Editor Feature Requests
« on: December 05, 2010, 12:05:28 am »
That's why I was trying to tell you that I plan to implement a text tool so you can type characters and they get drawn right into the sprite.

1647
TI Z80 / Re: Sprite Editor Feature Requests
« on: December 04, 2010, 11:41:40 pm »
So can you type in the text or you have to do the printing by hand? The latter takes forever and I try to avoid it as much as possible.

Print, as in using the OS text routines to print characters onto the screen.

1648
TI Z80 / Re: Sprite Editor Feature Requests
« on: December 04, 2010, 10:18:34 pm »
Text-to-image would turn text such "Hello" into the hex codes corresponding to an image of the text. Probably not feasible though.

It's very feasible, and is already on the list. All you would need to do is print the text onto the sprite.

1649
Axe / Re: [why] is diplay graph slow?
« on: December 04, 2010, 08:34:33 pm »
To quote Sean McLaughlin from Day 26 of his Learn TI-83 Plus Assembly in 28 Days:
Quote
The TI-85 and higher-number calculators have a memory mapped screen. That means a section of the calculator's RAM that holds a bit image of the screen is constantly being monitored. Whenever a byte in this area is changed, the display changes immediately. It is also possible to change the RAM area the driver looks at with a single port output. By switching the buffer location back and forth rapidly, you could create Game Boy-style flickerless 4- or 8-level grayscale.
Unfortunately, the "crap series" (everything lower than a TI-85) uses a driver that stores the screen image in its own RAM. In order to change the display, you have to send each byte in the image to the driver. It is also a very slow driver which needs a delay every time it is accessed.

The next line, although not applicable to answering your question, is my favorite line in the whole tutorial. ;D
Quote
Hopefully you are sufficiently depressed now, so let's look at how to make the Toshiba T6A04 (that's the name of the driver) our bitch.

1650
Axe / Re: Mouse
« on: December 04, 2010, 07:43:53 pm »
You said it yourself, the problem is the Repeat getKey→Z. Having that in the code will not let program execution advance until that getKey returns a value. When holding down the arrow keys, this will only return a value a few times per second, resulting in the mouse moving code only being reached a few times per second.

I see that you added it so you could press clear to jump out of it, so why not just use direct key input (e.g. getKey(15)) for the clear button as well as the arrow keys?

Pages: 1 ... 108 109 [110] 111 112 ... 153