Here's a screenshot of the ProgPad Oncalc Assembler I talked about in the Mosaic forum...



It's still a little glitchy with opening text files from the desktop. I found out that the screw up with the FileSaveAs command was a DoorsCS7 glitch and not my own. It should open DocDE texts when finished.

I also managed to find from Convert-From-Any-Base routine...


Code:
;-----> GetBase
;input: hl=zero terminated ascii string
;          c=base
;output: hl=value
GetBase:
   ex de,hl
   ld hl,0
GBLoop:
   ld a,c
   call MultHLA
   ld a,(de)
   or a
   ret z
   sub "0"
   ret c
   cp 10
   jr c,GBCont
   sub "A"-"0"-10
   ret c
GBcont:
   cp c
   ccf
   ret c
   push de
   ld d,0
   ld e,a
   add hl,de
   pop de
   inc de
   ld a,(de)
   or a
   ret z
   jr GBLoop

;-----> MultHLA
;multiply HL by A
MultHLA:
   push de
   ex de,hl
   ld hl,0
MHLALoop:
   or a
   jr z,MHLAEnd
   add hl,de
   dec a
   jr MHLALoop
MHLAEnd:
   pop de
   ret


Tell me what you think.
That looks excellent, xenon! Can you try it with a Doors CS 7 beta, though? The FileOpen and FileSaveAs routines work much more intelligently in Doors CS 6.5 beta and higher. Grats again.
That what I started with, but DoorsCS7 causes a glitch that doesn't pop the last 2 stacks of the FileSaveAs command and FileOpen would always crash. Sad The only issues I have with 6.2 is opening from the desktop, (which I had figured out with 6.5 Confused )
xenonparadox wrote:
That what I started with, but DoorsCS7 causes a glitch that doesn't pop the last 2 stacks of the FileSaveAs command and FileOpen would always crash. Sad The only issues I have with 6.2 is opening from the desktop, (which I had figured out with 6.5 Confused )
Oh, sorry about that one, that's definitely fixed in the latest beta that I'll be releasing by Friday. I forgot that I was the only one with that fix. Smile

Did you add your filetype to the Wiki?
No not yet, I'll do that now... As soon as someone tells me where to do it... Confused

By the way, those screenshots are for the "non compiling" part only. You might notice I stopped on the programs to let people compare sizes.
xenonparadox wrote:
No not yet, I'll do that now...

By the way, those screenshots are for the "non compiling" part only. You might notice I stopped on the programs to let people compare sizes.
I did indeed notice that. Smile That's the beauty of Doors CS: you can create programs with very complex interfaces in only a few hundred bytes. DocDE7 in my SDK folder on my computer is a bit smaller than DocDE6, but if I add the symbol table everyone's been clamoring for, it might get significantly longer. Actually, now that I think about it, that might be quite challenging...
If you want, I can edit out the unneeded parts and post a smaller version of DocDE here?If the latest beta has those routines I gave you, I can make the programs even smaller.

Anyway., where do you register a file type at? I checked the wiki and couldnt find it.
xenonparadox wrote:
If you want, I can edit out the unneeded parts and post a smaller version of DocDE here?

Where do you register a file type at? I checked the wiki and couldnt find it.
Just edit the page below. If you are unable to edit it for some reason, I'll make the edit for you.

http://dcs.cemetech.net/index.php?title=Registered_Filetypes
No, I can't edit it. Sad My username doesn't work there and I can't find the SignUp button. It uses the filetype 0,1,7.

