ASM tool for BASIC programmers

A forum where you can announce your awesome project(s).

Moderator: MaxCoderz Staff

User avatar
DJ_O
Calc King
Posts: 2324
Joined: Mon 20 Dec, 2004 6:47 pm
Location: Quebec (Canada)
Contact:

Post by DJ_O »

2nd, alpha, clear, enter, up, down, left, right, up+left, up+right, down+left, down+right
Image Image Image Now active at https://discord.gg/cuZcfcF (CodeWalrus server)
User avatar
dysfunction
Calc Master
Posts: 1454
Joined: Wed 22 Dec, 2004 3:07 am
Location: Through the Aura

Post by dysfunction »

With 2nd plus directionals, you could do spin jumps. :twisted:
Image


"You're very clever, young man, but it's turtles all the way down!"
the_unknown_one
Calc Master
Posts: 1089
Joined: Fri 17 Dec, 2004 9:53 am

lol

Post by the_unknown_one »

Yea, but i dont think anyone'll use it, but if someone would need it, they could ask me to put it in :wink:
User avatar
DJ_O
Calc King
Posts: 2324
Joined: Mon 20 Dec, 2004 6:47 pm
Location: Quebec (Canada)
Contact:

Post by DJ_O »

Maybe some people will use it, but only for the Silver Edition.

In a RPG it can be cool to have diagonal movements, especially if soemone would want to make a isometric game like Kerm CivSim or Mario RPG
Image Image Image Now active at https://discord.gg/cuZcfcF (CodeWalrus server)
DarkerLine
Calc Wizard
Posts: 526
Joined: Tue 08 Mar, 2005 1:37 am
Location: who wants to know?
Contact:

Post by DarkerLine »

Couldn't the routine just return whether or not each one of those keys is pressed, so the basic program should check if, for example, 2nd and up are pressed for multiple keypress checking.
just try to be nice to people.
_________________
My TI Blog - http://mpl.unitedti.org/
User avatar
Jim e
Calc King
Posts: 2457
Joined: Sun 26 Dec, 2004 5:27 am
Location: SXIOPO = Infinite lives for both players
Contact:

Post by Jim e »

Why not just check all the keys?
Image
DarkerLine
Calc Wizard
Posts: 526
Joined: Tue 08 Mar, 2005 1:37 am
Location: who wants to know?
Contact:

Post by DarkerLine »

Or, you could just slack off, take as input a number to specify the group for direct input, and put the result of the in command into a variable.
just try to be nice to people.
_________________
My TI Blog - http://mpl.unitedti.org/
the_unknown_one
Calc Master
Posts: 1089
Joined: Fri 17 Dec, 2004 9:53 am

*sigh*

Post by the_unknown_one »

I'll just post source of DI routine here, so you guys can see how i did it. I havent fully tested it yet, but it should work.

Code: Select all

directinput:
	ld a,191						; a = 191
	out (1),a						; loads a into key port
	in a,(1)						; loads key port value into a
	cp 223							; if a = 223
	jp z,ansispressed				; jump to ansispressed
	ld a,223						; a = 223
	out (1),a						; loads a into key port
	in a,(1)						; loads key port value into a
	cp 127							; if a = 127
	jp z,alphaispressed				; jump to alphaispressed
	ld a,253						; a = 253
	out (1),a						; loads a into key port
	in a,(1)						; loads key port value into a
	ld b,a							; b = a
	cp 254							; if a = 254
	jp z,enterispressed				; jump to enterispressed
	ld a,b							; a = b
	cp 191							; if a = 191
	jp z,clearispressed				; jump to clearispressed
	ld a,254						; a = 254
	out (1),a						; loads a into key port
	in a,(1)						; loads key port value into a
	ld b,a							; b = a
	cp 254							; if a = 254
	jp z,downispressed				; jump to downispressed
	ld a,b							; a = b
	cp 253							; if a = 253
	jp z,leftispressed				; jump to leftispressed
	ld a,b							; a = b
	cp 251							; if a = 251
	jp z,rightispressed				; jump to rightispressed
	ld a,b							; a = b
	cp 247							; if a = 247
	jp z,upispressed				; jump to upispressed
	ld a,b							; a = b
	cp 245							; if a = 245
	jp z,upandleftarepressed		; jump to upandleftarepressed
	ld a,b							; a = b
	cp 243							; if a = 243
	jp z,upandrightarepressed		; jump to upandrightarepressed
	ld a,b							; a = b
	cp 252							; if a = 252
	jp z,downandleftarepressed		; jump to downandleftarepressed
	ld a,b							; a = b
	cp 250							; if a = 250
	jp z,downandrightarepressed		; jump to downandrightarepressed
	xor a							; a = 0
	bcall(_setxxop1)				; OP1 = a
	bcall(_stoans)					; Ans = OP1
	ret								; end
