11 March 2016 - Forum Rules
Started by Pikachumanson, December 02, 2012, 03:07:55 AM
C965:D5 CA CMP $CA,X @ $01C9 = #$00CMP $CA,X @ $01C9 = #$00
C967:F5 C6 SBC $C6,X @ $01C5 = #$35
.org $8000 DTE_Routine: NOP LDY $0658 ;<-----This value has to be changed but I am not sure how I should do it LDA ($BE),Y ;This is the second. CMP #$30 ;DTE Range compare 1 BCC End ;If A is < #$30, skip DTE (Branch if carry clear) CLC ;Clear the carry flag - we get here because CMP #$80 ;DTE Range Compare 2 BCS End ;If A is >=#$80, skip DTE (Branch if carry set) ;If we get past the upper and lower bound range compares, we have DTE!RunCheck: NOP STX $07FE ;Store X temporarily to THE DEPTHS OF UNUSED RAM SEC SBC #$30 CLC LDX $07FF ;Load X with a test byte from THE DEPTHS OF UNUSED RAM CPX #$9D ;Compare it with test=true (#$9D in this case) BEQ SecondRun ;If test=true, we're printing the second character BNE FirstRun ;If test=false, we're printing the FIRST character.FirstRun: NOP ;For outputting the first character... LDX #$9D ;Load X with Test=true DEC $0658 ;Decrement load index (which gets transferred into Y) ASL A ;Double A to get DTE Pair Number JMP Base_Routine ;Jump to the shared bits of the routine (4C2780)SecondRun: NOP ASL A ;Double A for DTE Pair Number CLC ;Clear the carry cuz we're gonna add ADC #$01 ;Increment the accumulator ;A is now the index location of the second byte in the DTE Pair. LDX #$00 ;Load X with Test=FALSEBase_Routine: NOP STX $07FF ;Store test byte to THE DEPTHS OF UNUSED RAM TAX ;Transer A to X for the DTE table lookup LDA Create_DTE_Table,X ;Load A with where ever your DTE table happens to be,X LDX $07FE ;Restore X from before routineEnd: NOP JMP $AF29 ;Jump back to the routineCreate_DTE_Table: NOP.DSW 80 ;Create an 80 ($50) byte empty DTE table to be later filled in ;This gets put -immediately- after the routine.2389
0F:C1B6:AD FF 06 LDA $06FF = #$00 ;0F:C1B9:D0 1A BNE $C1D5 ; If 2nd_Pass = 0 Then0F:C1BB:B1 81 LDA ($81),Y @ $8478 = #$8D orig ; A = vbl_82|vbl_81[Y++]0F:C1BD:C8 INY orig ;0F:C1BE:C9 80 CMP #$80 ; 0F:C1C0:B0 01 BCS $C1C3 ; 0F:C1C2:60 RTS ;0F:C1C3:C9 E0 CMP #$E0 ;0F:C1C5:B0 FB BCS $C1C2 ; If A >= 80 And A < E0 Then0F:C1C7:EE FF 06 INC $06FF = #$00 ; 2nd_Pass = 10F:C1CA:38 SEC ;0F:C1CB:E9 80 SBC #$80 ;0F:C1CD:0A ASL ;0F:C1CE:AA TAX ;0F:C1CF:BD 40 BD LDA $BD40,X @ $BD40 = #$5E ; A = tbl_bd40[(A - 80) * 2]0F:C1D2:A2 00 LDX #$00 ; X = 00F:C1D4:60 RTS Else0F:C1DD:CE FF 06 DEC $06FF = #$00 ; 2nd_Pass = 0 DEY ;0F:C1E2:B1 81 LDA ($81),Y @ $8478 = #$8D ; A = vbl_82|vbl_81[--Y]0F:C1E4:C8 INY ; 0F:C1E5:38 SEC ; Y++0F:C1E6:E9 80 SBC #$80 ;0F:C1E8:0A ASL ;0F:C1E9:AA TAX ;0F:C1EA:BD 41 BD LDA $BD41,X @ $BD41 = #$01 ; A = tbl_bd40[(A - 80) * 2 + 1]0F:C1FA:60 RTS Return
Quote from: Bregalad on December 02, 2012, 12:05:58 PMWow I don't know which simulator you're using but apprently it's a very bad one.
C965:D5 CA CMP $CA,X @ $01C9 = #$00C967:F5 C6 SBC $C6,X @ $01C5 = #$35
Page created in 0.091 seconds with 20 queries.