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

Pages: [1]
1
ASM / Re: Renaming a command in TIOS
« on: March 24, 2017, 08:32:12 am »
Could these bcalls be of use for this?
FlashToRAM (http://wikiti.brandonw.net/index.php?title=83Plus:BCALLs:5017)
EraseFlashPage (http://wikiti.brandonw.net/index.php?title=83Plus:BCALLs:8084)
I managed to write a patch which writes zeros into flash and rename QuadReg to Q·dReg, so modifying it in RAM should be doable.
Writing back into flash after erasing the sector is probably also a matter of looping+stack?

However, I can't even get FlashToRAM to work. Since I want to copy page 1, I assume the source address is 0 and number of bytes is $8000. But I don't know where in RAM I should put the copy. Especially because RAM can only hold ~24000 bytes (sector size ~32000); I guess I'll have to use the archive?

2
ASM / Re: Renaming a command in TIOS
« on: March 13, 2017, 09:17:43 am »
From what I've gathered from this thread https://www.omnimaga.org/asm-language/(z80)-writing-to-flash/ it is possible to write into flash by finding a free sector to erase (I assume this is what zStart does, as there seem to be no side effects to the modification), then use WriteFlashUnsafe to write. When editing the original OS tough, don't I have to erase a sector that contains OS information?
I've tried reassembling the 2.43 Disassembly into an 8xu, but without success. I tried concatenating all pages, then compiling (SPASM tells me there are several redefinitions of labels and gives me a small file which, compiled with packxxu, gives me an unusuable 8xu). Compiling page for page of course resulted in reference errors.
(How) can one reasseble a 2.43 disassembly correctly?

3
ASM / Re: Renaming a command in TIOS
« on: March 12, 2017, 10:22:48 am »
Thanks for the tip, zStart is really useful. Unfortunately it seems to get deleted when doing an "All Memory" reset, however when adding it again, the "run on RAM Clear" option is still installed.
I checked Bit 2 of port 02h to confirm the flash is unlocked (http://wikiti.brandonw.net/index.php?title=83Plus:Ports:02)
I don't think I can avoid messing with the OS tough

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

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




6
The Axe Parser Project / Re: Dynamically access variables
« on: December 13, 2016, 03:40:37 pm »
Works fantastically, thank you both so much for your time!
I revised the program to use zero-indexing, good hint  :thumbsup:

7
The Axe Parser Project / Re: Dynamically access variables
« on: December 13, 2016, 01:35:49 pm »
Very nice, the ternary solution is already so much cleaner!
If I understood right, a pointer-table would require me to write the adresses of all Pic variables into a Buffer first?

8
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]