ansispressed:
	ld a,21							; a = 21
	jp keyispressed					; jump to keyispressed
alphaispressed:
	ld a,31							; a = 31
	jp keyispressed					; jump to keyispressed
enterispressed:
	ld a,105						; a = 105
	jp keyispressed					; jump to keyispressed
clearispressed:
	ld a,45							; a = 45
	jp keyispressed					; jump to keyispressed
downispressed:
	ld a,34							; a = 34
	jp keyispressed					; jump to keyispressed
leftispressed:
	ld a,24							; a = 24
	jp keyispressed					; jump to keyispressed
rightispressed:
	ld a,25							; a = 25
	jp keyispressed					; jump to keyispressed
upispressed:
	ld a,26							; a = 26
	jp keyispressed					; jump to keyispressed
downandleftarepressed:
	ld a,49							; a = 49
	jp keyispressed					; jump to keyispressed
downandrightarepressed:
	ld a,51							; a = 51
	jp keyispressed					; jump to keyispressed
upandleftarepressed:
	ld a,58							; a = 58
	jp keyispressed					; jump to keyispressed
upandrightarepressed:
	ld a,60							; a = 60
keyispressed:
	bcall(_setxxop1)				; OP1 = a
	bcall(_stoans)					; Ans = OP1
	ret								; end
User avatar
Jim e
Calc King
Posts: 2457
Joined: Sun 26 Dec, 2004 5:27 am
Location: SXIOPO = Infinite lives for both players
Contact:

Post by Jim e »

You can use a table for that, here this is kinda off the top of my head.

Code: Select all

gsGetcsc:
    ld c,$01        ;key port 
    ld de,$FFFE     ;d=reset e=key group 
    out (c),d       ;reset key 
    ld l,0      ;l holds key pressed 
cscloop: 
    out (c),e       ;set keygroup 
    ld b,8      ;loop, Delay needed when work with key driver 
    in a,(c)        ;read key 
cscbit: 
    inc l           ;inc to get key pressed 
    rra         ; if key pressed done 
    jr nc,donecsc 
    djnz cscbit     ;loop 8 
    out (c),d       ;reset key 
    rlc e           ;next key group 
    bit 7,e 
    jp nz,cscloop    ;if bit 7 set loop 
    ld l,0      ;if no key pressed 0 
donecsc: 
    ld h,0 
    ld bc,keys 
    add hl,bc 
    ld a,(hl) 
    ld l,a 
    ld h,0 
    bcall(__SetXXXXOP2) 
    bcall(_OP2ToOP1) 
    bcall(_stoans) 
    ret 
Keys: 
   .db 0 
   .db 034, 24, 26, 25, 00, 00, 00, 00 
   .db 105, 95, 85, 75, 65, 55, 45, 00 
   .db 104, 94, 84, 74, 64, 54, 44, 00 
   .db 103, 93, 83, 73, 63, 53, 43, 33 
   .db 102, 92, 82, 72, 62, 52, 42, 32 
   .db 000, 91, 81, 71, 61, 51, 41, 31 
   .db 011, 12, 13, 14, 15, 21, 22, 23 
I really don't know if that will work I just made it up. :)
But It will test all the keys, add you can add special code to make it detect multiple key presses.

I'm gonna use it for my own basic lib. :p
Image
the_unknown_one
Calc Master
Posts: 1089
Joined: Fri 17 Dec, 2004 9:53 am

uuh

Post by the_unknown_one »

Nah, its fine, the old code was buggy, so i have new code now. This code contains 1 more bug: when i press enter, instead of 105 it gives 5 :? :cry:

Code: Select all

