Author Topic: App Help  (Read 8544 times)

0 Members and 1 Guest are viewing this topic.

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4684
  • Rating: +718/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
App Help
« on: October 31, 2010, 01:45:46 pm »
Okay, so I have been programming in assembly for almost a year now and I want to turn my programs into an App. I have tried on several occasions to make Apps, but something isn't working for me. Do I need to make each b_call myself? And why doesn't it work when I make a parser hook that works on that page?

Offline jnesselr

  • King Graphmastur
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2270
  • Rating: +81/-20
  • TAO == epic
    • View Profile
Re: App Help
« Reply #1 on: October 31, 2010, 01:51:08 pm »
So many questions, so little code. Please give code, and explain what you know about how apps are different than asm programs. Like headers, signing, etc., so we know where to start.

Also, welcome to omnimaga!

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4684
  • Rating: +718/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: App Help
« Reply #2 on: October 31, 2010, 02:00:30 pm »
Thankee, and sorry. Let's see, I know how to make the header and I know that to exit the app I need to use that B_Call (I program in hex, so I do not know the B_Call off the top of my head). I know that apps are executed at 4000h. I have executed apps from Assembly programs by loading there page at 4000h and then executing them at 4080h (after the header) which isn't smart, I found out, because that B_Call doesn't free up the memory that was used temporarily by the asm program.

(And I do not have code at the moment unless you want all the hex?)
(I don't have the header here, but this is the actual code)


Offline jnesselr

  • King Graphmastur
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2270
  • Rating: +81/-20
  • TAO == epic
    • View Profile
Re: App Help
« Reply #3 on: October 31, 2010, 02:36:47 pm »
Don't program in hex.  Especially with something like apps.  We don't want to look them all up, and you shouldn't need to either. It's easier with an assembler. Still not sure, yet though.

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4684
  • Rating: +718/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: App Help
« Reply #4 on: October 31, 2010, 02:45:31 pm »
It is easier for me to program in hex, but I just need to know proper syntaxes and what not. All the app does is sets up a hook and then exits. The rest of the code consists of the hook and calls used by the hook.

Offline jnesselr

  • King Graphmastur
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2270
  • Rating: +81/-20
  • TAO == epic
    • View Profile
Re: App Help
« Reply #5 on: October 31, 2010, 03:10:24 pm »
Where are you storing the hook?  Seriously, this is why we like asm code and not hex.  How is it easier?

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4684
  • Rating: +718/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: App Help
« Reply #6 on: October 31, 2010, 03:24:10 pm »

The DB06 gets the flash page it is on
The 218B40 is the start of the hook
EF2650 installs the hook
EF2740 exits the app
After that is the hook and all of the calls.
Sorry, I don't program much with mnemonics

Offline jnesselr

  • King Graphmastur
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2270
  • Rating: +81/-20
  • TAO == epic
    • View Profile
Re: App Help
« Reply #7 on: October 31, 2010, 03:26:51 pm »
well, it makes it hard to do.  First off, store your hook in some safe place like appbackupscreen(Well, not there since everyone uses it, but you get the idea.)  Then, give that location to the installer and exit the app.  The problem I think you are having is the fact that the program might be calling the correct location, but the app page isn't swapped in.  Also, you need the location and length to copy the hook.  (ldir is the instruction. don't know about hex.  I think it is copy bc bytes from hl to de.)  Then, give the location of the hook or whatever the installer needs.

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2898
  • Rating: +467/-17
    • View Profile
    • TI-Boy CE
Re: App Help
« Reply #8 on: October 31, 2010, 03:29:31 pm »
Hooks are designed to run from apps, there is no problem there.
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline jnesselr

  • King Graphmastur
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2270
  • Rating: +81/-20
  • TAO == epic
    • View Profile
Re: App Help
« Reply #9 on: October 31, 2010, 03:34:08 pm »
Hooks are designed to run from apps, there is no problem there.
I thought the page had to be swapped in and everything.  Not sure, then.  I can't tell from his hex code either.

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4684
  • Rating: +718/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: App Help