Anyway, I thought I'd be NICE and post the source so far. There's still glitches with opening the Help window and DCS not displaying text when you begin at APStart (but if you type a letter it'll appear?) This is a good example of how the routines I gave Kerm are used and how they can save space.


Code:
#include "dcs6.inc"
.org $9D93
   .db $bb,$6d

   xor d
   ret
   jr Start
   .dw 0
   .db 6,0
   .dw Icon
   .dw 0
   .dw APStart
   .db $31,$7F
APMain:
   .db 3
   .db 0,1,7
   .db 0,1,1
   .db 0,1,2
Icon:
   .db $7F,$FE,$BF,$D5,$FF,$FF,$80,$01
   .db $80,$01,$80,$01,$80,$01,$80,$01
   .db $80,$01,$80,$01,$FF,$FF,$00,$00
   .db $C0,$61,$FF,$69,$AD,$5B,$AF,$5B
SubIcon:
   .db $3F,$F0,$20,$18,$E0,$14,$A0,$1E
   .db $A0,$02,$A0,$02,$A0,$02,$A0,$02
   .db $AD,$9A,$A9,$A2,$A5,$62,$AD,$5A
   .db $A0,$02,$BF,$FE,$80,$08,$FF,$F8
New:
   call 4000H

Start:
   CloseGUIStack()
   OpenGUIStack()
   ld hl,MainWin
   call PushAll
   PushGUIStack(15,code,7)
   GUIMouse(0)

APStart:
   push ix
   push ix
   CloseGUIStack()
   OpenGUIStack()
   ld hl,MainWin
   call PushAll
   pop hl
   ld de,-10
   add hl,de
   ld e,(hl)
   inc hl
   ld d,(hl)
   dec de
   dec de
   ld a,15
   push de
   ld hl,Code
   call PushGUIStack
   pop bc
   ld hl,-6
   add hl,bc
   push hl
   pop bc
   pop hl
   call TxtToCode
   GUIMouse(0)

TxtToCode:
   push hl
   push bc
   push bc
   pop de   
   ld a,15
   ld hl,Code
   call PushGUIStack
   call GetCode
   ex de,hl
   pop bc
   pop hl
   ldir
   ret

Open:
   call 4000h
   PopGUIStack()
   FileOpen()
   ld a,h
   or l
   jr z,OpenErr
   call TxtToCode
   GUIMouse(0)
OpenErr:
   PushGUIStack(15,Code,7)
   GUIMouse(0)

Save:
   call 4000h
   call GetCode
   ld de,APMain+1
   call FileSaveAs
   GUIMouse(0)

GetCode:
   ld a,9
   call GetItem
   ld de,6
   add hl,de
   ex de,hl
   ld hl,6
   add hl,bc
   push hl
   pop bc
   ex de,hl
   ret

GetItem:
   push af
   GUIFindFirst()
   pop af
   ld c,(hl)
   inc hl
   ld b,(hl)
   inc hl
   inc hl
   or a
   ret z
   dec hl
   dec hl
   dec hl
   ld b,a
GILoop:
   push bc
   GUIFindNext()
   pop bc
   djnz GILoop
   ld c,(hl)
   inc hl
   ld b,(hl)
   inc hl
   inc hl
   ret

Help:
   call 4000h
   ld hl,HlpWin
   call PushAll
   GUIMouse(0)

HlpQuit:
   call 4000h
   PopGUIStacks(5)
   GUIMouse(0)

Compile:

Quit:
   call 4000h
   CloseGUIStack()
   ret

PushAll:
   set 7,(iy+20)
   ld a,(hl)
   cp FFh
   ret z
   inc hl
   ld e,(hl)
   inc hl
   ld d,(hl)
   inc hl
   push hl
   push de
   call PushGUIStack
   pop de
   pop hl
   add hl,de
   jr PushAll

MainWin:
   .db LargeWin
   .dw 13
   .db %11100000
   .db %10110000
   .db %10010000
   .db %10010000
   .db %11110000
   .db "ProgPad",0
MainBtns:
   .db WinButtons
   .dw 7
   .db %00100000
   .dw 0
   .dw 0
   .dw Quit
ToolBar:
   .db LargeSprite
   .dw 52
   .db 0,0,6,8
   .db $01,$00,$20,$10,$08,$04,$79,$30,$27,$D7
   .db $C9,$E4,$4D,$4F,$AC,$D4,$2B,$34,$45,$40
   .db $AF,$D4,$48,$64,$45,$40,$A8,$56,$A8,$C4
   .db $45,$40,$A8,$55,$28,$04,$7D,$7F,$AF,$D7
   .db $E8,$C4,$01,$00,$20,$10,$08,$04
HNew:
   .db HotSpot
   .dw 6
   .db 0,0,8,8
   .dw New
HOpen:
   .db HotSpot
   .dw 6
   .db 8,0,11,8
   .dw Open
HSave:
   .db HotSpot
   .dw 6
   .db 19,0,9,8
   .dw Save
HComp:
   .db HotSpot
   .dw 6
   .db 28,0,9,8
   .dw Compile
HHelp:
   .db HotSpot
   .dw 6
   .db 37,0,9,8
   .dw Help
TabTxt:
   .db Text
   .dw 8
   .db 48,0,0
   .db "Tab:",0
Table:
   .db TextLineIn
   .dw 14
   .db 62,1,29
   .dw 8
   .dw 0
   .db "Z80TAB",0
EndOfMainStack:
   .db FFh

Code:
   .db 1,10,7,91
   .dw 0
   .db 0

HLPWin:
   .db SmallWin
   .dw 21
   .db 6,6
   .db %01110000
   .db %10001000
   .db %00110000
   .db %00000000
   .db %00100000
   .db "About Progpad",0
HLPBtns:
   .db WinButtons
   .dw 7
   .db %00100000
   .dw 0
   .dw 0
   .dw HLPQuit
HLPTitle:
   .db Text
   .dw 16
   .db 1,1,0
   .db "Progpad v1.0",0
HLPDate:
   .db Text
   .dw 14
   .db 1,8,0
   .db "June 16,2010",0
HLPName:
   .db Text
   .dw 23
   .db 1,16,0
   .db "By: Ghosuwa Wogomon",0
EndOfHelpStack:
   .db FFh


If you have any suggestions, tell me.
I haven't spent very much time on the GUI side of Mosaic, and have mostly worked on the assembler. If you would like to try using the Mosaic assembler to compile it, I can give you a copy.
Also, that convert from any base routine is really nice, I think I'll be taking that from you Cool
wow... it looks so nice...
i am probably going to download it on to my calc for fun when you upload it and use it beside DocDE7, unless its a lot better XD
Xenon, can you be more specific with some of those bugs? Do you have an email address where I can send the latest DCS7 build so you can give it a try? Nice job so far.
Yeah, my email is anakclusmos@yahoo.com.

Besides that, I think I'm gonna add a Character Insert table. I'll just add a window with 1 large pic of all the characters evenly spaced, use 1 hotpot to jump to an add character routine that multiplies (character-per-row*mouseY)+mouseX to find out the character. This saves a ton of space with hotspots.I'll answer back tomorrow but this is my last post today.
xenonparadox wrote:
Yeah, my email is anakclusmos@yahoo.com.

Besides that, I think I'm gonna add a Character Insert table. I'll just add a window with 1 large pic of all the characters evenly spaced, use 1 hotpot to jump to an add character routine that multiplies (character-per-row*mouseY)+mouseX to find out the character. This saves a ton of space with hotspots.I'll answer back tomorrow but this is my last post today.

wow.. that sounds really cool
xenonparadox wrote:
Yeah, my email is anakclusmos@yahoo.com.

Besides that, I think I'm gonna add a Character Insert table. I'll just add a window with 1 large pic of all the characters evenly spaced, use 1 hotpot to jump to an add character routine that multiplies (character-per-row*mouseY)+mouseX to find out the character. This saves a ton of space with hotspots.I'll answer back tomorrow but this is my last post today.
That sounds excellent; my only concern is that currently I don't thing the Multiline Text Box gives an index to the last-typed character location, so it might be challenging to insert arbitrary characters program-side. This is the main reason that I haven't implemented a Symbols window in Document DE is this exact stumbling block.
Well, I know from a decompiling standpoint that multiling texts end with 3 bytes, $00,$18,$??. basically all I have to do is find the multiline text I use (it's the last item in my stack) and increase the size by 1 using GUIFindNext, insert 1 byte at DE, copy the last 3 bytes forward by 1 byte, and place the character where the null was.That should work, right?
xenonparadox wrote:
Well, I know from a decompiling standpoint that multiling texts end with 3 bytes, $00,$18,$??. basically all I have to do is find the multiline text I use (it's the last item in my stack) and increase the size by 1 using GUIFindNext, insert 1 byte at DE, copy the last 3 bytes forward by 1 byte, and place the character where the null was.That should work, right?
That will only insert a character at the end of the document. What about typing in the middle of the document? Razz
Same thing, just starting at an offset from DE. DE-TextSize+CursorLoc.
I got a routine called CharInsert that inserts a byte and moves all bytes (until a null) forward one..
So, will it work?

Here's a screenshot of ProgPad opening a DocDE6 file in the DCS7 beta...

You mentioned that FileSaveAs was crashing in some way, is that still happening?
Yeah, but this time it isn't forgetting to pop stacks, it just crashes.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
» Goto page 1, 2, 3, 4, 5  Next
» View previous topic :: View next topic  
Page 1 of 5
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement