; ************************************************************************************* ; ; Videopac G7400 ROM Source ; ========================= ; ; contains only the parts that are different to o2rom-source from Paul Robson / Rene van den Enden ; ; by Mark Guttenbrunner (manopac) ; ; Version 1.0 (10-09-2006) ; ; ************************************************************************************* ; ; BIOS ROM Routine Addresses: ; ; $026A Initialize VP+ ; $027D Wait until VP+ Chip ready ; $0283 Send Display Mode Command to VP+ ; $0288 Send Command to VP+ ; $028c Send Data to VP+ ; $0296 Hide Plus-GFX ; $0299 Set Plus-Mode ; $02A1 Enable VP+ ; $02C2 Plus-Select-Game ; $02C3 Select-Game ; ; ************************************************************************************* ; ************************************************************************************* ; Changes in Original Code to support VP+ ; ************************************************************************************* 0000 44 6a JMP $26a ; instead of JMP $400 (initialize VP+ first) 037e 39 OUTL P1,A ; original: xch a,@r0 (which meant propably nothing) propably still means nothing ?????? 0393 99 bb ANL P1, #bb ; (instead of: anl p1,9b) disable also VP Plus when reading joystick ; ************************************************************************************* ; Initialize VP+ ; ************************************************************************************* 026a ba 00 MOV R2, #00 ; wait for 255 NOPs 026c 00 NOP 026d ea 6c DJNZ R2,$26c 026f 99 9f ANL P1, #9f ; enable VP+ access 0271 b9 02 MOV R1, #02 ; 02 = Command Register 0273 be 49 MOV R6, #49 ; !blnk tt !tl !crsr srow !conc !box dspl 0275 bf a0 MOV R7, #a0 ; Set G7400 Display Mode: 50 Hz, display all lines 0277 54 90 CALL $290 ; send to VP+ 0279 54 96 CALL $296 ; hide all Videopac+ 027b 84 00 JMP $400 ; jmp to "normal" start at $400 ; ************************************************************************************* ; Wait until VP+ Chip is no longer busy ; ************************************************************************************* 027d b8 06 MOV R0, #06 ; read Register 06h of VP+ 027f 80 MOVX A,@R0 0280 f2 7f JB7 $27f ; wait until Busy-Flag is cleared 0282 83 RET ; ************************************************************************************* ; Send Display Mode command to VP+ (A = Mode) ; ************************************************************************************* 0283 bf a0 MOV R7, #a0 ; Set Display Mode 0285 43 40 ORL A, #40 ; always with 50 Hz 0287 ae MOV R6,A ; ************************************************************************************* ; Send any Command to VP+ (R1 = 02), R6 = Value R7 = Command ; ************************************************************************************* 0288 b9 02 MOV R1,#02 028a 44 8e JMP $28e ; ************************************************************************************* ; Send Data to VP+ (R1 = 00), R6 = Color, R7 = Character or Character Data ; ************************************************************************************* 028c b9 00 MOV R1, #00 028e 54 7d CALL $27d ; wait until VP+ is not busy 0290 fe MOV A,R6 0291 91 MOVX @R1,A ; write R6 0292 19 INC R1 0293 ff MOV A,R7 ; write R7 0294 91 MOVX @R1,A 0295 83 RET ; ************************************************************************************* ; Hide all Plus-GFX by Setting Plus Mode all high ; ************************************************************************************* 0296 bf ff MOV R7, #ff 0298 ff MOV A,R7 ; ************************************************************************************* ; Set Plus-Mode ; ************************************************************************************* 0299 3d MOVD P5,A ; write low Nibble of A to P5 029a 47 SWAP 029b 3c MOVD P4,A ; write high Nibble of A to P4 029c ff MOV A,R7 029d 3f MOVD P7,A ; write low Nibble of R7 to P7 029e 47 SWAP 029f 3e MOVD P6,A ; write high Nibble of R7 to P6 02a0 83 RET ; ************************************************************************************* ; Enable Videopac Plus ; ************************************************************************************* 02a1 89 bc ORL P1, #bc ; 02a3 99 9f ANL P1, #9f ; !copymode !vpplus 02a5 83 RET ; ************************************************************************************* ; Entry Point for "Plus" Select Game ; ************************************************************************************* 02a6 27 CLR A ; on plus-select game 02a7 64 83 JMP $383 ; jump to page 1 ; ************************************************************************************* ; Entry Point for "Normal" Select Game ; ************************************************************************************* 02a9 54 96 CALL $296 ; hide all plus gfx 02ab 14 e7 CALL $0e7 ; setup VDC-access 02ad c5 SEL RB0 02ae ff MOV A,R7 ; Key in A was lost at call to hide-Plus 02af d5 SEL RB1 02b0 a9 MOV R1,A ; so get it back to and r1 02b1 85 CLR F0 ; no "Plus" Select Game 02b2 64 8b JMP $38b ; jmp to bank 3 ; ************************************************************************************* ; "SELECT GAME " String (Data Section) ; ************************************************************************************* 02b4 53 45 ANL A, #45 S E 02b6 4c ORL A,R4 L 02b7 45 STRT CNT E 02b8 43 54 ORL A, #54 C T 02ba 20 XCH A,@R0 02bb 47 SWAP G 02bc 41 ORL A,@R1 A 02bd 4d ORL A,R5 M 02be 45 STRT CNT E 02bf 20 XCH A,@R0 02c0 20 XCH A,@R0 02c1 20 XCH A,@R0 ; ************************************************************************************* ; Plus-SelectGame ; ************************************************************************************* 02c2 95 CPL F0 ; if this is running on a VP+ -> set F0 (in "normal" VP there is a NOP here) ; ************************************************************************************* ; Select Game for Videopac Plus ; ************************************************************************************* 02c3 54 a1 CALL $2a1 ; enable Videopac+ 02c5 be 00 MOV R6, #00 02c7 bf c0 MOV R7, #c0 02c9 54 88 CALL $288 ; display line #0 as second line 02cb be 1f MOV R6, #1f 02cd bf 00 MOV R7, #00 02cf 54 88 CALL $288 ; set the cursor to first column in line 1F (1st line = service line) 02d1 be 00 MOV R6, #00 02d3 bf 80 MOV R7, #80 02d5 54 88 CALL $288 ; Set normal write, advance cursor 02d7 bd 45 MOV R5, #45 ; Print "Select Game" 45 times 02d9 1e INC R6 ; Start with 001 for the Color 02da fe MOV A,R6 02db 53 07 ANL A, #07 ; and blank out the higher bits 02dd c6 d9 JZ $2d9 ; if its 000 increment again - we don't want black text 02df ae MOV R6,A ; R6 holds the color 02e0 bb b4 MOV R3, #b4 ; Position of "SELECT GAME " 02e2 bc 0e MOV R4, #0e ; 14 Characters 02e4 fb MOV A,R3 02e5 a3 MOVP A,@A 02e6 af MOV R7,A ; R7 holds the character, R6 02e7 54 8c CALL $28c 02e9 1b INC R3 ; next character 02ea ec e4 DJNZ R4, $e4 ; loop for each character 02ec ed d9 DJNZ R5, $d9 ; loop for each "Select Game " 02ee 23 01 MOV A, #01 02f0 bf 00 MOV R7, #00 02f2 54 99 CALL $299 ; Set Plus-Mode to 1 02f4 14 f1 CALL $0f1 ; Reset VDC 02f6 23 4a MOV A, #4a 02f8 34 a2 CALL $1a2 ; Play Select Game Tune 02fa 34 3d CALL $13d ; Get Key 02fc b6 a6 JF0 $2a6 ; if this was called with plus-SelectGame 02fe 44 a9 JMP $2a9 ; otherwise called on non+