« Reply #10 on: October 31, 2010, 04:26:18 pm »
Okay, if I use a hook that is in some application, do I need to use the special exit code? I am pretty sure I do not, but I am not sure. Also, do I need to come up with all of the coding to replace B_Calls? I have made hooks that work fine as long as they are in RAM (like AppBackUpScreen) so I will see if they work in a simple application.

Offline FloppusMaximus

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 290
  • Rating: +57/-5
    • View Profile
Re: App Help
« Reply #11 on: October 31, 2010, 07:57:39 pm »
Hooks are, indeed, designed to be run from apps.  That's why you have to pass the page number to the hook enable routine: the page gets saved along with the address of the hook.

Storing your hook in appBackUpScreen is not a great idea - assuming the idea is to leave the hook installed after your program exits - because other programs will overwrite that area.  Really, the only way to keep a hook installed permanently is for your program to be a Flash app.

@Xeda112358: I'm not sure what you mean by "special exit code".

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4684
  • Rating: +718/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: App Help
« Reply #12 on: October 31, 2010, 08:40:28 pm »
by special exit code I mean _JForceCmdNoChar as opposed to ret

@graphmastur: I learned all the hex and I have many addresses memorized, so it is easier for me to work in hex. I am not great with computers so it is nice to be able to program directly on the calc. With that being said, if anybody can walk me through what I need to start programming on the computer, that would be great. For small programs, I like to program directly on the calc, but larger programs use a lot of jumping and calling so it takes a while to count bytes.

I have a 64-bit processor and Windows 7. It isn't really that I am bad with computers, I just haven't been all too exposed.

Offline FloppusMaximus

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 290
  • Rating: +57/-5
    • View Profile
Re: App Help
« Reply #13 on: October 31, 2010, 08:55:44 pm »
Yes, JForceCmdNoChar is the correct way to exit the application.

It's quite impressive that you can write programs that complicated, by hand, in hex form, but probably not the best idea if you want to get help from us mere mortals :)  Here's a disassembly of the code you posted, to get started:
Code: [Select]
4080 in a, ($06)
4082 ld hl, $408B
4085 B_CALL _SetParserHook
4088 B_CALL _JForceCmdNoChar
408B add a, e
408C or a
408D ret z
408E push hl
408F ld hl, $B1B1
4092 sbc hl, bc
4094 pop hl
4095 jr z, $4099
4097 xor a
4098 ret

4099 ld (OP5), hl
409C rst rPUSHREALO1
409D ld hl, (fpBase)
40A0 ld bc, $0009
40A3 add hl, bc
40A4 ld (OP5+2), hl
40A7 call $459B
40AA ld hl, (OP5)
40AD ld a, h
40AE or l
40AF ret z
40B0 ld a, e
40B1 ld hl, $40A7
40B4 push hl
40B5 inc a
40B6 ld b, a
40B7 djnz $40BD
40B9 ld ($99E2), a
40BC ret

40BD djnz $40C3
40BF B_CALL _RunIndicOff
40C2 ret

40C3 djnz $40D8
40C5 ld hl, $4504
40C8 ld bc, $0035
40CB ld de, $99E2
40CE push de
40CF ldir
40D1 pop hl
40D2 in a, ($06)
40D4 B_CALL _SetFontHook
40D7 ret

40D8 djnz $40F3
40DA call $459B
40DD and $0F
40DF add a, a
40E0 add a, e
40E1 add a, a
40E2 add a, e
40E3 ld d, $00
40E5 ld e, a
40E6 ld hl, $9972
40E9 add hl, de
40EA push hl
40EB call $4560
40EE pop hl
40EF ex de, hl
40F0 ldir
40F2 ret

