Omnimaga: The Coders Of Tomorrow
Welcome, Guest. Please login or register.
 
Omnimaga: The Coders Of Tomorrow
19 May, 2013, 07:42:53 *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   home   news downloads projects tutorials misc forums rules new posts irc about Login Register  
+-OmnomIRC

You must Register, be logged in and have at least 40 posts to use this shout-box! If it still doesn't show up afterward, it might be that OmnomIRC is disabled for your group or under maintenance.

Note: You can also use an IRC client like mIRC, X-Chat or Mibbit to connect to an EFnet server and #omnimaga.

Pages: [1] 2 3 ... 5   Go Down
  Print  
Author Topic: Fullrene -  (Read 3343 times) Bookmark and Share
0 Members and 1 Guest are viewing this topic.
thepenguin77
z80 Assembly Master
LV10 31337 u53r (Next: 2000)
**********
Offline Offline

Gender: Male
Last Login: Yesterday at 21:48:33
Date Registered: 14 December, 2009, 04:21:52
Location: Purdue
Posts: 1483


Topic starter
Total Post Ratings: +778

View Profile
« on: 18 October, 2011, 23:50:16 »
+1

Most Recent Version Here

For those who haven't figured out where the name came from, I knew I had to use the word full, as in "full Ram", but I had to make it cool. So then I decided on Fullrene, those cool carbon creations, only to find out that it's spelled Fullerene.

I believe that this axiom is ready to go. It appears to work on every emulator I've tested it on, so it should be good.

A few notes on usage:
  • Syntax: Fcdf() or Fcdf()r (preferably at the start of the program)
  • The version without r will work on all calculators and is 163 bytes, period.
  • The version with the r won't work on the 83+BE, but is only 78 bytes.
  • This axiom sets up a wrapper around your entire program so that it can disable this feature when you quit. This means that you should either try to end your program by using Return or running off the end of the program. (Returnr still works, but it's bad practice to leave the calculator in this unlocked state.)
  • This routine disables interrupts


You should already know how Axioms work, but if you don't, send this appvar to your calculator and put it in flash. To include the axiom in your Axe program, add the line:

1
2
3
4
:AsmComp(FULLRENE)
   or
:#Axiom(FULLRENE)      (Axe hooks)

Then, include this line preferably at the top of your program.

1
2
3
4
:Fcdf()        (all calculators)
   or
:Fcdf()r        (non-83+BE calculators)

If you can't find Fcdf(, it's in [2nd] [Vars] [9 or 0] Wink

Also, if today is your lucky day, here is the code to optimize: (I'd be happy with even a single byte)
Spoiler for Hidden:
R Version

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64

scf
REP_NEXT
call unlockflash
REP_NEXT
call rVersionEnd
or a

unlockFlash:
in a, (06)
push af
REP_NEXT
ld (saveSP), sp
ld sp, $82A9+$4000

ld a, 1
out (05), a
rrca
ld i, a ;$80
dec a
out (06), a ;$7F

in a, (02)
bit 5, a

ld a, $C3 ;jp
REP_NEXT
ld hl, returnPointz

jr z, _83PlusSE


_84Plus:
ld ($80C8), a
ld ($80C9), hl
jp $4529


_83PlusSE:
push af ;sp-2
ld ($80FE), a
ld ($80FF), hl
jp $4276



returnPointz:
saveSP equ $+1
ld sp, 0000
xor a
out (05), a
pop af
out (06), a

ld a, $10
jr nc, wasUndoing
xor a
wasUndoing:
out ($25), a
bcall(_flashWriteDisable)
ret

rVersionEnd:
Non R Version

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
scf
REP_NEXT
call doIt
REP_NEXT
call allVersionEnd
or a

doIt:
        in a,(6)
        push af
push af
;UnlockFlash:
;Unlocks Flash protection.
;Destroys: appBackUpScreen
;          pagedCount
;          pagedGetPtr
;          arcInfo
;          iMathPtr5
;          pagedBuf
;          ramCode

        ld a,7Bh
        call translatePage
        out (6),a

ld hl, ($5092)
ld a, ($5094)

        call translatePage
        out (6),a
        ld a,0CCh
ld b, a
        cpir
        ld e,(hl)
        inc hl
        ld d,(hl)
ld (iMathPtr5), sp
        push de
;       pop ix

ld a, $C3
ld ($9898), a
REP_NEXT
ld hl, returnPoint
ld ($9899), hl

        ld hl,pagedBuf
        ld (hl),98h
        ld de,pagedBuf+1
        ld bc,49 ;so lucky VV
push bc
        ldir
        ld hl,(iMathPtr5)
push hl
        ld de,9A00h
        ld bc,50

ld a, c

        ldir  
        pop de
        ld hl,-14
        add hl,de
        ld (iMathPtr5),hl
pop iy ;that was convenient
;       ld iy,0056h-25h
;       ld a,50 ;covered
        ld (pagedCount),a
        ld a,8
        ld (arcInfo),a
;       jp (ix)
translatePage:
       bcall(_NZIf83Plus)
        ret z
        and 1Fh
        ret
returnPoint:
        ld iy,flags
ld hl,(iMathPtr5)
        ld de,14
        add hl,de
        ld sp,hl
        ex de,hl
        ld hl,9A00h
        ld bc,48
        ldir

in a, (02)
rlca
jr c, regularUnlock

ld (hl), b ;b is zero
pop af
ld a, $1F
jr c, notLocking
ld (hl), a ;should be $0F
notLocking:
dec hl
out (06), a
out (05), a ;should be 7
call $46D8 ;hack, works on 1.00 and 1.01

push af

regularUnlock:
pop af
ld a, $10
jr nc, wasUndoingz
xor a
wasUndoingz:
out ($25), a
finishUp:
pop af
out (06), a
bcall(_flashWriteDisable)
ret

If you're in Chrome, it's probably best to just quote this post.

* fullrene 1.8xv (0.33 KB - downloaded 14 times.)
« Last Edit: 07 November, 2011, 04:21:11 by thepenguin77 » Logged

zStart v1.3.011 4-29-2013  zStart fully works on 83+BE's (except custom font)
All of my utilities
TI-Connect Help
You can build a statue out of either 1'x1' blocks or 12'x12' blocks. The 1'x1' blocks will take a lot longer, but the final product is worth it.
       -Runer112
Pages: [1] 2 3 ... 5   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Powered by MySQL Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Powered by PHP
Page created in 0.431 seconds with 31 queries.
Skin by DJ Omnimaga edited from SMF default theme with the help of tr1p1ea.
All programs, games and songs avaliable on this website are property of their respective owners.
Best viewed in Opera, Firefox, Chrome and Safari with a resolution of 1024x768 or above.