I use ld s on absolute addresses, not relative ones... Did I misunderstand ?
Notice each command's code starts with .org 0. This means that all the labels in your code are offsets relative to the start of the code, and the REP_NEXT macro signals that the next 16-bit immediate value is such a relative value to which the actual base address of the code should be added when compiled.
The ABS_NEXT macro signals that the next 16-bit immediate value is an absolute (fixed) value that is not relative to anything and should not be offset.
Oh. Okay I knew about the ".org 0" and its pupose, but didn't understand how the prefixes were supposed to be used.
-> Info : I'm using Axe 1.2.2a. Which one do you use Runer ?
Same.
Still, the token hook doesn't work on my setups (both real and emulated). Could you transfer me your compiled program file to see if the problem comes from my calc or the compilator ? Thanks.
I'm currently porting a big project from BASIC to Axe, and I needed to store flags (for account managing). That's when I realized that Axe lacks bit support ({A}e0 works fine, but there's nothing like 1->{A}e0 to set / reset flags)
Or you can do {A} or value -> {A} and {A} xor value -> {A} to set/reset a bit (with value from [1-2-4...-128]
As for token hook doesn't working, quickly looking at the source didn't give me apparent errors, but since you use a lot of SMC, it is kinda hard to see Maybe a more experimented axiom coders could tell, or me taking more time to look/test, but time is precious for me these days
If time is precious, go along then.
There only is one instruction modified per function, the last one (with all the .db s). It is a bit / set / res n, (iy+nn). The goal is to write the offest first, then the correct opcode (for ReadFlag( and WriteFlag( only)
As for functions behaving incorrectly, I see two issues in a first look:
The code you use to signal that the next address should be replaced actually signals not to replace the next address. The correct signal is $7F. I'd also advise using the REP_NEXT macro provided by Axe.inc instead of producing the signals manually, although some tweaking may need to be done for it to work properly in some assemblers.
All arguments are passed as 16-bit values, but you pop some off the stack into af. This puts the low byte (the one you want) into f, not a. You should pop these arguments into a 16-bit register pair and then move them into a.
pop af places the high byte into a ? Strange, ReadFlag( and WriteFlag( work fine for me, but they use some pop af. I'll check that. I compile using ClrHome's online assembler (DEVPAC8X doesn't work on my computer for unknown reasons), and when using REP_NEXT it pulls an error.
Quote from: AxiomSDK.txt
; The following prefixes will change the replacement policy: ; ; $7F Next instruction is a relative address. ; $40,$Offs Next instruction is a relative address with an unsigned byte offset. ; $49 Next instruction is an absolute address.
I use ld s on absolute addresses, not relative ones... Did I misunderstand ?
After working a lot on TI-BASIC, I came back to play with Axe. However, I also learnt much thanks to Eeems' Learn Assembly in 28 Days (Kudos to him !)
I'm currently porting a big project from BASIC to Axe, and I needed to store flags (for account managing). That's when I realized that Axe lacks bit support ({A}e0 works fine, but there's nothing like 1->{A}e0 to set / reset flags) So I finally wrote an Axe library (which turned to be composed of assembly code by 99%), then an Axiom.
It allows to write to and read from 3 groups of 8 flags each using hl. (asm programmers : these are asm_flags1 to 3, as you must have guessed)
The code almost works, but there are two problems : one is that one function behaves incorrectly, the other is that the token hook doesn't work... And I don't know why. Before posting here the final version, I ask help, mainly for the second problem. I don't understand why the token hook doesn't work at all.
Wow, thanks for the quick reply. I don't see what can be folded, though.
Numbers are properly highlighted (including A-F and a-f being only included when using a $ prefix or h suffix), however there are two bugs that I'm not able to correct due to UDL not allowing me to do so : First, binary numbers aren't correctly highlighted : %10010110 is colored as intended, but %12345678 is too (whereas it shouldn't) The other bug is that is a comma follows a number, it won't be highlighted (.db $FD , $CB colors both numbers, but .db $FD,$CB highlights none).
Hello Notepad++ users that are also z80 programmers, ISSOtm here !
I launched myself into assembly programming, and chose Npp as an editor because Windows default Notepad is too "default". However, I missed the syntaxic coloration, and although choosing "Assembly" language properly colored the comments, the instructions were black.
Thanks to version 6.0 (5.0 ? Don't remember), we are now able to define languages by ourselves.
Quote from: Kevin
That already existed before 6.0 !
Yes, but it used to be extremely basic, sorry. Now we can define keywords as "prefixes", and much more.
So, if you use Notepad++, here are 5541 bytes for you : the z80 coloration file. Do the following when you have downloaded the file :
Open Npp
In the Language menu, select "Define your language"
In the dialogue box, press "Import..." and find the xml file
Restart Npp
Now you can access "Asm z80" at the bottom of the Language list !
If you're not happy with the name I've given, re-open the dialogue box, and select Language : Asm z80 Press "Rename", and enter the new name. Restart Npp to load changes.
I've put all instructions (including stuff like sll), and compiler instructions (like #define or .org). However tell me if you want me to add more. Redistribution ? Of course you can ! As long as you mention my name.
Here is a screenshot taken of me working with the coloration on :
This project is not dead, I am just near an exam, so I can't really work on it. I am currently fixing the NPC bug which causes render errors, and also working on a pre-implementation of battle systems. The NPC bug isn't apparently linked to my new custom sprite routine (which is more useful but less general-purpose than the Axe's default one), but instead to wrong data being read. I still wonder why.
The battle system currently only displays the enemy stats and sprite, but the only interaction is displaying a "Hurry, get away !" (<-- Reference to this) unless you have the hidden FIGHTING KIT item.
I didn't know that forgetting a comma could corrupt entire memory areas. <-- Yes, that was the bug But there is another (graphical only) glitch : when NPC render, sometimes a copy of the player's front sprite appears at an apparently random position (depending little on the NPC position). Also, when it is in the bottom right quadrant of the screen, the cross NPC doesn't render. At all.
I'm also converting the sprites to the new format ; anyway, because I don't use Pt-Mask( anymore, sometimes I don't anymore need the mask = optimization ! 11326 bytes used on a 16384 large app : any suggestions for new features ?
Development is being slowed down during holidays, because I want to spend some time with my family.
I think I'm going to use a custom sprite routine (written in a combo of Axe and Hex) to display NPCs. Here is the code ; I don't know : 1. Is it faster than Pt-Mask()r ? 2. Same question for size ?
Here is an example program, will display a chest which will be used in a near future version :
Code to write
Assembly equivalent (when possible)
What does it mean
SPRITE(0,,Pic5PRITE) DispGraphClrDraw getKey r Return
:Copy(GDB7NPCS,L1) This won't work, because when you compile the app, the data in GDB7NPCS is set in stone and can't be modified because it's part of the app. My bet is if you changed everything like this to utilize free RAM areas or some temporary appvars, most of the errors would go away.
No, it will work, because it copies data FROM GDB7NPCS to L1 (which is is RAM, because I sometimes edit NPC data)
And with the way Axe compiles apps vs. programs, you have to change the code a bit to work. (eg. you can't change data in GDB's in apps) I'll take a look and see if I can find anything.
RIGHT ! There is the bug ! It is because I didn't read Axe command list correctly
Quote from: Quigibo in Axe command list
nib{EXP} Returns the EXPth nibble in RAM. Use this to access external data in RAM. Since there are twice as many nibbles as bytes, make sure pointers are multiplied by 2. nib{EXP}r Returns the EXPth nibble in RAM, or ROM if compiled as an application. Use this to access internal data. Since there are twice as many nibbles as bytes, make sure pointers are multiplied by 2.
When I was using ASM programs, I used nib{}. When this code was compiled to app, it looked for data... in RAM, not the app. Thanks for help, now it works !
CHANGELOG : ! Now compiled as a 16kb app ! + Added a pickaxe and a breakable wall ! + Added a maze ! < Where am I ?? | + Added an option to "Fast-Forward" the game (actually uses Axe's Full function) + Added an option to reset the save while in-game (before, it needed either save hacking or to manually delete the save fie) + Added some kind of tutorial level + Now with ladders ! * Fixed a bug with the "dig landmark" cross not appearing upon resetting save, but appearing when re-starting the game. * Fixed a bug with the save text not being cleared when cancelling save procedure * Introduced bugs, I think
The files are coming as soon as the pickaxe and ladders are fully implemented and (mostly) debugged.
[EDIT] Done, but I'm currently adding the inventory. It is almost finished, I just need help from a friend to finalize the item sprites
Do you plan to make this a Flash app or program in its final form?
Oh ! I was planning to announce this ! ...Yeah, it seems that I'm going to need compiling as an app I finally reached THE limit : my calc refuses to run the program, it is too large (8713 bytes raw, + 14 header bytes = 8727, hey, I thought it was possible to run programs up to 8816 bytes large).
Quote from: Quigibo
There is also an option to compile to applications. This uses very hackish code and may not work on all models of calculator so be cautious when using this feature as this is the one that can cause archive corruptions if the it fails to write the application correctly.
I'm making a backup
Now, I am just afraid of one thing : the Archive is actually Flash Memory, and if it is as the SSDs, it can be only written to a limited amount of times (I found 100,000, can anyone confirm ?). I don't want to make it un-erasable !
[Compiled once...] Wait, it looks like the map is corrupted. Sprites, too ? Oh.
[Compiled twice...] Wait, Axe displayed "Size : ROBOT" (which is the name of the Omnicalc font I'm using) ? The game IS corrupted , not the source, but the app went mad.
[Compiled again, unarchived the source...] <-- Yes, that changed the app There is DEFINITELY a problem. I uninstalled Omnicalc, to see if that fixes anything. No way. The sources are on Dropbox, can anyone try to see where is the problem ? Maybe it is just Axe that fails.
Very nice so far, looking at the scrreens. Gonna try the game when I have computer access.
Thanks ! If you try the game, you will "finish" it quite quickly, I need to make a better scenario / bigger map (< Note : remove this when game is completly coded)
The cross that spots the key disappears when it is taken >DONE It is also saved in the file, actually I implemented the save of NPC visiblity
A better animation when unlocking the locked door in the garden >DONE
Removal of some now unused code >DONE
Optimization on checking whether you should be able to walk or not on the target tile, >DONE (and another one is being done) that should also make movement smoother. >The script is faster only when the tile you try to walk on isn't walkable
Expanded scenario and map ! >BEING DONE
A bit more than 7200 bytes Found (one) strange bug : when selecting Enter to start the "Save" sequence, if you press Enter before the text appears, it will not process the save sequence, but instead trigger the interaction script. Unknown reason. I think others will follow (der:P)
ISSOtm: you seem to be using Dropbox as your image host. When you do that, please make sure you put the images in the public folder and copy the links from there. Currently, they seem to be in a non-public location because I can't see them (Dropbox gives me an error saying I'm not allowed to view those files, so your images will probably only show up to you and not anyone else).
Moved the files, here are the screenshots !
Spoiler For Screenshots:
Sorry if the screen sometimes garble, it doesn't happen on my calc, but on TileM it occurs
Your very first screen !
Interactable signs !
Door warping !
Dang. A locked door.
Save and reload !
Isn't there something ?
Now with NPCs !
Spoiler For Cheating device:
Updated to display more data !
Example : warp to an out of bounds location which displays a glitched terrain WARNING : Pressing Enter in this kind of zone may lead the game into interpreting garble data as tile interaction, and will trigger invalid routines (you may freeze the game, make it return with a ERR:SYNTAX (don't know which RAM address is called at that time) or just crash / freeze the game with a RAM clear)
Enter a different area with exactly the same graphics and interactions, but without warps or NPCs
Example : kind of walk through walls cheat
If you enter a zone you usually can warp only if you entered aan odd number of doors with having entered and even number of doors (and vice-versa), you will stay on the doors after warping. This is because a flag is changed when walking through a door. This now works differently, so this glitch doesn't work anymore !
Little screen you might encounter
Spoiler For Walkthrough part 1:
Spoiler For Walkthrough part 2:
Spoiler For Walkthrough part 3:
Spoiler For Walkthrough part 4:
Coming when this part of the game will be released !
Development is going on, bugfixes and bugs came with it, as did NPCs ! Saves created with old versions may give strange bugs. I recommend : 1. Delete save file 2. Use Cheating Device to set MapID to 0, and fix other strange values by yourself. Remember : the save length changed !
I also released a cheating device, which can't edit data while the game is running, but can hack the save after execution.
There now is a very strange bug with it : when you open it, it changes save data even if you don't open the save file [EDIT] Fixed, but another bug has been introduced, and it makes the game unplayable. Release is delayed.
Now it is made differently : 1. It is not possible anymore to walk on it 2. It will be possible to remove the cross when digged, and then to walk on where it was. I just need to be less lazy and implement NPC state save
Example : rotate your guy without changing its target tile
Now, it does NOT change the tile it is "looking" at, I mean pressing Enter will still trigger the tile you were looking at before "manually" rotating. It is saved in another part of the file
If you enter a zone you usually can warp only if you entered aan odd number of doors with having entered and even number of doors (and vice-versa), you will stay on the doors after warping. This is because a flag is changed when walking through a door.
Nope ! Now it works differently. This kind of glitch isn't possible anymore
Wait, I just need to find the files on my second computer, and they'll be disponible along with new screenshots !