Some more GB Printer documentation

This commit is contained in:
Rangi 2019-05-11 13:01:59 -04:00
parent 5248d18f58
commit 7890fae995
6 changed files with 29 additions and 28 deletions

View File

@ -54,7 +54,7 @@ NUM_FRAMES EQU const_value
const FAST_TEXT_DELAY_F ; 0 const FAST_TEXT_DELAY_F ; 0
const NO_TEXT_DELAY_F ; 1 const NO_TEXT_DELAY_F ; 1
; wGBPrinter:: ; cfd0 ; wGBPrinterBrightness:: ; cfd0
GBPRINTER_LIGHTEST EQU $00 GBPRINTER_LIGHTEST EQU $00
GBPRINTER_LIGHTER EQU $20 GBPRINTER_LIGHTER EQU $20
GBPRINTER_NORMAL EQU $40 GBPRINTER_NORMAL EQU $40

View File

@ -7,7 +7,7 @@ DefaultOptions:
db FRAME_1 db FRAME_1
; wTextboxFlags: use text speed ; wTextboxFlags: use text speed
db 1 << FAST_TEXT_DELAY_F db 1 << FAST_TEXT_DELAY_F
; wGBPrinter: normal brightness ; wGBPrinterBrightness: normal
db GBPRINTER_NORMAL db GBPRINTER_NORMAL
; wOptions2: menu account on ; wOptions2: menu account on
db 1 << MENU_ACCOUNT db 1 << MENU_ACCOUNT

View File

@ -343,7 +343,7 @@ Options_Print:
.Save: .Save:
ld b, a ld b, a
ld [wGBPrinter], a ld [wGBPrinterBrightness], a
.NonePressed: .NonePressed:
ld b, $0 ld b, $0
@ -375,7 +375,7 @@ Options_Print:
GetPrinterSetting: GetPrinterSetting:
; converts GBPRINTER_* value in a to OPT_PRINT_* value in c, ; converts GBPRINTER_* value in a to OPT_PRINT_* value in c,
; with previous/next GBPRINTER_* values in d/e ; with previous/next GBPRINTER_* values in d/e
ld a, [wGBPrinter] ld a, [wGBPrinterBrightness]
and a and a
jr z, .IsLightest jr z, .IsLightest
cp GBPRINTER_LIGHTER cp GBPRINTER_LIGHTER

View File

