[Coco] Trivia Fever
Robert Gault
robert.gault at att.net
Sun Feb 23 22:06:14 EST 2014
Bill Pierce wrote:
>
> Rogelio,
> I just disassembled the "kbdhack" module and it links to CCIO, patches a few bytes after saving the original values. Then it seems to set the clock with a value of zero. Seeding the timer maybe?
> It would take a disassembly of L1V2 CCIO to tell what is being patched. I'm pretty sure the v1 & v2 CCIOs are slightly different hence the failure. The "kbdhack" seems to be the only mod.
> Of course I'm working from the disk images from the archive, so I don't know how "accurate" they are as far as duplicating any possible "copy protection" that may be on the original disks.
> What seems to be going on (from an old diassembly of L1 CCIO from the repo) "kbdhack" if setting up a new IRQ and then resetting the time via F$STIME. So it makes me wonder if the whole patch involves setting up the game timer using the system clock.
> There's another patch section at the end of the listing but it's never called and I'm wondering if this is the reverse code for resetting the patch after you exit the game to return OS9 to normal, hence the "saving" of the original values before patching. The IRQ patch may point to this routine so it runs on exit(??). The address of this section is part of the patch.
>
> All-in-all, the whole thing is really small and just a few lines of code, so it's not making any "major" changes.
> If this is all that's being done, there should be a way to modify it to work on L1V2. It would take good disassemblies of both L1V1 & L1V2 CCIOs to adjust the xx,y values being altered to point to the proper place. The original source probably would have assembled properly for either version given the proper OS9DEFS file as the source most likely referred to the symbols in the defs for the patching if written properly
>
>
> Bill Pierce
Bill,
Here is my disassembly of kbdhack. Slightly different interpretation from yours.
Since we F$Link to CCIO it won't matter which version is present. In fact, we
could link to VTIO by changing L004B and kbdhack would still work.
Unfortunately Trivia is a packed Basic09 module so there is no way to tell what,
if anything, #40 is supposed to do. It is not the correct way to send parameters
to a B09 program.
Robert
nam KbdHack
ttl program module
* Disassembled 2014/02/22 16:06:46 by Disasm v1.5 (C) 1988 by RML
ifp1
use /dd/defs/defsfile
endc
tylg set Prgrm+Objct
atrv set ReEnt+rev
rev set $01
mod eom,name,tylg,atrv,start,size
u0000 rmb 1
u0001 rmb 275
size equ .
name equ *
fcs /KbdHack/
start equ *
leax >L004B,pcr CCIO not in Level2
* regA= type/language
lda #$E1
os9 F$Link
* regY=module entry point
lda $03,y copy lbra READ for CCIO
ldx $04,y
sta >L0064,pcr save the lbra READ from CCIO
stx >L0065,pcr
sty >L0062,pcr save CCIO entry address
leax >L0055,pcr message = TRIVIA #40
stx >L0060,pcr set pointer for message
leax >L0067,pcr address of kbdhack routine
lda #$7E jmp
sta $03,y make CCIO jmp to L0067 on a read
stx $04,y
leax >L004F,pcr date/time data
os9 F$STime start the clock
clrb
os9 F$Exit
L004B fcs /CCIO/
* 1984, Jan, 1, 1:00AM
L004F fcb $54,1,1,1,0
L0055 fcc /TRIVIA #40/
fcb $0D
L0060 rmb 2 pointer in TRIVIA #40 message
L0062 rmb 2 CCIO entry address
L0064 rmb 3 storage of original lbra READ in CCIO
* lbra READ in CCIO
* will now vector below
L0067 ldx >L0060,pcr get message pointer
lda ,x get character in message
leax $01,x update pointer
stx >L0060,pcr save pointer
cmpa #$0D end of message
bne L008C return to CCIO if not finished
pshs y,x,b,a save registers
ldy >L0062,pcr restore CCIO
lda >L0064,pcr
ldx >L0065,pcr
sta $03,y
stx $04,y
puls y,x,b,a recover registers
L008C clrb exit to CCIO
rts
emod
eom equ *
end
More information about the Coco
mailing list