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

Pages: 1 ... 12 13 [14] 15 16 ... 55
196
ASM / Re: Learn Hex/NikProgrammer
« on: July 27, 2014, 11:59:53 pm »
I highly recommend CoBB's z80 guide:
http://sgate.emt.bme.hu/patai/publications/z80guide/

I started with AsmGuru back in the day and thought it was great, but really all it teaches you is how to use bcalls and work with system flags. Not too useful if you want to get started on games as you won't really understand the logic behind things. CoBB's tutorial provides a more theoretical approach i think as does 28 Days and will get you much closer to being able to dive into your own games.

I never spent too much time looking through Hot_dog's tutorial, it came a bit after my tutorial time, but it's in the Omnimaga archives:
http://www.omnimaga.org/files/Our-TI-PC-Products-Music-and-Calculator-Videos/Our-TI-Documentations/

EDIT: You might want to check out the "readme" to CoBB's tutorial, it's got a nice explanation of the dangers of just using other people's code (or BCALLs) without really understanding/taking the time to understand what they do:
http://sgate.emt.bme.hu/patai/publications/z80guide/read1st.html

197
TI Z80 / Re: TI-2048 by Josiah W.
« on: July 16, 2014, 10:14:44 pm »
The grayscale looks really nice on calc. Personally this is my favorite of the 2048 clones :)

198
ASM / Re: Learn Hex/NikProgrammer
« on: July 06, 2014, 08:33:01 pm »
The bcalls are a bit more complicated than that. What you will find in ti83plus.inc is an address for the bcalls. Someone else can probably explain this much better, but i believe essentially there's a big table which holds the address + flash page of the bcalls. The bcalls are stored in the OS, the include file just provides you with an easy way to access them. Rather than remember the address in the table (for example, $450A for _PutS) you can just type the name. There isn't any code in the include file so it won't increase the size of your file any, there are only equates.

199
ASM / Re: Learn Hex/NikProgrammer
« on: July 05, 2014, 09:05:48 am »
I was talking about the underscore in the B_CALL macro ;)

200
ASM / Re: 8X+ > flash writing question
« on: July 04, 2014, 05:05:45 am »
I think in the majority of cases jr z will be faster than jp z, i'm not sure but i would assume that you wouldn't come across an error very often. When jr doesn't take the jump, it's both faster and smaller than jp (i'm talking about after the bit 5,c).

EDIT: Disregard what i said, i just looked at the code a bit more closely and realize that bit 5 would be set not reset if there was an error  :-X

201
ASM / Re: Learn Hex/NikProgrammer
« on: July 03, 2014, 03:01:54 pm »
What doesn't work? Assembling it? Are you using the ti83plus.inc that i linked to? What exactly are you trying to assemble (can you post the code)? Does it not assemble or does the .8xp not work?

202
TI Z80 / Re: Flag Database CSE
« on: July 01, 2014, 10:06:29 pm »
Great work, tifreak! (and Weregoose ;))

203
ASM / Re: 8X+ > flash writing question
« on: July 01, 2014, 01:28:32 pm »
Because you'd have to change the jr to a jp, which uses an absolute address rather than a relative one.

And thanks calc84 and DrDnar for the explanations.

204
TI Z80 / Re: Flag Database CSE
« on: June 30, 2014, 03:51:19 pm »
Assuming it's the same setup as the old GetKey values, i think all you really need to do is split the 10s and 1s. Subtract 4 from the 10s (A = 41, so 4-4 = 0), multiply by 5 (0*5 = 0) then add the 1s. If the number is greater than 3, you'll need to subtract 2. You'll also need to handle [Var] and [Clear].
A = 41 = (4-4)*5 + 1 = 1
B = 42 = (4-4)*5 + 2 = 2
D = 51 = (5-4)*5 + 1 - 2 = 4
Z = 93 = (9-4)*5 + 3 - 2 = 26

205
ASM / Re: Learn Hex/NikProgrammer
« on: June 29, 2014, 05:27:36 pm »
You'll need to add:
#define b_call(xxxx) rst 28h \ .dw xxxx
..to the top. Also, i would recommend using this ti83plus.inc instead. Most people use bcall(_XXXX), you might find that that is already defined in your ti83plus.inc.

EDIT: Just to clarify, that is bcall without the underscore. I believe TI added an instruction for B_CALL, so you might be able to use B_CALL _NewLine (no parentheses) just like any other instruction, too.