@ -30,7 +30,7 @@ Printer_PrepareTileMapForPrint:
push af push af
call Printer_StartTransmission call Printer_StartTransmission
pop af pop af
ld [wcbfa], a ld [wPrinterMargins], a
call Printer_CopyTileMapToBuffer call Printer_CopyTileMapToBuffer
ret ret
@ -60,8 +60,8 @@ PrintDexEntry:
ldh [rIE], a ldh [rIE], a
call Printer_StartTransmission call Printer_StartTransmission
ld a, $10 ln a, 1, 0
ld [wcbfa], a ld [wPrinterMargins], a
farcall PrintPage1 farcall PrintPage1
call ClearTileMap call ClearTileMap
ld a, %11100100 ld a, %11100100
@ -86,8 +86,8 @@ PrintDexEntry:
ldh [hBGMapMode], a ldh [hBGMapMode], a
call Printer_StartTransmission call Printer_StartTransmission
ld a, $3 ln a, 0, 3
ld [wcbfa], a ld [wPrinterMargins], a
farcall PrintPage2 farcall PrintPage2
call Printer_ResetJoypadRegisters call Printer_ResetJoypadRegisters
ld a, 4 ld a, 4
@ -151,7 +151,7 @@ PrintPCBox:
xor a xor a
ldh [hBGMapMode], a ldh [hBGMapMode], a
call PrintPCBox_Page1 call PrintPCBox_Page1
ld a, $10 ; to be loaded to wcbfa ln a, 1, 0 ; to be loaded to wPrinterMargins
call Printer_PrepareTileMapForPrint call Printer_PrepareTileMapForPrint
call Printer_ResetRegistersAndStartDataSend call Printer_ResetRegistersAndStartDataSend
jr c, .cancel jr c, .cancel
@ -162,7 +162,7 @@ PrintPCBox:
xor a xor a
ldh [hBGMapMode], a ldh [hBGMapMode], a
call PrintPCBox_Page2 call PrintPCBox_Page2
ld a, $0 ; to be loaded to wcbfa ln a, 0, 0 ; to be loaded to wPrinterMargins
call Printer_PrepareTileMapForPrint call Printer_PrepareTileMapForPrint
call Printer_ResetRegistersAndStartDataSend call Printer_ResetRegistersAndStartDataSend
jr c, .cancel jr c, .cancel
@ -174,7 +174,7 @@ PrintPCBox:
xor a xor a
ldh [hBGMapMode], a ldh [hBGMapMode], a
call PrintPCBox_Page3 call PrintPCBox_Page3
ld a, $0 ; to be loaded to wcbfa ln a, 0, 0 ; to be loaded to wPrinterMargins
call Printer_PrepareTileMapForPrint call Printer_PrepareTileMapForPrint
call Printer_ResetRegistersAndStartDataSend call Printer_ResetRegistersAndStartDataSend
jr c, .cancel jr c, .cancel
@ -186,7 +186,7 @@ PrintPCBox:
xor a xor a
ldh [hBGMapMode], a ldh [hBGMapMode], a
call PrintPCBox_Page4 call PrintPCBox_Page4
ld a, $3 ; to be loaded to wcbfa ln a, 0, 3 ; to be loaded to wPrinterMargins
call Printer_PrepareTileMapForPrint call Printer_PrepareTileMapForPrint
call Printer_ResetRegistersAndStartDataSend call Printer_ResetRegistersAndStartDataSend
.cancel .cancel
@ -229,7 +229,7 @@ PrintUnownStamp:
ldh [hBGMapMode], a ldh [hBGMapMode], a
call LoadTileMapToTempTileMap call LoadTileMapToTempTileMap
farcall PlaceUnownPrinterFrontpic farcall PlaceUnownPrinterFrontpic
ld a, $0 ; to be loaded to wcbfa ln a, 0, 0 ; to be loaded to wPrinterMargins
call Printer_PrepareTileMapForPrint call Printer_PrepareTileMapForPrint
call Call_LoadTempTileMapToTileMap call Call_LoadTempTileMapToTileMap
call Printer_ResetJoypadRegisters call Printer_ResetJoypadRegisters
@ -290,7 +290,7 @@ PrintMail:
xor a xor a
ldh [hBGMapMode], a ldh [hBGMapMode], a
ld a, $13 ; to be loaded to wcbfa ln a, 1, 3 ; to be loaded to wPrinterMargins
call Printer_PrepareTileMapForPrint call Printer_PrepareTileMapForPrint
ld hl, hVBlank ld hl, hVBlank
ld a, [hl] ld a, [hl]
@ -332,7 +332,7 @@ PrintPartymon:
xor a xor a
ldh [hBGMapMode], a ldh [hBGMapMode], a
farcall PrintPartyMonPage1 farcall PrintPartyMonPage1
ld a, $10 ; to be loaded to wcbfa ln a, 1, 0 ; to be loaded to wPrinterMargins
call Printer_PrepareTileMapForPrint call Printer_PrepareTileMapForPrint
ld hl, hVBlank ld hl, hVBlank
@ -353,7 +353,7 @@ PrintPartymon:
xor a xor a
ldh [hBGMapMode], a ldh [hBGMapMode], a
farcall PrintPartyMonPage2 farcall PrintPartyMonPage2
ld a, $3 ; to be loaded to wcbfa ln a, 0, 3 ; to be loaded to wPrinterMargins
call Printer_PrepareTileMapForPrint call Printer_PrepareTileMapForPrint
ld a, 18 / 2 ld a, 18 / 2
@ -398,7 +398,7 @@ _PrintDiploma:
push af push af
ld [hl], %0100 ld [hl], %0100
ld a, $10 ; to be loaded to wcbfa ln a, 1, 0 ; to be loaded to wPrinterMargins
call Printer_PrepareTileMapForPrint call Printer_PrepareTileMapForPrint
call Printer_ResetJoypadRegisters call Printer_ResetJoypadRegisters
@ -416,7 +416,7 @@ _PrintDiploma:
farcall PrintDiplomaPage2 farcall PrintDiplomaPage2
ld a, $3 ; to be loaded to wcbfa ln a, 0, 3 ; to be loaded to wPrinterMargins
call Printer_PrepareTileMapForPrint call Printer_PrepareTileMapForPrint
call Call_LoadTempTileMapToTileMap call Call_LoadTempTileMapToTileMap
call Printer_ResetJoypadRegisters call Printer_ResetJoypadRegisters
@ -820,7 +820,7 @@ Printer_GetMonGender:
ld l, a ld l, a
ld a, [wAddrOfBoxToPrint + 1] ld a, [wAddrOfBoxToPrint + 1]
ld h, a ld h, a
ld bc, $2b ld bc, 2 + MONS_PER_BOX + MON_DVS
add hl, bc add hl, bc
ld bc, BOXMON_STRUCT_LENGTH ld bc, BOXMON_STRUCT_LENGTH
ld a, [wWhichBoxMonToPrint] ld a, [wWhichBoxMonToPrint]

