wabbitcode/studio basics

Got questions? Got answers? Go here for both.

Moderator: MaxCoderz Staff

puromtec
New Member
Posts: 43
Joined: Fri 07 May, 2010 11:00 pm

wabbitcode/studio basics

Post by puromtec »

Pardon the lack of TI development skills, but does anyone know of a good WabbitCode tutorial or serious user manual?

Rather than seek out yet another forum (http://wabbit.codeplex.com/ or http://www.revsoft.org/phpBB2/index.php), I'd like to ask here about trouble I'm having with understanding what is probably basic operations with this IDE.

Why does it not allow me to "Add->New File"? I can add existing, but add new just does nothing.

Also, "Assemble->Assemble is grayed out. Why would that be?

I have downloaded the latest version for windows: 0.2.3785.35474
I have set Build Step to build an .asm file that I added to the project to build to TI83 Plus Application.

Are they only supporting Mac from now on? This link seems to make that apparent. http://code.google.com/p/wabbitstudio/

Here are my steps for usage of the Wabbitcode.

Make new project. Add this .asm file to it. (yes it stinks of noob, I know)

Code: Select all

 include "ti83plus.inc"

EXT_APP equ 1   ;This definition is required of all apps
cseg            ;This linker directive is required of all apps.

;This is the application header definition area required for all apps.
 db 080h,0Fh    ;Field: Program length
 db   00h,00h,00h,00h ;Length=0 (N/A for unsigned apps)
 db 080h,012h    ;Field: Program type
 db   01h,04h  ;Type= Shareware, TI-83Plus
 db 080h,021h    ;Field: App ID
 db   01h       ;Id = 1
 db 080h,031h    ;Field: App Build
 db   01h       ;Build = 1
 db 080h,048h    ;Field: App Name
 db 54h, 45h, 53h, 54h, 4dh, 4Bh, 45h, 52h ;Name = "TESTMAKER" must be 8 characters
 db 080h,081h    ;Field: App Pages
 db 01h         ;App Pages = 1
 db 080h,090h    ;No default splash screen
 db 03h,026h ,09h,04h, 04h,06fh,01bh,80h     ;Field: Date stamp- 5/12/1999
 db 02h,0dh,040h                             ;Dummy encrypted TI date stamp signature
 db 0a1h ,06bh ,099h ,0f6h ,059h ,0bch ,067h 
 db 0f5h ,085h ,09ch ,09h ,06ch ,0fh ,0b4h ,03h ,09bh ,0c9h 
 db 03h ,032h ,02ch ,0e0h ,03h ,020h ,0e3h ,02ch ,0f4h ,02dh 
 db 073h ,0b4h ,027h ,0c4h ,0a0h ,072h ,054h ,0b9h ,0eah ,07ch 
 db 03bh ,0aah ,016h ,0f6h ,077h ,083h ,07ah ,0eeh ,01ah ,0d4h 
 db 042h ,04ch ,06bh ,08bh ,013h ,01fh ,0bbh ,093h ,08bh ,0fch 
 db 019h ,01ch ,03ch ,0ech ,04dh ,0e5h ,075h 
 db 80h,7Fh      ;Field: Program Image length
 db   0,0,0,0    ;Length=0, N/A
 db   0,0,0,0    ;Reserved
 db   0,0,0,0    ;Reserved
 db   0,0,0,0    ;Reserved
 db   0,0,0,0    ;Reserved
;appBackUpScreen = 98FA
;holds current selection id

StartApp:
	B_CALL ClrLCDFull
	call SetDefaults
Main:
MenuLoop:
	call DisplayMenu
	B_CALL	GetKey
	call ProcessMenuAction
	B_CALL	GetKey	
	B_JUMP JForceCmdNoChar   ;Exit the application
;	ret

SetDefaults:
	ld a, 0
	ld (appBackUpScreen), a
	call CreateVs
	ret


DisplayMenu:

;****Give two options
;	1. take test
;	2. make test
;	3. last test taken score
;	4. quit

	call PageNew
	call ResTI
	ld hl, MainHeader
	call Display

	call NewLine
	call ResTI
	call GetSelected
	ld c, 0
	call SetSelected
	ld hl, MainChoice1
	call Display

	call NewLine
	call ResTI
	call GetSelected
	ld c, 1
	call SetSelected
	ld hl, MainChoice2
	call Display

	call NewLine
	call ResTI
	call GetSelected
	ld c, 2
	call SetSelected
	ld hl, MainChoice3
	call Display

	call NewLine
	call ResTI
	call GetSelected
	ld c, 3
	call SetSelected
	ld hl, MainChoice4
	call Display

	ret


SetSelected:
	ld a, (de)
	cp c
	call z, SetTI
	ret

SetTI:
	set textInverse,(IY + textFlags)
	ret

ResTI:
	res textInverse, (IY+textFlags) 
	ret

PageNew:
	ld a, 0
	ld (penCol), a
	ld a, 0
	ld (penRow), a
	ret

NewLine:	
	ld a, 0
	ld (penCol), a
	ld a, (penRow)
	add a, 8
	ld (penRow), a
	ret

Display:
	ld de, OP1
  	ld BC, 23
;	B_CALL StrCopy           ;Copy the string to ram
  	ldir
	ld hl, OP1              
  	B_CALL VPutS
	ret


;**ProcessMenuAction*************************************
ProcessMenuAction:
	cp kDown
	jp z, MoveDown
	cp kUp
	jp z, MoveUp
	cp kEnter
	jp ProcessCommand
	ret

ProcessCommand:
	call GetSelected
	ld a, (de)
	cp 1	; make test
	jp z, MakeTest

	jp MenuLoop


GetSelected: ; de will point to the data
	ld hl, SELname
	B_CALL Mov9ToOP1
	B_CALL ChkFindSym
	ret c
	ld a, b	; archived status
	add 0ffh
	ret c

	inc de
	inc de
	inc de
	inc de
	inc de
	inc de
	
	ret


MoveUp:
	;;;;;;;;;;;;;;;;;HERE HERE decrement variable
;	ld a, (appBackUpScreen)
	;decrement the selected variable
	
	ld	hl, SELname
	B_CALL Mov9ToOP1
	B_CALL ChkFindSym
	ret c
	ld a, b ; archived status
	add 0ffh 
	ret c
	;de is pointing to the data
	inc de
	inc de
	inc de
	inc de
	inc de
	inc de

	ld a, (de)
	ld h, 1
	sub a, h
	ld (de), a

	jp MenuLoop;

MoveDown:

	ld	hl, SELname
	B_CALL Mov9ToOP1
	B_CALL ChkFindSym
	ret c
	ld a, b ; archived status
	add 0ffh 
	ret c
	;de is pointing to the data
	;INCREMENT the value of the data	

	inc de
	inc de
	inc de
	inc de
	inc de
	inc de

	ld a, (de)
	ld h, 1
	add a, h
	ld (de), a

	jp MenuLoop;


;**Exit_App*************************************
Exit_App:
	B_CALL ReloadAppEntryVecs ; load the monitor vectors
; to App loader
;
	B_JUMP JForceCmdNoChar ; exit the app and
; initiate home screen





;---Make runtime variables
CreateVs:

	LD	hl, SELname
	B_CALL Mov9ToOP1

	LD hl, 7 ; 2 for size, 4 for identifier, 1 for value = 7 bytes
	B_CALL CreateAppVar
	;de points to the data structure
	;load our identifier into first part of variable
	inc de                                    ;get over size bytes
	inc de
	ld hl,Identifier
	ld bc,4
	ldir
	;default value set to 0
	;inc de
	ld a, 0
	ld (de), a
	
	ret

MakeTest:

	;initialize test index variable if needed
	;variable will allow retrieval of other variables that represent tests.
	call InitTestIndex

	B_CALL ClrLCDFull
	ld a, 0
	ld (penRow), a
	ld (penCol), a

	;save pointer to the name buffer
	;appBackupScreen + 50 => 98A4h is the pointer variable to the end of the buffer
	;initialize the pointer to point to the appBackupScreen
	ld hl, 98A4h
	ld (hl), 98h
	inc hl
	ld (hl), 72h 

GetTestNameLoop:

	;enter name of new test (max 30 characters)
	B_CALL GetKey
	cp kEnter
	jp z, SaveNewTestName
	;'a' contains the key pressed
	;save it in the name buffer
	
	;get current pointer value (transfer ram value to a register
	; so use hl)
	ld hl, (98A4h)
	ld b, h
	ld h, l
	ld l, b
	ld (hl), a   ;save character to the current buffer end position
	;increment the pointer by 1 
	inc hl		;move the end of the buffer end position by 1
	;flip hl again to save it ??? i guess
	ld b, h
	ld h, l
	ld l, b
	;save new pointer value
	ld (98A4h), hl	;save the new position of the buffer end to the pointer location
	;write to the screen
	;save the value of a to a place in ram that has null after it

	ld (98A6h), a
	ld a, 0
	ld (98A7h), a
	ld hl, 98A6h
	B_CALL VPutS
	call SlidePen

	;save in appBackUpScreen (1 offset) each character
	;when enter is pressed, write 0
 	;save new variable 'Test' + testname using createAppVar
	
	;ask for text of new question
	;save in appBackUpScreen (1 offset) each character
	;when enter is pressed, write 0
	;if length is greater than zero, append to test variable
	;use 0, question token, question text, 0
	;if length is zero, then return to menu loop label

  	;ask for answer option
	;save in appBackUpScreen (1 offset) each character
	;when enter is pressed, write 0
	;if length of is greater than zero, append to test variable
	;use 0, choice token, choice text,0
	;if length is zero, then ask for number of the correct choice

	
	jp GetTestNameLoop

InitTestIndex:	
	;load the variable identifier
	ld hl, TestIdxname
	B_CALL Mov9ToOP1
	;check symbol table
	B_CALL ChkFindSym
	jr nc, InitTestCreated
	;if not, create it for initially 100 bytes
 	ld hl, 100
	B_CALL CreateAppVar
	push hl
	push de
	B_CALL OP4ToOP1
	pop de
	pop hl
	ret
InitTestCreated:
	;variable created by now, check if it is archived
	ld a, b
	or a
	jr z, InitTestIndexDone
	;unarchive variable
	B_CALL Arc_Unarc
	jr InitTestIndex
InitTestIndexDone:
	;set the Identifier "TMKR" as the first 4 bytes
	;even if already there
	inc de
	inc de
	ld hl,Identifier
	ld bc,4
	ldir	
	ret


SlidePen:
	ld a, (penCol)
	inc a
	ld (penCol), a
	ret



SaveNewTestName:
;saves characters from the appbufferscreen
	;=9872 addy
	;save to variable TestIdx
	;resize if neccessary


	ret

 ;write the pc to the port for debug tracing
TracePC:
	push pc

	ret

;23 characters per line
MainHeader:
	DB "Test Maker App", 0
MainChoice1: 
	DB "Take Test",0
MainChoice2:
	DB "Make Test",0
MainChoice3:
	DB "Last Test Score",0
MainChoice4:
	DB "Quit",0

SELname:
	DB	AppVarObj, "Selected",0

TestIdxname:
	DB AppVarObj, "TestIdx",0

Identifier:
	DB "TMKR",0



Then have ti83plus.inc in same directory. And then "try" to build. However it is grayed out. This code worked when assembled by Zilog and then loaded into the TI-83 flash debugger. What am I missing?

Thanks in advance.
User avatar
benryves
Maxcoderz Staff
Posts: 3087
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Re: wabbitcode/studio basics

Post by benryves »

I know I recommended it but I'm afraid to say I've never used it. :? My immediate response would be to ask on its forum but I guess you don't want to do that (RevSoft only came back up after weeks of downtime a few days ago so activity there seems even deader than here, if such a thing can be believed).

That said:
puromtec wrote:This code worked when assembled by Zilog and then loaded into the TI-83 flash debugger.
May I ask why you decided to stop using ZDS and the flash debugger? It seemed to work for you there. The flash debugger isn't great (and can be easily replaced with any other debugging emulator, e.g. Wabbitemu or PindurTI), but ZDS is a solid product*.

__________________________________
* Disclaimer: I never used ZDS either!
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Re: wabbitcode/studio basics

Post by King Harold »

benryves wrote:The flash debugger isn't great
Understatement of the year :)

What's wrong with Latenite, though? It works fine for me - and we know how it works, we don't know how wabbitcode works, well maybe someone here does but they haven't said so

I don't know about ZDS, I've only used TASM (sucks) and various versions of Brass (nice) and Spasm (I still prefer Brass, sorry Spencer)

edit:
what's going on here? why does hl need to be saved "backwards"?

Code: Select all

   ld hl, (98A4h)

   ld b, h   ;|
   ld h, l   ;| this
   ld l, b   ;|

   ld (hl), a   ;save character to the current buffer end position
   ;increment the pointer by 1
   inc hl      ;move the end of the buffer end position by 1
   ;flip hl again to save it ??? i guess

   ld b, h   ;|
   ld h, l   ;| and this
   ld l, b   ;|

   ;save new pointer value
   ld (98A4h), hl
puromtec
New Member
Posts: 43
Joined: Fri 07 May, 2010 11:00 pm

Re: wabbitcode/studio basics

Post by puromtec »

>May I ask why you decided to stop using ZDS and the flash debugger?
To be honest, I got the recommendation from King harold at another time and place. Also, (I may be off) but, it looked like it lacked macros and was old and lacked text editing features.

>What's wrong with Latenite, though?
If this is directed at me, I'd say my initial difficulties with getting it to make apps with it PLUS what benryves said, found here:
http://www.junemann.nl/maxcoderz/viewto ... f=5&t=2836
If you have pointers on getting latenight to help make an app for TI-83 plus, I'd be highly greatful.

>what's going on here? why does hl need to be saved "backwards"?
Trying keep the number in little/big-endian (my guess). If completely a whacked out idea, just tell me. But I am of the disposition that each issue be started as a new thread. I'll keep my actual assembly code issues segregated from this high level development tool discussion.

Getting good at machine/assembly programming will round out the final edge in my software skills, plus i think the stuff is just cool as #$%@, anyway. However, I just did not foresee such a clunky start with this stuff.
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Re: wabbitcode/studio basics

Post by King Harold »

Latenite can certainly build apps, although you need a rather nasty hack if you're on a 64bit system (like me)

Anyway, it should come with an "App project" by default, which IIRC just works, but otherwise, here is a setup that works (for me)

Build script:

Code: Select all

@ECHO OFF
SET PLATFORM=ti8x
SET SHELL=none
SET EXTENSION=hex
BUILD\COMPILE
Compile.com

Code: Select all

REM TI Calculator Build Script - Ben Ryves 2005-2006

REM Jump to source directory
CD "%SOURCE_DIR%"

REM Add compiler directory to PATH
SET PATH=%PATH%;"%COMPILE_DIR%"

REM Set up debugger information
SET DEBUG_DEBUGGER="%DEBUG_DIR%/PindurTI/PindurTI Debugger.exe"
SET DEBUG_DEBUGGER_ARGS="%DEBUG_DIR%/PindurTI/ROMs/%PLATFORM%.rom" -d "%DEBUG_LOG%" -s "%PROJECT_DIR%/Build/%BUILD_FILE_NOEXT%.debug" -l

REM Run the assembler
BRASS "%SOURCE_FILE%" "%PROJECT_DIR%/Bin/%PROJECT_NAME% - %BUILD_FILE_NOEXT%.%EXTENSION%" -x -d -l "%PROJECT_DIR%/Bin/%PROJECT_NAME%.htm"
CD "%PROJECT_DIR%/Bin/"
DEL *.inc
Headers.asm

Code: Select all

.binarymode ti8xapp                 ; TI-83+ Application
.deflong bjump(label)               ; Jump macro
    call BRT_JUMP0
    .dw label
.enddeflong
.deflong bcall(label)               ; Call macro
    rst rBR_CALL
    .dw label
.enddeflong
.include "ASCII Mapping.asm"
.local
.include "../Program.asm"
.endlocal
.include "TIOS Variables.asm"
Program.asm

Code: Select all

.variablename "Name"
.inclabels "ti8x.lbl" 
.defpage 0, 16*1024, $4000          ; Page 0 definition
.export

.page 0                             ; Start page 0
                                    ; ← header is added in here for us
    main
    EXT_APP = 1    ; I'm not really sure what this does but whatever
.block 128            ; space for the header
	bcall(_JForceCmdNoChar) ;quit
It's just a trivial single-page app, multi page is harder, and maybe I'm doing everything wrong but at least it works
And I have some odd stuff in the Latenite\Compile map, such as wabbitsign, 0104.key, rabsig, GLheader, and fillapp (I don't know how much of that is relevant)
User avatar
benryves
Maxcoderz Staff
Posts: 3087
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Re: wabbitcode/studio basics

Post by benryves »

Brass uses Wappsign to sign apps. You'll first need to make sure it knows where the key file is:
You need to run Wappsign. It should be listed somewhere in the TI-83 Plus Flash Debugger start menu entry, or in the \Utils subdirectory of the Flash Debugger's installation folder. For signing to work, the Wappsign application needs to know where your key file resides. Click the [...] button next to the 'Key File' box, then browse for the 0104.key file. Click 'Yes' on the 'This directory is not in your search path. Add it now?' dialog box. Tick the 'Save Settings on Exit' box, then click 'Close'.
The same applies to Brass 3, which comes with a sample TI application project you can copy and paste to create a new app. You'd need to edit the .brassproj project file (XML) and you can then use the GUI builder (double-click the project file). Personally, I use Programmer's Notepad for most development these days (it can be set to invoke external tools when you press a key and to parse the output from those tools to provide an clickable error report).
puromtec
New Member
Posts: 43
Joined: Fri 07 May, 2010 11:00 pm

Re: wabbitcode/studio basics

Post by puromtec »

Thanks a lot Harold, exactly what I need (I should be on my way now).

Ben thanks for the info, too.
User avatar
benryves
Maxcoderz Staff
Posts: 3087
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Re: wabbitcode/studio basics

Post by benryves »

Just to let you know that WabbitStudio has a new website, with a way to report bugs and grab the latest version.
puromtec
New Member
Posts: 43
Joined: Fri 07 May, 2010 11:00 pm

Re: wabbitcode/studio basics

Post by puromtec »

Build process complete 0 errors and 0 warnings.

So, now i get this error:

Pop-up message TItle: "Debug Script"
"1 error in debug script
Error: Unknown file type. (C:\Users\me\Documents\TiWork\LateniteProjects\Tester\Tester\Bin\Tester - TI-83 Plus (Native).8xp)"

The only mention of it on the internet shows this thread: http://www.junemann.nl/maxcoderz/viewto ... 8&start=15

I have used all the code from Harold above. I have used the app example code for the brass manual with a small edit for a label, but otherwise same.

The following is the program.asm

Code: Select all

.variablename "Name"
.inclabels "ti8x.lbl" 
.defpage 0, 16*1024, $4000 ; Page 0 definition
.export

.page 0 ; Start page 0
; ← header is added in here for us
main
EXT_APP = 1 ; I'm not really sure what this does but whatever
.block 128 ; space for the header

	xor a                       ; Reset the -
	ld (curCol),a               ; cursor column and the -
	ld (curRow),a               ; cursor row.

	ld hl,TextString            ; Copy from...
	ld de,saveSScreen           ; Copy to...

	ld a,(hl)                   ; Copy the string to RAM
	ld (de),a
	inc hl
	inc de
	or a
	jr nz,EndApp
        
	ld hl,saveSScreen
	bcall(_putS)                ; Display the string
       
	bcall(_getKey)              ; Wait for a key
       
EndApp:
	bjump(_JForceCmdNoChar)     ; Exit
		
TextString
      	 .asc "This simple app."
        .asc "just displays a "
        .asc "bit of text on  "
        .asc "your calculator "
        .asc "screen.",0
Any ideas are appreciated.
puromtec
New Member
Posts: 43
Joined: Fri 07 May, 2010 11:00 pm

Re: wabbitcode/studio basics

Post by puromtec »

I am not sure the assumed steps will allow you to get the sample app to compile and then run in debug mode on the pindurTI emulator on a fresh machine with the loosely associated downloads. This is turning out to be horribly difficult procedure, and if or when i can get it working I will document the entire steps as a video posted for all to see.
User avatar
tr1p1ea
Maxcoderz Staff
Posts: 4141
Joined: Thu 16 Dec, 2004 10:06 pm
Location: I cant seem to get out of this cryogenic chamber!
Contact:

Re: wabbitcode/studio basics

Post by tr1p1ea »

I just tested the following and it assembles/signs and runs in the debugger on my machine at least:

Code: Select all

; test application
;-----------------

.binarymode ti8xapp

.variablename "TESTAPP "

.inclabels "Includes\ti8x.lbl"

.deflong bjump(label)
  call BRT_JUMP0
  .dw label
.enddeflong

.deflong bcall(label)
  rst rBR_CALL
  .dw label
.enddeflong

.defpage 0, 16*1024, $4000

.page 0

.block 128

main:
  bcall(_clrLCDFull)

	xor a
  ld (PenCol),a
  ld (penRow),a
  ld hl,txtString
  ld de,savesScreen
  bcall(_strCopy)
  ld hl,savesScreen
  bcall(_PutS)

  bcall(_getKey)
	
  bjump(_JForceCmdNoChar)

txtString:
  .db "Test APP!",0
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."
Image
Image
puromtec
New Member
Posts: 43
Joined: Fri 07 May, 2010 11:00 pm

Re: wabbitcode/studio basics

Post by puromtec »

Thanks trip, however, I am stuck. I have lost all patients with this latenight/brass/pindurti software and I cannot get it to do a simple app. I keep getting "Unknown file type" from a debug script popup. It is like PindurTI does not like the output of brass.

I have updated brass.exe to the latest available, (1.0.4.11). I have used King Harold's scripts found in this thread, which helped me get it to biuld. I have now successful builds ending up in the bin folder.

The one last variable (that is screwing me over) could be the ROM file. I got my ROM file from some torrent. Could it be a bad rom?

Also, I notice a failure at the end of the build, here...
"Error: Could not write list file (The given key was not present in the dictionary." Is this relevant?
puromtec
New Member
Posts: 43
Joined: Fri 07 May, 2010 11:00 pm

Re: wabbitcode/studio basics

Post by puromtec »

So, a blind pig will find an acorn eventually...

Ran (tried) the wabbitemu and dragged a couple output files to it. the 8xk seemed to work with it. FINALLY, got the proverbial hello world to work in an emulator. whewww.
User avatar
benryves
Maxcoderz Staff
Posts: 3087
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Re: wabbitcode/studio basics

Post by benryves »

Brass 1.x was incredibly poorly written (I never found the cause of the dictionary error you reported, for one). This is why I rewrote it completely for 3.x, though by that time other assemblers and developer tools had sprung up that seemed far better than anything I'd managed to knock together myself so I left it as a basic assembler without an IDE. I'm glad you got something working in the end, though!
puromtec
New Member
Posts: 43
Joined: Fri 07 May, 2010 11:00 pm

Re: wabbitcode/studio basics

Post by puromtec »

The wabbitemu will run the 8xk file, but i cannot set a breakpoint of 4080 and actually debug and step through my application. This is dissapointing. I have invested a lot in getting latenite to complie an app with all the hacks from harold, then find out pindurti cannot except my built file, then I have randomly discovered that wabbitemu will "run" my app, but it appears to like only breakpoints set in wabbitcode ide. It is insanely difficult to get just the tools working for this endeavor. I have not written any code in MONTHS since i decided to jump ship off of the ZDS and TI-flash debugger (buggy as hell) and use tools that have been talked to death about in 200+ post threads that leave the reader dizzy. Where are the software engineering principles?
Post Reply