40F3 djnz $411B
40F5 call $459B
40F8 and $0F
40FA add a, a
40FB add a, e
40FC add a, a
40FD add a, e
40FE ld d, $00
4100 ld e, a
4101 ld hl, $9972
4104 add hl, de
4105 push hl
4106 call $459B
4109 and $0F
410B add a, a
410C add a, e
410D add a, a
410E add a, e
410F ld b, $00
4111 ld c, a
4112 push bc
4113 call $4539
4116 pop bc
4117 pop hl
4118 ldir
411A ret

411B djnz $4135
411D call $4560
4120 ld h, d
4121 ld l, e
4122 srl b
4124 rr c
4126 push bc
4127 dec hl
4128 ld (hl), b
4129 dec hl
412A ld (hl), c
412B inc hl
412C inc hl
412D call $4580
4130 pop de
4131 B_CALL _DelMem
4134 ret

4135 djnz $4157
4137 ld hl, $00AA
413A ld (OP1+1), hl
413D rst rFINDSYM
413E ex de, hl
413F ld e, (hl)
4140 sla (hl)
4142 inc hl
4143 ld d, (hl)
4144 rl (hl)
4146 inc hl
4147 add hl, de
4148 ex de, hl
4149 push hl
414A B_CALL _InsertMem
414D pop hl
414E ld b, h
414F ld c, l
4150 add hl, de
4151 ex de, hl
4152 dec hl
4153 dec de
4154 jp $4573

4157 djnz $4184
4159 ld hl, $00AA
415C ld (OP1+1), hl
415F rst rFINDSYM
4160 ex de, hl
4161 ld e, (hl)
4162 inc hl
4163 ld d, (hl)
4164 inc hl
4165 add hl, de
4166 dec hl
4167 ld de, $8587
416A ld bc, $0040
416D call $4573
4170 ld hl, $0000
4173 ld (curRow), hl
4176 ld a, $7F
4178 ld (de), a
4179 ex de, hl
417A B_CALL _PutPS
417D ld a, ($8587)
4180 B_CALL _PutMap
4183 ret

4184 djnz $4193
4186 ld bc, $0040
4189 call $4539
418C ex de, hl
418D ld de, textShadow
4190 jp $4580

4193 djnz $41C4
4195 call $459B
4198 and $07
419A add a, a
419B add a, a
419C add a, a
419D add a, a
419E push af
419F call $459B
41A2 and $0F
41A4 pop bc
41A5 add a, b
41A6 ld b, $00
41A8 ld c, a
41A9 ld hl, textShadow
41AC add hl, bc
41AD ld a, (hl)
41AE sub $30
41B0 cp $0A
41B2 jr c, $41B6
41B4 sub $07
41B6 pop hl
41B7 rst $0038
41B8 ld b, l
41B9 djnz $41CD
41BB call $459B
41BE cpl
41BF ld b, a
41C0 ld a, b
41C1 out ($01), a
41C3 in a, ($01)
41C5 cpl
41C6 or a
41C7 jr z, $41C0
41C9 pop hl
41CA jp $45FF

41CD djnz $41FD
41CF call $459B
41D2 push de
41D3 call $459B
41D6 push af
41D7 call $459B
41DA push de
41DB ld b, d
41DC ld c, e
41DD call $4539
41E0 pop bc
41E1 pop af
41E2 push bc
41E3 push de
41E4 push af
41E5 call $4560
41E8 ex de, hl
41E9 ld b, c
41EA ld de, OP1+1
41ED call $44D0
41F0 xor a
41F1 ld (de), a
41F2 pop af
41F3 ld (OP1), a
41F6 pop hl
41F7 pop bc
41F8 pop de
41F9 pop af
41FA jp $46A2

41FD djnz $4229
41FF call $459B
4202 push de
4203 ld hl, $01AA
4206 ld (OP1+1), hl
4209 rst rFINDSYM
420A ex de, hl
420B ld c, (hl)
420C inc hl
420D ld b, (hl)
420E inc hl
420F ld de, OP1+1
4212 ldir
4214 xor a
4215 ld (de), a
4216 call $459B
4219 ld (OP1), a
421C B_CALL _ChkFindSym
421F pop hl
4220 ret c
4221 ld a, b
4222 or a
4223 ret nz
4224 inc hl
4225 inc hl
4226 jp $423A

