More updates

This commit is contained in:
Jonatan Nilsson 2019-06-21 10:09:57 +00:00
parent c20a27f02e
commit b7ee801fa5
6 changed files with 38 additions and 30 deletions

1
game/controller.asm Normal file
View file

@ -0,0 +1 @@
controller.asm

View file

@ -6,7 +6,7 @@ textwriter_posy: ds 1
textwriter_curdelay: ds 1 textwriter_curdelay: ds 1
textwriter_active: ds 1 textwriter_active: ds 1
SECTION "ram_textmap", ROM0,ALIGN[8] SECTION "rom_textmap", ROM0,ALIGN[8]
textwriter_map: textwriter_map:
; 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F ; 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
db $50,$50,$50,$50,$50,$50,$50,$50,$50,$50,$50,$50,$50,$50,$50,$50 ; 0 db $50,$50,$50,$50,$50,$50,$50,$50,$50,$50,$50,$50,$50,$50,$50,$50 ; 0
@ -65,9 +65,16 @@ InitWindow:
ld [hl], $55 ld [hl], $55
ret ; Return ret ; Return
ClearWindow:
ld hl, (_SCRN1 + $21)
ld a, $50
ld b, $1E
call Memfill
ld hl, (_SCRN1 + $41)
ld b, $1E
call Memfill
; Start to print a string on screen ; Start to print a string on screen
; @param b - PosX on where to draw text
; @param c - PosY on where to draw text
; @param de - Address source string ; @param de - Address source string
; @return a - garbage ; @return a - garbage
; @return b - PosX on where to draw text ; @return b - PosX on where to draw text
@ -78,10 +85,10 @@ StartText:
ld a, 0 ld a, 0
ld [textwriter_curletter], a ld [textwriter_curletter], a
ld [textwriter_curdelay], a ld [textwriter_curdelay], a
ld a, 1
ld [textwriter_active], a
ld [textwriter_posx], a ld [textwriter_posx], a
ld [textwriter_posy], a ld [textwriter_posy], a
ld a, 1
ld [textwriter_active], a
ld hl, textwriter_curtext ld hl, textwriter_curtext
ld a, d ld a, d
ld [hli], a ld [hli], a

BIN
main.o

Binary file not shown.

BIN
test.gb

Binary file not shown.

View file

@ -1,17 +1,17 @@
ROM Bank #0 (HOME): ROM Bank #0 (HOME):
SECTION: $0200-$027F ($0080 bytes) ["ram_textmap"] SECTION: $0200-$027F ($0080 bytes) ["rom_textmap"]
$0200 = textwriter_map $0200 = textwriter_map
SECTION: $1280-$136B ($00EC bytes) ["TextWriter"] SECTION: $1280-$137D ($00FE bytes) ["TextWriter"]
$1368 = DrawActiveText.exit $137A = DrawActiveText.exit
$1314 = DrawActiveText.movexaxis $1326 = DrawActiveText.movexaxis
$1305 = DrawActiveText.moveyaxis $1317 = DrawActiveText.moveyaxis
$131C = DrawActiveText.drawletter $132E = DrawActiveText.drawletter
$1330 = DrawActiveText.checkNewline $1342 = DrawActiveText.checkNewline
$134E = DrawActiveText.continue $1360 = DrawActiveText.continue
$1345 = DrawActiveText.checkRepeatOnce $1357 = DrawActiveText.checkRepeatOnce
$12F4 = DrawActiveText.startdrawtext $1306 = DrawActiveText.startdrawtext
$12C1 = StartText $12D3 = StartText
$12DD = DrawActiveText $12EF = DrawActiveText
$1280 = InitWindow $1280 = InitWindow
SECTION: $0031-$003E ($000E bytes) ["Game Loop"] SECTION: $0031-$003E ($000E bytes) ["Game Loop"]
$0037 = GameLoop.mainloop $0037 = GameLoop.mainloop
@ -34,15 +34,15 @@ ROM Bank #0 (HOME):
SECTION: $0280-$127F ($1000 bytes) ["Font"] SECTION: $0280-$127F ($1000 bytes) ["Font"]
$0280 = Page1 $0280 = Page1
$1280 = Page1End $1280 = Page1End
SLACK: $2DBF bytes SLACK: $2DAD bytes
WRAM Bank #0: WRAM Bank #0:
SECTION: $C000-$C006 ($0007 bytes) ["ram_textwriter"] SECTION: $C000-$C006 ($0007 bytes) ["ram_textwriter"]
$C002 = textwriter_curletter $C002 = textwriter_curletter
$C005 = textwriter_curdelay $C005 = textwriter_curdelay
$C006 = textwriter_active
$C003 = textwriter_posx $C003 = textwriter_posx
$C004 = textwriter_posy $C004 = textwriter_posy
$C006 = textwriter_active
$C000 = textwriter_curtext $C000 = textwriter_curtext
SLACK: $0FF9 bytes SLACK: $0FF9 bytes

View file

@ -1,16 +1,16 @@
; File generated by rgblink ; File generated by rgblink
00:0200 textwriter_map 00:0200 textwriter_map
00:1368 DrawActiveText.exit 00:137A DrawActiveText.exit
00:1314 DrawActiveText.movexaxis 00:1326 DrawActiveText.movexaxis
00:1305 DrawActiveText.moveyaxis 00:1317 DrawActiveText.moveyaxis
00:131C DrawActiveText.drawletter 00:132E DrawActiveText.drawletter
00:1330 DrawActiveText.checkNewline 00:1342 DrawActiveText.checkNewline
00:134E DrawActiveText.continue 00:1360 DrawActiveText.continue
00:1345 DrawActiveText.checkRepeatOnce 00:1357 DrawActiveText.checkRepeatOnce
00:12F4 DrawActiveText.startdrawtext 00:1306 DrawActiveText.startdrawtext
00:12C1 StartText 00:12D3 StartText
00:12DD DrawActiveText 00:12EF DrawActiveText
00:1280 InitWindow 00:1280 InitWindow
00:0037 GameLoop.mainloop 00:0037 GameLoop.mainloop
00:0031 GameLoop 00:0031 GameLoop
@ -24,7 +24,7 @@
00:1280 Page1End 00:1280 Page1End
00:C002 textwriter_curletter 00:C002 textwriter_curletter
00:C005 textwriter_curdelay 00:C005 textwriter_curdelay
00:C006 textwriter_active
00:C003 textwriter_posx 00:C003 textwriter_posx
00:C004 textwriter_posy 00:C004 textwriter_posy
00:C006 textwriter_active
00:C000 textwriter_curtext 00:C000 textwriter_curtext