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] 2 3 ... 314
1
News / Re: Castlevania: Prelude of Chaos ported to PC
« on: November 09, 2020, 04:43:36 pm »
Huh, I bet we could use a calculator as a keyboard for this.

2
TI Z80 / Re: First Fantasy: Mana Force 2020 updates
« on: October 29, 2020, 05:15:13 pm »
That looks wonderful :0
I remember for the monochrome series, the precursor to Batlib actually used a font hook in a similar way. The programmer could use hex codes to create sprites on-the-fly for 0-9 and A-F (so 16 tiles) and then use the normal Output( command to draw a map. (That's actually why Batlib's first set of commands are font- and hex-oriented).

3
Web Programming and Design / Re: Stupid CSS
« on: September 28, 2020, 05:27:49 pm »
That is really freaking cool :0

4
TI-BASIC / Re: Zeda's Hex Codes
« on: September 28, 2020, 05:23:48 pm »
The numbers in binary:
0 ==> 00
1 ==> 01
2 ==> 10
3 ==> 11

So writing a 3 brings both lines LOW, writing 2 sets the upper line LOW and the lower line HIGH.
Writing 0 and 1 do the opposite of 3 and 2, respectively.

The routine here might be useful to you :)

5
TI-BASIC / Re: Zeda's Hex Codes
« on: September 28, 2020, 02:14:23 pm »
In binary, when you write 00 to port 0, it sets the two lines to 1 (HIGH maybe?). Basically, what you write gets inverted.
When you write a 0 to one of the lines, you kind of release it, but when you write a 1 (setting the line LOW?), you kind of lock it there.

So when you have two calculators connected, and one sets the lowest bit to LOW, the other calculator cannot pull it HIGH. But when the line is already HIGH, either or both calculators can bring it LOW.
When both calculators bring a line LOW, it remains LOW until all calculators have "released" it back to high.

A TI-OS-related caveat: at the home screen or in a BASIC program, if the lines are not released, the calc will basically be frozen, so before you return control back to TI-OS, make sure to write a 0 to port 0 (this brings both lines to 1).

Now, given the topic, I would assume that you want a hexcode. There are many ways to interact with the port, but the very basics: 3E0xD300, where x is 0, 1, 2, or 3 will write to the port, and DB00 will read from the port.

6
ASM / Re: HotkeySE | DoorsCS
« on: September 22, 2020, 12:22:36 pm »
I think you can do something like:
Code: [Select]
"HELLO"→Str1
"WORLD"[00]
"THIS"[00]
"IS"[00]
"A"[00]
"TEST"[00]

Then Str1 points to the first zero-terminated string (note that Axe will automatically tack on a 00 when you → a string)

7
ASM / Re: Hotkeys SE | DoorsCS
« on: September 21, 2020, 04:32:17 pm »
What you could do is have a simple menu where the user can move a cursor to highlight an option (like "Edit"), then they press a button to assign to that option. Your code looks for the string associated with the keypress, and if the string is empty (i.e., starts with a null byte), then it isn't a valid option. You also need to verify the keypress isn't already assigned to an option.

It's basically your idea, using an empty string to signify the keypress is invalid.

8
ASM / Re: Hotkeys SE | DoorsCS
« on: September 20, 2020, 09:32:45 am »
Alright, I just got to try this (it turns out the reason it crashed for me was a bug from another program I was testing).

This is simple and practical; good work! It genuinely improves my DCS experience just by having the [.] and [prgm] buttons for renaming and editing. (Especially the [prgm] one as that is quite intuitive, same with [(] and [)] for copy/paste).

9
Nice work :O

10
TI Z80 / Re: Play it safe with the Ti-83+/Ti-84+ Screen
« on: August 27, 2020, 06:33:39 am »
Oh, thank you for adding this update! It's annoying that these new calcs don't work the same .__.

11
ASM / Re: WikiTI
« on: August 03, 2020, 04:41:35 pm »
You can edit the pages on wikiti btw. As for the mirrored port writing being ignored, that's actually really handy to know. I suspect that two different people contributed those facts, or maybe it was he came person who forgot?

12
ASM / Re: ASM Optimized routines
« on: July 23, 2020, 10:53:14 pm »
rand8 (very fast)
I have a beautiful RNG. It is 47cc and 10 bytes.

Code: [Select]
;HL must be non-zero
  add hl,hl
  sbc a,a
  and %00101101
  xor l
  ld l,a
  ld a,r
  add a,a   ;Because R is a 7-bit register
  add a,h
;HL is the new seed
;A is the output, or AL for 16 bits.
Spoiler For Explanation:
Upon first inspection, that use of the R register might look like it is being used as a source of randomness, but it is in fact being used as a cheap counter. This leaves us in a very interesting position: If the R register happens to be random or chaotic in your use-case, then that is good! But if R just acts as a counter, then that is also good, because that is what the PRNG needs.

The basic trick is to combine a counter or LCG with an LFSR to smooth out the distribution of the LSFR. Since LSFRs are very fast, and R is a built-in counter on the Z80, we can combine them to make a very, very fast random number generator that is decent quality.

Now, there are some caveats. Due to the nature of the R register, this does not have a fixed cycle length. On average, it has a cycle length of 5592320 (meaning you could expect it to loop after every 5592320 numbers generated). The cycle length could be as low as 65535 (it is essentially just the LFSR), or as high as 8388480. If you wait for external input between calls, then you basically have a true RNG.
Spoiler For Images:
Here is a gif demonstration:

Another good use-case is fire animation! (sorry for the poor quality gif, it's really a lot smoother IRL)


eZ80 8-bit RNG
If HL is 24-bit, as in ADL mode on the eZ80, then your LFSR needs different taps (but in this case, it doesn't improve cycle length because we are still using H instead of UHL):
Code: [Select]
;HL must be non-zero
  add hl,hl
  sbc a,a
  and %10000111
  xor l
  ld l,a
  ld a,r
  add a,a   ;Because R is a 7-bit register
  add a,h
;HL is the new seed
;A is the output, or AL for 16 bits.

I have no idea what the speed is on the eZ80. 10 fetches, maybe?
Spoiler For Comparison Images:
this comparison might be a little easier to interpret:
(LFSR only)


(combined with R as a counter)


8-bit RNG, 39cc
Apparently even an 8-bit LFSR combined with the R register does a great job at generating noise, so here is an even faster version (faster for the Z80, though this code also works on the eZ80):
Code: [Select]
;E must be non-zero
;10 bytes, 39cc
;min period: 255
;max period: 32640
;avg period: 21760

  sla e
  sbc a,a
  and %01011111
  xor e
  ld e,a
  ld a,r
  add a,e

;E is the new seed, non-zero so long as the input was non-zero
;A is the output
Spoiler For Image:

13
TI Z80 / Re: First Fantasy: Mana Force 2020 updates
« on: June 06, 2020, 04:05:21 pm »
I saw that on TICalc, it looks cool :0

14
Calculator C / Re: What's the best sprite editor for TI 68k C/ASM?
« on: May 21, 2020, 08:00:52 am »
It has been a long time since I did 68k C and Assembly, but I thought that you could basically "include" a .bmp or .png or what-have-you. I know I can do that with the Z80 calcs and probably eZ80.

If so, I always opt for old-school MS Paint, or mtpaint on Linux.

15
News / Re: Super Star Hero, A Futuristic Action-RPG For Windows
« on: May 13, 2020, 06:02:13 pm »

Pages: [1] 2 3 ... 314