directinput:
	ld a,191						; a = 191
	out (1),a						; loads a into key port
	in a,(1)						; loads key port value into a
	cp 223							; if a = 223
	jp z,ansispressed				; jump to ansispressed
	ld a,223						; a = 223
	out (1),a						; loads a into key port
	in a,(1)						; loads key port value into a
	cp 127							; if a = 127
	jp z,alphaispressed				; jump to alphaispressed
	ld a,253						; a = 253
	out (1),a						; loads a into key port
	in a,(1)						; loads key port value into a
	ld b,a							; b = a
	cp 254							; if a = 254
	jp z,enterispressed				; jump to enterispressed
	ld a,b							; a = b
	cp 191							; if a = 191
	jp z,clearispressed				; jump to clearispressed
	ld a,254						; a = 254
	out (1),a						; loads a into key port
	in a,(1)						; loads key port value into a
	ld b,a							; b = a
	cp 254							; if a = 254
	jp z,downispressed				; jump to downispressed
	ld a,b							; a = b
	cp 253							; if a = 253
	jp z,leftispressed				; jump to leftispressed
	ld a,b							; a = b
	cp 251							; if a = 251
	jp z,rightispressed				; jump to rightispressed
	ld a,b							; a = b
	cp 247							; if a = 247
	jp z,upispressed				; jump to upispressed
	ld a,b							; a = b
	cp 245							; if a = 245
	jp z,upandleftarepressed		; jump to upandleftarepressed
	ld a,b							; a = b
	cp 243							; if a = 243
	jp z,upandrightarepressed		; jump to upandrightarepressed
	ld a,b							; a = b
	cp 252							; if a = 252
	jp z,downandleftarepressed		; jump to downandleftarepressed
	ld a,b							; a = b
	cp 250							; if a = 250
	jp z,downandrightarepressed		; jump to downandrightarepressed
	xor a							; a = 0
	bcall(_setxxop1)				; OP1 = a
	bcall(_stoans)					; Ans = OP1
	ret								; end
ansispressed:
	ld a,21							; a = 21
	jp keyispressed					; jump to keyispressed
alphaispressed:
	ld a,31							; a = 31
	jp keyispressed					; jump to keyispressed
enterispressed:
	ld a,105						; a = 105
	jp keyispressed					; jump to keyispressed
clearispressed:
	ld a,45							; a = 45
	jp keyispressed					; jump to keyispressed
downispressed:
	ld a,34							; a = 34
	jp keyispressed					; jump to keyispressed
leftispressed:
	ld a,24							; a = 24
	jp keyispressed					; jump to keyispressed
rightispressed:
	ld a,26							; a = 26
	jp keyispressed					; jump to keyispressed
upispressed:
	ld a,25							; a = 25
	jp keyispressed					; jump to keyispressed
downandleftarepressed:
	ld a,58							; a = 58
	jp keyispressed					; jump to keyispressed
downandrightarepressed:
	ld a,60							; a = 60
	jp keyispressed					; jump to keyispressed
upandleftarepressed:
	ld a,49							; a = 49
	jp keyispressed					; jump to keyispressed
upandrightarepressed:
	ld a,51							; a = 51
keyispressed:
	bcall(_setxxop1)				; OP1 = a
	bcall(_stoans)					; Ans = OP1
	ret								; end
User avatar
Jim e
Calc King
Posts: 2457
Joined: Sun 26 Dec, 2004 5:27 am
Location: SXIOPO = Infinite lives for both players
Contact:

Post by Jim e »

_setxxop1 can only go up to 99, do this instead.

Code: Select all

    ld l,a 
    ld h,0 
    bcall(__SetXXXXOP2) 
    bcall(_OP2ToOP1) 

that shows everthing.
Image
the_unknown_one
Calc Master
Posts: 1089
Joined: Fri 17 Dec, 2004 9:53 am

thx

Post by the_unknown_one »

Thx man! It works perfect now! It's at v. 0.0.7 atm, have to make 1 routine yet (but i need xlib source for it) and then i'll release v. 0.1!
User avatar
Jim e
Calc King
Posts: 2457
Joined: Sun 26 Dec, 2004 5:27 am
Location: SXIOPO = Infinite lives for both players
Contact:

Post by Jim e »

what routine is it, maybe I can help.
Image
the_unknown_one
Calc Master
Posts: 1089
Joined: Fri 17 Dec, 2004 9:53 am

:p

Post by the_unknown_one »

No, i can do it myself, i just need xlib source to see how to do some stuff, and else it'll be easy.
necro
Calc King
Posts: 1619
Joined: Sat 26 Mar, 2005 2:45 am
Location: your shadow

Post by necro »

you realy ought to make this into a app so you can you could use hooks instead of the asm( command and also add a asm program hook to replace the asm( command for other programs
Post Reply