!ulGbStxECmHOihJBwO:matrix.org

gbdev asm

170 Members
3 Servers

Load older messages


SenderMessageTime
1 Aug 2021
@_discord_236164041867788288:t2bot.ioMidnight#9871 Is this what a lookup table is, or is that something else? 21:27:16
@_discord_289179191348428800:t2bot.ioEievui#2759 Yes. 21:27:24
@_discord_236164041867788288:t2bot.ioMidnight#9871 How does this actually work, though? How can you easily access any item in the table other than the first? 21:32:05
@_discord_289179191348428800:t2bot.ioEievui#2759 By adding a to .table, we can offset the table to point to the corresponding entry. 21:32:46
@_discord_289179191348428800:t2bot.ioEievui#2759 That's what this does:
    add a, LOW(.table)
    ld l, a
    adc a, HIGH(.table)
    sub a, l
    ld h, a
21:33:00
@_discord_289179191348428800:t2bot.ioEievui#2759 hl is now .table + a 21:33:11
@_discord_236164041867788288:t2bot.ioMidnight#9871 Hmm... I'm not sure if something like that would be too long for what I'm trying to do. 21:34:56
@_discord_236164041867788288:t2bot.ioMidnight#9871 When using an LYC interrupt, how many cycles do you have to do something before it moves on to the next scanline? 21:35:21
@_discord_289179191348428800:t2bot.ioEievui#2759 It probably would be. Like I said, all of this is unnecessary because those values are sequential. 21:35:23
@_discord_289179191348428800:t2bot.ioEievui#2759 https://gbdev.io/pandocs/pixel_fifo.html?highlight=FIFO#pixel-fifo 21:35:37
@_discord_236164041867788288:t2bot.ioMidnight#9871 I'm not working on the memset stuff right now. 21:35:38
@_discord_289179191348428800:t2bot.ioEievui#2759 An entire line is 114 cycles, VRAM time per line varies. 21:36:17
@_discord_289179191348428800:t2bot.ioEievui#2759 It's best to assume you only have 16, because that's the minimum. 21:36:43
@_discord_289179191348428800:t2bot.ioEievui#2759 (of VRAM time) 21:36:48
@_discord_236164041867788288:t2bot.ioMidnight#9871 16's not a lot. 21:37:54
@_discord_289179191348428800:t2bot.ioEievui#2759 What do you need to do in that time? 21:38:20
@_discord_236164041867788288:t2bot.ioMidnight#9871 Do something to figure out which line I'm on, in order to know what to do for that line, and then do something (probably mostly scrolling). 21:38:56
@_discord_236164041867788288:t2bot.ioMidnight#9871 And then after that, set stuff up for the next interrupt. 21:39:15
@_discord_289179191348428800:t2bot.ioEievui#2759 So you only need to load a single value during HBlank 21:39:22
@_discord_236164041867788288:t2bot.ioMidnight#9871 ? 21:39:34
@_discord_289179191348428800:t2bot.ioEievui#2759 None of that requires VRAM access. 21:39:48
@_discord_236164041867788288:t2bot.ioMidnight#9871 The scrolling does. 21:39:59
@_discord_236164041867788288:t2bot.ioMidnight#9871 Doesn't it? 21:40:09
@_discord_289179191348428800:t2bot.ioEievui#2759 It doesn't, but that's why I said this ^ 21:40:15
@_discord_289179191348428800:t2bot.ioEievui#2759 Do all of that work before HBlank, update scroll (load one value), then prepare the next line. 21:40:41
@_discord_289179191348428800:t2bot.ioEievui#2759
  ; Figure out what the scroll value is and store it in `b`
  ; Now wait for HBlank
: ld a, [rSTAT]
  and a, STATF_BUSY
  jr nz, :-
  ld a, b
  ld [rSCX], b
  ; Now prepare the next line
21:42:22
@_discord_236164041867788288:t2bot.ioMidnight#9871 I can't think of how to do that. (for what it's worth, I didn't sleep well last night, so I'm pretty out of it) 21:42:33
@_discord_289179191348428800:t2bot.ioEievui#2759 Just put the rSTAT loop before the part where it's actually needed. 21:43:13
@_discord_289179191348428800:t2bot.ioEievui#2759 Like in that example 21:43:18
@_discord_236164041867788288:t2bot.ioMidnight#9871 ...Yeah, I think I'm probably going to have to take a break from this for today. I'm apparently tired enough that my ability to read code has hit pretty much zero. 21:43:36

There are no newer messages yet.


Back to Room List