4229 djnz $4263
422B call $4680
422E B_CALL _ZeroOP1
4231 ld hl, $01AA
4234 ld (OP1+1), hl
4237 rst rFINDSYM
4238 ex de, hl
4239 ld b, (hl)
423A inc hl
423B inc hl
423C ld de, OP1+1
423F call $44D0
4242 xor a
4243 ld (de), a
4244 call $459B
4247 ld (OP1), a
424A B_CALL _ChkFindSym
424D inc de
424E inc de
424F push de
4250 call $459B
4253 pop hl
4254 add hl, bc
4255 push hl
4256 call $4661
4259 push hl
425A call $459B
425D pop hl
425E add hl, de
425F pop de
4260 jp $448B

4263 djnz $4278
4265 call $4661
4268 push hl
4269 call $459B
426C pop hl
426D add hl, de
426E push hl
426F call $459B
4272 pop hl
4273 ld a, (hl)
4274 ld (hl), e
4275 jp $45FF

4278 djnz $4287
427A call $4661
427D push hl
427E call $459B
4281 pop hl
4282 add hl, de
4283 ld a, (hl)
4284 jp $45FF

4287 djnz $42AB
4289 call $4680
428C call $4661
428F push hl
4290 call $459B
4293 pop hl
4294 add hl, de
4295 push hl
4296 call $4691
4299 ld de, plotSScreen
429C add hl, de
429D push hl
429E call $459B
42A1 push af
42A2 call $459B
42A5 pop bc
42A6 pop hl
42A7 pop de
42A8 jp $44C1

42AB djnz $42C4
42AD call $459B
42B0 ld a, $80
42B2 add a, d
42B3 ld d, a
42B4 push de
42B5 call $4560
42B8 pop hl
42B9 ld a, (de)
42BA ldi
42BC dec hl
42BD ld (hl), a
42BE inc hl
42BF ld a, b
42C0 or c
42C1 jr nz, $42B9
42C3 ret

42C4 djnz $42D6
42C6 call $459B
42C9 ld a, $80
42CB add a, d
42CC ld d, a
42CD push de
42CE call $459B
42D1 ld b, d
42D2 ld c, e
42D3 jp $4282

42D6 djnz $42E9
42D8 call $459B
42DB ld a, $80
42DD add a, d
42DE ld d, a
42DF push de
42E0 call $459B
42E3 pop hl
42E4 ld a, (hl)
42E5 ld (hl), e
42E6 jp $45FF

42E9 djnz $42F6
42EB call $459B
42EE ld a, $80
42F0 add a, d
42F1 ld d, a
42F2 ld a, (de)
42F3 jp $45FF

42F6 djnz $42FF
42F8 call $4661
42FB push hl
42FC jp $4282

42FF djnz $4312
4301 call $4560
4304 srl b
4306 rr c
4308 ld hl, saveSScreen
430B push hl
430C call $4580
430F ld (hl), $C9
4311 ret

4312 djnz $4322
4314 call $4560
4317 ex de, hl
4318 ld de, saveSScreen
431B push de
431C ldir
431E ex de, hl
431F ld (hl), $C9
4321 ret

4322 djnz $4343
4324 call $459B
4327 push af
4328 call $459B
432B push af
432C call $459B
432F push af
4330 call $459B
4333 push af
4334 call $4560
4337 pop hl
4338 pop af
4339 ld l, a
433A pop bc
433B pop af
433C ld c, a
433D call $46F7
4340 jp $46CD

4343 djnz $434F
4345 call $459B
4348 push af
4349 call $4661
434C pop af
434D ld a, (hl)
434E ret

