Changeset 34 for trunk/page00/util.asm

Show
Ignore:
Timestamp:
08/03/09 04:24:45 (3 years ago)
Author:
brandonlw
Message:

Some code to actually write the received TI-OS to Flash
It (almost) works, as far as I can tell

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/page00/util.asm

    r30 r34  
    44 PUBLIC _APP_PUSH_ERRORH,_APP_POP_ERRORH,FindSym,PushRealO1,Mov9ToOP1,FPAdd,OP1ToOP2,LCDDelay 
    55 PUBLIC Placeholder005Fh,Placeholder0006h,Placeholder004Eh,Placeholder0003h,Placeholder0035h 
    6  PUBLIC outputPage,NZIf83Plus,ZIfSlowSpeed,GetBytePaged,MakeOffPageCall 
    7  PUBLIC BCALL,BJUMP,JErrorNo,SetupPagedPtr,PagedGet 
     6 PUBLIC outputPage,NZIf83Plus,ZIfSlowSpeed,GetBytePaged,MakeOffPageCall,CopyFlashPage,CopyToRAMPage 
     7 PUBLIC CopyRAMToFlashPage 
     8 PUBLIC BCALL,BJUMP,JErrorNo,SetupPagedPtr,PagedGet,EraseRAMPage 
    89 EXTERN Page0Call,UpdateAPD,PowerOff,GetCSC 
    910 
     
    2021Placeholder004Eh: 
    2122Placeholder005Fh: 
     23       ret 
     24 
     25CopyToRAMPage: 
     26       di 
     27       out (7),a 
     28       ld a,b 
     29       out (5),a 
     30       ld hl,8000h 
     31       ld de,0C000h 
     32       ld bc,4000h 
     33       ldir 
     34       ld a,81h 
     35       out (7),a 
     36       xor a 
     37       out (5),a 
     38       ret 
     39 
     40CopyFlashPage: 
     41       ld hl,4000h 
     42$$:    push af 
     43       push bc 
     44       ld de,tempSwapArea 
     45       ld bc,128 
     46       push hl 
     47       B_CALL FlashToRam2 
     48       pop de 
     49       pop af 
     50       push af 
     51       ld hl,tempSwapArea 
     52       ld bc,128 
     53       push de 
     54       B_CALL WriteFlash 
     55       pop hl 
     56       ld bc,128 
     57       add hl,bc 
     58       pop bc 
     59       pop af 
     60       bit 7,h 
     61       jr z,$B 
     62       ret 
     63 
     64CopyRAMToFlashPage: 
     65       di 
     66       ld hl,4000h 
     67$$:    push af 
     68       push bc 
     69       push hl 
     70       ;Copy from extra RAM page A to Flash page B 
     71       out (5),a 
     72       ld de,8000h 
     73       add hl,de 
     74       ld de,tempSwapArea 
     75       ld bc,128 
     76       ldir 
     77       xor a 
     78       out (5),a 
     79       pop de 
     80       pop af 
     81       push af 
     82       ld hl,tempSwapArea 
     83       ld bc,128 
     84       push de 
     85       B_CALL WriteFlash 
     86       pop hl 
     87       ld bc,128 
     88       add hl,bc 
     89       pop bc 
     90       pop af 
     91       bit 7,h 
     92       jr z,$B 
     93       ret 
     94 
     95EraseRAMPage: 
     96       di 
     97       out (7),a 
     98       ld hl,8000h 
     99       ld (hl),0 
     100       ld de,8001h 
     101       ld bc,4000h-1 
     102       ldir 
     103       ld a,81h 
     104       out (7),a 
    22105       ret 
    23106