View File

@ -9,8 +9,8 @@ Printer_StartTransmission:
ld [wPrinterOpcode], a ld [wPrinterOpcode], a
ld hl, wPrinterConnectionOpen ld hl, wPrinterConnectionOpen
set 0, [hl] set 0, [hl]
ld a, [wGBPrinter] ld a, [wGBPrinterBrightness]
ld [wGBPrinterSettings], a ld [wPrinterExposureTime], a
xor a xor a
ld [wJumptableIndex], a ld [wJumptableIndex], a
ret ret
@ -353,11 +353,11 @@ Printer_ComputeChecksum:
Printer_StageHeaderForSend: Printer_StageHeaderForSend:
ld a, $1 ld a, $1
ld [wGameboyPrinter2bppSource + 0], a ld [wGameboyPrinter2bppSource + 0], a
ld a, [wcbfa] ld a, [wPrinterMargins]
ld [wGameboyPrinter2bppSource + 1], a ld [wGameboyPrinter2bppSource + 1], a
ld a, %11100100 ld a, %11100100 ; 3,2,1,0
ld [wGameboyPrinter2bppSource + 2], a ld [wGameboyPrinter2bppSource + 2], a
ld a, [wGBPrinterSettings] ld a, [wPrinterExposureTime]
ld [wGameboyPrinter2bppSource + 3], a ld [wGameboyPrinter2bppSource + 3], a
ret ret

View File

@ -957,8 +957,9 @@ wPrinterTileMapBuffer:: ds SCREEN_HEIGHT * SCREEN_WIDTH ; ca90
wPrinterTileMapBufferEnd:: wPrinterTileMapBufferEnd::
wPrinterStatus:: db ; cbf8 wPrinterStatus:: db ; cbf8
ds 1 ds 1
wcbfa:: db ; High nibble is for margin before the image, low nibble is for after.
wGBPrinterSettings:: db wPrinterMargins:: db ; cbfa
wPrinterExposureTime:: db ; cbfb
ds 16 ds 16
wGameboyPrinterRAMEnd:: wGameboyPrinterRAMEnd::
@ -1583,7 +1584,7 @@ wTextboxFlags::
; bit 0: 1-frame text delay ; bit 0: 1-frame text delay
; bit 4: no text delay ; bit 4: no text delay
db db
wGBPrinter:: ; cfd0 wGBPrinterBrightness:: ; cfd0
; bit 0-6: brightness ; bit 0-6: brightness
; lightest: $00 ; lightest: $00
; lighter: $20 ; lighter: $20