434F djnz $436C
4351 call $4661
4354 push hl
4355 call $459B
4358 push de
4359 call $459B
435C pop bc
435D pop hl
435E dec hl
435F call $460B
4362 push de
4363 push bc
4364 call $4539
4367 pop bc
4368 pop hl
4369 ldir
436B ret

436C B_CALL _GrBufCpy
436F ret

4370 push hl
4371 add hl, hl
4372 ld a, (hl)
4373 add hl, hl
4374 add hl, hl
4375 add hl, hl
4376 pop hl
4377 dec de
4378 ld a, d
4379 or e
437A jr nz, $4370
437C dec bc
437D ld a, b
437E or c
437F jr nz, $4377
4381 ret

4382 add hl, bc
4383 push af
4384 dec hl
4385 pop af
4386 rl (hl)
4388 push af
4389 dec bc
438A ld a, b
438B or c
438C jr nz, $4384
438E pop af
438F ret

4390 add hl, bc
4391 ex de, hl
4392 add hl, bc
4393 xor a
4394 push af
4395 pop af
4396 dec hl
4397 dec de
4398 ld a, (de)
4399 adc a, (hl)
439A ld (hl), a
439B push af
439C dec bc
439D ld a, b
439E or c
439F jr nz, $4395
43A1 pop af
43A2 ex de, hl
43A3 ret

43A4 add hl, bc
43A5 ex de, hl
43A6 add hl, bc
43A7 xor a
43A8 push af
43A9 pop af
43AA dec hl
43AB dec de
43AC ld a, (de)
43AD sbc a, (hl)
43AE ld (hl), a
43AF push af
43B0 dec bc
43B1 ld a, b
43B2 or c
43B3 jr nz, $43A9
43B5 pop af
43B6 ex de, hl
43B7 ret

43B8 push hl
43B9 push bc
43BA ld a, (de)
43BB inc de
43BC cpi
43BE jr nz, $43CB
43C0 ld a, b
43C1 or c
43C2 jr nz, $43BA
43C4 ex de, hl
43C5 pop bc
43C6 pop de
43C7 sbc hl, bc
43C9 scf
43CA ret

43CB pop bc
43CC pop hl
43CD ld a, d
43CE or e
43CF jr nz, $43B8
43D1 ret

43D2 ld a, (de)
43D3 inc de
43D4 cpi
43D6 jr nz, $43DD
43D8 ld a, b
43D9 or c
43DA jr nz, $43D2
43DC cp a
43DD ret

43DE ld de, OP1
43E1 push de
43E2 ld de, OP5+6
43E5 push de
43E6 call $440C
43E9 ex de, hl
43EA rrd
43EC ex de, hl
43ED call $440C
43F0 ex de, hl
43F1 rrd
43F3 ex de, hl
43F4 dec de
43F5 ld a, h
43F6 or l
43F7 jr nz, $43E6
43F9 pop hl
43FA sbc hl, de
43FC ld b, h
43FD ld c, l
43FE pop hl
43FF ld (hl), a
4400 inc hl
4401 ld a, c
4402 add a, a
4403 dec a
4404 add a, $80
4406 ld (hl), a
4407 inc hl
4408 ex de, hl
4409 ldir
440B ret

440C xor a
440D ld b, $10
440F add hl, hl
4410 rla
4411 cp $0A
4413 jr c, $4418
4415 sub $0A
4417 inc l
4418 djnz $440F
441A ret

441B ld a, (de)
441C nop
441D ld (hl), a
441E inc de
441F inc hl
4420 dec bc
4421 ld a, b
4422 or c
4423 jr nz, $441B
4425 ret