206
ASM / Re: Need help with ExecAns//NikProgrammer
« on: June 29, 2014, 02:14:41 pm »
What do you mean by user protection? Anyone can run it using Asm(prgmRWAPPV. But there aren't very many error checks, i could add a couple simple things such as quitting when you don't provide any data in Ans (for example "1APPV1" instead "1APPV1Hello").

I think it's a little long for your average hex code and you might want to play around with it a bit first just to make sure that it works well, but you can do whatever you want with the code. Consider it in the Public Domain. And be careful, 'cuz if you pass it the wrong arguments when trying to write to an AppVar, there's a strong chance you'll get a RAM clear. I'd hate for your program to get erased...

207
ASM / Re: 8X+ > flash writing question
« on: June 28, 2014, 10:20:41 pm »
I think the "trick" here is that bit 7 will always be the opposite of the byte you're trying to write (here in b), so if bit 7 of b is 1, bit 7 of (hl) will be 0 (so XORing the two will always give you 1). If it's finished, then you'll get the same bit that's in b, so XORing them will give you 0 (so z will be set). I don't really know how all of it works, that's just what i got from calc84's message.

EDIT: And (hl) doesn't really return the value of (hl) but rather a status byte, so i think you could read from anywhere in flash (like "ld a,($4000) \ xor b") and it would return the same thing until the thing finishes. Also, if you just cp (hl) there's a chance that the status byte has the same value as the byte you're trying to write.

208
ASM / Re: Need help with ExecAns//NikProgrammer
« on: June 28, 2014, 05:24:56 pm »
The hex codes should be in the spoiler at the bottom of the post, so you should be able to use those. The program is pretty long, though, so it'd be much more convenient just to load the .8xp. If you've got any questions about the code feel free to ask, it appears that the information on some of those BCALLs at WikiTI isn't complete, _RclAns for example will also load the pointer to its data if Ans isn't a number, basically just like _ChkFindSym. From the 83 Plus System Routines Guide:
Quote
RclVarSym will recall the contents of the variable to OP1 if it is real, to OP1 and OP2 if the variable is complex and otherwise leaves the name as is in OP1 and returns HL as the symbol table pointer and DE as the data pointer as in ChkFindSym.

If there's anything else you'd like added (or if you find something that doesn't work), let me know and i'll see what i can do to add/fix it :)

209
ASM / Re: Need help with ExecAns//NikProgrammer
« on: June 28, 2014, 03:17:57 pm »
I just wrote a program (151 bytes) that takes the following format: [1:NAME_OF_APPVAR:STRING_TO_STORE] to store a string to an AppVar or [2:NAME_OF_APPVAR] to store the contents of the AppVar into Ans. Here's the assembly:
Code: [Select]
#include "includes/ti83plus.inc"
 
.db t2ByteTok,tasmCmp            ;the AsmPrgm token
.org $9D95                        ;progstart, all asm programs are loaded to this address in RAM
 
saferam1 =$86EC                    ;saveSScreen=768
name_str = saferam1
size = saferam1+7
code_start = saferam1+9

start:
    bcall(_RclAns)                ;de = start of data, first two bytes are size bytes
    cp 4                        ;if ans is a string, a = 4
     ret nz
    ex de,hl
    ld e,(hl)
    inc hl
    ld d,(hl)                    ;de = size of Ans
    inc hl
    ld a,(hl)                    ;a = action # (1 or 2)
    inc hl                        ;hl = start of string name
    dec de                        ;the first byte is the action number
    dec de
    dec de
    dec de
    dec de
    dec de                        ;-5 for the string name
    ld (size),de
    dec hl
    ld (hl),AppVarObj
    ld de,name_str                ;copy name in Ans to name_str
    ld bc,6
    ldir
    ld (code_start),hl
    ex de,hl
    ld (hl),0
    ld hl,name_str
    rst 20h                        ;_Mov9ToOP1, copy 9 bytes from (hl) to OP1 (copies our AppVar name)

    sub '1'                        ;$31
     jr z,write_appvar
    dec a
     ret nz
read_appvar:
    bcall(_ChkFindSym)
     ret c
    ex de,hl
    ld c,(hl)                    ;first two bytes are the size bytes
    inc hl
    ld b,(hl)                    ;bc = size of Ans
    inc hl
    ld (size),bc
    ld de,code_start
    ldir                        ;copy the whole string to code_start
    bcall(_AnsName)
    bcall(_ChkFindSym)
    bcall(_DelVar)
    bcall(_AnsName)
    bcall(_ChkFindSym)

    ld a,StrngObj
    ld hl,(size)
    bcall(_CreateVar)
    ld bc,(size)
    inc bc
    inc bc                        ;rewrite the size bytes
    ld hl,size
    ldir
    ret
write_appvar:
    ld hl,(size)
    bcall(_EnoughMem)            ;check if we've got enough space to create the AppVar
     ret c
    ex de,hl
    push hl
        push hl
            bcall(_ChkFindSym)    ;OP1 = name of variable to find
             jr c,$+5
                bcall(_DelVarArc)    ;delete AppVar if it already exists
        pop hl
        bcall(_CreateAppVar)    ;OP1 = name, hl = size
    pop bc
    inc de
    inc de                        ;skip size word
    ld hl,(code_start)
    ldir                        ;copy Ans into AppVar
    ret

The AppVar name must be 5 characters long, if you don't want to use 5 characters just fill them with spaces. There isn't very much error checking since that would increase the size of the program a bit. I'd recommend sending the .8xp to your calc, but here's the hex codes just in case. Be careful, if you give the wrong inputs (for example, not giving it any data making it try to create an AppVar of size 0) you risk clearing your RAM.

Optimizations are welcome ;)

Spoiler For Hex codes:
Code: [Select]
EFD74A
FE04
C0
EB
5E
23
56
23
7E
23
1B
1B
1B
1B
1B
1B
ED53F386
2B
3615
11EC86
010600
EDB0
22F586
EB
3600
21EC86
E7
D631
2837
3D
C0
EFF142
D8
EB
4E
23
46
23
ED43F386
11F586
EDB0
EF524B
EFF142
EF5143
EF524B
EFF142
3E04
2AF386
EF704E
ED4BF386
03
03
21F386
EDB0
C9
2AF386
EFFD42
D8
EB
E5
E5
EFF142
3803
EFC64F
E1
EF6A4E
C1
13
13
2AF586
EDB0
C9

210
ASM / Re: 8X+ > flash writing question
« on: June 28, 2014, 10:43:37 am »
...or simply leaving out the bit 7,a. I'm also not sure what the following "bit 5, (hl)" is for. Have you tried seeing if it works without it? You're just waiting for the byte to update so i can't imagine what you'd need it for.

Pages: 1 ... 12 13 [14] 15 16 ... 55