Im just using this as a way to show off some of the graphics that Ive been working on for one of my projects. This is only a small subsections of the material, but it gives a good idea what the rest is like. Ill try to post new demos here occasionally whenever I get the motivation to. All the [key] lines in the menus are dynamic. If the key is rebound, it changes to the new key.
Also one of the screenshots shows some random token in one of the lines of text. I noticed. Ill fix it.
A long time ago I made a small font program editor. At @Xeda112358's request I recently revived it and am working on beating it into a working shape. Im posting it here so I don't have to constantly upload to a 3rd party site every time I update it and on the off chance someone else might want to use it.
I am using the crystal timers for very precise timekeeping and I want to know if I can disable and enable interrupts for certain small routines without that throwing off the timer.
What does using ei and di to enable and disable interrupts do to the interrupts 'timer'? Does it pause it so that if an interrupt would occur in 1000 t-states before interrupts were disabled, it would actually happen 1000 t-states after they were enabled again or does it happen 1000 - (amount of t-states that interrupts were disabled for) t-states? Does using the crystal timers vs normal interrupts make any difference?
I did some research and experimentation and I found out how to use the built in Auto Power Down (APD) feature in an assembly program. I couldn't really find any kind of relevant documentation on WikiTi so I just looked at the memory areas that looked related and tried some things until I got something that works. Since I found this all out by experimentation, there is a chance that I could be totally wrong and that the calc doesn't go into low power mode or something but I'm pretty sure that I am correct. I guess the only way to tell for sure is for me to stick fresh batteries in a calc and run it in an assembly program until it dies and then to do the same thing for my APD but that could take weeks to a month.
The routiene in Axe (but it is very easy to translate to assembly if you want):
:GOff();If you are using graylib or any custom interrupt, turn it off here. If not, skip this step :*save 0x8000*;The APD destroys 256 bytes starting at 0x8000 so if you use that area for storage, you will need to back it up. If not, you don't have to do anything. :0x180C->{0x89F8}r;Set some flags so that it works :0x0101->(0x8448)r;Set the APD timer to right about to shut off :Asm(FF);Call the OS interrupt (This is 'rst 38h' in assembly) :FnOn;Interrupts should be on at this point because of the last line but it doesn't hurt to be very sure. (This is 'ei' in assembly) :Stop;Wait until the OS interrupt fires. It is at this point that the calc actually turns off (This is 'halt' in assembly) :0x7469->{0x8448}r;Set the APD timer to what it normally is so the calc doesn't instantly APD when you quit the program :0x0804->{0x89F8}r;Restore some flags :*restore 0x8000*;Restore the values you saved. If you didn't save anything you of course don't need to restore it :GOn();If you are using graylib or any custom interrupt, turn it back on here
This routiene turns the calc off as soon as you call it which means if you want your program to turn off after no keys have been pressed for a while, you will have to do that yourself. It works fine if the On key is being held when it starts (which means if you have the user press On to turn the calc off you don't have to wait for them to release On to call this) It doesn't wait for the On key to be released when it is finished so I would put a loop at the end of it to wait until the On key is released.
In my experiments with this it worked fine with all sorts of memory screwed up so as long as you save 0x8000 then you shouldn't have to do any other kind of setup. I don't know exactly what flags I am messing with (since I am too lazy to look up what they are - something like iy + onflags I think) in the two flags steps but I know they are nessicary and that there doesn't seem to be any kind of ill effect from setting them in that way.
Hey, I'm still working on this game for some reason.
It has been a while and I haven't had much time to work on Driller kNight since I have been away at college but here is an update anyway.
I am planning to release updates to the game on the first of every month to help boost the site and to give myself a deadline to work toward. Since I have a limited time to test, there is a chance I missed some bug. I would be very suprised if the game crashes but you shouldn't leave important things in RAM anyway.
Some unrelated things about the size of the game: To recompile the whole game takes over 6 minutes. The game is broken up into 8 seperate files and each takes anywhere from 90 seconds (the App) to 15 seconds (the file that creates the saves) The file dedicated to holding constants and variable locations is over 6k
Spoiler For Changelog::
New Features: The game can now be saved in the middle of a level. Be warned that the save file will be >10k and archived. The player can now view some stats such as kills and loot collected Added 1 new unit
Changes: The godmode and random level add-ons are no longer optional Removed the intro scroll when the game first starts The invert screen option no longer does anything although the user's preference is still saved The game now requires 20k of free RAM to run (Was 16k before)
Improvements: Opening / closing menus is now twice as fast Rewrote the Refiner Ai to not be so over powered / RNG based Rewrote the Clearer Ai not to get stuck if there was no rubble nearby Units no longer sit still and wait to die if they have low health and are being attacked Upgrade menu is easier to use and upgrade costs are now clearer The framerate no longer drops by 10% for each repair node built The game now runs ~15% faster in general Fixed the game crashing when revealing very large caverns Roads no longer appear unpowered for a second when a building or road is removed As a result of the previous fix the game now crashes when more than 60 power plants are built. (I could fix this but I thought it was funny) Various parts of the game have been moved around to begin working toward 83+ support Large amounts of the game's internals have been gutted and reworked to make expansion much easier
Outstandng bugs: I beleive that the game will crash if the user doesn't have the 10k-13k needed to create the save file but I haven't tested it. If the game reveals a cavern over 2/3 the size of the largest map it will still crash (Up from crashing on caverns over 1/8 the size previously) The user can save the game right before they finish a level, gain the stats from winning, load the save, finish it to gain the stats again, load the save... On one of the last levels the game states that the user needs to build a Hover Refiner to win even thought the pre-level story clearly states that a Doom Platform is the object.
I would post some screenshots but very few of the visuals have changed.
Quick question: Is there anyway to set an interrupt to trigger in X clock ticks? I was looking at some code and think I found a way to shave ~600-1800 clock ticks off of fastCopy (the lcd routine) if there is.
So... I have been working on porting Driller kNight to the pc. It is going pretty well so far. I even have a screen shot of it running. The graphics are not final. They will probably change a bunch.
As the title suggests, I am struggling with chaining hooks. So far, I have successfully created a Raw Key hook in ram. I have been poking around chaining and have had no luck yet. (only some interesting crashes) Here is What I understand I need to do: save the 3 bytes that hold the pointer and page of the hook that already exists, install the hook and quit. The hook runs my code then switches the page at $4000 (I assume the existing hook is an app) and calls the saved address. It then switches the page back to what it was originally and returns. Am I missing something here?
Here is the newest release of Driller kNight! I have added a huge amount of content since my last release. Eight new units and several new buildings have been added. Combat has been added to the game and giant monsters made of rock have come to destroy your base and slugs are sliding in to drain power from buildings! A story has been added to the beginning of each level and a conclusion at the end of each level. Each unit and building has a range of tasks and many have special abilities. The settings menu is well developed and allows frameskip for faster games, greyscale tuning, difficulty adjustment and more. The game takes about 10 hours to complete, but 100% completion takes more than 40 hours. It still will not run on an 83+ however. There are 2 addons, Godmode and RandomLevels which I will release on August 19 and September 2. These add on to the original game and allow for many fun new games but aren't required to play.
Spoiler For Old Version:
After several months of long programming sessions I have finished Driller kNight, a full length overhead mining strategy game. It has 20 levels. Unlike most games, the levels can be chosen. You can choose between 1-3 levels to beat in order to progress deeper. The only exception is that the first 11 must all be beaten to unlock the last 9. There are 15 units and 6 buildings. It will not run on an 83+ due to lack of memory.
It may not be an on the edge of your seat excitement, but it is a fun way to pass some time. I believe that the screenshots speak for themselves, so... here is the download.
Spoiler For more detailed overview:
Driller kNight - Release
The controls are pretty simple. 2nd is always the select key. Press and hold it to create the drag box. Alpha selects or unselects a tile. Stat opens the menu for a unit. Pressing left or right changes the current job. (if it is a job the unit cannot have, it will change to one it can have once the menu is closed) Some units can only have one job, while others can change it. XTOn places a road on the selected tile. Delete kills the unit or building selected giving a refund if needed (select buildings by selecting their tile) The building menu only opens if you have selected a tile. Clear is always quit. Be careful not to press it too long since it will quit the level. Press mode to end the level when you have completed the goal. Pressing ON+stat pauses the game and turns the screen off. Pressing ON will resume. (If you don't press it, you can keep playing after the goal has been completed) Once the first 11 levels have been completed, the last 9 will unlock.
Tech tree: Storage: recruits workers and is where resources are deposited Small teleport: recruits everything below Loader dozer Power plant: powers nearby roads Support station: adds 10 air a tick (almost every unit uses 1 per tick) assuming it is next to a powered road Large teleport: recruits every unit from Loader dozer up Refinement station: Generates ore and crystals Buildings that need to be powered must have a powered road next to their main tile (the one you selected when you built them if they have multiple)
Units: Each unit can hold one of three jobs - Driller, clearer, or collector. Drillers mine the wall they are currently on and move to a nearby one if there is one. Walls will collapse (basically mined for free) if they are not next to two other walls. Clearers act just like drillers but they target the rubble left behind after the wall is drilled. Collectors collect the ore and crystals that are left behind by the clearers and drillers. They target crystals before ore and bring them to the nearest storage. It is your job to figure out what all the units do. Be warned that the infinity ship is huge drain on resources.
General question: Does anyone know how to use the Menu hook? (and be willing to teach me how to use it) I am familiar with how to use other hooks (home screen and key) My current attempts have lead to some screwed up menus. (At least that much of the hook works) I mainly use Axe, but can easily enough hash out a solution to a problem in assembly. (I'm really just looking for some example code - I don't care if it is Axe or assembly and it doesn't even need to be commented!) Thanks for any help!
Several people (myself included) have posted about using Mimas to create Axioms. I decided to write a tutorial on how to create an axiom using Mimas.
Getting set up: Download Axe. Open it up and find the files called TokenHook.inc and Axe.inc. Download Mimas. Open it up and find the file asmTo8xv.exe. Drag both files one at a time over asmTo8xv. They might need to be in the folder for it to work. That should create the files TOKENHOO.8xv and AXE.8xv Send TOKENHOO.8xv and AXE.8xv to your calc. (If you don't already have Mimas and Axe this probably isn't for you)
Create a new program IN MIMAS. Whatever you name it, DON'T name it the same thing as what your axiom is going to be called. Open the menu for that program and chose 'Libraries'. Add both TOKENHOO and AXE. Now you are ready to start programming! If you are unfamiliar with the Axiom format, Axe has a file on it in the 'Developers' folder.
DWAXM_HEADER ;This tells Axe that this is an axiom ;these name can be found by pressing 2nd + catalog and opening AXE DWDispHLEnd ;sets the size DBAXM_ALL ;It works for all compile types DB$27,$00 ;It will be the token fMin( found under math DBAXM_INLINE ;It is inline DBAXM_1ARG ;1 argument, A number in this case RORG0 ;This is the start of the axiom's code! BCALLDispHL ;The argument is already in HL. All we have to do is display it! DispHLEnd: ;End of this command's code DW$00 ;The end of the axiom DWhFmin ;which token to replace DB6 ;the replacement is 6 characters long DB"DispHL" ;thats all! Now to compile! Before compiling choose your axiom's name. It MUST be different from the code's name or it WON'T WORK! Create a program in a include your axiom. Compile once with Axe to convert the axiom to an appv. Once you open you program (not the Mimas one!) the token replacements should show up. (if you made any) If it just displays one empty line, your token repalcement was bad. Pull the batteries and try again. You should have successfully created an axiom with Mimas!
I made a copy of the Axe parser command list that is available on-calc! Not much say about it, the title is pretty self-explanatory. Updated! Here's the download! (+ some screenshots)
Guess what? I made another small font program editor. Yay. Well, I made a lot of improvements - especially on the frame rate. My first attempt got a screaming frame rate of 3 fps. On full speed mode. It was terrible. I made some optimizations and this version gets 10-20 fps. On slow speed mode. Kinda faster. My old editor couldn't open programs that had fewer than 8 lines. The new one doesn't care. There are a lot of other improvements I won't bother mention. I am posting it now because it has reached the point where I am using the editor to edit itself. Trippy right? It would be cool if I got some responses or even better yet - IDEAS! (Or even better yet - some code!) I have kept some of zStarts key shortcuts such as on stat to APD and on + to copy and on enter to paste. (the copy and paste code is buggy and is commented out for now) I am in full bug-hunter mode - please tell me if anything is weird (even just the controls) The only known bug is copying code and then evaluating it. (copy then on+ math) The code needs to be compiled (as an app or program) you compile prgmEDITRSRC
on key combos: on + / Sets a boundary on + + copys all the code between the boundarys on + enter pastes all the copied code to the cursor's location on + math evaluates the copied code There will eventually be recall from progNAME in the copied code also
I'm probably going to keep working on it whether or not it gets any interest. (but it feels great to get some support)
Well... I have some random questions... I think I understand asm enough to take responses that way. (Write the code in mimas, decompile it to hex and insert it in my Axe program.) I use the on key frequently, but that seems to break the equation evaluator since it counts as basic. Is there any way to clear the ON break error? (I already used runprgm's error handler to no avail.) What are the arguments for the Axe compile B_CALL? Is it the program name in op1? Is there anyway to tell for sure if you have memory corruption? The program behaves normally except when it is asked to create a new program. (It behaves weirdly like saying the prgm took up x bytes but displaying many more in the editor.) In order to find custom tokens in axioms the program reads the compiled axiom. Is there a better way to do that?
That is all I can think of now... Thanks for any help! (Even if is a link)