4426 push bc
4427 ld (OP5+6), hl
442A ld a, $3F
442C cp (hl)
442D call z, $4470
4430 inc hl
4431 ld b, $00
4433 inc b
4434 inc hl
4435 ld a, (hl)
4436 cp $3F
4438 jr z, $443E
443A cp $2B
443C jr nz, $4433
443E push hl
443F dec hl
4440 ex de, hl
4441 ld hl, $0000
4444 ld (OP6+3), hl
4447 inc hl
4448 ld a, (de)
4449 and $0F
444B dec de
444C push hl
444D push de
444E push bc
444F call $458D
4452 pop bc
4453 ld de, (OP6+3)
4457 add hl, de
4458 ld (OP6+3), hl
445B pop de
445C pop hl
445D ld a, $0A
445F push de
4460 push bc
4461 call $458D
4464 pop bc
4465 pop de
4466 djnz $4448
4468 ld de, (OP6+3)
446C ld a, e
446D pop hl
446E pop bc
446F ret

4470 ld sp, (OP5+6)
4474 ret

4475 add a, e
4476 ld b, a
4477 ld hl, kbdWUR
447A ld a, (hl)
447B cp $32
447D jr c, $4482
447F ld a, $32
4481 ld (hl), a
4482 cp $0A
4484 jr nz, $4489
4486 ld a, $0A
4488 ld (hl), a
4489 ld a, b
448A ret

448B ld (OP5+6), hl
448E ld hl, plotSScreen
4491 ld (OP6+3), hl
4494 ld b, $0C
4496 push bc
4497 ld b, $08
4499 push bc
449A ld a, (de)
449B push de
449C ld l, a
449D ld h, $00
449F add hl, hl
44A0 add hl, hl
44A1 add hl, hl
44A2 ld bc, (OP5+6)
44A6 add hl, bc
44A7 ex de, hl
44A8 ld hl, (OP6+3)
44AB call $44C1
44AE ld (OP6+3), hl
44B1 pop de
44B2 inc de
44B3 pop bc
44B4 djnz $4499
44B6 dec h
44B7 dec h
44B8 dec h
44B9 inc l
44BA ld (OP6+3), hl
44BD pop bc
44BE djnz $4496
44C0 ret

44C1 ld bc, $080C
44C4 ld a, (de)
44C5 nop
44C6 ld (hl), a
44C7 inc de
44C8 ld a, b
44C9 ld b, $00
44CB add hl, bc
44CC ld b, a
44CD djnz $44C4
44CF ret

44D0 ld c, $00
44D2 ld a, (hl)
44D3 cp $29
44D5 jr nz, $44D9
44D7 ld a, $20
44D9 cp $BB
44DB jr nz, $44E7
44DD inc hl
44DE dec b
44DF ld a, (hl)
44E0 sub $4F
44E2 cp $6D
44E4 jr c, $44E7
44E6 dec a
44E7 inc hl
44E8 ld (de), a
44E9 inc de
44EA inc c
44EB djnz $44D2
44ED ret

44EE ld (hl), a
44EF ld a, $0C
44F1 sub b
44F2 ld c, a
44F3 ld a, (hl)
44F4 push bc
44F5 push af
44F6 ld a, (de)
44F7 nop
44F8 ld (hl), a
44F9 inc de
44FA inc hl
44FB djnz $44F6
44FD add hl, bc
44FE pop af
44FF pop bc
4500 dec a
4501 jr nz, $44F4
4503 ret

4504 add a, e
4505 cp $01
4507 jr z, $450C
4509 xor a
450A dec a
450B ret

450C ld a, b
450D cp $3A
450F jr c, $4513
4511 sub $07
4513 sub $30
4515 cp $10
4517 jr nc, $4509
4519 ld c, a
451A ld a, (parseVar+1)
451D or a
451E jr z, $4509
4520 ld a, c
4521 push bc
4522 add a, a
4523 add a, c
4524 add a, a
4525 add a, c
4526 ld d, $00
4528 ld e, a
4529 ld hl, $996B
452C add hl, de
452D ld a, b
452E ld bc, $0007
4531 ld de, lFont_record
4534 ldir
4536 pop bc
4537 xor a
4538 ret

