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 [4] 5 6 ... 317
46
TI Calculators / Re: Nover 3 "reset detected" loop nspire CX II
« on: December 23, 2020, 12:40:15 pm »
Nover 3 was created ~7 years ago for the nspire. The nspire CX II is similar, but fairly different and I would be surprised if nover 3 even worked on the CX II. That said, I don't really follow the CX II series, so I could be wrong. I just know the software and hardware have changed since the original CX models.

47
ASM / Re: looking for a code exorcist
« on: December 19, 2020, 08:03:19 am »
Sweet baby carrots :0
Maybe the actual circuits bare degraded causing bits to linger on the bus or something? Other idea: it looks like the code might be missing the 01 in the "ld bc,**" instruction (01xxxx) because he LSB comes first.
Code: [Select]
$0000  1 nop \ nop
$0001  0 ld bc,xx00h (DB00 in your case)
$0002  1 ld a,(bc) \ nop
$0010  1 djnz $+0
$0011  0 ld de,xx00h
$0012  1 ld (de),a \ nop
$00F0  1 ret p \ nop
$00F1  WTF pop af \ nope (oof!)
$00F2  0 jp p,xx00
$00FF  0 rst 38h \ nop
Once the program is on your calc, if you could hex-dump it, then we could check if maybe it is missing the 01.

48
ASM / Re: WikiTI
« on: December 08, 2020, 08:13:42 pm »
Oh, thanks for confirming that. I know the code to set 15MHz mode does take some advantage of that, because it essentially writes a 0 to port 20h (mirror of the link port) on those calcs which is generally safe, but writes a non-zero value on the other calcs.

49
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.

50
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).

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

52
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 :)

53
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.

54
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)

55
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.

56
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).

57
Nice work :O

58
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 .__.

59
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?

60
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:

Pages: 1 2 3 [4] 5 6 ... 317