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.


Topics - Okimoka

Pages: [1]
1
ASM / Renaming a command in TIOS
« on: March 11, 2017, 07:48:16 pm »
I have a disassembled 2.43 OS which I'd like to modify.
Specifically, I want to rename a Command (QuadReg). The modification should not be affected by a reset.
For that reason I cannot use token hooks or the like, so I figured I'd have to write into flash.
I was able to unlock the flash (copying code from ptterase.z80), but I couldn't get writing bytes into it to work
(talking about this function http://wikiti.brandonw.net/index.php?title=83Plus:OS:Raw_Flash_Commands#Writing).
The String "QuadReg" is at $7D49 (page 1A) and $4D85 (page 1)
I tried "set" to modify the bits and ld to zero the bytes, but it didn't work.

I'm wondering if this is even possible (as wikiti states, the command name has to be in a sector?)
Or would it be a better approach to modify the disassembly, then reassemble to .8xu?

2
Axe / Use "Pause" without stopping game
« on: December 23, 2016, 11:31:03 am »
Edit: I figured, since the z80 is single-threaded, this (using interrupts) is probably the only solution

Sorry, back with another one  :-\
A subroutine, which I will call inside my main game loop, should be executed with a delay of 1 second.
The subroutine may be called more than once in one execution of the main game loop, every loop will last ca. 0.01s.
Obviously, "Pause" doesn't work, because I want the main loop to continue running, and Pause seems to stop the entire program (the game should continue running).
My attempt at solving this was adding this timer to the main loop (I don't expect J to become larger than 256)
Code: [Select]
.Initially I and J are 0
I+1→I
If I=65535
 J+1→J
End
And then, every time I would want to call the subroutine, instead I would write the "time" (I,J) into the free space of a buffer (Buff(30)→GDB1)
(0th: I/256; 1st: I^256; 2nd: J)

So, for example, when I call the subroutine after 30min (180000s) of running time, "J" will be 2 (180000/65536) and "I" will be 48928 (180000^65536), which results in the timestamp:{191,32,2}. Because I want to execute it one second later, I will add 100 to the first value so I get {36,33,2}.
I don't expect more than 10 subroutine calls to "queue" at the same time, so the Buffer is of size 3*10, as I need 3 bytes of space to store the timestamp.
The main loop checks if there is a timestamp in the Buffer which equals the current time
Code: [Select]
For(A,0,10)
If ({GDB1+(A*3)}=I/256) and ({GDB1+(A*3)+1}=I^256) and ({GDB1+(A*3)+2}=J)
sub(DELAY)
0→{GDB1+(A*3)}:0→{GDB1+(A*3)+1}:0→{GDB1+(A*3)+2} .Clear space
End
End
Anyway, this is the only solution I could come up with.
This seems way too complicated for a simple task as delay, is there a better solution?




3
The Axe Parser Project / Dynamically access variables
« on: December 13, 2016, 01:06:17 pm »
Is there a way to shorten this code?

Code: [Select]
If L=1
 Pt-On(...,Pic1)
End
If L=2
 Pt-On(...,Pic2)
End
If L=3
 Pt-On(...,Pic3)
End
...

I tried accessing the images using memory adresses but it doesn't seem like the Pic variables have constant memory space between them.
Is there a way to evaluate an expression as a variable?
Is this already the most efficient you can get?
Thank you for your help!

Pages: [1]