4539 push bc
453A B_CALL _AnsName
453D rst rFINDSYM
453E B_CALL _DelVarNoArc
4541 pop hl
4542 B_CALL _CreateStrng
4545 inc de
4546 inc de
4547 ret

4548 ld a, $30
454A rrd
454C cp $3A
454E jr c, $4552
4550 add a, $07
4552 ld (de), a
4553 dec de
4554 ret

4555 ld a, (de)
4556 cp $3A
4558 jr c, $455C
455A sub $07
455C inc de
455D rld
455F ret

4560 B_CALL _ZeroOP1
4563 ld a, $AA
4565 ld (OP1+1), a
4568 rst rFINDSYM
4569 call c, $4470
456C ex de, hl
456D ld c, (hl)
456E inc hl
456F ld b, (hl)
4570 inc hl
4571 ex de, hl
4572 ret

4573 call $4548
4576 call $4548
4579 dec hl
457A dec bc
457B ld a, b
457C or c
457D jr nz, $4573
457F ret

4580 call $4555
4583 call $4555
4586 inc hl
4587 dec bc
4588 ld a, b
4589 or c
458A jr nz, $4580
458C ret

458D ld b, $08
458F ld de, $0000
4592 ex de, hl
4593 add hl, hl
4594 rlca
4595 jr nc, $4598
4597 add hl, de
4598 djnz $4593
459A ret

459B ld bc, (OP5)
459F ld a, b
45A0 or c
45A1 jr z, $45B4
45A3 dec bc
45A4 ld (OP5), bc
45A8 ld hl, (OP5+2)
45AB call $45C7
45AE ld (OP5+2), hl
45B1 ret

45B2 push de
45B3 push hl
45B4 call $458D
45B7 ld de, (OP5+6)
45BB add hl, de
45BC ld (OP5+6), hl
45BF pop hl
45C0 ld a, $0A
45C2 call $458D
45C5 pop de
45C6 ret

45C7 ld a, (hl)
45C8 push hl
45C9 and $0F
45CB srl a
45CD push af
45CE inc a
45CF ld c, a
45D0 ld b, $00
45D2 add hl, bc
45D3 ex de, hl
45D4 ld hl, $0000
45D7 ld (OP5+6), hl
45DA inc hl
45DB pop af
45DC jr nc, $45E4
45DE ld a, (de)
45DF and $0F
45E1 call $45B2
45E4 ld a, (de)
45E5 and $F0
45E7 rlca
45E8 rlca
45E9 rlca
45EA rlca
45EB call $45B2
45EE dec de
45EF dec c
45F0 ld a, c
45F1 or a
45F2 jr nz, $45DE
45F4 pop hl
45F5 ld de, $0009
45F8 add hl, de
45F9 ld de, (OP5+6)
45FD ld a, e
45FE ret

45FF ld l, a
4600 ld h, $00
4605 B_CALL _OP2ToOP1
4608 or $01
460A ret

460B ld (OP6+3), a
460E ld a, b
460F or a
4610 jr nz, $461C
4612 ld a, c
4613 or a
4614 jr z, $4626
4616 dec a
4617 jr nz, $461C
4619 ld (OP5+6), hl
461C ld a, (OP6+3)
461F inc hl
4620 cp (hl)
4621 jr nz, $461F
4623 dec bc
4624 jr $460E

4626 ex de, hl
4627 ld hl, (OP5+6)
462A ex de, hl
462B sbc hl, de
462D ld b, h
462E ld c, l
462F ret

4630 ld a, (hl)
4631 cp $61
4633 jr c, $4641
4635 ex de, hl
4636 ld (hl), $BB
4638 inc hl
4639 ex de, hl
463A add a, $4F
463C cp $BB
463E jr c, $4641
4640 inc a
4641 cp $2E
4643 jr nz, $4647
4645 ld a, $3A
4647 cp $20
4649 jr nz, $464D
464B ld a, $29
464D cp $3F
464F jr nz, $4652
4651 dec a
4652 ld (de), a
4653 inc de
4654 inc hl
4655 dec bc
4656 ld a, b
4657 or c
4658 jr nz, $4630
465A pop hl
465B ex de, hl
465C sbc hl, de
465E push hl
465F pop bc
4660 ret

4661 call $4560
4664 ex de, hl
4665 ld b, c
4666 ld de, OP1+1
4669 call $44D0
466C xor a
466D ld (de), a
466E call $459B
4671 ld (OP1), a
4674 B_CALL _ChkFindSym
4677 call c, $4470
467A ex de, hl
467B ld c, (hl)
467C inc hl
467D ld b, (hl)
467E inc hl
467F ret

4680 call $459B
4683 and $03
4685 add a, a
4686 add a, a
4687 add a, a
4688 add a, $A6
468A ld ($44C5), a
468D ld ($44F7), a
4690 ret

4691 call $459B
4694 push de
4695 call $459B
4698 ex de, hl
4699 add hl, hl
469A add hl, hl
469B ld d, h
469C ld e, l
469D add hl, hl
469E add hl, de
469F pop de
46A0 add hl, de
46A1 ret

46A2 push hl
46A3 push bc
46A4 push de
46A5 ld hl, OP1+1
46A8 ld bc, $0000
46AB xor a
46AC inc c
46AD inc hl
46AE cp (hl)
46AF jr nz, $46AC
46B1 push bc
46B2 B_CALL _ChkFindSym
46B5 call c, $4470
46B8 ld a, b
46B9 pop bc
46BA ld hl, $000C
46BD add hl, bc
46BE ex de, hl
46BF or a
46C0 jr nz, $46C4
46C2 ld e, $02
46C4 add hl, de
46C5 pop de
46C6 add hl, de
46C7 pop bc
46C8 pop de
46C9 B_CALL _FlashToRAM2
46CC ret

46CD push hl
46CE add hl, hl
46CF add hl, hl
46D0 add hl, hl
46D1 pop hl
46D2 ld a, $20
46D4 add a, h
46D5 out ($10), a
46D7 push hl
46D8 add hl, hl
46D9 add hl, hl
46DA add hl, hl
46DB pop hl
46DC ld a, $80
46DE add a, l
46DF out ($10), a
46E1 push bc
46E2 push hl
46E3 push hl
46E4 add hl, hl
46E5 add hl, hl
46E6 add hl, hl
46E7 pop hl
46E8 ld a, (de)
46E9 inc de
46EA out ($11), a
46EC djnz $46E3
46EE pop hl
46EF pop bc
46F0 dec c
46F1 inc h
46F2 ld a, c
46F3 or a
46F4 jr nz, $46CD
46F6 ret

46F7 push bc
46F8 push hl
46F9 ld hl, saveSScreen
46FC push hl
46FD ex de, hl
46FE ld a, c
46FF push af
4700 push hl
4701 push bc
4702 ld a, (hl)
4703 ld (de), a
4704 inc de
4705 ld a, b
4706 ld b, $00
4708 add hl, bc
4709 ld b, a
470A djnz $4702
470C pop bc
470D pop hl
470E pop af
470F inc hl
4710 dec a
4711 jr nz, $46FF
4713 pop de
4714 pop hl
4715 pop bc
4716 ret

(That's a creative use of djnz, by the way.  I never thought of that.)

Offline jnesselr

  • King Graphmastur
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2270
  • Rating: +81/-20
  • TAO == epic
    • View Profile
Re: App Help
« Reply #14 on: October 31, 2010, 09:00:23 pm »
Wow, we are just mortals compared to that.  Impressive.  Now, I'm confused as to why you djnz'd to $41C4 when that is in the middle of a command?  41CD is probably what you wanted.  Hence, why hex programming is dangerous.

Now, I have never ever seen DJNZ like that. That is insane.  I can't even follow the code.  BTW, another reason why no hex is good.  comments!

Don't know what's wrong right now, though.  Thanks for that disassembly FloppusMaximus.